]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Rework ibpb_calculations()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 27 Jul 2023 19:03:28 +0000 (20:03 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Aug 2023 15:02:54 +0000 (16:02 +0100)
commitb274f6878b6199c35968b39be2afa1de62763f5b
treef0865276e82f5ffcce60302572dd8092b57d0338
parent04dee21883ea59132f4454b09367bc149e6185cb
x86/spec-ctrl: Rework ibpb_calculations()

... in order to make the SRSO mitigations easier to integrate.

 * Check for AMD/Hygon CPUs directly, rather than assuming based on IBPB.
   In particular, Xen supports synthesising the IBPB bit to guests on Intel to
   allow IBPB while dissuading the use of (legacy) IBRS.
 * Collect def_ibpb_entry rather than opencoding the BTC_NO calculation for
   both opt_ibpb_entry_{pv,hvm}.

No functional change.

This is part of XSA-434 / CVE-2023-20569

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
(cherry picked from commit 292f68fb77196a35ac92b296792770d0f3190d75)
xen/arch/x86/spec_ctrl.c