From cfa591aedf1a9449b1a5e6b9294ea858d4f0e8eb Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Thu, 29 Mar 2018 12:14:16 +0800 Subject: [PATCH] dm/VBS-U: implement read callback of isr cfg Registers in the isr configuration region are read-only. Signed-off-by: Jian Jun Chen Reviewed-by: Hao Li Reviewed-by: Zhao Yakui Acked-by: Eddie Dong --- devicemodel/hw/pci/virtio/virtio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devicemodel/hw/pci/virtio/virtio.c b/devicemodel/hw/pci/virtio/virtio.c index 0d160470a..9e93d5be7 100644 --- a/devicemodel/hw/pci/virtio/virtio.c +++ b/devicemodel/hw/pci/virtio/virtio.c @@ -1260,8 +1260,15 @@ bad_qindex: static uint32_t virtio_isr_cfg_read(struct pci_vdev *dev, uint64_t offset, int size) { - /* TODO: to be implemented */ - return 0; + struct virtio_base *base = dev->arg; + uint32_t value = 0; + + value = base->isr; + base->isr = 0; /* a read clears this flag */ + if (value) + pci_lintr_deassert(dev); + + return value; } static uint32_t