]> git.proxmox.com Git - mirror_qemu.git/commit - target/arm/cpu.c
target/arm: Don't clobber ID_PFR1.Security on M-profile cores
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 19 Nov 2020 21:55:52 +0000 (21:55 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Dec 2020 11:44:55 +0000 (11:44 +0000)
commit4018818840f499d0a478508aedbb6802c8eae928
tree2f8e62097421b2fdc5fdc8dc9b7f7e5f83ca1bd5
parentcad8e2e3160dd10371552fce6cd8c6e171503e13
target/arm: Don't clobber ID_PFR1.Security on M-profile cores

In arm_cpu_realizefn() we check whether the board code disabled EL3
via the has_el3 CPU object property, which we create if the CPU
starts with the ARM_FEATURE_EL3 feature bit.  If it is disabled, then
we turn off ARM_FEATURE_EL3 and also zero out the relevant fields in
the ID_PFR1 and ID_AA64PFR0 registers.

This codepath was incorrectly being taken for M-profile CPUs, which
do not have an EL3 and don't set ARM_FEATURE_EL3, but which may have
the M-profile Security extension and so should have non-zero values
in the ID_PFR1.Security field.

Restrict the handling of the feature flag to A/R-profile cores.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201119215617.29887-4-peter.maydell@linaro.org
target/arm/cpu.c