]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/arm: Fix VNCR fault detection logic
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 16 Jan 2024 16:56:05 +0000 (16:56 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Jan 2024 11:30:47 +0000 (11:30 +0000)
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

target/arm/tcg/tlb_helper.c

index dd5de74ffb792e234f04cd8b488785bb5329b114..5477c7fb7dc9ef083778c01512620e06255733ee 100644 (file)
@@ -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) {