target/arm: Report VNCR_EL2 based faults correctly
commit674e5345275d42581ed859acfb1ef14ebf98f9d6
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:54 +0000 (9 14:43 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:44:45 +0000 (9 14:44 +0000)
tree3776d376dd2c748aa82d83570421cb740c5cb5b7
parentdaf9b4a00fd19dcab8df9091080367889befa4c2
target/arm: Report VNCR_EL2 based faults correctly

If FEAT_NV2 redirects a system register access to a memory offset
from VNCR_EL2, that access might fault.  In this case we need to
report the correct syndrome information:
 * Data Abort, from same-EL
 * no ISS information
 * the VNCR bit (bit 13) is set

and the exception must be taken to EL2.

Save an appropriate syndrome template when generating code; we can
then use that to:
 * select the right target EL
 * reconstitute a correct final syndrome for the data abort
 * report the right syndrome if we take a FEAT_RME granule protection
   fault on the VNCR-based write

Note that because VNCR is bit 13, we must start keeping bit 13 in
template syndromes, by adjusting ARM_INSN_START_WORD2_SHIFT.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
target/arm/cpu.h
target/arm/syndrome.h
target/arm/tcg/tlb_helper.c
target/arm/tcg/translate-a64.c