]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: x86: Drop semi-arbitrary restrictions on IPI type in fastpath
authorSean Christopherson <seanjc@google.com>
Tue, 5 Aug 2025 19:05:12 +0000 (12:05 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 19 Aug 2025 18:59:33 +0000 (11:59 -0700)
Drop the restrictions on fastpath IPIs only working for fixed IRQs with a
physical destination now that the fastpath is explicitly limited to "fast"
delivery.  Limiting delivery to a single physical APIC ID guarantees only
one vCPU will receive the event, but that isn't necessary "fast", e.g. if
the targeted vCPU is the last of 4096 vCPUs.  And logical destination mode
or shorthand (to self) can also be fast, e.g. if only a few vCPUs are
being targeted.  Lastly, there's nothing inherently slow about delivering
an NMI, INIT, SIPI, SMI, etc., i.e. there's no reason to artificially
limit fastpath delivery to fixed vector IRQs.

Link: https://lore.kernel.org/r/20250805190526.1453366-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c

index 1b64c71458a27d5c906e5e51be3b063837a5ff3e..6d93547526e691bb785814b77789fca3456188ed 100644 (file)
@@ -2146,13 +2146,7 @@ static int handle_fastpath_set_x2apic_icr_irqoff(struct kvm_vcpu *vcpu, u64 data
        if (!lapic_in_kernel(vcpu) || !apic_x2apic_mode(vcpu->arch.apic))
                return 1;
 
-       if (((data & APIC_SHORT_MASK) == APIC_DEST_NOSHORT) &&
-           ((data & APIC_DEST_MASK) == APIC_DEST_PHYSICAL) &&
-           ((data & APIC_MODE_MASK) == APIC_DM_FIXED) &&
-           ((u32)(data >> 32) != X2APIC_BROADCAST))
-               return kvm_x2apic_icr_write_fast(vcpu->arch.apic, data);
-
-       return 1;
+       return kvm_x2apic_icr_write_fast(vcpu->arch.apic, data);
 }
 
 static int handle_fastpath_set_tscdeadline(struct kvm_vcpu *vcpu, u64 data)