Skip to content

Commit de8e8eb

Browse files
committed
Merge tag 'kvm-x86-tdx-6.19' of https://github.com/kvm-x86/linux into HEAD
KVM TDX changes for 6.19: - Overhaul the TDX code to address systemic races where KVM (acting on behalf of userspace) could inadvertantly trigger lock contention in the TDX-Module, which KVM was either working around in weird, ugly ways, or was simply oblivious to (as proven by Yan tripping several KVM_BUG_ON()s with clever selftests). - Fix a bug where KVM could corrupt a vCPU's cpu_list when freeing a vCPU if creating said vCPU failed partway through. - Fix a few sparse warnings (bad annotation, 0 != NULL). - Use struct_size() to simplify copying capabilities to userspace.
2 parents adc99a6 + 398180f commit de8e8eb

File tree

24 files changed

+495
-448
lines changed

24 files changed

+495
-448
lines changed

arch/arm64/kvm/arm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,12 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
18351835
return r;
18361836
}
18371837

1838+
long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,
1839+
unsigned long arg)
1840+
{
1841+
return -ENOIOCTLCMD;
1842+
}
1843+
18381844
void kvm_arch_sync_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot)
18391845
{
18401846

arch/loongarch/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ config KVM
2525
select HAVE_KVM_IRQCHIP
2626
select HAVE_KVM_MSI
2727
select HAVE_KVM_READONLY_MEM
28-
select HAVE_KVM_VCPU_ASYNC_IOCTL
2928
select KVM_COMMON
3029
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
3130
select KVM_GENERIC_HARDWARE_ENABLING

arch/loongarch/kvm/vcpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,8 +1473,8 @@ int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq)
14731473
return 0;
14741474
}
14751475

1476-
long kvm_arch_vcpu_async_ioctl(struct file *filp,
1477-
unsigned int ioctl, unsigned long arg)
1476+
long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,
1477+
unsigned long arg)
14781478
{
14791479
void __user *argp = (void __user *)arg;
14801480
struct kvm_vcpu *vcpu = filp->private_data;

arch/mips/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config KVM
2222
select EXPORT_UASM
2323
select KVM_COMMON
2424
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
25-
select HAVE_KVM_VCPU_ASYNC_IOCTL
2625
select KVM_MMIO
2726
select KVM_GENERIC_MMU_NOTIFIER
2827
select KVM_GENERIC_HARDWARE_ENABLING

arch/mips/kvm/mips.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,8 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
895895
return r;
896896
}
897897

898-
long kvm_arch_vcpu_async_ioctl(struct file *filp, unsigned int ioctl,
899-
unsigned long arg)
898+
long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,
899+
unsigned long arg)
900900
{
901901
struct kvm_vcpu *vcpu = filp->private_data;
902902
void __user *argp = (void __user *)arg;

arch/powerpc/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if VIRTUALIZATION
2020
config KVM
2121
bool
2222
select KVM_COMMON
23-
select HAVE_KVM_VCPU_ASYNC_IOCTL
2423
select KVM_VFIO
2524
select HAVE_KVM_IRQ_BYPASS
2625

arch/powerpc/kvm/powerpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
20282028
return -EINVAL;
20292029
}
20302030

2031-
long kvm_arch_vcpu_async_ioctl(struct file *filp,
2032-
unsigned int ioctl, unsigned long arg)
2031+
long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,
2032+
unsigned long arg)
20332033
{
20342034
struct kvm_vcpu *vcpu = filp->private_data;
20352035
void __user *argp = (void __user *)arg;

arch/riscv/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config KVM
2323
select HAVE_KVM_IRQCHIP
2424
select HAVE_KVM_IRQ_ROUTING
2525
select HAVE_KVM_MSI
26-
select HAVE_KVM_VCPU_ASYNC_IOCTL
2726
select HAVE_KVM_READONLY_MEM
2827
select HAVE_KVM_DIRTY_RING_ACQ_REL
2928
select KVM_COMMON

arch/riscv/kvm/vcpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
238238
return VM_FAULT_SIGBUS;
239239
}
240240

241-
long kvm_arch_vcpu_async_ioctl(struct file *filp,
242-
unsigned int ioctl, unsigned long arg)
241+
long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,
242+
unsigned long arg)
243243
{
244244
struct kvm_vcpu *vcpu = filp->private_data;
245245
void __user *argp = (void __user *)arg;

arch/s390/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ config KVM
2020
def_tristate y
2121
prompt "Kernel-based Virtual Machine (KVM) support"
2222
select HAVE_KVM_CPU_RELAX_INTERCEPT
23-
select HAVE_KVM_VCPU_ASYNC_IOCTL
2423
select KVM_ASYNC_PF
2524
select KVM_ASYNC_PF_SYNC
2625
select KVM_COMMON

0 commit comments

Comments
 (0)