]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'kvm-x86-vmx-6.19' of https://github.com/kvm-x86/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Nov 2025 08:44:52 +0000 (09:44 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Nov 2025 08:44:52 +0000 (09:44 +0100)
KVM VMX changes for 6.19:

 - Use the root role from kvm_mmu_page to construct EPTPs instead of the
   current vCPU state, partly as worthwhile cleanup, but mostly to pave the
   way for tracking per-root TLB flushes so that KVM can elide EPT flushes on
   pCPU migration if KVM has flushed the root at least once.

 - Add a few missing nested consistency checks.

 - Rip out support for doing "early" consistency checks via hardware as the
   functionality hasn't been used in years and is no longer useful in general,
   and replace it with an off-by-default module param to detected missed
   consistency checks (i.e. WARN if hardware finds a check that KVM does not).

 - Fix a currently-benign bug where KVM would drop the guest's SPEC_CTRL[63:32]
   on VM-Enter.

 - Misc cleanups.

1  2 
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/tdx.c
arch/x86/kvm/vmx/vmenter.S
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/x86_ops.h

Simple merge
index f2d8fc3fecaa7811a07434f5f674a7d359268b9e,326db9b9c567066fe782e17ed2673363c8ba3fdf..2d7a4d52ccfb4210fcb56aa742225b8e506fbb13
@@@ -2664,48 -2747,9 +2664,49 @@@ err_out
        return -EIO;
  }
  
 +typedef void *tdx_vm_state_guard_t;
 +
 +static tdx_vm_state_guard_t tdx_acquire_vm_state_locks(struct kvm *kvm)
 +{
 +      int r;
 +
 +      mutex_lock(&kvm->lock);
 +
 +      if (kvm->created_vcpus != atomic_read(&kvm->online_vcpus)) {
 +              r = -EBUSY;
 +              goto out_err;
 +      }
 +
 +      r = kvm_lock_all_vcpus(kvm);
 +      if (r)
 +              goto out_err;
 +
 +      /*
 +       * Note the unintuitive ordering!  vcpu->mutex must be taken outside
 +       * kvm->slots_lock!
 +       */
 +      mutex_lock(&kvm->slots_lock);
 +      return kvm;
 +
 +out_err:
 +      mutex_unlock(&kvm->lock);
 +      return ERR_PTR(r);
 +}
 +
 +static void tdx_release_vm_state_locks(struct kvm *kvm)
 +{
 +      mutex_unlock(&kvm->slots_lock);
 +      kvm_unlock_all_vcpus(kvm);
 +      mutex_unlock(&kvm->lock);
 +}
 +
 +DEFINE_CLASS(tdx_vm_state_guard, tdx_vm_state_guard_t,
 +           if (!IS_ERR(_T)) tdx_release_vm_state_locks(_T),
 +           tdx_acquire_vm_state_locks(kvm), struct kvm *kvm);
 +
  static int tdx_td_init(struct kvm *kvm, struct kvm_tdx_cmd *cmd)
  {
+       struct kvm_tdx_init_vm __user *user_data = u64_to_user_ptr(cmd->data);
        struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
        struct kvm_tdx_init_vm *init_vm;
        struct td_params *td_params = NULL;
Simple merge
Simple merge
Simple merge