From a6954486e96debda9eac6b30c29d84fe9edf7055 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Mon, 16 Sep 2019 19:55:51 +0800 Subject: [PATCH] hv: vpci: a minor fix about handling vmsix table mmio access for post-launched VM In "commit 90480d" we use a pointer new_owner to point to the actual vPCI device for post-launched VM when this device is assigned to this post-launched VM from SOS. However, now DM will use SOS's vmsix_table_mmio_access_handler to trap vMSI-X table mmio access for post-launched VM. So we should use the post-launched VM's vPCI device in this case. Tracked-On: #3475 Signed-off-by: Li, Fei1 --- hypervisor/dm/vpci/vmsix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hypervisor/dm/vpci/vmsix.c b/hypervisor/dm/vpci/vmsix.c index c39cc16e3..6ba395b40 100644 --- a/hypervisor/dm/vpci/vmsix.c +++ b/hypervisor/dm/vpci/vmsix.c @@ -289,6 +289,10 @@ int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void *handler void *hva; vdev = (struct pci_vdev *)handler_private_data; + /* This device is assigned to post-launched VM from SOS */ + if (vdev->new_owner != NULL) { + vdev = vdev->new_owner; + } offset = mmio->address - vdev->msix.mmio_gpa; if (msixtable_access(vdev, (uint32_t)offset)) {