Skip to content

KVM: Expose speculation control feature to guests

KarimAllah Ahmed kvm lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 28 repliesIn review
  2. v55 patches 39 repliesSuperseded
  3. v45 patches 10 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v34 patches25 repliesSuperseded
v24 patches11 repliesSuperseded

Changes in v6 from the cover letter

- Do not penalize (save/restore IBRS) all L2 guests when anyone of them starts using the SPEC_CTRL.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDXarch/x86/kvm/cpuid.c arch/x86/kvm/cpuid.h+4 -51 reply
2/5KVM: x86: Add IBPB supportarch/x86/kvm/cpuid.c arch/x86/kvm/svm.c arch/x86/kvm/vmx.c+116 -316 replies
3/5KVM: VMX: Emulate MSR_IA32_ARCH_CAPABILITIESarch/x86/kvm/cpuid.c arch/x86/kvm/vmx.c arch/x86/kvm/x86.c+17 -13 replies
4/5KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRLarch/x86/kvm/cpuid.c arch/x86/kvm/vmx.c arch/x86/kvm/x86.c+110 -66 replies
5/5KVM: SVM: Allow direct access to MSR_IA32_SPEC_CTRLarch/x86/kvm/svm.c+59 -02 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniKonrad Rzeszutek WilkDarren KennyJim Mattson
1/5R-b R-b R-b
2/5R-b
3/5R-b R-b R-b R-b
4/5R-b R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/5] KVM: Expose speculation control feature to guests

Add direct access to speculation control MSRs for KVM guests. This allows the guest to protect itself against Spectre V2 using IBRS+IBPB instead of a retpoline+IBPB based approach.

It also exposes the ARCH_CAPABILITIES MSR which is used by Intel processors to indicate RDCL_NO and IBRS_ALL.

Keep in mind that the SVM part of the patch is unchanged this time. Mostly to get feedback/confirmation about the nested handling for VMX first, once this is done I will update SVM as well.

v6:
- Do not penalize (save/restore IBRS) all L2 guests when anyone of them starts using the SPEC_CTRL.

v5:
- svm: add PRED_CMD and SPEC_CTRL to direct_access_msrs list.
- vmx: check also for X86_FEATURE_SPEC_CTRL for msr reads and writes.
- vmx: Use MSR_TYPE_W instead of MSR_TYPE_R for the nested IBPB MSR
- rewrite commit message for IBPB patch [2/5] (Ashok)

v4:
- Add IBRS passthrough for SVM (5/5).
- Handle nested guests properly.
- expose F(IBRS) in kvm_cpuid_8000_0008_ebx_x86_features

Ashok Raj (1):
KVM: x86: Add IBPB support

KarimAllah Ahmed (4):
KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX
KVM: VMX: Emulate MSR_IA32_ARCH_CAPABILITIES
KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL
KVM: SVM: Allow direct access to MSR_IA32_SPEC_CTRL

 arch/x86/kvm/cpuid.c |  22 ++++--
 arch/x86/kvm/cpuid.h |   1 +
 arch/x86/kvm/svm.c   |  87 +++++++++++++++++++++++
 arch/x86/kvm/vmx.c   | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/x86.c   |   1 +
 5 files changed, 299 insertions(+), 8 deletions(-)
Cc Andi Kleen <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Arjan van de Ven <[email protected]>
Cc Ashok Raj <[email protected]>
Cc Asit Mallick <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Janakarajan Natarajan <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Jun Nakajima <[email protected]>
Cc Laura Abbott <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Masami Hiramatsu <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Radim Krčmář <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tim Chen <[email protected]>
Cc Tom Lendacky <[email protected]>
Signature · 1 line
2.7.4