]> git.proxmox.com Git - qemu.git/commitdiff
i8259: Do not clear level-triggered lines in IRR on init
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 24 Jan 2012 15:29:29 +0000 (16:29 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 17 Feb 2012 15:58:22 +0000 (09:58 -0600)
When an input line is handled as level-triggered, it will immediately
raise an IRQ on the output of a PIC again that goes through an init
reset. So only clear the edge-triggered inputs from IRR in that
scenario.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/i8259.c
hw/i8259_common.c
hw/kvm/i8259.c

index 1a4b1ab0dd20b484693c4389fa51c7f5f7091fc8..53daf78652e3addced75a1eddf44bdc7ddeb6981 100644 (file)
@@ -231,8 +231,8 @@ static void pic_reset(DeviceState *dev)
 {
     PICCommonState *s = DO_UPCAST(PICCommonState, dev.qdev, dev);
 
-    pic_init_reset(s);
     s->elcr = 0;
+    pic_init_reset(s);
 }
 
 static void pic_ioport_write(void *opaque, target_phys_addr_t addr64,
index 775fda453c3573d83a151346710b13ca1a39617a..ab3d98b2a179140cb42bc286fd9a3c67ab77b622 100644 (file)
@@ -28,7 +28,7 @@
 void pic_reset_common(PICCommonState *s)
 {
     s->last_irr = 0;
-    s->irr = 0;
+    s->irr &= s->elcr;
     s->imr = 0;
     s->isr = 0;
     s->priority_add = 0;
index eb98889329b8f9c9d5b6a90f49e0a5a7b03ab656..94d1b9aa95cc7accb683c4238f99f0733bfc1633 100644 (file)
@@ -84,8 +84,8 @@ static void kvm_pic_reset(DeviceState *dev)
 {
     PICCommonState *s = DO_UPCAST(PICCommonState, dev.qdev, dev);
 
-    pic_reset_common(s);
     s->elcr = 0;
+    pic_reset_common(s);
 
     kvm_pic_put(s);
 }