target/arm: Escalate to correct HardFault when AIRCR.BFHFNMINS is set
commit1a5182c0d2eaa8dc8e7dbd914fba8d07d5595fe0
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 23 Jul 2018 12:34:57 +0000 (23 13:34 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 24 Jul 2018 10:43:08 +0000 (24 11:43 +0100)
treea0c599b1c4f8757de1800e98d8ea2a70ca649be7
parent042374c92e83da5c8f906b9b97814a21eac2a09f
target/arm: Escalate to correct HardFault when AIRCR.BFHFNMINS is set

When we escalate a v8M exception to HardFault, if AIRCR.BFHFNMINNS is
set then we need to decide whether it should become a secure HardFault
or a nonsecure HardFault. We should always escalate to the same
target security state as the original exception. The current code
tries to test this using the 'secure' bool, which is not right because
that flag indicates whether the target security state only for
banked exceptions; the effect was that we were incorrectly escalating
always-secure exceptions like SecureFault to a nonsecure HardFault.

Fix this by defining, logging and using a new 'targets_secure' bool
which tracks the condition we actually want.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180723123457.2038-1-peter.maydell@linaro.org
hw/intc/armv7m_nvic.c
hw/intc/trace-events