提交 9195c4da 编写于 作者: G Gleb Natapov 提交者: Avi Kivity

KVM: x86: Call mask notifiers from pic

If pit delivers interrupt while pic is masking it OS will never do EOI
and ack notifier will not be called so when pit will be unmasked no pit
interrupts will be delivered any more. Calling mask notifiers solves this
issue.
Signed-off-by: NGleb Natapov <gleb@redhat.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 68be0803
...@@ -363,10 +363,20 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val) ...@@ -363,10 +363,20 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
} }
} else } else
switch (s->init_state) { switch (s->init_state) {
case 0: /* normal mode */ case 0: { /* normal mode */
u8 imr_diff = s->imr ^ val,
off = (s == &s->pics_state->pics[0]) ? 0 : 8;
s->imr = val; s->imr = val;
for (irq = 0; irq < PIC_NUM_PINS/2; irq++)
if (imr_diff & (1 << irq))
kvm_fire_mask_notifiers(
s->pics_state->kvm,
SELECT_PIC(irq + off),
irq + off,
!!(s->imr & (1 << irq)));
pic_update_irq(s->pics_state); pic_update_irq(s->pics_state);
break; break;
}
case 1: case 1:
s->irq_base = val & 0xf8; s->irq_base = val & 0xf8;
s->init_state = 2; s->init_state = 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册