diff options
author | Claudio Fontana <cfontana@suse.de> | 2020-08-11 15:16:33 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-10-05 16:41:22 +0200 |
commit | bb4776be7733659bdbce4548e2c042107bad76f4 (patch) | |
tree | 7e02c1ea2062cea1e312f85c93f9a1b60414319c /softmmu | |
parent | 994aa172006a545e0e854ebbdb2edef6030f3ad3 (diff) |
cpus: add handle_interrupt to the CpusAccel interface
kvm: uses the generic handler
qtest: uses the generic handler
whpx: changed to use the generic handler (identical implementation)
hax: changed to use the generic handler (identical implementation)
hvf: changed to use the generic handler (identical implementation)
tcg: adapt tcg-cpus to point to the tcg-specific handler
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/cpus.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 99f418437b..f3d0c59f78 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -225,6 +225,24 @@ int64_t cpus_get_elapsed_ticks(void) return cpu_get_ticks(); } +static void generic_handle_interrupt(CPUState *cpu, int mask) +{ + cpu->interrupt_request |= mask; + + if (!qemu_cpu_is_self(cpu)) { + qemu_cpu_kick(cpu); + } +} + +void cpu_interrupt(CPUState *cpu, int mask) +{ + if (cpus_accel->handle_interrupt) { + cpus_accel->handle_interrupt(cpu, mask); + } else { + generic_handle_interrupt(cpu, mask); + } +} + static int do_vm_stop(RunState state, bool send_stop) { int ret = 0; |