From: Richard Henderson Date: Wed, 8 Oct 2025 21:56:00 +0000 (-0700) Subject: target/arm: Copy EXLOCKEn to EXLOCK on exception to the same EL X-Git-Tag: v10.2.0-rc1~67^2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d77ed960164490d4daeaa3e1a3532ea53477538a;p=thirdparty%2Fqemu.git target/arm: Copy EXLOCKEn to EXLOCK on exception to the same EL Per R_WTXBY, PSTATE.EXLOCK is 0 on an exception to a higher EL, and copied from EXLOCKEn otherwise. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-id: 20251008215613.300150-61-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- diff --git a/target/arm/helper.c b/target/arm/helper.c index 1aa0a157b7..0077788e1e 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9071,8 +9071,13 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs) } else { addr += 0x600; } - } else if (pstate_read(env) & PSTATE_SP) { - addr += 0x200; + } else { + if (pstate_read(env) & PSTATE_SP) { + addr += 0x200; + } + if (is_a64(env) && (env->cp15.gcscr_el[new_el] & GCSCR_EXLOCKEN)) { + new_mode |= PSTATE_EXLOCK; + } } switch (cs->exception_index) {