]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Mitigate IBPB not flushing the RSB/RAS
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Jun 2022 15:18:36 +0000 (16:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 4 Nov 2022 13:22:04 +0000 (13:22 +0000)
commit32445f23fea6a533fc1d7ade5871246d75210bf1
treef4f92f194f4e43f9423a4afa1f027194a2c700a7
parent07be0fe497349ed423c5201bdc410b6281ebf04f
x86/spec-ctrl: Mitigate IBPB not flushing the RSB/RAS

Introduce spec_ctrl_new_guest_context() to encapsulate all logic pertaining to
using MSR_PRED_CMD for a new guest context, even if it only has one user
presently.

Introduce X86_BUG_IBPB_NO_RET, and use it extend spec_ctrl_new_guest_context()
with a manual fixup for hardware which mis-implements IBPB.

This is part of XSA-422 / CVE-2022-23824.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 2b27967fb89d7904a1571a2fb963b1c9cac548db)
xen/arch/x86/asm-macros.c
xen/arch/x86/domain.c
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/cpufeatures.h
xen/include/asm-x86/spec_ctrl.h