[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 22/25] target/arm: do not use cc->do_interrupt for KVM di
From: |
Richard Henderson |
Subject: |
Re: [PATCH v11 22/25] target/arm: do not use cc->do_interrupt for KVM directly |
Date: |
Fri, 11 Dec 2020 11:44:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 12/11/20 2:31 AM, Claudio Fontana wrote:
> 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>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> target/arm/helper.c | 4 ++++
> target/arm/kvm64.c | 6 ++----
> 2 files changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH v11 17/25] accel/tcg: split TCG-only code from cpu_exec_realizefn, (continued)
- [PATCH v11 17/25] accel/tcg: split TCG-only code from cpu_exec_realizefn, Claudio Fontana, 2020/12/11
- [PATCH v11 24/25] cpu: move cc->transaction_failed to tcg_ops, Claudio Fontana, 2020/12/11
- [PATCH v11 14/25] cpu: Remove unnecessary noop methods, Claudio Fontana, 2020/12/11
- [PATCH v11 20/25] cpu: Move tlb_fill to tcg_ops, Claudio Fontana, 2020/12/11
- [PATCH v11 22/25] target/arm: do not use cc->do_interrupt for KVM directly, Claudio Fontana, 2020/12/11
- Re: [PATCH v11 22/25] target/arm: do not use cc->do_interrupt for KVM directly,
Richard Henderson <=
- [PATCH v11 23/25] cpu: move cc->do_interrupt to tcg_ops, Claudio Fontana, 2020/12/11
- [PATCH v11 19/25] cpu: Move cpu_exec_* to tcg_ops, Claudio Fontana, 2020/12/11
- [PATCH v11 25/25] cpu: move do_unaligned_access to tcg_ops, Claudio Fontana, 2020/12/11
- Re: [PATCH v11 00/25] i386 cleanup PART 1, no-reply, 2020/12/11
- Re: [PATCH v11 00/25] i386 cleanup PART 1, Philippe Mathieu-Daudé, 2020/12/11