aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-01-16 16:56:05 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-01-26 11:30:47 +0000
commit6b504a01c17de92f2851d63f181210eff97191d0 (patch)
treee261956c8c798f6763c30a35d2a3eefa2e22dce2
parent604927e357c2b292c70826e4ce42574ad126ef32 (diff)
downloadqemu-6b504a01c17de92f2851d63f181210eff97191d0.zip
qemu-6b504a01c17de92f2851d63f181210eff97191d0.tar.gz
qemu-6b504a01c17de92f2851d63f181210eff97191d0.tar.bz2
target/arm: Fix VNCR fault detection logic
In arm_deliver_fault() we check for whether the fault is caused by a data abort due to an access to a FEAT_NV2 sysreg in the memory pointed to by the VNCR. Unfortunately part of the condition checks the wrong argument to the function, meaning that it would spuriously trigger, resulting in some instruction aborts being taken to the wrong EL and reported incorrectly. Use the right variable in the condition. Fixes: 674e5345275d425 ("target/arm: Report VNCR_EL2 based faults correctly") Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-id: 20240116165605.2523055-1-peter.maydell@linaro.org
-rw-r--r--target/arm/tcg/tlb_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c
index dd5de74..5477c7f 100644
--- a/target/arm/tcg/tlb_helper.c
+++ b/target/arm/tcg/tlb_helper.c
@@ -184,7 +184,7 @@ void arm_deliver_fault(ARMCPU *cpu, vaddr addr,
* (and indeed syndrome does not have the EC field in it,
* because we masked that out in disas_set_insn_syndrome())
*/
- bool is_vncr = (mmu_idx != MMU_INST_FETCH) &&
+ bool is_vncr = (access_type != MMU_INST_FETCH) &&
(env->exception.syndrome & ARM_EL_VNCR);
if (is_vncr) {