dev: Correctly clear interrupts in VirtIO PCI
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>
Tue, 3 Feb 2015 19:25:47 +0000 (14:25 -0500)
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>
Tue, 3 Feb 2015 19:25:47 +0000 (14:25 -0500)
Correctly clear the PCI interrupt belonging to a VirtIO device when
the ISR register is read.

src/dev/virtio/pci.cc

index a051a8f51adbc04c5221a5adf615c3a953cb10bf..fb0735eba170f7c25b550ba856065eb9bdebe4ab 100644 (file)
@@ -123,8 +123,11 @@ PciVirtIO::read(PacketPtr pkt)
       case OFF_ISR_STATUS: {
           DPRINTF(VIOPci, "   ISR_STATUS\n");
           assert(size == sizeof(uint8_t));
-          uint8_t isr_status(interruptDeliveryPending ? 1 : 0);
-          interruptDeliveryPending = false;
+          const uint8_t isr_status(interruptDeliveryPending ? 1 : 0);
+          if (interruptDeliveryPending) {
+              interruptDeliveryPending = false;
+              intrClear();
+          }
           pkt->set<uint8_t>(isr_status);
       } break;