diff options
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r-- | virt/kvm/ioapic.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 8a9c6cc382f8..92496ff3d82d 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -103,6 +103,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | |||
103 | { | 103 | { |
104 | unsigned index; | 104 | unsigned index; |
105 | bool mask_before, mask_after; | 105 | bool mask_before, mask_after; |
106 | union kvm_ioapic_redirect_entry *e; | ||
106 | 107 | ||
107 | switch (ioapic->ioregsel) { | 108 | switch (ioapic->ioregsel) { |
108 | case IOAPIC_REG_VERSION: | 109 | case IOAPIC_REG_VERSION: |
@@ -122,19 +123,20 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) | |||
122 | ioapic_debug("change redir index %x val %x\n", index, val); | 123 | ioapic_debug("change redir index %x val %x\n", index, val); |
123 | if (index >= IOAPIC_NUM_PINS) | 124 | if (index >= IOAPIC_NUM_PINS) |
124 | return; | 125 | return; |
125 | mask_before = ioapic->redirtbl[index].fields.mask; | 126 | e = &ioapic->redirtbl[index]; |
127 | mask_before = e->fields.mask; | ||
126 | if (ioapic->ioregsel & 1) { | 128 | if (ioapic->ioregsel & 1) { |
127 | ioapic->redirtbl[index].bits &= 0xffffffff; | 129 | e->bits &= 0xffffffff; |
128 | ioapic->redirtbl[index].bits |= (u64) val << 32; | 130 | e->bits |= (u64) val << 32; |
129 | } else { | 131 | } else { |
130 | ioapic->redirtbl[index].bits &= ~0xffffffffULL; | 132 | e->bits &= ~0xffffffffULL; |
131 | ioapic->redirtbl[index].bits |= (u32) val; | 133 | e->bits |= (u32) val; |
132 | ioapic->redirtbl[index].fields.remote_irr = 0; | 134 | e->fields.remote_irr = 0; |
133 | } | 135 | } |
134 | mask_after = ioapic->redirtbl[index].fields.mask; | 136 | mask_after = e->fields.mask; |
135 | if (mask_before != mask_after) | 137 | if (mask_before != mask_after) |
136 | kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); | 138 | kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); |
137 | if (ioapic->redirtbl[index].fields.trig_mode == IOAPIC_LEVEL_TRIG | 139 | if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG |
138 | && ioapic->irr & (1 << index)) | 140 | && ioapic->irr & (1 << index)) |
139 | ioapic_service(ioapic, index); | 141 | ioapic_service(ioapic, index); |
140 | break; | 142 | break; |