aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/ioapic.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r--virt/kvm/ioapic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 7c79c1d76d0c..0b9df8303dcf 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (C) 2001 MandrakeSoft S.A. 2 * Copyright (C) 2001 MandrakeSoft S.A.
3 * Copyright 2010 Red Hat, Inc. and/or its affiliates.
3 * 4 *
4 * MandrakeSoft S.A. 5 * MandrakeSoft S.A.
5 * 43, rue d'Aboukir 6 * 43, rue d'Aboukir
@@ -151,7 +152,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
151 update_handled_vectors(ioapic); 152 update_handled_vectors(ioapic);
152 mask_after = e->fields.mask; 153 mask_after = e->fields.mask;
153 if (mask_before != mask_after) 154 if (mask_before != mask_after)
154 kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); 155 kvm_fire_mask_notifiers(ioapic->kvm, KVM_IRQCHIP_IOAPIC, index, mask_after);
155 if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG 156 if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG
156 && ioapic->irr & (1 << index)) 157 && ioapic->irr & (1 << index))
157 ioapic_service(ioapic, index); 158 ioapic_service(ioapic, index);
@@ -192,12 +193,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
192 193
193int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) 194int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
194{ 195{
195 u32 old_irr = ioapic->irr; 196 u32 old_irr;
196 u32 mask = 1 << irq; 197 u32 mask = 1 << irq;
197 union kvm_ioapic_redirect_entry entry; 198 union kvm_ioapic_redirect_entry entry;
198 int ret = 1; 199 int ret = 1;
199 200
200 spin_lock(&ioapic->lock); 201 spin_lock(&ioapic->lock);
202 old_irr = ioapic->irr;
201 if (irq >= 0 && irq < IOAPIC_NUM_PINS) { 203 if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
202 entry = ioapic->redirtbl[irq]; 204 entry = ioapic->redirtbl[irq];
203 level ^= entry.fields.polarity; 205 level ^= entry.fields.polarity;