KVM: make irq ack notifications aware of routing table
IRQ ack notifications assume an identity mapping between pin->gsi, which might not be the case with, for example, HPET. Translate before acking. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Gleb Natapov <gleb@redhat.com>
This commit is contained in:

committed by
Avi Kivity

parent
934d534f8a
commit
44882eed2e
@@ -49,7 +49,8 @@ static void pic_unlock(struct kvm_pic *s)
|
||||
spin_unlock(&s->lock);
|
||||
|
||||
while (acks) {
|
||||
kvm_notify_acked_irq(kvm, __ffs(acks));
|
||||
kvm_notify_acked_irq(kvm, SELECT_PIC(__ffs(acks)),
|
||||
__ffs(acks));
|
||||
acks &= acks - 1;
|
||||
}
|
||||
|
||||
@@ -232,7 +233,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
|
||||
}
|
||||
pic_update_irq(s);
|
||||
pic_unlock(s);
|
||||
kvm_notify_acked_irq(kvm, irq);
|
||||
kvm_notify_acked_irq(kvm, SELECT_PIC(irq), irq);
|
||||
|
||||
return intno;
|
||||
}
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#include "lapic.h"
|
||||
|
||||
#define PIC_NUM_PINS 16
|
||||
#define SELECT_PIC(irq) \
|
||||
((irq) < 8 ? KVM_IRQCHIP_PIC_MASTER : KVM_IRQCHIP_PIC_SLAVE)
|
||||
|
||||
struct kvm;
|
||||
struct kvm_vcpu;
|
||||
|
Reference in New Issue
Block a user