x86/amd: Introduce and use X86_BUG_NULL_SEG
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 27 Dec 2018 15:13:58 +0000 (15:13 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Sep 2021 12:27:06 +0000 (13:27 +0100)
commit48a160f46251f9752bd39a854ca74d80fbbbe90c
tree42083d718efeeae36f3ed726b28e687bad26e27d
parent98f176b62b6136f696da88032f9c12a244ac9aed
x86/amd: Introduce and use X86_BUG_NULL_SEG

AMD/Hygon processors before the Zen2 microarchitecture don't clear the base or
limit fields when loading a NULL segment.

Express the logic in terms of cpu_bug_null_seg, and adjust the workaround in
do_set_segment_base().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/amd.c
xen/arch/x86/cpu/hygon.c
xen/arch/x86/pv/misc-hypercalls.c
xen/include/asm-x86/cpufeature.h
xen/include/asm-x86/cpufeatures.h