diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2020-10-08 11:21:54 -0500 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-10-20 16:12:00 +0100 |
commit | 50244cc76abcac3296cff3d84826f5ff71808c80 (patch) | |
tree | 405be2f634aa69ace7537ca6ef67cf1f94c526b7 /target | |
parent | 4aedfc0f633fd06dd2a5dc8ffa93f4c56117e37f (diff) | |
download | qemu-50244cc76abcac3296cff3d84826f5ff71808c80.zip qemu-50244cc76abcac3296cff3d84826f5ff71808c80.tar.gz qemu-50244cc76abcac3296cff3d84826f5ff71808c80.tar.bz2 |
target/arm: Fix reported EL for mte_check_fail
The reporting in AArch64.TagCheckFail only depends on PSTATE.EL,
and not the AccType of the operation. There are two guest
visible problems that affect LDTR and STTR because of this:
(1) Selecting TCF0 vs TCF1 to decide on reporting,
(2) Report "data abort same el" not "data abort lower el".
Reported-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Message-id: 20201008162155.161886-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/mte_helper.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c index 734cc5c..153bd1e 100644 --- a/target/arm/mte_helper.c +++ b/target/arm/mte_helper.c @@ -525,14 +525,10 @@ static void mte_check_fail(CPUARMState *env, uint32_t desc, reg_el = regime_el(env, arm_mmu_idx); sctlr = env->cp15.sctlr_el[reg_el]; - switch (arm_mmu_idx) { - case ARMMMUIdx_E10_0: - case ARMMMUIdx_E20_0: - el = 0; + el = arm_current_el(env); + if (el == 0) { tcf = extract64(sctlr, 38, 2); - break; - default: - el = reg_el; + } else { tcf = extract64(sctlr, 40, 2); } |