ioapic: clear irq_eoi when updating the ioapic redirect table entry
PATCH 1/1 ioapic: clear irq_eoi when updating the ioapic redirect table entry
irq_eoi is used to count the number of irq injected during eoi broadcast. It should be set to 0 when updating the ioapic's redirect table entry.
--- hw/intc/ioapic.c | 1 + 1 file changed, 1 insertion(+)
hw/intc/ioapic.c +1 -0
@@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,/* restore RO bits */ s->ioredtbl[index] &=IOAPIC_RW_BITS ; s->ioredtbl[index] |= ro_bits; + s->irq_eoi[index] =0 ;ioapic_fix_edge_remote_irr (&s->ioredtbl[index]);ioapic_service (s); }
Signature · 1 line
2.17.1
Quoted 15 lines · Li Qiang
irq_eoiis used to count the number of irq injected during eoi broadcast. It should be set to 0 when updating the ioapic's redirect table entry.Suggested-by Peter Xu <[email protected]>Signed-off-by Li Qiang <[email protected]>--- hw/intc/ioapic.c | 1 + 1 file changed, 1 insertion(+)hw/intc/ioapic.c +0
-0
hw/intc/ioapic.c ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val, · line 383
Quoted 4 lines
hw/intc/ioapic.c +1
-0@@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,/* restore RO bits */ s->ioredtbl[index] &=IOAPIC_RW_BITS ; s->ioredtbl[index] |= ro_bits; + s->irq_eoi[index] =0 ;
It'll be cleared for twice for each ioapic entry because it only supports 32bit write to these registers. Though it seems fine, e.g., when the guest only want to update the vector info we should still clear it:
Quoted 7 lines
hw/intc/ioapic.c +0
-0ioapic_fix_edge_remote_irr (&s->ioredtbl[index]);ioapic_service (s); }Signature · 1 line
2.17.1
Regards,
Signature · 1 line
Peter Xu
Paolo Bonzini
AppliedQuoted 16 lines · Li Qiang
irq_eoiis used to count the number of irq injected during eoi broadcast. It should be set to 0 when updating the ioapic's redirect table entry.Suggested-by Peter Xu <[email protected]>Signed-off-by Li Qiang <[email protected]>--- hw/intc/ioapic.c | 1 + 1 file changed, 1 insertion(+)hw/intc/ioapic.c +0
-0
hw/intc/ioapic.c ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val, · line 386
Quoted 7 lines
hw/intc/ioapic.c +1
-0@@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,/* restore RO bits */ s->ioredtbl[index] &=IOAPIC_RW_BITS ; s->ioredtbl[index] |= ro_bits; + s->irq_eoi[index] =0 ;ioapic_fix_edge_remote_irr (&s->ioredtbl[index]);ioapic_service (s); }
Queued, thanks.
Paolo