qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/pci: migration: Skip config space check for vendor specific capability during restore/load
@ 2024-01-30  9:56 Vinayak Kale
  2024-01-30 18:02 ` Vinayak Kale
  0 siblings, 1 reply; 9+ messages in thread
From: Vinayak Kale @ 2024-01-30  9:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: targupta, cjia, acurrid, zhiw, Vinayak Kale

In case of migration, during restore operation, qemu checks the config space of the pci device with the config space
in the migration stream captured during save operation. In case of config space data mismatch, restore operation is failed.

config space check is done in function get_pci_config_device(). By default VSC (vendor-specific-capability) in config space is checked.

Ideally qemu should not check VSC during restore/load. This patch skips the check by not setting pdev->cmask[] for VSC offsets in pci_add_capability().
If cmask[] is not set for an offset, then qemu skips config space check for that offset.

Signed-off-by: Vinayak Kale <vkale@nvidia.com>
---
 hw/pci/pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 76080af580..32429109df 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2485,8 +2485,11 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
     memset(pdev->used + offset, 0xFF, QEMU_ALIGN_UP(size, 4));
     /* Make capability read-only by default */
     memset(pdev->wmask + offset, 0, size);
-    /* Check capability by default */
-    memset(pdev->cmask + offset, 0xFF, size);
+
+    if (cap_id != PCI_CAP_ID_VNDR) {
+        /* Check non-vendor specific capability by default */
+        memset(pdev->cmask + offset, 0xFF, size);
+    }
     return offset;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-09  9:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30  9:56 [PATCH] hw/pci: migration: Skip config space check for vendor specific capability during restore/load Vinayak Kale
2024-01-30 18:02 ` Vinayak Kale
2024-01-30 18:58   ` Alex Williamson
2024-01-31  9:52     ` Vinayak Kale
2024-01-31 17:38       ` Alex Williamson
2024-02-01 17:38         ` Vinayak Kale
2024-02-01 18:10           ` Michael S. Tsirkin
2024-02-02  0:03             ` Alex Williamson
2024-02-09  9:17               ` Vinayak Kale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).