Skip to contentSkip to conversation

vfio/pci: Fix regression due to unexisting property use-legacy-x86-rom

PATCH In review Zhenzhong Duan 2 participants 4 messages Jul 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/pci: Fix regression due to unexisting property use-legacy-x86-rom

TYPE_VFIO_PCI doesn't have property use-legacy-x86-rom, but TYPE_VFIO_PCI_NOHOTPLUG has. The compatibility config leads to SIGABRT on new QEMU.

The default value of element use_legacy_x86_rom for TYPE_VFIO_PCI is already false, so no need extra processing.

Fixes d5fcf0d960d8 ("hw/i386: Add the ramfb romfile compatibility")
---
 hw/vfio/types.h   | 2 ++
 hw/core/machine.c | 2 +-
 hw/i386/microvm.c | 2 +-
 hw/i386/pc_piix.c | 2 +-
 hw/i386/pc_q35.c  | 2 +-
 hw/vfio/pci.c     | 2 --
 6 files changed, 6 insertions(+), 6 deletions(-)
hw/vfio/types.h +2 -0
index fa20c29b9f..c19334ff25 100644
@@ -18,4 +18,6 @@
 #define TYPE_VFIO_PCI "vfio-pci"
 /* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
 
+#define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
 #endif /* HW_VFIO_VFIO_TYPES_H */
hw/core/machine.c +1 -1
index d6b2240fc2..bd47527479 100644
@@ -41,7 +41,7 @@ GlobalProperty hw_compat_10_0[] = {
     { "scsi-hd", "dpofua", "off" },
     { "vfio-pci", "x-migration-load-config-after-iter", "off" },
     { "ramfb", "use-legacy-x86-rom", "true"},
-    { "vfio-pci", "use-legacy-x86-rom", "true" },
+    { "vfio-pci-nohotplug", "use-legacy-x86-rom", "true" },
 };
 const size_t hw_compat_10_0_len = G_N_ELEMENTS(hw_compat_10_0);
 
