From: Richard Henderson Date: Wed, 8 Oct 2025 21:55:38 +0000 (-0700) Subject: target/arm: Add arm_hcr_el2_nvx_eff X-Git-Tag: v10.2.0-rc1~67^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e703a01f00a156f7944b8150bfb787ce273a4a0;p=thirdparty%2Fqemu.git target/arm: Add arm_hcr_el2_nvx_eff Implement the pseudocode function EffectiveHCR_EL2_NVx. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20251008215613.300150-39-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b8abfd8276..54f3d7b1cc 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2235,6 +2235,7 @@ static inline bool arm_is_el2_enabled(CPUARMState *env) */ uint64_t arm_hcr_el2_eff_secstate(CPUARMState *env, ARMSecuritySpace space); uint64_t arm_hcr_el2_eff(CPUARMState *env); +uint64_t arm_hcr_el2_nvx_eff(CPUARMState *env); uint64_t arm_hcrx_el2_eff(CPUARMState *env); /* diff --git a/target/arm/helper.c b/target/arm/helper.c index 8e342b0811..e397fe75bd 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3904,6 +3904,16 @@ uint64_t arm_hcr_el2_eff(CPUARMState *env) return arm_hcr_el2_eff_secstate(env, arm_security_space_below_el3(env)); } +uint64_t arm_hcr_el2_nvx_eff(CPUARMState *env) +{ + uint64_t hcr = arm_hcr_el2_eff(env); + + if (!(hcr & HCR_NV)) { + return 0; /* CONSTRAINED UNPREDICTABLE wrt NV1 */ + } + return hcr & (HCR_NV2 | HCR_NV1 | HCR_NV); +} + /* * Corresponds to ARM pseudocode function ELIsInHost(). */