]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Sanitize cpuinfo ID registers fields
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 16 Sep 2021 06:25:37 +0000 (07:25 +0100)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Thu, 16 Sep 2021 21:15:44 +0000 (14:15 -0700)
commit0bf9efb9ee4cc6cdafbe0a0ed1529449bb9d6825
tree0467c9345c86ab67d8c124430b4272dd9d59d272
parent3b78e2774a00c0341e99527179715e8cffcb0f36
xen/arm: Sanitize cpuinfo ID registers fields

Define a sanitize_cpu function to be called on secondary cores to
sanitize the system cpuinfo structure.

The safest value is taken when possible and the system is marked tainted
if we encounter values which are incompatible with each other.

Call the update_system_features function on all secondary cores that are
kept running and taint the system if different midr are found between
cores but hmp-unsafe=true was passed on Xen command line.

This is only supported on arm64 so update_system_features is an empty
static inline on arm32.

The patch is adding a new TAINT_CPU_OUT_OF_SPEC to warn the user if
Xen is running on a system with features differences between cores which
are not supported.

The patch is disabling CTR_EL0, DCZID_EL0 and ZCRusing #if 0 with a TODO
as this patch is not handling sanitization of those registers.
CTR_EL0/DCZID will be handled in a future patch to properly handle
different cache attributes when possible.
ZCR should be sanitize once we add support for SVE in Xen.

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