hw/i386/microvm.c +1 -1
index d90b69a162..94d22a232a 100644
@@ -635,7 +635,7 @@ GlobalProperty microvm_properties[] = {
      */
     { "pcie-root-port", "io-reserve", "0" },
     { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
 };
 
 static void microvm_class_init(ObjectClass *oc, const void *data)
hw/i386/pc_piix.c +1 -1
index ad5caff3a5..c03324281b 100644
@@ -80,7 +80,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static GlobalProperty pc_piix_compat_defaults[] = {
     { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
 };
 static const size_t pc_piix_compat_defaults_len =
     G_N_ELEMENTS(pc_piix_compat_defaults);
hw/i386/pc_q35.c +1 -1
index 9b9519fa02..b309b2b378 100644
@@ -69,7 +69,7 @@
 static GlobalProperty pc_q35_compat_defaults[] = {
     { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "39" },
     { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
 };
 static const size_t pc_q35_compat_defaults_len =
     G_N_ELEMENTS(pc_q35_compat_defaults);
hw/vfio/pci.c +0 -2
index e72d514a4c..0c4606d9cb 100644
@@ -49,8 +49,6 @@
 #include "vfio-migration-internal.h"
 #include "vfio-helpers.h"
 
-#define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
-
 /* Protected by BQL */
 static KVMRouteChange vfio_route_change;
 
Signature · 1 line
2.47.1
#1 lore raw

Hello Zhenzhong,

Quoted 9 lines · Zhenzhong Duan

TYPE_VFIO_PCI doesn't have property use-legacy-x86-rom, but TYPE_VFIO_PCI_NOHOTPLUG has. The compatibility config leads to SIGABRT on new QEMU.

The default value of element use_legacy_x86_rom for TYPE_VFIO_PCI is already false, so no need extra processing.

Fixes d5fcf0d960d8 ("hw/i386: Add the ramfb romfile compatibility")

Fix is here :

https://lore.kernel.org/qemu-devel/[email protected]/

Thanks,

C.

Quoted 85 lines
---
  hw/vfio/types.h   | 2 ++
  hw/core/machine.c | 2 +-
  hw/i386/microvm.c | 2 +-
  hw/i386/pc_piix.c | 2 +-
  hw/i386/pc_q35.c  | 2 +-
  hw/vfio/pci.c     | 2 --
  6 files changed, 6 insertions(+), 6 deletions(-)
hw/vfio/types.h +2 -0
index fa20c29b9f..c19334ff25 100644
@@ -18,4 +18,6 @@
  #define TYPE_VFIO_PCI "vfio-pci"
  /* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
 
+#define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
  #endif /* HW_VFIO_VFIO_TYPES_H */
hw/core/machine.c +1 -1
index d6b2240fc2..bd47527479 100644
@@ -41,7 +41,7 @@ GlobalProperty hw_compat_10_0[] = {
      { "scsi-hd", "dpofua", "off" },
      { "vfio-pci", "x-migration-load-config-after-iter", "off" },
      { "ramfb", "use-legacy-x86-rom", "true"},
-    { "vfio-pci", "use-legacy-x86-rom", "true" },
+    { "vfio-pci-nohotplug", "use-legacy-x86-rom", "true" },
  };
  const size_t hw_compat_10_0_len = G_N_ELEMENTS(hw_compat_10_0);
 
hw/i386/microvm.c +1 -1
index d90b69a162..94d22a232a 100644
@@ -635,7 +635,7 @@ GlobalProperty microvm_properties[] = {
       */
      { "pcie-root-port", "io-reserve", "0" },
      { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
  };
 
  static void microvm_class_init(ObjectClass *oc, const void *data)
hw/i386/pc_piix.c +1 -1
index ad5caff3a5..c03324281b 100644
@@ -80,7 +80,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
  static GlobalProperty pc_piix_compat_defaults[] = {
      { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
  };
  static const size_t pc_piix_compat_defaults_len =
      G_N_ELEMENTS(pc_piix_compat_defaults);
hw/i386/pc_q35.c +1 -1
index 9b9519fa02..b309b2b378 100644
@@ -69,7 +69,7 @@
  static GlobalProperty pc_q35_compat_defaults[] = {
      { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "39" },
      { TYPE_RAMFB_DEVICE, "use-legacy-x86-rom", "true" },
-    { TYPE_VFIO_PCI, "use-legacy-x86-rom", "true" },
+    { TYPE_VFIO_PCI_NOHOTPLUG, "use-legacy-x86-rom", "true" },
  };
  static const size_t pc_q35_compat_defaults_len =
      G_N_ELEMENTS(pc_q35_compat_defaults);
hw/vfio/pci.c +0 -2
index e72d514a4c..0c4606d9cb 100644
@@ -49,8 +49,6 @@
  #include "vfio-migration-internal.h"
  #include "vfio-helpers.h"
 
-#define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
-
  /* Protected by BQL */
  static KVMRouteChange vfio_route_change;
 
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Cédric Le Goater <[email protected]>
Subject: Re: [PATCH] vfio/pci: Fix regression due to unexisting property use-legacy-x86-rom

Hello Zhenzhong,

Quoted 9 lines · Zhenzhong Duan

TYPE_VFIO_PCI doesn't have property use-legacy-x86-rom, but TYPE_VFIO_PCI_NOHOTPLUG has. The compatibility config leads to SIGABRT on new QEMU.

The default value of element use_legacy_x86_rom for TYPE_VFIO_PCI is already false, so no need extra processing.

Fixes d5fcf0d960d8 ("hw/i386: Add the ramfb romfile compatibility")
Quoted 5 lines

Fix is here :

https://lore.kernel.org/qemu-devel/20250723062714.1245826-1-clg@redhat
.com/

Ah, thanks Cédric, good to see this, I should have checked vfio-next first.

BRs,
Zhenzhong

#3 lore raw
Quoted 21 lines · Zhenzhong
Quoted 21 lines

-----Original Message-----
From: Cédric Le Goater <[email protected]>
Subject: Re: [PATCH] vfio/pci: Fix regression due to unexisting property use-legacy-x86-rom

Hello Zhenzhong,

Quoted 9 lines · Zhenzhong Duan

TYPE_VFIO_PCI doesn't have property use-legacy-x86-rom, but TYPE_VFIO_PCI_NOHOTPLUG has. The compatibility config leads to SIGABRT on new QEMU.

The default value of element use_legacy_x86_rom for TYPE_VFIO_PCI is already false, so no need extra processing.

Fixes d5fcf0d960d8 ("hw/i386: Add the ramfb romfile compatibility")
Quoted 7 lines
Quoted 5 lines

Fix is here :

https://lore.kernel.org/qemu-devel/20250723062714.1245826-1-clg@redhat
.com/

Ah, thanks Cédric, good to see this, I should have checked vfio-next first.

I have been waiting a bit (too long) to send the fix upstream because people were in vacations and I would like to possibly send Steve's fixes too. I should send a PR today or tomorrow.

Thanks,

C.