diff options
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/ioapic.c | 10 | ||||
-rw-r--r-- | virt/kvm/irq_comm.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 1eddae94bab3..1150c6d5c7b8 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -95,8 +95,6 @@ static int ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx) | |||
95 | if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG) | 95 | if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG) |
96 | pent->fields.remote_irr = 1; | 96 | pent->fields.remote_irr = 1; |
97 | } | 97 | } |
98 | if (!pent->fields.trig_mode) | ||
99 | ioapic->irr &= ~(1 << idx); | ||
100 | 98 | ||
101 | return injected; | 99 | return injected; |
102 | } | 100 | } |
@@ -136,7 +134,8 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | |||
136 | mask_after = ioapic->redirtbl[index].fields.mask; | 134 | mask_after = ioapic->redirtbl[index].fields.mask; |
137 | if (mask_before != mask_after) | 135 | if (mask_before != mask_after) |
138 | kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); | 136 | kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); |
139 | if (ioapic->irr & (1 << index)) | 137 | if (ioapic->redirtbl[index].fields.trig_mode == IOAPIC_LEVEL_TRIG |
138 | && ioapic->irr & (1 << index)) | ||
140 | ioapic_service(ioapic, index); | 139 | ioapic_service(ioapic, index); |
141 | break; | 140 | break; |
142 | } | 141 | } |
@@ -184,9 +183,10 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) | |||
184 | if (!level) | 183 | if (!level) |
185 | ioapic->irr &= ~mask; | 184 | ioapic->irr &= ~mask; |
186 | else { | 185 | else { |
186 | int edge = (entry.fields.trig_mode == IOAPIC_EDGE_TRIG); | ||
187 | ioapic->irr |= mask; | 187 | ioapic->irr |= mask; |
188 | if ((!entry.fields.trig_mode && old_irr != ioapic->irr) | 188 | if ((edge && old_irr != ioapic->irr) || |
189 | || !entry.fields.remote_irr) | 189 | (!edge && !entry.fields.remote_irr)) |
190 | ret = ioapic_service(ioapic, irq); | 190 | ret = ioapic_service(ioapic, irq); |
191 | } | 191 | } |
192 | } | 192 | } |
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index a8bd466d00cc..ddc17f0e2f35 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c | |||
@@ -160,7 +160,8 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin) | |||
160 | unsigned gsi = pin; | 160 | unsigned gsi = pin; |
161 | 161 | ||
162 | list_for_each_entry(e, &kvm->irq_routing, link) | 162 | list_for_each_entry(e, &kvm->irq_routing, link) |
163 | if (e->irqchip.irqchip == irqchip && | 163 | if (e->type == KVM_IRQ_ROUTING_IRQCHIP && |
164 | e->irqchip.irqchip == irqchip && | ||
164 | e->irqchip.pin == pin) { | 165 | e->irqchip.pin == pin) { |
165 | gsi = e->gsi; | 166 | gsi = e->gsi; |
166 | break; | 167 | break; |
@@ -259,6 +260,7 @@ static int setup_routing_entry(struct kvm_kernel_irq_routing_entry *e, | |||
259 | int delta; | 260 | int delta; |
260 | 261 | ||
261 | e->gsi = ue->gsi; | 262 | e->gsi = ue->gsi; |
263 | e->type = ue->type; | ||
262 | switch (ue->type) { | 264 | switch (ue->type) { |
263 | case KVM_IRQ_ROUTING_IRQCHIP: | 265 | case KVM_IRQ_ROUTING_IRQCHIP: |
264 | delta = 0; | 266 | delta = 0; |