]> xenbits.xensource.com Git - xen.git/commit
x86/amd: Work around CLFLUSH ordering on older parts
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Jun 2022 13:51:47 +0000 (15:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jun 2022 13:51:47 +0000 (15:51 +0200)
commit25c7adeefa7538d1f88bab1859ce77f8b46f229e
tree2fd3cf068e5775474752547ee01a65e82a2cc000
parent204d4f16506334a0398649c714c19349145589be
x86/amd: Work around CLFLUSH ordering on older parts

On pre-CLFLUSHOPT AMD CPUs, CLFLUSH is weakely ordered with everything,
including reads and writes to the address, and LFENCE/SFENCE instructions.

This creates a multitude of problematic corner cases, laid out in the manual.
Arrange to use MFENCE on both sides of the CLFLUSH to force proper ordering.

This is part of XSA-402.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 062868a5a8b428b85db589fa9a6d6e43969ffeb9
master date: 2022-06-09 14:23:07 +0200
xen/arch/x86/cpu/amd.c
xen/arch/x86/flushtlb.c
xen/include/asm-x86/cpufeatures.h