summary refs log tree commit diff stats
path: root/hw/pci/pci.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2025-03-14 15:14:50 +0900
committerMichael S. Tsirkin <mst@redhat.com>2025-05-14 05:39:14 -0400
commit3a031e395dc65239d031890d038bc354af61dc35 (patch)
tree3a3abd1b8d850cd9ecdeede1c20bdcf97fc3f0e7 /hw/pci/pci.c
parentabde58f8644491503c058c2ff0775613f251c8e6 (diff)
downloadfocaccia-qemu-3a031e395dc65239d031890d038bc354af61dc35.tar.gz
focaccia-qemu-3a031e395dc65239d031890d038bc354af61dc35.zip
hw/pci: Do not add ROM BAR for SR-IOV VF
A SR-IOV VF cannot have a ROM BAR.

Co-developed-by: Yui Washizu <yui.washidu@gmail.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20250314-sriov-v9-1-57dae8ae3ab5@daynix.com>
Tested-by: Yui Washizu <yui.washidu@gmail.com>
Tested-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r--hw/pci/pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index fe38c4c028..6d9d3ce90f 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2522,6 +2522,14 @@ static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom,
         return;
     }
 
+    if (pci_is_vf(pdev)) {
+        if (pdev->rom_bar > 0) {
+            error_setg(errp, "ROM BAR cannot be enabled for SR-IOV VF");
+        }
+
+        return;
+    }
+
     if (load_file || pdev->romsize == UINT32_MAX) {
         path = qemu_find_file(QEMU_FILE_TYPE_BIOS, pdev->romfile);
         if (path == NULL) {