qemu/target
Claudio Fontana 853bfef4e6 target/arm: do not use cc->do_interrupt for KVM directly
cc->do_interrupt is in theory a TCG callback used in accel/tcg only,
to prepare the emulated architecture to take an interrupt as defined
in the hardware specifications,

but in reality the _do_interrupt style of functions in targets are
also occasionally reused by KVM to prepare the architecture state in a
similar way where userspace code has identified that it needs to
deliver an exception to the guest.

In the case of ARM, that includes:

1) the vcpu thread got a SIGBUS indicating a memory error,
   and we need to deliver a Synchronous External Abort to the guest to
   let it know about the error.
2) the kernel told us about a debug exception (breakpoint, watchpoint)
   but it is not for one of QEMU's own gdbstub breakpoints/watchpoints
   so it must be a breakpoint the guest itself has set up, therefore
   we need to deliver it to the guest.

So in order to reuse code, the same arm_do_interrupt function is used.
This is all fine, but we need to avoid calling it using the callback
registered in CPUClass, since that one is now TCG-only.

Fortunately this is easily solved by replacing calls to
CPUClass::do_interrupt() with explicit calls to arm_do_interrupt().

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210204163931.7358-9-cfontana@suse.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-02-05 10:24:14 -10:00
..
alpha cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
arm target/arm: do not use cc->do_interrupt for KVM directly 2021-02-05 10:24:14 -10:00
avr cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
cris cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
hppa cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
i386 cpu: Move debug_excp_handler to tcg_ops 2021-02-05 10:24:14 -10:00
lm32 cpu: Move debug_excp_handler to tcg_ops 2021-02-05 10:24:14 -10:00
m68k cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
microblaze cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
mips cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
moxie cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
nios2 cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
openrisc cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
ppc cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
riscv cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
rx cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
s390x cpu: Move debug_excp_handler to tcg_ops 2021-02-05 10:24:14 -10:00
sh4 cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
sparc cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
tilegx cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
tricore cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
unicore32 cpu: Move tlb_fill to tcg_ops 2021-02-05 10:24:14 -10:00
xtensa cpu: Move debug_excp_handler to tcg_ops 2021-02-05 10:24:14 -10:00
meson.build meson: target 2020-08-21 06:30:35 -04:00