Skip to content

KVM: x86: Plug an intra-guest Spectre v2 hole

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: x86: Defer IBPBs for vCPU and nested transitions until core run looparch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c arch/x86/kvm/x86.h+8 -21 reply
2/2KVM: x86: Emit IBPB on pCPU migration if IBPB is advertised to guestarch/x86/kvm/x86.c+13 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: x86: Plug an intra-guest Spectre v2 hole

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

Signature · 1 line
2.52.0.457.g6b5491de43-goog