Merge tag 'kvm-x86-misc-6.6' of https://github.com/kvm-x86/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 31 Aug 2023 17:36:33 +0000 (13:36 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 31 Aug 2023 17:36:33 +0000 (13:36 -0400)
KVM x86 changes for 6.6:

 - Misc cleanups

 - Retry APIC optimized recalculation if a vCPU is added/enabled

 - Overhaul emergency reboot code to bring SVM up to par with VMX, tie the
   "emergency disabling" behavior to KVM actually being loaded, and move all of
   the logic within KVM

 - Fix user triggerable WARNs in SVM where KVM incorrectly assumes the TSC
   ratio MSR can diverge from the default iff TSC scaling is enabled, and clean
   up related code

 - Add a framework to allow "caching" feature flags so that KVM can check if
   the guest can use a feature without needing to search guest CPUID

1  2 
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/lapic.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c

Simple merge
Simple merge
Simple merge
Simple merge
index 488814e919ca0ef3b51574e1a5a51ec320c6170f,226b3a780d0fcb20120040da0fb4e1c494c01e95..f283eb47f6acec7d34453c2047536bfaa14b66c5
@@@ -1004,10 -1017,16 +1040,10 @@@ static struct vmcb *svm_get_lbr_vmcb(st
  void svm_update_lbrv(struct kvm_vcpu *vcpu)
  {
        struct vcpu_svm *svm = to_svm(vcpu);
 -
 -      bool enable_lbrv = svm_get_lbr_msr(svm, MSR_IA32_DEBUGCTLMSR) &
 -                                         DEBUGCTLMSR_LBR;
 -
 -      bool current_enable_lbrv = !!(svm->vmcb->control.virt_ext &
 -                                    LBR_CTL_ENABLE_MASK);
 -
 -      if (unlikely(is_guest_mode(vcpu) && guest_can_use(vcpu, X86_FEATURE_LBRV)))
 -              if (unlikely(svm->nested.ctl.virt_ext & LBR_CTL_ENABLE_MASK))
 -                      enable_lbrv = true;
 +      bool current_enable_lbrv = svm->vmcb->control.virt_ext & LBR_CTL_ENABLE_MASK;
 +      bool enable_lbrv = (svm_get_lbr_vmcb(svm)->save.dbgctl & DEBUGCTLMSR_LBR) ||
-                          (is_guest_mode(vcpu) && svm->lbrv_enabled &&
++                          (is_guest_mode(vcpu) && guest_can_use(vcpu, X86_FEATURE_LBRV) &&
 +                          (svm->nested.ctl.virt_ext & LBR_CTL_ENABLE_MASK));
  
        if (enable_lbrv == current_enable_lbrv)
                return;
Simple merge
Simple merge
Simple merge