Merge tag 'kvm-x86-6.1-2' of https://github.com/sean-jc/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Sep 2022 17:25:13 +0000 (13:25 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 30 Sep 2022 11:09:48 +0000 (07:09 -0400)
KVM x86 updates for 6.1, batch #2:

 - Misc PMU fixes and cleanups.

 - Fixes for Hyper-V hypercall selftest

12 files changed:
1  2 
.mailmap
arch/arm64/kvm/arm.c
arch/s390/kvm/kvm-s390.c
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/emulate.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c
mm/vmstat.c
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/x86_64/vmx.h
tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c

diff --cc .mailmap
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -11107,29 -11302,17 +11316,30 @@@ int kvm_arch_vcpu_ioctl_set_mpstate(str
  
        vcpu_load(vcpu);
  
 -      if (!lapic_in_kernel(vcpu) &&
 -          mp_state->mp_state != KVM_MP_STATE_RUNNABLE)
 +      switch (mp_state->mp_state) {
 +      case KVM_MP_STATE_UNINITIALIZED:
 +      case KVM_MP_STATE_HALTED:
 +      case KVM_MP_STATE_AP_RESET_HOLD:
 +      case KVM_MP_STATE_INIT_RECEIVED:
 +      case KVM_MP_STATE_SIPI_RECEIVED:
 +              if (!lapic_in_kernel(vcpu))
 +                      goto out;
 +              break;
 +
 +      case KVM_MP_STATE_RUNNABLE:
 +              break;
 +
 +      default:
                goto out;
 +      }
  
        /*
-        * KVM_MP_STATE_INIT_RECEIVED means the processor is in
-        * INIT state; latched init should be reported using
-        * KVM_SET_VCPU_EVENTS, so reject it here.
+        * Pending INITs are reported using KVM_SET_VCPU_EVENTS, disallow
+        * forcing the guest into INIT/SIPI if those events are supposed to be
+        * blocked.  KVM prioritizes SMI over INIT, so reject INIT/SIPI state
+        * if an SMI is pending as well.
         */
-       if ((kvm_vcpu_latch_init(vcpu) || vcpu->arch.smi_pending) &&
+       if ((!kvm_apic_init_sipi_allowed(vcpu) || vcpu->arch.smi_pending) &&
            (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED ||
             mp_state->mp_state == KVM_MP_STATE_INIT_RECEIVED))
                goto out;
diff --cc mm/vmstat.c
Simple merge
Simple merge