]> www.infradead.org Git - users/hch/misc.git/commitdiff
Merge branches 'fixes', 'misc', 'mmu', 'pir', 'selftests', 'svm' and 'vmx'
authorSean Christopherson <seanjc@google.com>
Thu, 8 May 2025 22:59:54 +0000 (22:59 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 8 May 2025 22:59:54 +0000 (22:59 +0000)
* fixes:
  KVM: SVM: Set/clear SRSO's BP_SPEC_REDUCE on 0 <=> 1 VM count transitions
  KVM: x86/mmu: Prevent installing hugepages when mem attributes are changing
  KVM: SVM: Update dump_ghcb() to use the GHCB snapshot fields
  KVM: x86/mmu: Check and free obsolete roots in kvm_mmu_reload()
  KVM: x86: Check that the high 32bits are clear in kvm_arch_vcpu_ioctl_run()
  KVM: SVM: Forcibly leave SMM mode on SHUTDOWN interception

* misc:
  KVM: Remove obsolete comment about locking for kvm_io_bus_read/write
  KVM: x86: Unify cross-vCPU IBPB
  KVM: SVM: Clear current_vmcb during vCPU free for all *possible* CPUs
  KVM: x86: Add module param to control and enumerate device posted IRQs
  KVM: VMX: Don't send UNBLOCK when starting device assignment without APICv
  KVM: x86: Rescan I/O APIC routes after EOI interception for old routing
  KVM: x86: Add a helper to deduplicate I/O APIC EOI interception logic
  KVM: x86: Isolate edge vs. level check in userspace I/O APIC route scanning
  KVM: x86: Advertise support for AMD's PREFETCHI
  KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
  KVM: x86: clean up a return
  KVM: x86: Advertise support for WRMSRNS
  x86/msr: Rename the WRMSRNS opcode macro to ASM_WRMSRNS (for KVM)
  KVM: x86: Generalize IBRS virtualization on emulated VM-exit
  KVM: x86: Propagate AMD's IbrsSameMode to the guest
  x86/cpufeatures: Define X86_FEATURE_AMD_IBRS_SAME_MODE

* mmu:
  KVM: x86/mmu: Warn if PFN changes on shadow-present SPTE in shadow MMU
  KVM: x86/tdp_mmu: WARN if PFN changes for spurious faults
  KVM: x86/tdp_mmu: Merge prefetch and access checks for spurious faults
  KVM: x86/mmu: Further check old SPTE is leaf for spurious prefetch fault

* pir:
  x86/irq: KVM: Add helper for harvesting PIR to deduplicate KVM and posted MSIs
  KVM: VMX: Use arch_xchg() when processing PIR to avoid instrumentation
  KVM: VMX: Isolate pure loads from atomic XCHG when processing PIR
  KVM: VMX: Process PIR using 64-bit accesses on 64-bit kernels
  x86/irq: KVM: Track PIR bitmap as an "unsigned long" array
  KVM: VMX: Ensure vIRR isn't reloaded at odd times when sync'ing PIR
  x86/irq: Track if IRQ was found in PIR during initial loop (to load PIR vals)
  x86/irq: Ensure initial PIR loads are performed exactly once

* selftests:
  KVM: selftests: Add a test for x86's fastops emulation
  KVM: selftests: Add a basic SEV-SNP smoke test
  KVM: selftests: Decouple SEV policy from VM type
  KVM: selftests: Force GUEST_MEMFD flag for SNP VM type
  KVM: selftests: Add library support for interacting with SNP
  KVM: selftests: Introduce SEV VM type check
  KVM: selftests: Replace assert() with TEST_ASSERT_EQ()
  KVM: selftests: Add SMT control state helper
  KVM: selftests: Add vmgexit helper
  KVM: selftests: SEV-SNP test for KVM_SEV_INIT2

* svm:
  x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables
  KVM: SVM: Treat DEBUGCTL[5:2] as reserved
  KVM: SVM: avoid frequency indirect calls
  KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field
  x86/cpufeatures: Add "Allowed SEV Features" Feature
  KVM: SVM: Add a mutex to dump_vmcb() to prevent concurrent output
  KVM: SVM: Include the vCPU ID when dumping a VMCB
  KVM: SVM: Add the type of VM for which the VMCB/VMSA is being dumped
  KVM: SVM: Dump guest register state in dump_vmcb()
  KVM: SVM: Decrypt SEV VMSA in dump_vmcb() if debugging is enabled
  KVM: SVM: Fix SNP AP destroy race with VMRUN

* vmx:
  KVM: VMX: Clean up and macrofy x86_ops
  KVM: VMX: Define a VMX glue macro for kvm_complete_insn_gp()
  KVM: VMX: Move vt_apicv_pre_state_restore() to posted_intr.c and tweak name
  KVM: x86: Revert kvm_x86_ops.mem_enc_ioctl() back to an OPTIONAL hook
  KVM: VMX: Flush shadow VMCS on emergency reboot
  KVM: VMX: Use LEAVE in vmx_do_interrupt_irqoff()
  KVM: nVMX: Check MSR load/store list counts during VM-Enter consistency checks

14 files changed:
1  2  3  4  5  6  7  8 
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/lapic.c
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/posted_intr.c
arch/x86/kvm/vmx/posted_intr.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
virt/kvm/kvm_main.c

Simple merge
Simple merge
Simple merge
Simple merge
index a284dce227a08ecee060ada56997b156f4cfaac3,8d1b632e33d288b4ddec9cfeeef5c96f0d6a1c0e,a284dce227a08ecee060ada56997b156f4cfaac3,221060b578f9272df4d85b2b62dd0bef5b90ae8c,a284dce227a08ecee060ada56997b156f4cfaac3,a284dce227a08ecee060ada56997b156f4cfaac3,a284dce227a08ecee060ada56997b156f4cfaac3,a284dce227a08ecee060ada56997b156f4cfaac3..cbc84c6abc2e3f8b1f18ed8d1c9629fd7f827466
@@@@@@@@@ -7696,23 -7749,7 -7696,23 -7697,23 -7696,23 -7696,23 -7696,23 -7696,23 +7751,7 @@@@@@@@@ bool kvm_arch_pre_set_memory_attributes
                return kvm_unmap_gfn_range(kvm, range);
        }
        
