diff options
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r-- | virt/kvm/ioapic.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 23b81cf242af..e85a2bcd2db1 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -101,6 +101,7 @@ static void ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx) | |||
101 | static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | 101 | static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) |
102 | { | 102 | { |
103 | unsigned index; | 103 | unsigned index; |
104 | bool mask_before, mask_after; | ||
104 | 105 | ||
105 | switch (ioapic->ioregsel) { | 106 | switch (ioapic->ioregsel) { |
106 | case IOAPIC_REG_VERSION: | 107 | case IOAPIC_REG_VERSION: |
@@ -120,6 +121,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | |||
120 | ioapic_debug("change redir index %x val %x\n", index, val); | 121 | ioapic_debug("change redir index %x val %x\n", index, val); |
121 | if (index >= IOAPIC_NUM_PINS) | 122 | if (index >= IOAPIC_NUM_PINS) |
122 | return; | 123 | return; |
124 | mask_before = ioapic->redirtbl[index].fields.mask; | ||
123 | if (ioapic->ioregsel & 1) { | 125 | if (ioapic->ioregsel & 1) { |
124 | ioapic->redirtbl[index].bits &= 0xffffffff; | 126 | ioapic->redirtbl[index].bits &= 0xffffffff; |
125 | ioapic->redirtbl[index].bits |= (u64) val << 32; | 127 | ioapic->redirtbl[index].bits |= (u64) val << 32; |
@@ -128,6 +130,9 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | |||
128 | ioapic->redirtbl[index].bits |= (u32) val; | 130 | ioapic->redirtbl[index].bits |= (u32) val; |
129 | ioapic->redirtbl[index].fields.remote_irr = 0; | 131 | ioapic->redirtbl[index].fields.remote_irr = 0; |
130 | } | 132 | } |
133 | mask_after = ioapic->redirtbl[index].fields.mask; | ||
134 | if (mask_before != mask_after) | ||
135 | kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); | ||
131 | if (ioapic->irr & (1 << index)) | 136 | if (ioapic->irr & (1 << index)) |
132 | ioapic_service(ioapic, index); | 137 | ioapic_service(ioapic, index); |
133 | break; | 138 | break; |
@@ -426,3 +431,4 @@ int kvm_ioapic_init(struct kvm *kvm) | |||
426 | kvm_io_bus_register_dev(&kvm->mmio_bus, &ioapic->dev); | 431 | kvm_io_bus_register_dev(&kvm->mmio_bus, &ioapic->dev); |
427 | return 0; | 432 | return 0; |
428 | } | 433 | } |
434 | |||