Fix a bug where KVM neglects to emit IBPB when a vCPU is migrated *back* to
a previous pCPU, in which case a misbehaving task B in the guest can unduly
infuence e.g. the BTB of task A in the guest (running in the same vCPU).
FWIW, I've had the first patch sitting around for several months as a
micro-optimization, but was never posted it as I wasn't 100% confident my
analysis was correct. But it makes plugging this hole much easier, so here
it is... Reviews most definitely welcome.
Sean Christopherson (2):
KVM: x86: Defer IBPBs for vCPU and nested transitions until core run
loop
KVM: x86: Emit IBPB on pCPU migration if IBPB is advertised to guest
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/x86.c | 20 +++++++++++++++++++-
arch/x86/kvm/x86.h | 2 +-
3 files changed, 21 insertions(+), 2 deletions(-)
base-commit: e81f7c908e1664233974b9f20beead78cde6343a
--
2.52.0.457.g6b5491de43-goog