]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Add Cortex-A77 erratum 1508412 handling
authorLuca Fancellu <luca.fancellu@arm.com>
Mon, 17 Jul 2023 12:25:46 +0000 (13:25 +0100)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 1 Aug 2023 23:10:46 +0000 (16:10 -0700)
commit87eaa43b30f8ffb600f8e6f765d5c7e4bcb241b9
tree4a8ec265bf720173a28b499bdbcf4885b0d90968
parente05a0e65b09d8512fdf4881c7fae713045c7d83d
xen/arm: Add Cortex-A77 erratum 1508412 handling

Cortex-A77 cores (r0p0, r1p0) could deadlock on a sequence of a
store-exclusive or read of PAR_EL1 and a load with device or non-cacheable
memory attributes.
A workaround is available, but it depends on a firmware counterpart.

The proposed workaround from the errata document is to modify the software
running at EL1 and above to include a DMB SY before and after accessing
PAR_EL1.

In conjunction to the above, the firmware needs to use a specific write
sequence to several IMPLEMENTATION DEFINED registers to have the hardware
insert a DMB SY after all load-exclusive and store-exclusive instructions.

Apply the workaround to Xen where PAR_EL1 is read, implementing an helper
function to do that.
Since Xen can be interrupted by irqs in any moment, add a barrier on
entry/exit when we are running on the affected cores.

A guest without the workaround can deadlock the system, so warn the users
of Xen with the above type of cores to use only trusted guests, by
printing a message on Xen startup.

This is XSA-436 / CVE-2023-34320.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
[stefano: add XSA-436 to commit message]
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
SUPPORT.md
docs/misc/arm/silicon-errata.txt
xen/arch/arm/Kconfig
xen/arch/arm/arm64/entry.S
xen/arch/arm/cpuerrata.c
xen/arch/arm/domain.c
xen/include/asm-arm/arm64/page.h
xen/include/asm-arm/cpufeature.h
xen/include/asm-arm/sysregs.h