xen/arm: Sanitize CTR_EL0
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 16 Sep 2021 06:25:40 +0000 (07:25 +0100)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Thu, 16 Sep 2021 21:15:52 +0000 (14:15 -0700)
commit98f176b62b6136f696da88032f9c12a244ac9aed
tree9bf5b56d44289f951527c1cfa7a8a49a87cbd362
parentef17eb9d3a89bea120ba3949b73cd482c6173648
xen/arm: Sanitize CTR_EL0

Sanitize CTR_EL0 value between cores and taint Xen if incompatible
values are found.

In the case of different i-cache types, the sanitize ctr_el0 will have a
sanitize value but this is currently not used or exposed to guest which
are seeing the original ctr_el0 value.

Use the opportunity to rename CTR_L1Ip to use an upper case name like
Linux does.
The patch is also defining ICACHE_POLICY_xxx instead of only having
CTR_L1IP_xxx to sync the definitions with Linux and is updating the code
using those accordingly (arm32 setup).

On platforms with only the same type of cores, this patch should not
modify the current Xen behaviour.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/cpufeature.c
xen/arch/arm/cpufeature.c
xen/arch/arm/setup.c
xen/include/asm-arm/cpufeature.h
xen/include/asm-arm/processor.h