Skip to content

Commit

Permalink
target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled
Browse files Browse the repository at this point in the history
ARM trusted firmware, when built with FEAT_HCX support, sets SCR_EL3.HXEn bit
to allow EL2 to modify HCRX_EL2 register without trapping it in EL3. Qemu
uses a valid mask to clear unsupported SCR_EL3 bits when emulating SCR_EL3
write, and that mask doesn't include SCR_EL3.HXEn bit even if FEAT_HCX is
enabled and exposed to the guest. As a result EL3 writes of that bit are
ignored.

Cc: qemu-stable@nongnu.org
Signed-off-by: Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
Message-id: 20230105221251.17896-4-eiakovlev@linux.microsoft.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 08899b5)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Evgeny Iakovlev authored and Michael Tokarev committed Mar 29, 2023
1 parent de60587 commit c3ea5ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions target/arm/helper.c
Expand Up @@ -1820,6 +1820,9 @@ static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
if (cpu_isar_feature(aa64_sme, cpu)) {
valid_mask |= SCR_ENTP2;
}
if (cpu_isar_feature(aa64_hcx, cpu)) {
valid_mask |= SCR_HXEN;
}
} else {
valid_mask &= ~(SCR_RW | SCR_ST);
if (cpu_isar_feature(aa32_ras, cpu)) {
Expand Down

0 comments on commit c3ea5ef

Please sign in to comment.