[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/10] accel/tcg: move i386 halt handling to sysemu_ops
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 03/10] accel/tcg: move i386 halt handling to sysemu_ops |
Date: |
Mon, 20 Mar 2023 15:52:02 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
On 20/3/23 11:10, Alex Bennée wrote:
We don't want to be polluting the core run loop code with target
specific handling, punt it to sysemu_ops where it belongs.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/hw/core/sysemu-cpu-ops.h | 5 +++++
target/i386/cpu-internal.h | 1 +
accel/tcg/cpu-exec.c | 14 +++-----------
target/i386/cpu-sysemu.c | 12 ++++++++++++
target/i386/cpu.c | 1 +
5 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c
index 28115edf44..e545bf7590 100644
--- a/target/i386/cpu-sysemu.c
+++ b/target/i386/cpu-sysemu.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/main-loop.h"
#include "cpu.h"
#include "sysemu/xen.h"
#include "sysemu/whpx.h"
Missing "hw/i386/apic.h" which declares apic_poll_irq() ...
@@ -310,6 +311,17 @@ void x86_cpu_apic_realize(X86CPU *cpu, Error **errp)
}
}
+void x86_cpu_handle_halt(CPUState *cpu)
+{
+ if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
+ X86CPU *x86_cpu = X86_CPU(cpu);
+ qemu_mutex_lock_iothread();
+ apic_poll_irq(x86_cpu->apic_state);
... used here.
+ cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL);
+ qemu_mutex_unlock_iothread();
+ }
+}
Otherwise,
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
- [PATCH 00/10] accel/tcg: refactor the cpu-exec loop, Alex Bennée, 2023/03/20
- [PATCH 08/10] accel/tcg: push i386 specific hacks into handle_cpu_interrupt callback, Alex Bennée, 2023/03/20
- [PATCH 05/10] accel/tcg: remove the fake_user_interrupt guards, Alex Bennée, 2023/03/20
- [PATCH 03/10] accel/tcg: move i386 halt handling to sysemu_ops, Alex Bennée, 2023/03/20
- [PATCH 10/10] accel/tcg: remove unused includes, Alex Bennée, 2023/03/20
- [PATCH 04/10] accel/tcg: don't bother with ifdef for CPU_DUMP_CCOP, Alex Bennée, 2023/03/20