Skip to content

KVM: VMX: Preserve host's DEBUGCTL.FREEZE_IN_SMM

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 misc, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v6 Latest8 patches 8 repliesApplied

Changes in v6 from the cover letter

- WARN in tdx_vcpu_run() if KVM requests DR6 load.
- Ignore unsupported-but-suppressed DEBUGCTL bits when doing consistency check on vmcs12.
- Add support for DEBUGCTL.RTM_DEBUG.
- Use accessors in all paths.
- Add a dedicated vmx_reload_guest_debugctl().

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/8KVM: TDX: Use kvm_arch_vcpu.host_debugctl to restore the host's DEBUGCTLarch/x86/kvm/vmx/common.h arch/x86/kvm/vmx/tdx.c+2 -61 reply
2/8KVM: x86: Convert vcpu_run()'s immediate exit param into a generic bitmaparch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/svm.c arch/x86/kvm/vmx/main.c +4 more+31 -210 replies
3/8KVM: x86: Drop kvm_x86_ops.set_dr6() in favor of a new KVM_RUN flagarch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/svm.c +3 more+11 -220 replies
4/8KVM: VMX: Allow guest to set DEBUGCTL.RTM_DEBUG if RTM is supportedarch/x86/include/asm/msr-index.h arch/x86/kvm/vmx/vmx.c+5 -00 replies
5/8KVM: VMX: Extract checking of guest's DEBUGCTL into helperarch/x86/kvm/vmx/vmx.c+17 -121 reply
6/8KVM: nVMX: Check vmcs12->guest_ia32_debugctl on nested VM-Enterarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+15 -50 replies
7/8KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIsarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/pmu_intel.c arch/x86/kvm/vmx/vmx.c +1 more+24 -121 reply
8/8KVM: VMX: Preserve host's DEBUGCTLMSR_FREEZE_IN_SMM while running the guestarch/x86/include/asm/kvm_host.h arch/x86/kvm/vmx/main.c arch/x86/kvm/vmx/nested.c +3 more+41 -34 replies

Reviews trailers per patch

4 of 8 patches have a Reviewed-by or Acked-by.

PatchDapeng MiAdrian HunterMaxim Levitsky
1/8R-b
2/8
3/8
4/8
5/8R-b
6/8
7/8R-b
8/8R-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 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/8] KVM: VMX: Preserve host's DEBUGCTL.FREEZE_IN_SMM

Preserve the host's FREEZE_IN_SMM setting by stuffing GUEST_DEBUGCTL, so that SMM activity doesn't bleed into PMU events while running the guest.

Along the way, enforce the supported set of DEBUGCTL bits when processing vmcs12.GUEST_DEBUGCTL, as KVM can't rely on hardware to reject an MSR value that is supported in hardware.

To minimize the probability of the nVMX fix breaking existing setups, allow the guest to use DEBUGCTL.RTM_DEBUG if RTM is exposed to the guest.

v6:
- WARN in tdx_vcpu_run() if KVM requests DR6 load.
- Ignore unsupported-but-suppressed DEBUGCTL bits when doing consistency check on vmcs12.
- Add support for DEBUGCTL.RTM_DEBUG.
- Use accessors in all paths.
- Add a dedicated vmx_reload_guest_debugctl().

v5: https://lore.kernel.org/all/[email protected]

Maxim Levitsky (3):
KVM: nVMX: Check vmcs12->guest_ia32_debugctl on nested VM-Enter
KVM: VMX: Wrap all accesses to IA32_DEBUGCTL with getter/setter APIs
KVM: VMX: Preserve host's DEBUGCTLMSR_FREEZE_IN_SMM while running the
guest

Sean Christopherson (5):
KVM: TDX: Use kvm_arch_vcpu.host_debugctl to restore the host's
DEBUGCTL
KVM: x86: Convert vcpu_run()'s immediate exit param into a generic
bitmap
KVM: x86: Drop kvm_x86_ops.set_dr6() in favor of a new KVM_RUN flag
KVM: VMX: Allow guest to set DEBUGCTL.RTM_DEBUG if RTM is supported
KVM: VMX: Extract checking of guest's DEBUGCTL into helper

 arch/x86/include/asm/kvm-x86-ops.h |  1 -
 arch/x86/include/asm/kvm_host.h    | 15 ++++++--
 arch/x86/include/asm/msr-index.h   |  1 +
 arch/x86/kvm/svm/svm.c             | 14 ++++----
 arch/x86/kvm/vmx/common.h          |  2 --
 arch/x86/kvm/vmx/main.c            | 17 +++------
 arch/x86/kvm/vmx/nested.c          | 21 ++++++++---
 arch/x86/kvm/vmx/pmu_intel.c       |  8 ++---
 arch/x86/kvm/vmx/tdx.c             | 24 ++++++-------
 arch/x86/kvm/vmx/vmx.c             | 57 ++++++++++++++++++------------
 arch/x86/kvm/vmx/vmx.h             | 26 ++++++++++++++
 arch/x86/kvm/vmx/x86_ops.h         |  4 +--
 arch/x86/kvm/x86.c                 | 25 ++++++++++---
 13 files changed, 140 insertions(+), 75 deletions(-)

base-commit: 61374cc145f4a56377eaf87c7409a97ec7a34041

Signature · 1 line
2.50.0.rc0.642.g800a2b2222-goog