KVM: x86: reset edge sense circuit of i8259 on init

The spec says that during initialization "The edge sense circuit is
reset which means that following initialization an interrupt request
(IR) input must make a low-to-high transition to generate an interrupt",
but currently if edge triggered interrupt is in IRR it is delivered
after i8259 initialization.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Gleb Natapov 2012-01-24 15:06:05 +02:00 committed by Avi Kivity
parent d2a1b483a4
commit 242ec97c35

View File

@ -307,6 +307,7 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
if (val & 0x10) { if (val & 0x10) {
s->init4 = val & 1; s->init4 = val & 1;
s->last_irr = 0; s->last_irr = 0;
s->irr &= s->elcr;
s->imr = 0; s->imr = 0;
s->priority_add = 0; s->priority_add = 0;
s->special_mask = 0; s->special_mask = 0;