Skip to content

Commit ca909f9

Browse files
committed
KVM: x86: Drop ASSERT() on I/O APIC EOIs being only for LEVEL_to WARN_ON_ONCE
Remove kvm_ioapic_update_eoi_one()'s ASSERT() that the vector's entry is configured to be level-triggered, as KVM intercepts and forward EOIs to the I/O APIC even for edge-triggered IRQs (see kvm_ioapic_scan_entry()), and nothing guarantees the local APIC's TMR register is synchronized with the I/O APIC redirection table, i.e. the @trigger_mode check just out of sight doesn't provide any meaningful protection. Given that roughly half of the historic ASSERT()s are/were guest- and/or user-triggerable, it's safe to assume no one has run meaningful workloads with DEBUG=1, i.e. that the ASSERT() has been dead code since it was added 18+ years ago. Opportunistically drop the unnecessary forward declaration of kvm_ioapic_update_eoi_one(). For all intents and purposes, no functional change intended. Link: https://patch.msgid.link/20251206004311.479939-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 3718799 commit ca909f9

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

arch/x86/kvm/ioapic.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
static int ioapic_service(struct kvm_ioapic *vioapic, int irq,
3838
bool line_status);
3939

40-
static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu,
41-
struct kvm_ioapic *ioapic,
42-
int trigger_mode,
43-
int pin);
44-
4540
static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic)
4641
{
4742
unsigned long result = 0;
@@ -564,7 +559,6 @@ static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu,
564559
kvm_lapic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI)
565560
return;
566561

567-
ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG);
568562
ent->fields.remote_irr = 0;
569563
if (!ent->fields.mask && (ioapic->irr & (1 << pin))) {
570564
++ioapic->irq_eoi[pin];

0 commit comments

Comments
 (0)