- ------static bool hugepage_test_mixed(struct kvm_memory_slot *slot, gfn_t gfn,
- ------                                int level)
- ------{
- ------        return lpage_info_slot(gfn, slot, level)->disallow_lpage & KVM_LPAGE_MIXED_FLAG;
- - ----}
- - ----
- - ----static void hugepage_clear_mixed(struct kvm_memory_slot *slot, gfn_t gfn,
- - ----                                 int level)
- - ----{
- - ----        lpage_info_slot(gfn, slot, level)->disallow_lpage &= ~KVM_LPAGE_MIXED_FLAG;
- ------}
        
   -    static void hugepage_clear_mixed(struct kvm_memory_slot *slot, gfn_t gfn,
   -                                     int level)
   -    {
   -            lpage_info_slot(gfn, slot, level)->disallow_lpage &= ~KVM_LPAGE_MIXED_FLAG;
   -    }
   -    
- ------static void hugepage_set_mixed(struct kvm_memory_slot *slot, gfn_t gfn,
- ------                               int level)
- ------{
- ------        lpage_info_slot(gfn, slot, level)->disallow_lpage |= KVM_LPAGE_MIXED_FLAG;
- ------}
        
        static bool hugepage_has_attrs(struct kvm *kvm, struct kvm_memory_slot *slot,
                                       gfn_t gfn, int level, unsigned long attrs)
Simple merge
Simple merge
Simple merge
Simple merge
index 99d1d599ff8ce27f633fca7dc738b430a449acfb,d70e5b90087d86f26e0137e2dbc9b0e8f55adede,4cf5bf5b33d71487385f0701e91581be3d871076,99d1d599ff8ce27f633fca7dc738b430a449acfb,99d1d599ff8ce27f633fca7dc738b430a449acfb,99d1d599ff8ce27f633fca7dc738b430a449acfb,99d1d599ff8ce27f633fca7dc738b430a449acfb,d31272691b9b4160a71208487b914d8e5ccaafda..5c615e5845bf04788c1b41831a8126f76bf55c59
@@@@@@@@@ -34,9 -33,9 -34,9 -34,9 -34,9 -34,9 -34,9 -34,9 +34,9 @@@@@@@@@ static DEFINE_PER_CPU(raw_spinlock_t, w
        
        #define PI_LOCK_SCHED_OUT SINGLE_DEPTH_NESTING
        
- ----- struct pi_desc *vcpu_to_pi_desc(struct kvm_vcpu *vcpu)
 -      static inline struct pi_desc *vcpu_to_pi_desc(struct kvm_vcpu *vcpu)
+++++++ static struct pi_desc *vcpu_to_pi_desc(struct kvm_vcpu *vcpu)
        {
 -              return &(to_vmx(vcpu)->pi_desc);
 +              return &(to_vt(vcpu)->pi_desc);
        }
        
        static int pi_try_set_control(struct pi_desc *pi_desc, u64 *pold, u64 new)
Simple merge
Simple merge
index f6ce044b090a17cb17e0dfe4caf46f2691a75aa9,9896fd574bfc9da0900091b65dfc3a58d001863f,b45e9d6b526185c8345a88604134a98e06bee325,f6ce044b090a17cb17e0dfe4caf46f2691a75aa9,f6ce044b090a17cb17e0dfe4caf46f2691a75aa9,f6ce044b090a17cb17e0dfe4caf46f2691a75aa9,f6ce044b090a17cb17e0dfe4caf46f2691a75aa9,247d54de101ab17524367aece847a920697859e8..75c0a934556d30feea57856a973d263332156304
                        r = READ_ONCE(kvm->arch.default_tsc_khz);
                        goto out;
                }
-------         case KVM_MEMORY_ENCRYPT_OP: {
+++++++         case KVM_MEMORY_ENCRYPT_OP:
+ +++++                 r = -ENOTTY;
+ +++++                 if (!kvm_x86_ops.mem_enc_ioctl)
+ +++++                         goto out;
+ +++++ 
                        r = kvm_x86_call(mem_enc_ioctl)(kvm, argp);
                        break;
-------         }
                case KVM_MEMORY_ENCRYPT_REG_REGION: {
                        struct kvm_enc_region region;
        
Simple merge