x86/spec-ctrl: Calculate safe PTE addresses for L1TF mitigations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 25 Jul 2018 12:10:19 +0000 (12:10 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Aug 2018 16:14:18 +0000 (17:14 +0100)
commitd044f6cc590c58178d87ad78f1859d1c7905ee0b
tree20c1f0d5587593307c36cd807d4b83f869c17d8f
parente6441a804b76797c6ebac81b7d70ff19e5df9188
x86/spec-ctrl: Calculate safe PTE addresses for L1TF mitigations

Safe PTE addresses for L1TF mitigations are ones which are within the L1D
address width (may be wider than reported in CPUID), and above the highest
cacheable RAM/NVDIMM/BAR/etc.

All logic here is best-effort heuristics, which should in practice be fine for
most hardware.  Future work will see about disentangling the SRAT handling
further, as well as having L0 pass this information down to lower levels when
virtualised.

This is part of XSA-273 / CVE-2018-3620.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit b03a57c9383b32181e60add6b6de12b473652aa4)
xen/arch/x86/setup.c
xen/arch/x86/spec_ctrl.c
xen/arch/x86/srat.c
xen/common/efi/boot.c
xen/include/asm-x86/spec_ctrl.h