Skip to content

Commit 4d846f1

Browse files
committed
KVM: x86: Drop MAX_NR_RESERVED_IOAPIC_PINS, use KVM_MAX_IRQ_ROUTES directly
Directly use KVM_MAX_IRQ_ROUTES when checking the number of routes being defined by userspace when creating a split IRQCHIP. The restriction has nothing to do with the I/O APIC, e.g. most modern userspace usage is for routing MSIs. Breaking the unnecessary dependency on the I/O APIC will allow burying all of ioapic.h behind CONFIG_KVM_IOAPIC=y. No functional change intended. Link: https://patch.msgid.link/20251206004311.479939-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 9eabb2a commit 4d846f1

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

arch/x86/kvm/ioapic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ struct kvm;
1010
struct kvm_vcpu;
1111

1212
#define IOAPIC_NUM_PINS KVM_IOAPIC_NUM_PINS
13-
#define MAX_NR_RESERVED_IOAPIC_PINS KVM_MAX_IRQ_ROUTES
1413
#define IOAPIC_VERSION_ID 0x11 /* IOAPIC version */
1514
#define IOAPIC_EDGE_TRIG 0
1615
#define IOAPIC_LEVEL_TRIG 1

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6717,7 +6717,7 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
67176717
case KVM_CAP_SPLIT_IRQCHIP: {
67186718
mutex_lock(&kvm->lock);
67196719
r = -EINVAL;
6720-
if (cap->args[0] > MAX_NR_RESERVED_IOAPIC_PINS)
6720+
if (cap->args[0] > KVM_MAX_IRQ_ROUTES)
67216721
goto split_irqchip_unlock;
67226722
r = -EEXIST;
67236723
if (irqchip_in_kernel(kvm))

0 commit comments

Comments
 (0)