]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Always use arm_pan_enabled() when checking if PAN is enabled
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:50 +0000 (14:43 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:50 +0000 (14:43 +0000)
commit7fda076357684b643e1abc0553a1622b25c43a05
treea80ae2ccce08686b9cffd169040720fc1f2b108a
parentad4e2d4db13e17726cd68908f5c4043bf82051f8
target/arm: Always use arm_pan_enabled() when checking if PAN is enabled

Currently the code in target/arm/helper.c mostly checks the PAN bits
in env->pstate or env->uncached_cpsr directly when it wants to know
if PAN is enabled, because in most callsites we know whether we are
in AArch64 or AArch32. We do have an arm_pan_enabled() function, but
we only use it in a few places where the code might run in either an
AArch32 or AArch64 context.

For FEAT_NV, when HCR_EL2.{NV,NV1} is {1,1} PAN is always disabled
even when the PSTATE.PAN bit is set, the "is PAN enabled" test
becomes more complicated. Make all places that check for PAN use
arm_pan_enabled(), so we have a place to put the FEAT_NV test.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
target/arm/helper.c