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 <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Zide Chen 2018-11-19 15:50:23 -08:00 committed by lijinxia
parent 119eccfea1
commit 53971e1974

View File

@ -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) { 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; uint64_t hva;
vdev = (struct pci_vdev *)handler_private_data; 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)) { if (msixtable_access(vdev, (uint32_t)offset)) {
vmsix_table_rw(vdev, mmio, (uint32_t)offset); vmsix_table_rw(vdev, mmio, (uint32_t)offset);