From 53971e1974335cac2150e64b27a199de32c768d8 Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Mon, 19 Nov 2018 15:50:23 -0800 Subject: [PATCH] hv: fix 2 bugs in msix.c - in vmsix_cfgwrite(), it should write the new value 'val'. - in vmsix_table_mmio_access_handler(), mmio_gpa is a typo for intercepted_gpa. Tracked-On: #1568 Signed-off-by: Zide Chen Reviewed-by: Li, Fei1 --- hypervisor/dm/vpci/msix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/dm/vpci/msix.c b/hypervisor/dm/vpci/msix.c index ac322fed7..4fbb25956 100644 --- a/hypervisor/dm/vpci/msix.c +++ b/hypervisor/dm/vpci/msix.c @@ -177,7 +177,7 @@ static int vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes } if (((msgctrl ^ val) & PCIM_MSIXCTRL_FUNCTION_MASK) != 0U) { - pci_pdev_write_cfg(vdev->pdev.bdf, offset, 2U, msgctrl); + pci_pdev_write_cfg(vdev->pdev.bdf, offset, 2U, val); } } @@ -246,7 +246,7 @@ static int vmsix_table_mmio_access_handler(struct io_request *io_req, void *hand uint64_t hva; vdev = (struct pci_vdev *)handler_private_data; - offset = mmio->address - vdev->msix.mmio_gpa; + offset = mmio->address - vdev->msix.intercepted_gpa; if (msixtable_access(vdev, (uint32_t)offset)) { vmsix_table_rw(vdev, mmio, (uint32_t)offset);