x86/ctxt: Issue a speculation barrier between vcpu contexts
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Nov 2017 18:35:11 +0000 (18:35 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 26 Jan 2018 14:10:21 +0000 (14:10 +0000)
commita2ed643ed783020f885035432e9c0919756921d1
tree29c7fd63f937e729f74b92e5e84e390d450f7524
parent2713715305ca516f698d58cec5e0b322c3b2c4eb
x86/ctxt: Issue a speculation barrier between vcpu contexts

Issuing an IBPB command flushes the Branch Target Buffer, so that any poison
left by one vcpu won't remain when beginning to execute the next.

The cost of IBPB is substantial, and skipped on transition to idle, as Xen's
idle code is robust already.  All transitions into vcpu context are fully
serialising in practice (and under consideration for being retroactively
declared architecturally serialising), so a cunning attacker cannot use SP1 to
try and skip the flush.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
docs/misc/xen-command-line.markdown
xen/arch/x86/domain.c
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/spec_ctrl.h