All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/arm: do not use cc->do_interrupt for KVM directly
@ 2020-12-07  8:40 Claudio Fontana
  2020-12-07 13:09 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Claudio Fontana @ 2020-12-07  8:40 UTC (permalink / raw)
  To: Alex Bennée, Dongjiu Geng
  Cc: Peter Maydell, Philippe Mathieu-Daudé,
	Claudio Fontana, Eduardo Habkost, qemu-devel

cc->do_interrupt is a TCG callback used in accel/tcg only,
call instead directly the arm_cpu_do_interrupt for the
injection of exeptions from KVM, so that

do_interrupt can be exported to TCG-only operations in the CPUClass.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
 target/arm/helper.c | 4 ++++
 target/arm/kvm64.c  | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 38cd35c049..bebaabf525 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9895,6 +9895,10 @@ static void handle_semihosting(CPUState *cs)
  * Do any appropriate logging, handle PSCI calls, and then hand off
  * to the AArch64-entry or AArch32-entry function depending on the
  * target exception level's register width.
+ *
+ * Note: this is used for both TCG (as the do_interrupt tcg op),
+ *       and KVM to re-inject guest debug exceptions, and to
+ *       inject a Synchronous-External-Abort.
  */
 void arm_cpu_do_interrupt(CPUState *cs)
 {
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index f74bac2457..2b17e4203d 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -960,7 +960,7 @@ static void kvm_inject_arm_sea(CPUState *c)
 
     env->exception.syndrome = esr;
 
-    cc->do_interrupt(c);
+    arm_cpu_do_interrupt(c);
 }
 
 #define AARCH64_CORE_REG(x)   (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
@@ -1545,7 +1545,7 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit)
     env->exception.vaddress = debug_exit->far;
     env->exception.target_el = 1;
     qemu_mutex_lock_iothread();
-    cc->do_interrupt(cs);
+    arm_cpu_do_interrupt(cs);
     qemu_mutex_unlock_iothread();
 
     return false;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2020-12-08 17:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  8:40 [PATCH] target/arm: do not use cc->do_interrupt for KVM directly Claudio Fontana
2020-12-07 13:09 ` Philippe Mathieu-Daudé
2020-12-07 13:59 ` Alex Bennée
2020-12-07 17:49 ` Eduardo Habkost
2020-12-07 18:07   ` Peter Maydell
2020-12-07 18:18     ` Claudio Fontana
2020-12-07 18:28     ` Eduardo Habkost
2020-12-07 20:56       ` Peter Maydell
2020-12-07 21:01         ` Peter Maydell
2020-12-07 21:06         ` Claudio Fontana
2020-12-07 21:12           ` Peter Maydell
2020-12-07 21:17             ` Claudio Fontana
2020-12-07 21:28             ` Eduardo Habkost
2020-12-07 21:26           ` Eduardo Habkost
2020-12-07 21:50             ` Peter Maydell
2020-12-08 13:27               ` Philippe Mathieu-Daudé
2020-12-08 13:51                 ` Claudio Fontana
2020-12-08 13:55                   ` Claudio Fontana
2020-12-08 14:34                     ` Philippe Mathieu-Daudé
2020-12-08 16:19                       ` Claudio Fontana
2020-12-08 16:28                       ` Eduardo Habkost
2020-12-08 17:43                         ` Claudio Fontana
2020-12-07 18:08   ` Claudio Fontana
2020-12-07 18:14     ` Peter Maydell
2020-12-07 18:17       ` Claudio Fontana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.