i8259: Do not clear level-triggered lines in IRR on init
PATCH 1/1 i8259: Do not clear level-triggered lines in IRR on init
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.
--- hw/i8259.c | 2 +- hw/i8259_common.c | 2 +- hw/kvm/i8259.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
hw/i8259.c +1 -1
@@ -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,
hw/i8259_common.c +1 -1
@@ -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 ;
hw/kvm/i8259.c +1 -1
@@ -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); }
Signature · 1 line
1.7.3.4
Quoted 5 lines · Jan Kiszka
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.
Looks good to me.
Quoted 50 lines
Signed-off-by Jan Kiszka <[email protected]>--- hw/i8259.c | 2 +- hw/i8259_common.c | 2 +- hw/kvm/i8259.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)hw/i8259.c +1
-1@@ -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,hw/i8259_common.c +1
-1@@ -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 ;hw/kvm/i8259.c +1
-1@@ -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); }Signature · 1 line
1.7.3.4
--
Gleb.
Quoted 44 lines · Jan Kiszka
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 <[email protected]>--- hw/i8259.c | 2 +- hw/i8259_common.c | 2 +- hw/kvm/i8259.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)hw/i8259.c +1
-1@@ -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,hw/i8259_common.c +1
-1@@ -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 ;hw/kvm/i8259.c +0
-0
hw/kvm/i8259.c static void kvm_pic_reset(DeviceState *dev) · line 91
Quoted 9 lines
hw/kvm/i8259.c +1
-1@@ -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); }
Ping.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Anthony Liguori
AppliedQuoted 6 lines · Jan Kiszka
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<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 47 lines
--- hw/i8259.c | 2 +- hw/i8259_common.c | 2 +- hw/kvm/i8259.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)hw/i8259.c +1
-1@@ -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,hw/i8259_common.c +1
-1@@ -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 ;hw/kvm/i8259.c +1
-1@@ -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); }