[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 24/28] hw/intc/armv7m_nvic: Fix "return from inactive hand
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 24/28] hw/intc/armv7m_nvic: Fix "return from inactive handler" check |
Date: |
Tue, 1 Dec 2020 09:58:53 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 11/19/20 3:56 PM, Peter Maydell wrote:
> In commit 077d7449100d824a4 we added code to handle the v8M
> requirement that returns from NMI or HardFault forcibly deactivate
> those exceptions regardless of what interrupt the guest is trying to
> deactivate. Unfortunately this broke the handling of the "illegal
> exception return because the returning exception number is not
> active" check for those cases. In the pseudocode this test is done
> on the exception the guest asks to return from, but because our
> implementation was doing this in armv7m_nvic_complete_irq() after the
> new "deactivate NMI/HardFault regardless" code we ended up doing the
> test on the VecInfo for that exception instead, which usually meant
> failing to raise the illegal exception return fault.
>
> In the case for "configurable exception targeting the opposite
> security state" we detected the illegal-return case but went ahead
> and deactivated the VecInfo anyway, which is wrong because that is
> the VecInfo for the other security state.
>
> Rearrange the code so that we first identify the illegal return
> cases, then see if we really need to deactivate NMI or HardFault
> instead, and finally do the deactivation.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/intc/armv7m_nvic.c | 59 +++++++++++++++++++++++--------------------
> 1 file changed, 32 insertions(+), 27 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 24/28] hw/intc/armv7m_nvic: Fix "return from inactive handler" check,
Richard Henderson <=