KVM: x86: don't notify userspace IOAPIC on edge-triggered interrupt EOI
Quoted 15 lines · Vitaly Kuznetsov
Review void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, · line 423
Quoted 9 lines · linmiaohe
(quoted diff) +1
-1@@ -417,7 +417,7 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, kvm_set_msi_irq(vcpu->kvm, entry, &irq); - if (irq.level && + if (irq.trig_mode && kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT, irq.dest_id, irq.dest_mode)) __set_bit(irq.vector, ioapic_handled_vectors);Assuming Radim's comment (
13db77347db1) is correct, the change in3159d36ad799looks wrong and your patch restores the status quo. Actually,kvm_set_msi_irq()always setsirq->level= 1 so checking it is pointless.
Quoted 1 line
Reviewed-by Vitaly Kuznetsov <[email protected]>
Thanks for review.
Quoted 3 lines
(but it is actually possible that there's a buggy userspace out there which expects EOI notifications; we won't find out unless we try to fix the bug).
Yeh, there may be a buggy userspace hidden from this unexpected EOI notifications. It may not be worth enough to fix it as we may spend many time to catch the bug.
Perhaps we should only remove the pointless checking of irq->level for cleanup. :)
Quoted 21 lines · linmiaohe
Quoted 15 lines · Vitaly Kuznetsov
Review void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, · line 423
Quoted 9 lines · linmiaohe
(quoted diff) +1
-1@@ -417,7 +417,7 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, kvm_set_msi_irq(vcpu->kvm, entry, &irq); - if (irq.level && + if (irq.trig_mode && kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT, irq.dest_id, irq.dest_mode)) __set_bit(irq.vector, ioapic_handled_vectors);Assuming Radim's comment (
13db77347db1) is correct, the change in3159d36ad799looks wrong and your patch restores the status quo. Actually,kvm_set_msi_irq()always setsirq->level= 1 so checking it is pointless.Quoted 1 line
Reviewed-by Vitaly Kuznetsov <[email protected]>Thanks for review.
Quoted 1 line
Quoted 6 lines
Quoted 2 lines
(but it is actually possible that there's a buggy userspace out there which expects EOI notifications; we won't find out unless we try to fix the bug).
Yeh, there may be a buggy userspace hidden from this unexpected EOI notifications. It may not be worth enough to fix it as we may spend many time to catch the bug.
Perhaps we should only remove the pointless checking ofirq->levelfor cleanup. :)
I'm feeling brave so in case nobody expresses any particular concerns let's just fix it :-)
Signature · 1 line
Vitaly