Skip to contentSkip to conversation

vfio: Add property documentation

PATCH Superseded Cédric Le Goater 7 participants 15 messages Feb 13, 2025 – Mar 11, 2025

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 vfio: Add property documentation

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw devices are simpler.

Organize the vfio-pci properties in topics. It would be great to have a way to do the same for the output.

Cc Tony Krowiak <[email protected]>
Cc Eric Farman <[email protected]>
Cc Eric Auger <[email protected]>

---

Changes in v2:

- Fixed version numbers
- Fixed #ifdef in vfio/ccw.c
- Addressed vfio-pci-nohotplug
- Organize the vfio-pci properties in topics

 hw/vfio/ap.c       |   9 +++
 hw/vfio/ccw.c      |  15 +++++
 hw/vfio/pci.c      | 134 +++++++++++++++++++++++++++++++++++++++++++++
 hw/vfio/platform.c |  23 ++++++++
 4 files changed, 181 insertions(+)
hw/vfio/ap.c +9 -0
index 30b08ad375d5ecae886c5000fbaa364799fe76d0..ec1150e5d627fce83a5a6319af471fd0aa45ae9b 100644
@@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = true;
     device_class_set_legacy_reset(dc, vfio_ap_reset);
     dc->bus_type = TYPE_AP_BUS;
+
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
 }
 
 static const TypeInfo vfio_ap_info = {
hw/vfio/ccw.c +15 -0
index 67bc137f9be6d43c5970c6271f3cdbfffd8a32de..242dc39660fcd028722093d637b7b64440649863 100644
@@ -717,6 +717,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
     cdc->handle_halt = vfio_ccw_handle_halt;
     cdc->handle_clear = vfio_ccw_handle_clear;
     cdc->handle_store = vfio_ccw_handle_store;
+
+    object_class_property_set_description(klass, /* 2.10 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "force-orb-pfch",
+                                          "Force unlimited prefetch");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+    object_class_property_set_description(klass, /* 9.2 */
+                                          "loadparm",
+                                          "Define which devices that can be used for booting");
 }
 
 static const TypeInfo vfio_ccw_info = {
hw/vfio/pci.c +134 -0

146 lines not on this page · raw message

hw/vfio/platform.c +23 -0
index 1070a2113a17edb9ebafb5066e51ee2bc52a767d..8e646e543692221e86b16fecd8bf40316f064a7d 100644
@@ -674,6 +674,29 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     /* Supported by TYPE_VIRT_MACHINE */
     dc->user_creatable = true;
+
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "host",
+                                          "Host device name of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "x-irqfd",
+                                          "Use irqfd for IRQ handling");
+
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+
 }
 
 static const TypeInfo vfio_platform_dev_info = {
Signature · 1 line
2.48.1
#1 lore raw
Quoted 3 lines · Cédric Le Goater

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw

Typo: vfio-platform

Regards,
BALATON Zoltan

#2 lore raw
Quoted 6 lines · BALATON Zoltan
Quoted 3 lines · Cédric Le Goater

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw

Typo: vfio-platform

French influence ! Thanks,

C.

#3 lore raw
In reply to Cédric Le Goater

Hi Cédric,

Quoted 239 lines · Cédric Le Goater

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw devices are simpler.

Organize the vfio-pci properties in topics. It would be great to have a way to do the same for the output.

Cc Tony Krowiak <[email protected]>
Cc Eric Farman <[email protected]>
Cc Eric Auger <[email protected]>

---

Changes in v2:

- Fixed version numbers
- Fixed #ifdef in vfio/ccw.c
- Addressed vfio-pci-nohotplug
- Organize the vfio-pci properties in topics

 hw/vfio/ap.c       |   9 +++
 hw/vfio/ccw.c      |  15 +++++
 hw/vfio/pci.c      | 134 +++++++++++++++++++++++++++++++++++++++++++++
 hw/vfio/platform.c |  23 ++++++++
 4 files changed, 181 insertions(+)
hw/vfio/ap.c +9 -0
index 30b08ad375d5ecae886c5000fbaa364799fe76d0..ec1150e5d627fce83a5a6319af471fd0aa45ae9b 100644
@@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = true;
     device_class_set_legacy_reset(dc, vfio_ap_reset);
     dc->bus_type = TYPE_AP_BUS;
+
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
 }
 
 static const TypeInfo vfio_ap_info = {
hw/vfio/ccw.c +15 -0
index 67bc137f9be6d43c5970c6271f3cdbfffd8a32de..242dc39660fcd028722093d637b7b64440649863 100644
@@ -717,6 +717,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
     cdc->handle_halt = vfio_ccw_handle_halt;
     cdc->handle_clear = vfio_ccw_handle_clear;
     cdc->handle_store = vfio_ccw_handle_store;
+
+    object_class_property_set_description(klass, /* 2.10 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "force-orb-pfch",
+                                          "Force unlimited prefetch");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+    object_class_property_set_description(klass, /* 9.2 */
+                                          "loadparm",
+                                          "Define which devices that can be used for booting");
 }
 
 static const TypeInfo vfio_ccw_info = {
hw/vfio/pci.c +134 -0
index 9a55e7b77324babf7295132b08e3ba23b482a291..fbd8cf566b1cfd508ccb0042a395e3b79ba781c0 100644
@@ -3433,6 +3433,133 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
     pdc->exit = vfio_exitfn;
     pdc->config_read = vfio_pci_read_config;
     pdc->config_write = vfio_pci_write_config;
+
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "host",
+                                          "Host PCI address [domain:]<bus:slot.function> of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    /*
+     * Display
+     */
+
+    object_class_property_set_description(klass, /* 1.5 */
+                                          "x-vga",
+                                          "Add support for VGA MMIO and I/O port access");
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "display",
+                                          "Add display support");
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "xres",
+                                          "Set X display resolution the vgpu should use");
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "yres",
+                                          "Set Y display resolution the vgpu should use");
+
+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */
+                                          "x-igd-opregion",
+                                          "Add IGD OpRegion support for (headless system)");
+    object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51) */
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode device assignment support. "
+                                          "Assign 00:02.0 from the host to 00:02.0 in the VM");
+
+    /*
+     * NVIDIA
+     */
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-no-geforce-quirks",
+                                          "Disable GeForce quirks (for NVIDIA Quadro/GRID/Tesla). Improves performance");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-kvm-ioeventfd",
+                                          "Disable ioeventfd quirk (NVIDIA)");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-vfio-ioeventfd",
+                                          "Enable ioeventfd quirks to be handled by VFIO directly. Improves performance");
+    object_class_property_set_description(klass, /* 2.11 */
+                                          "x-nv-gpudirect-clique",
+                                          "Add NVIDIA GPUDirect Cliques support");
+
+    /*
+     * Migration support
+     */
+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking",
+                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking",
+                                          "Disable device dirty page tracking and use container-based dirty page tracking");
+    object_class_property_set_description(klass, /* 5.2, 8.0 non-experimetal */
+                                          "enable-migration",
+                                          "Enale device migration. Also requires a host VFIO PCI variant "
+                                          "driver with migration support enabled");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "migration-events",
+                                          "Emit VFIO migration QAPI event when a VFIO device changes its migration "
+                                          "state. For management applications");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "skip-vsc-check",
+                                          "Skip config space check for Vendor Specific Capability. Useful for "
+                                          "NVIDIA vGPU driver migration");
+
+    /*
+     * debug, tracing
+     */
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-intx",
+                                          "Bypass INTx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msi",
+                                          "Bypass MSI interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msix",
+                                          "Bypass MSIx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-vendor-id",
+                                          "Set emulated PCI Vendor ID. Allows testing quirks");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-device-id",
+                                          "Set emulated PCI device ID. Allows testing quirks");
+
+    /*
+     * other
+     */
+    object_class_property_set_description(klass, /* 8.1 */
+                                          "vf-token",
+                                          "Add support for VF token among PF and VFs (Linux 5.7+)");
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "x-intx-mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping when under "
+                                          "INTx interrupts. Improves performance");
+    object_class_property_set_description(klass, /* 2.3 */
+                                          "x-req",
+                                          "Add device request notification support (Linux 4.0+)");
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "x-balloon-allowed",
+                                          "Allow devices to opt-in for ballooning");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-vendor-id",
+                                          "Set emulated PCI Sub-vendor ID");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-device-id",
+                                          "Set emulated PCI Sub-device ID");
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-msix-relocation",
+                                          "Allow relocating MSI-X MMIO on systems which page size is larger "
+                                          "than the PCI spec recommendation. Mostly for sPAPR");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
 }
 
 static const TypeInfo vfio_pci_dev_info = {
@@ -3461,6 +3588,13 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 
     device_class_set_props(dc, vfio_pci_dev_nohotplug_properties);
     dc->hotpluggable = false;
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "ramfb",
+                                          "Add ramfb support");
+    object_class_property_set_description(klass, /* 8.2 */
+                                          "x-ramfb-migrate",
+                                          "Add ramfb migration support");
+
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
hw/vfio/platform.c +6 -0
index 1070a2113a17edb9ebafb5066e51ee2bc52a767d..8e646e543692221e86b16fecd8bf40316f064a7d 100644
@@ -674,6 +674,29 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     /* Supported by TYPE_VIRT_MACHINE */
     dc->user_creatable = true;
+
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "host",
+                                          "Host device name of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 692

Quoted 10 lines
hw/vfio/platform.c +10 -0
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "x-irqfd",
+                                          "Use irqfd for IRQ handling");

nit: why not reorder by release of introduction then? Same for other devices.

Thanks

Eric

Quoted 10 lines
hw/vfio/platform.c +7 -0
+
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+
 }
 
 static const TypeInfo vfio_platform_dev_info = {
#4 lore raw
Quoted 247 lines · Eric Auger

Hi Cédric,

Quoted 243 lines · Cédric Le Goater

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw devices are simpler.

Organize the vfio-pci properties in topics. It would be great to have a way to do the same for the output.

Cc Tony Krowiak <[email protected]>
Cc Eric Farman <[email protected]>
Cc Eric Auger <[email protected]>

---

Changes in v2:

- Fixed version numbers
- Fixed #ifdef in vfio/ccw.c
- Addressed vfio-pci-nohotplug
- Organize the vfio-pci properties in topics

  hw/vfio/ap.c       |   9 +++
  hw/vfio/ccw.c      |  15 +++++
  hw/vfio/pci.c      | 134 +++++++++++++++++++++++++++++++++++++++++++++
  hw/vfio/platform.c |  23 ++++++++
  4 files changed, 181 insertions(+)
hw/vfio/ap.c +9 -0
index 30b08ad375d5ecae886c5000fbaa364799fe76d0..ec1150e5d627fce83a5a6319af471fd0aa45ae9b 100644
@@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
      dc->hotpluggable = true;
      device_class_set_legacy_reset(dc, vfio_ap_reset);
      dc->bus_type = TYPE_AP_BUS;
+
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
  }
 
  static const TypeInfo vfio_ap_info = {
hw/vfio/ccw.c +15 -0
index 67bc137f9be6d43c5970c6271f3cdbfffd8a32de..242dc39660fcd028722093d637b7b64440649863 100644
@@ -717,6 +717,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
      cdc->handle_halt = vfio_ccw_handle_halt;
      cdc->handle_clear = vfio_ccw_handle_clear;
      cdc->handle_store = vfio_ccw_handle_store;
+
+    object_class_property_set_description(klass, /* 2.10 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "force-orb-pfch",
+                                          "Force unlimited prefetch");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+    object_class_property_set_description(klass, /* 9.2 */
+                                          "loadparm",
+                                          "Define which devices that can be used for booting");
  }
 
  static const TypeInfo vfio_ccw_info = {
hw/vfio/pci.c +134 -0
index 9a55e7b77324babf7295132b08e3ba23b482a291..fbd8cf566b1cfd508ccb0042a395e3b79ba781c0 100644
@@ -3433,6 +3433,133 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
      pdc->exit = vfio_exitfn;
      pdc->config_read = vfio_pci_read_config;
      pdc->config_write = vfio_pci_write_config;
+
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "host",
+                                          "Host PCI address [domain:]<bus:slot.function> of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    /*
+     * Display
+     */
+
+    object_class_property_set_description(klass, /* 1.5 */
+                                          "x-vga",
+                                          "Add support for VGA MMIO and I/O port access");
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "display",
+                                          "Add display support");
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "xres",
+                                          "Set X display resolution the vgpu should use");
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "yres",
+                                          "Set Y display resolution the vgpu should use");
+
+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */
+                                          "x-igd-opregion",
+                                          "Add IGD OpRegion support for (headless system)");
+    object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51) */
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode device assignment support. "
+                                          "Assign 00:02.0 from the host to 00:02.0 in the VM");
+
+    /*
+     * NVIDIA
+     */
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-no-geforce-quirks",
+                                          "Disable GeForce quirks (for NVIDIA Quadro/GRID/Tesla). Improves performance");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-kvm-ioeventfd",
+                                          "Disable ioeventfd quirk (NVIDIA)");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-vfio-ioeventfd",
+                                          "Enable ioeventfd quirks to be handled by VFIO directly. Improves performance");
+    object_class_property_set_description(klass, /* 2.11 */
+                                          "x-nv-gpudirect-clique",
+                                          "Add NVIDIA GPUDirect Cliques support");
+
+    /*
+     * Migration support
+     */
+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking",
+                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking",
+                                          "Disable device dirty page tracking and use container-based dirty page tracking");
+    object_class_property_set_description(klass, /* 5.2, 8.0 non-experimetal */
+                                          "enable-migration",
+                                          "Enale device migration. Also requires a host VFIO PCI variant "
+                                          "driver with migration support enabled");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "migration-events",
+                                          "Emit VFIO migration QAPI event when a VFIO device changes its migration "
+                                          "state. For management applications");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "skip-vsc-check",
+                                          "Skip config space check for Vendor Specific Capability. Useful for "
+                                          "NVIDIA vGPU driver migration");
+
+    /*
+     * debug, tracing
+     */
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-intx",
+                                          "Bypass INTx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msi",
+                                          "Bypass MSI interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msix",
+                                          "Bypass MSIx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-vendor-id",
+                                          "Set emulated PCI Vendor ID. Allows testing quirks");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-device-id",
+                                          "Set emulated PCI device ID. Allows testing quirks");
+
+    /*
+     * other
+     */
+    object_class_property_set_description(klass, /* 8.1 */
+                                          "vf-token",
+                                          "Add support for VF token among PF and VFs (Linux 5.7+)");
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "x-intx-mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping when under "
+                                          "INTx interrupts. Improves performance");
+    object_class_property_set_description(klass, /* 2.3 */
+                                          "x-req",
+                                          "Add device request notification support (Linux 4.0+)");
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "x-balloon-allowed",
+                                          "Allow devices to opt-in for ballooning");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-vendor-id",
+                                          "Set emulated PCI Sub-vendor ID");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-device-id",
+                                          "Set emulated PCI Sub-device ID");
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-msix-relocation",
+                                          "Allow relocating MSI-X MMIO on systems which page size is larger "
+                                          "than the PCI spec recommendation. Mostly for sPAPR");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
  }
 
  static const TypeInfo vfio_pci_dev_info = {
@@ -3461,6 +3588,13 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 
      device_class_set_props(dc, vfio_pci_dev_nohotplug_properties);
      dc->hotpluggable = false;
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "ramfb",
+                                          "Add ramfb support");
+    object_class_property_set_description(klass, /* 8.2 */
+                                          "x-ramfb-migrate",
+                                          "Add ramfb migration support");
+
  }
 
  static const TypeInfo vfio_pci_nohotplug_dev_info = {
hw/vfio/platform.c +10 -0
index 1070a2113a17edb9ebafb5066e51ee2bc52a767d..8e646e543692221e86b16fecd8bf40316f064a7d 100644
@@ -674,6 +674,29 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
      /* Supported by TYPE_VIRT_MACHINE */
      dc->user_creatable = true;
+
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "host",
+                                          "Host device name of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
Quoted 8 lines

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 692

Quoted 6 lines
hw/vfio/platform.c +6 -0
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "x-irqfd",
+                                          "Use irqfd for IRQ handling");

nit: why not reorder by release of introduction then? Same for other devices.

Yep. I will do that in v3.

Thanks,

C.

Quoted 15 lines

Thanks

Eric

Quoted 10 lines
hw/vfio/platform.c +7 -0
+
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+
  }
 
  static const TypeInfo vfio_platform_dev_info = {
#5 lore raw
In reply to Cédric Le Goater
Quoted 85 lines · On Thu, 13 Feb 2025 14:50:50 +0100 Cédric Le Goater <[email protected]> wrote:

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw devices are simpler.

Organize the vfio-pci properties in topics. It would be great to have a way to do the same for the output.

Cc Tony Krowiak <[email protected]>
Cc Eric Farman <[email protected]>
Cc Eric Auger <[email protected]>

---

Changes in v2:

- Fixed version numbers
- Fixed #ifdef in vfio/ccw.c
- Addressed vfio-pci-nohotplug
- Organize the vfio-pci properties in topics

 hw/vfio/ap.c       |   9 +++
 hw/vfio/ccw.c      |  15 +++++
 hw/vfio/pci.c      | 134 +++++++++++++++++++++++++++++++++++++++++++++
 hw/vfio/platform.c |  23 ++++++++
 4 files changed, 181 insertions(+)
hw/vfio/ap.c +9 -0
index 30b08ad375d5ecae886c5000fbaa364799fe76d0..ec1150e5d627fce83a5a6319af471fd0aa45ae9b 100644
@@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = true;
     device_class_set_legacy_reset(dc, vfio_ap_reset);
     dc->bus_type = TYPE_AP_BUS;
+
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
 }
 
 static const TypeInfo vfio_ap_info = {
hw/vfio/ccw.c +15 -0
index 67bc137f9be6d43c5970c6271f3cdbfffd8a32de..242dc39660fcd028722093d637b7b64440649863 100644
@@ -717,6 +717,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
     cdc->handle_halt = vfio_ccw_handle_halt;
     cdc->handle_clear = vfio_ccw_handle_clear;
     cdc->handle_store = vfio_ccw_handle_store;
+
+    object_class_property_set_description(klass, /* 2.10 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "force-orb-pfch",
+                                          "Force unlimited prefetch");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+    object_class_property_set_description(klass, /* 9.2 */
+                                          "loadparm",
+                                          "Define which devices that can be used for booting");
 }
 
 static const TypeInfo vfio_ccw_info = {
hw/vfio/pci.c +4 -0
index 9a55e7b77324babf7295132b08e3ba23b482a291..fbd8cf566b1cfd508ccb0042a395e3b79ba781c0 100644
@@ -3433,6 +3433,133 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
     pdc->exit = vfio_exitfn;
     pdc->config_read = vfio_pci_read_config;
     pdc->config_write = vfio_pci_write_config;
+
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "host",
+                                          "Host PCI address [domain:]<bus:slot.function> of assigned device");

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3449

Quoted 10 lines
hw/vfio/pci.c +10 -0
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    /*
+     * Display
+     */
+
+    object_class_property_set_description(klass, /* 1.5 */
+                                          "x-vga",
+                                          "Add support for VGA MMIO and I/O port access");

"Expose VGA address spaces for device"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3452

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "display",
+                                          "Add display support");

"Enable display support for device, ex. vGPU"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3455

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "xres",
+                                          "Set X display resolution the vgpu should use");

Maybe capitalize for consistency, vGPU.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3466

Quoted 11 lines
hw/vfio/pci.c +11 -0
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "yres",
+                                          "Set Y display resolution the vgpu should use");
+
+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */
+                                          "x-igd-opregion",
+                                          "Add IGD OpRegion support for (headless system)");

[Cc Tomita and Corvin have more recent understanding of IGD options]

Not necessarily for headless systems, unless others have better suggestions, maybe just "Expose host IGD OpRegion table to guest".

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3470

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51) */
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode device assignment support. "
+                                          "Assign 00:02.0 from the host to 00:02.0 in the VM");

Not really. Tomita added a useful comment and commit log in 37f05a59e869. Perhaps:

"Override DVMT Pre-Allocated value for IGD stolen memory. (32MiB units)"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3483

Quoted 13 lines
hw/vfio/pci.c +13 -0
+
+    /*
+     * NVIDIA
+     */
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-no-geforce-quirks",
+                                          "Disable GeForce quirks (for NVIDIA Quadro/GRID/Tesla). Improves performance");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-kvm-ioeventfd",
+                                          "Disable ioeventfd quirk (NVIDIA)");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-vfio-ioeventfd",
+                                          "Enable ioeventfd quirks to be handled by VFIO directly. Improves performance");

The above two should be under debugging, they're only used by NVIDIA quirks but they exist for the purpose of validating behavior with and without. The first disables registering an ioeventfd with KVM and the latter disables directly "wiring" it through to vfio. Maybe (respectively):

"Disable registration of ioeventfds with KVM"

"Disable linking of KVM ioeventfds to VFIO ioeventfds"

NB. setting the latter does not improve performance.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3486

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.11 */
+                                          "x-nv-gpudirect-clique",
+                                          "Add NVIDIA GPUDirect Cliques support");

"Add NVIDIA GPUDirect capability indicating P2P DMA clique for device. (0~15)"

(maybe this is already specified as a uint4 given the PropertyInfo?)

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3496

Quoted 10 lines
hw/vfio/pci.c +10 -0
+
+    /*
+     * Migration support
+     */
+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking",
+                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking",
+                                          "Disable device dirty page tracking and use container-based dirty page tracking");

These are really debug as well, right? They just happen to be migration related debug.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3508

Quoted 12 lines
hw/vfio/pci.c +12 -0
+    object_class_property_set_description(klass, /* 5.2, 8.0 non-experimetal */
+                                          "enable-migration",
+                                          "Enale device migration. Also requires a host VFIO PCI variant "
+                                          "driver with migration support enabled");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "migration-events",
+                                          "Emit VFIO migration QAPI event when a VFIO device changes its migration "
+                                          "state. For management applications");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "skip-vsc-check",
+                                          "Skip config space check for Vendor Specific Capability. Useful for "
+                                          "NVIDIA vGPU driver migration");

The vsc check is really for debug too since it's enabled by default and mostly only exists as a visible option for manipulation by the machine type.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3518

Quoted 10 lines
hw/vfio/pci.c +10 -0
+
+    /*
+     * debug, tracing
+     */
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-intx",
+                                          "Bypass INTx interrupts. Allows interrupt tracing");

"Disable direct VFIO->KVM INTx injection. Allows to trace INTx interrupts"

s/INTx/MSI/
s/INTx/MSIx/

for the next.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3530

Quoted 12 lines
hw/vfio/pci.c +12 -0
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msi",
+                                          "Bypass MSI interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msix",
+                                          "Bypass MSIx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-vendor-id",
+                                          "Set emulated PCI Vendor ID. Allows testing quirks");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-device-id",
+                                          "Set emulated PCI device ID. Allows testing quirks");

"Override PCI Vendor ID with provided value"

s/Vendor/Device/

There are also "sub" versions of these for subsystem Vendor and Device IDs.

None of these are really for quirks, they're more for making devices appear as other devices. For reasons.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3537

Quoted 7 lines
hw/vfio/pci.c +7 -0
+
+    /*
+     * other
+     */
+    object_class_property_set_description(klass, /* 8.1 */
+                                          "vf-token",
+                                          "Add support for VF token among PF and VFs (Linux 5.7+)");

"Specify UUID VF token. Required for VF when PF is owned by another VFIO driver"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3541

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "x-intx-mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping when under "
+                                          "INTx interrupts. Improves performance");

Changes performance perhaps. This should also be under debug.

"When EOI is not provided by KVM/QEMU, wait time to re-enable device direct access after INTx"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3544

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.3 */
+                                          "x-req",
+                                          "Add device request notification support (Linux 4.0+)");

Also debug.

"Disable device request notification support"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3547

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "x-balloon-allowed",
+                                          "Allow devices to opt-in for ballooning");

Debug.

"Override allowing ballooning with device. (DANGER)"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3553

Quoted 6 lines
hw/vfio/pci.c +6 -0
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-vendor-id",
+                                          "Set emulated PCI Sub-vendor ID");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-device-id",
+                                          "Set emulated PCI Sub-device ID");

Ah, here they are. Grouping with non-subsystem would make sense to me.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3557

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-msix-relocation",
+                                          "Allow relocating MSI-X MMIO on systems which page size is larger "
+                                          "than the PCI spec recommendation. Mostly for sPAPR");

Yes, we added it because of systems with >4K pages, but there do exist devices that do not follow the PCI spec recommendation and place non-MSI related registers too close the vector table and pba.

"Specify MSI-X MMIO relocation to the end of specified existing BAR or new BAR to avoid virtualization overhead due to adjacent device registers"

Quoted 9 lines
hw/vfio/pci.c +5 -0
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
 }
 
 static const TypeInfo vfio_pci_dev_info = {

hw/vfio/pci.c static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) · line 3593

Quoted 6 lines
hw/vfio/pci.c +3 -0
@@ -3461,6 +3588,13 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 
     device_class_set_props(dc, vfio_pci_dev_nohotplug_properties);
     dc->hotpluggable = false;
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "ramfb",
+                                          "Add ramfb support");

"Enable ramfb to provide pre-boot graphics for devices enabling display option"

hw/vfio/pci.c static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) · line 3596

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 8.2 */
+                                          "x-ramfb-migrate",
+                                          "Add ramfb migration support");

Debug.

"Override default migration support for ramfb support"

Quoted 15 lines
hw/vfio/pci.c +1 -0
+
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
hw/vfio/platform.c +3 -0
index 1070a2113a17edb9ebafb5066e51ee2bc52a767d..8e646e543692221e86b16fecd8bf40316f064a7d 100644
@@ -674,6 +674,29 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     /* Supported by TYPE_VIRT_MACHINE */
     dc->user_creatable = true;
+
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "host",

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 689

Quoted 10 lines
hw/vfio/platform.c +10 -0
+                                          "Host device name of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping");

This is essentially the same as the vfio-pci INTx version, only used when we don't have a mechanism for EOI.

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 692

Quoted 3 lines
hw/vfio/platform.c +3 -0
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "x-irqfd",
+                                          "Use irqfd for IRQ handling");

Debug. Allow disabling irqfd support.

Maybe rather than trying to group debug options together they should just be explicitly labeled in the description, ex. "[DEBUG]"

Thanks,
Alex

Quoted 10 lines
hw/vfio/platform.c +7 -0
+
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+
 }
 
 static const TypeInfo vfio_platform_dev_info = {
#6 lore raw
Quoted 11 lines · Alex Williamson
Quoted 8 lines · On Thu, 13 Feb 2025 14:50:50 +0100 Cédric Le Goater <[email protected]> wrote:

+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */ +                                          "x-igd-opregion", +                                          "Add IGD OpRegion support for (headless system)");

Quoted 5 lines

[Cc Tomita and Corvin have more recent understanding of IGD options]

Not necessarily for headless systems, unless others have better suggestions, maybe just "Expose host IGD OpRegion table to guest".

Sounds good. Note that it's required for the Intel GOP (EFI driver) and the Windows driver. So, it's mandatory for non headless systems.

Quoted 8 lines
Quoted 7 lines

+    object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51) */
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode device assignment support. "
+                                          "Assign 00:02.0 from the host to 00:02.0 in the VM");

Quoted 4 lines

Not really.  Tomita added a useful comment and commit log in 37f05a59e869.  Perhaps:

"Override DVMT Pre-Allocated value for IGD stolen memory. (32MiB units)"

Nit: This sets the Graphics Mode Select value of the GMCH Graphics Control register. While we currently only support values in the range of 0x00 - 0x40, I don't see a reason to not support 0xF0 - 0xFE which uses 4 MiB increments.

Signature · 2 lines
Kind regards,
Corvin
#7 lore raw
Quoted 12 lines · Corvin Köhne
Quoted 11 lines · Alex Williamson
Quoted 8 lines · On Thu, 13 Feb 2025 14:50:50 +0100 Cédric Le Goater <[email protected]> wrote:
hw/vfio/pci.c +7 -0
+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */
+                                          "x-igd-opregion",
+                                          "Add IGD OpRegion support for

(headless system)");

Quoted 8 lines
Quoted 5 lines

[Cc Tomita and Corvin have more recent understanding of IGD options]

Not necessarily for headless systems, unless others have better suggestions, maybe just "Expose host IGD OpRegion table to guest".

Sounds good. Note that it's required for the Intel GOP (EFI driver) and the Windows driver. So, it's mandatory for non headless systems.

"Expose host IGD OpRegion to guest" sounds more accurate I think. OpRegion is not a table, it contains Video BIOS Table (VBT) for display output port info.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

+ object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51)
*/

(quoted diff) +2 -0
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode

device assignment support. "
+ "Assign 00:02.0 from the host to
00:02.0 in the VM");

Quoted 4 lines
Quoted 4 lines

Not really. Tomita added a useful comment and commit log in 37f05a59e869. Perhaps:

"Override DVMT Pre-Allocated value for IGD stolen memory. (32MiB units)"

"Override IGD data stolen memory size. (32MiB units)" might be better.

Quoted 3 lines

Nit: This sets the Graphics Mode Select value of the GMCH Graphics Control register. While we currently only support values in the range of 0x00 - 0x40, I don't see a reason to not support 0xF0 - 0xFE which uses 4 MiB increments.

I skipped the 4MiB values before for keeping the conditions simple and these 32 MiB values should cover most cases. We can consider supporting 4MiB values.

#8 lore raw
In reply to Alex Williamson

+Kirti
+Joao

Quoted 10 lines · Alex Williamson

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3496

Quoted 10 lines
hw/vfio/pci.c +10 -0
+
+    /*
+     * Migration support
+     */
+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking",
+                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking",
+                                          "Disable device dirty page tracking and use container-based dirty page tracking");
Quoted 2 lines

These are really debug as well, right? They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior during migration") commit 30b916778517 ("vfio/common: Allow disabling device dirty page tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Thanks,

C.

#9 lore raw
Quoted 24 lines · Cédric Le Goater
(quoted diff) +2 -0
+Kirti
+Joao
Quoted 12 lines · Alex Williamson
Quoted 4 lines

+
+    /*
+     * Migration support
+     */

Quoted 8 lines

+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking", +                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking", +                                          "Disable device dirty page tracking and use container-based dirty page tracking");

Quoted 2 lines

These are really debug as well, right?  They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

Quoted 7 lines

  commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior during migration")
  commit 30b916778517 ("vfio/common: Allow disabling device dirty page tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Sorry for the extreme delay but I was out travelling for the past 3 weeks for vacation and work.

The property is marked as x- but my intent was both debug/testing and to have something that allows me to select the dirty tracker between device vs platform dirty tracker if something is wrong with say VF dirty tracker or if there's some limitations around it. These days we actually use it a lot as my default to have IOMMU dirty tracker in use. I wouldn't label it exclusively as '(debug)' just yet.

The precopy option might be to avoid dirty tracking at all and it's generally useful when you don't have dirty tracking at all or say snapshots or 'offline migration'. But I have never seen real use of it, or need for that matter, except the early days of VFIO migration during testing.

#10 lore raw

Joao,

Quoted 42 lines · Joao Martins
Quoted 24 lines · Cédric Le Goater
(quoted diff) +2 -0
+Kirti
+Joao
Quoted 12 lines · Alex Williamson
Quoted 4 lines

+
+    /*
+     * Migration support
+     */

Quoted 8 lines

+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking", +                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking", +                                          "Disable device dirty page tracking and use container-based dirty page tracking");

Quoted 2 lines

These are really debug as well, right?  They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

Quoted 7 lines

  commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior
during migration")
  commit 30b916778517 ("vfio/common: Allow disabling device dirty page tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Sorry for the extreme delay but I was out travelling for the past 3 weeks for vacation and work.

The property is marked as x- but my intent was both debug/testing and to have something that allows me to select the dirty tracker between device vs platform dirty tracker if something is wrong with say VF dirty tracker or if there's some limitations around it. These days we actually use it a lot as my default to have IOMMU dirty tracker in use. I wouldn't label it exclusively as '(debug)' just yet.

Quoted 4 lines

The precopy option might be to avoid dirty tracking at all and it's generally useful when you don't have dirty tracking at all or say snapshots or 'offline migration'. But I have never seen real use of it, or need for that matter, except the early days of VFIO migration during testing.

Could you please send a patch on top of :

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

This would be great to keep the information in the git history.

Thanks,

C.

#11 lore raw
Quoted 52 lines · Cédric Le Goater

Joao,

Quoted 44 lines · Joao Martins
Quoted 24 lines · Cédric Le Goater
(quoted diff) +2 -0
+Kirti
+Joao
Quoted 12 lines · Alex Williamson
Quoted 4 lines

+
+    /*
+     * Migration support
+     */

Quoted 8 lines

+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking", +                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking", +                                          "Disable device dirty page tracking and use container-based dirty page tracking");

Quoted 2 lines

These are really debug as well, right?  They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

Quoted 8 lines

   commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior during migration")
   commit 30b916778517 ("vfio/common: Allow disabling device dirty page tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Sorry for the extreme delay but I was out travelling for the past 3 weeks for vacation and work.

The property is marked as x- but my intent was both debug/testing and to have something that allows me to select the dirty tracker between device vs platform dirty tracker if something is wrong with say VF dirty tracker or if there's some limitations around it. These days we actually use it a lot as my default to have IOMMU dirty tracker in use. I wouldn't label it exclusively as '(debug)' just yet.

Quoted 4 lines

The precopy option might be to avoid dirty tracking at all and it's generally useful when you don't have dirty tracking at all or say snapshots or 'offline migration'. But I have never seen real use of it, or need for that matter, except the early days of VFIO migration during testing.

Quoted 5 lines

Could you please send a patch on top of :

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

This would be great to keep the information in the git history.

I'll send a patch shortly.

#12 lore raw
Quoted 53 lines · Joao Martins
Quoted 52 lines · Cédric Le Goater

Joao,

Quoted 48 lines · Joao Martins
Quoted 24 lines · Cédric Le Goater
(quoted diff) +2 -0
+Kirti
+Joao
Quoted 12 lines · Alex Williamson
Quoted 4 lines

+
+    /*
+     * Migration support
+     */

Quoted 8 lines

+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking", +                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking", +                                          "Disable device dirty page tracking and use container-based dirty page tracking");

Quoted 2 lines

These are really debug as well, right?  They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

Quoted 8 lines

   commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior
during migration")
   commit 30b916778517 ("vfio/common: Allow disabling device dirty page
tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Sorry for the extreme delay but I was out travelling for the past 3 weeks for vacation and work.

The property is marked as x- but my intent was both debug/testing and to have something that allows me to select the dirty tracker between device vs platform dirty tracker if something is wrong with say VF dirty tracker or if there's some limitations around it. These days we actually use it a lot as my default to have IOMMU dirty tracker in use. I wouldn't label it exclusively as '(debug)' just yet.

The precopy option might be to avoid dirty tracking at all and it's generally useful when you don't have dirty tracking at all or say snapshots or 'offline migration'. But I have never seen real use of it, or need for that matter, except the early days of VFIO migration during testing.

Quoted 7 lines
Quoted 5 lines

Could you please send a patch on top of :

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

This would be great to keep the information in the git history.

I'll send a patch shortly.

I am about to send a last PR. I will check in the evening for your update.

Thanks,

C.

#13 lore raw
Quoted 58 lines · Cédric Le Goater
Quoted 57 lines · Joao Martins
Quoted 56 lines · Cédric Le Goater

Joao,

Quoted 46 lines · Joao Martins
Quoted 24 lines · Cédric Le Goater
(quoted diff) +2 -0
+Kirti
+Joao
Quoted 12 lines · Alex Williamson
Quoted 4 lines

+
+    /*
+     * Migration support
+     */

Quoted 8 lines

+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking", +                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking", +                                          "Disable device dirty page tracking and use container-based dirty page tracking");

Quoted 2 lines

These are really debug as well, right?  They just happen to be migration related debug.

I suppose so. I would rather keep them under the migration topic and add 'debug' in the comment.

Changes :

Quoted 8 lines

    commit bb0990d1740f ("vfio: Change default dirty pages tracking behavior during migration")
    commit 30b916778517 ("vfio/common: Allow disabling device dirty page tracking")

do not explicitly explain why these properties are useful in any way.

Kirti, Joao, could you ?

Sorry for the extreme delay but I was out travelling for the past 3 weeks for vacation and work.

The property is marked as x- but my intent was both debug/testing and to have something that allows me to select the dirty tracker between device vs platform dirty tracker if something is wrong with say VF dirty tracker or if there's some
limitations around it. These days we actually use it a lot as my default to have
IOMMU dirty tracker in use. I wouldn't label it exclusively as '(debug)' just yet.

Quoted 4 lines

The precopy option might be to avoid dirty tracking at all and it's generally useful when you don't have dirty tracking at all or say snapshots or 'offline migration'. But I have never seen real use of it, or need for that matter, except the early days of VFIO migration during testing.

Could you please send a patch on top of :

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

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

This would be great to keep the information in the git history.

I'll send a patch shortly.

I am about to send a last PR. I will check in the evening for your update.

Ok -- just sent it

Joao

#14 lore raw
In reply to Alex Williamson
Quoted 166 lines · Alex Williamson
Quoted 85 lines · On Thu, 13 Feb 2025 14:50:50 +0100 Cédric Le Goater <[email protected]> wrote:

Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw devices are simpler.

Organize the vfio-pci properties in topics. It would be great to have a way to do the same for the output.

Cc Tony Krowiak <[email protected]>
Cc Eric Farman <[email protected]>
Cc Eric Auger <[email protected]>

---

Changes in v2:

- Fixed version numbers
- Fixed #ifdef in vfio/ccw.c
- Addressed vfio-pci-nohotplug
- Organize the vfio-pci properties in topics

  hw/vfio/ap.c       |   9 +++
  hw/vfio/ccw.c      |  15 +++++
  hw/vfio/pci.c      | 134 +++++++++++++++++++++++++++++++++++++++++++++
  hw/vfio/platform.c |  23 ++++++++
  4 files changed, 181 insertions(+)
hw/vfio/ap.c +9 -0
index 30b08ad375d5ecae886c5000fbaa364799fe76d0..ec1150e5d627fce83a5a6319af471fd0aa45ae9b 100644
@@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
      dc->hotpluggable = true;
      device_class_set_legacy_reset(dc, vfio_ap_reset);
      dc->bus_type = TYPE_AP_BUS;
+
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
  }
 
  static const TypeInfo vfio_ap_info = {
hw/vfio/ccw.c +15 -0
index 67bc137f9be6d43c5970c6271f3cdbfffd8a32de..242dc39660fcd028722093d637b7b64440649863 100644
@@ -717,6 +717,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data)
      cdc->handle_halt = vfio_ccw_handle_halt;
      cdc->handle_clear = vfio_ccw_handle_clear;
      cdc->handle_store = vfio_ccw_handle_store;
+
+    object_class_property_set_description(klass, /* 2.10 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "force-orb-pfch",
+                                          "Force unlimited prefetch");
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
+    object_class_property_set_description(klass, /* 9.2 */
+                                          "loadparm",
+                                          "Define which devices that can be used for booting");
  }
 
  static const TypeInfo vfio_ccw_info = {
hw/vfio/pci.c +4 -0
index 9a55e7b77324babf7295132b08e3ba23b482a291..fbd8cf566b1cfd508ccb0042a395e3b79ba781c0 100644
@@ -3433,6 +3433,133 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
      pdc->exit = vfio_exitfn;
      pdc->config_read = vfio_pci_read_config;
      pdc->config_write = vfio_pci_write_config;
+
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "host",
+                                          "Host PCI address [domain:]<bus:slot.function> of assigned device");

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3449

Quoted 10 lines
hw/vfio/pci.c +10 -0
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    /*
+     * Display
+     */
+
+    object_class_property_set_description(klass, /* 1.5 */
+                                          "x-vga",
+                                          "Add support for VGA MMIO and I/O port access");

"Expose VGA address spaces for device"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3452

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "display",
+                                          "Add display support");

"Enable display support for device, ex. vGPU"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3455

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "xres",
+                                          "Set X display resolution the vgpu should use");

Maybe capitalize for consistency, vGPU.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3466

Quoted 11 lines
hw/vfio/pci.c +11 -0
+    object_class_property_set_description(klass, /* 3.2 */
+                                          "yres",
+                                          "Set Y display resolution the vgpu should use");
+
+    /*
+     * IGD
+     */
+
+    object_class_property_set_description(klass, /* 2.7 */
+                                          "x-igd-opregion",
+                                          "Add IGD OpRegion support for (headless system)");

[Cc Tomita and Corvin have more recent understanding of IGD options]

Not necessarily for headless systems, unless others have better suggestions, maybe just "Expose host IGD OpRegion table to guest".

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3470

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51) */
+                                          "x-igd-gms",
+                                          "Add Intel graphics legacy mode device assignment support. "
+                                          "Assign 00:02.0 from the host to 00:02.0 in the VM");

Not really. Tomita added a useful comment and commit log in 37f05a59e869. Perhaps:

"Override DVMT Pre-Allocated value for IGD stolen memory. (32MiB units)"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3483

Quoted 13 lines
hw/vfio/pci.c +13 -0
+
+    /*
+     * NVIDIA
+     */
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-no-geforce-quirks",
+                                          "Disable GeForce quirks (for NVIDIA Quadro/GRID/Tesla). Improves performance");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-kvm-ioeventfd",
+                                          "Disable ioeventfd quirk (NVIDIA)");
+    object_class_property_set_description(klass, /* 3.0 */
+                                          "x-no-vfio-ioeventfd",
+                                          "Enable ioeventfd quirks to be handled by VFIO directly. Improves performance");

The above two should be under debugging, they're only used by NVIDIA quirks but they exist for the purpose of validating behavior with and without. The first disables registering an ioeventfd with KVM and the latter disables directly "wiring" it through to vfio. Maybe (respectively):

"Disable registration of ioeventfds with KVM"

"Disable linking of KVM ioeventfds to VFIO ioeventfds"

NB. setting the latter does not improve performance.

Quoted 7 lines

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3486

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.11 */
+                                          "x-nv-gpudirect-clique",
+                                          "Add NVIDIA GPUDirect Cliques support");

"Add NVIDIA GPUDirect capability indicating P2P DMA clique for device. (0~15)"

(maybe this is already specified as a uint4 given the PropertyInfo?)

It's not. I will add range [0-15]

Quoted 12 lines

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3496

Quoted 11 lines
hw/vfio/pci.c +10 -0
+
+    /*
+     * Migration support
+     */
+    object_class_property_set_description(klass, /* 5.2 */
+                                          "x-pre-copy-dirty-page-tracking",
+                                          "Disable dirty pages tracking during iterative phase");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "x-device-dirty-page-tracking",
+                                          "Disable device dirty page tracking and use container-based dirty page tracking");
Quoted 2 lines

These are really debug as well, right? They just happen to be migration related debug.

I asked Joao and Kirti.

Quoted 170 lines

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3508

Quoted 12 lines
hw/vfio/pci.c +12 -0
+    object_class_property_set_description(klass, /* 5.2, 8.0 non-experimetal */
+                                          "enable-migration",
+                                          "Enale device migration. Also requires a host VFIO PCI variant "
+                                          "driver with migration support enabled");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "migration-events",
+                                          "Emit VFIO migration QAPI event when a VFIO device changes its migration "
+                                          "state. For management applications");
+    object_class_property_set_description(klass, /* 9.1 */
+                                          "skip-vsc-check",
+                                          "Skip config space check for Vendor Specific Capability. Useful for "
+                                          "NVIDIA vGPU driver migration");

The vsc check is really for debug too since it's enabled by default and mostly only exists as a visible option for manipulation by the machine type.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3518

Quoted 10 lines
hw/vfio/pci.c +10 -0
+
+    /*
+     * debug, tracing
+     */
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-intx",
+                                          "Bypass INTx interrupts. Allows interrupt tracing");

"Disable direct VFIO->KVM INTx injection. Allows to trace INTx interrupts"

s/INTx/MSI/
s/INTx/MSIx/

for the next.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3530

Quoted 12 lines
hw/vfio/pci.c +12 -0
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msi",
+                                          "Bypass MSI interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-no-kvm-msix",
+                                          "Bypass MSIx interrupts. Allows interrupt tracing");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-vendor-id",
+                                          "Set emulated PCI Vendor ID. Allows testing quirks");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-device-id",
+                                          "Set emulated PCI device ID. Allows testing quirks");

"Override PCI Vendor ID with provided value"

s/Vendor/Device/

There are also "sub" versions of these for subsystem Vendor and Device IDs.

None of these are really for quirks, they're more for making devices appear as other devices. For reasons.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3537

Quoted 7 lines
hw/vfio/pci.c +7 -0
+
+    /*
+     * other
+     */
+    object_class_property_set_description(klass, /* 8.1 */
+                                          "vf-token",
+                                          "Add support for VF token among PF and VFs (Linux 5.7+)");

"Specify UUID VF token. Required for VF when PF is owned by another VFIO driver"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3541

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 1.3 */
+                                          "x-intx-mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping when under "
+                                          "INTx interrupts. Improves performance");

Changes performance perhaps. This should also be under debug.

"When EOI is not provided by KVM/QEMU, wait time to re-enable device direct access after INTx"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3544

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 2.3 */
+                                          "x-req",
+                                          "Add device request notification support (Linux 4.0+)");

Also debug.

"Disable device request notification support"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3547

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "x-balloon-allowed",
+                                          "Allow devices to opt-in for ballooning");

Debug.

"Override allowing ballooning with device. (DANGER)"

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3553

Quoted 6 lines
hw/vfio/pci.c +6 -0
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-vendor-id",
+                                          "Set emulated PCI Sub-vendor ID");
+    object_class_property_set_description(klass, /* 2.5 */
+                                          "x-pci-sub-device-id",
+                                          "Set emulated PCI Sub-device ID");

Ah, here they are. Grouping with non-subsystem would make sense to me.

hw/vfio/pci.c static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) · line 3557

Quoted 4 lines
hw/vfio/pci.c +4 -0
+    object_class_property_set_description(klass, /* 2.12 */
+                                          "x-msix-relocation",
+                                          "Allow relocating MSI-X MMIO on systems which page size is larger "
+                                          "than the PCI spec recommendation. Mostly for sPAPR");

Yes, we added it because of systems with >4K pages, but there do exist devices that do not follow the PCI spec recommendation and place non-MSI related registers too close the vector table and pba.

"Specify MSI-X MMIO relocation to the end of specified existing BAR or new BAR to avoid virtualization overhead due to adjacent device registers"

Quoted 9 lines
hw/vfio/pci.c +5 -0
+#ifdef CONFIG_IOMMUFD
+    object_class_property_set_description(klass, /* 9.0 */
+                                          "iommufd",
+                                          "Set host IOMMUFD backend device ");
+#endif
  }
 
  static const TypeInfo vfio_pci_dev_info = {

hw/vfio/pci.c static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) · line 3593

Quoted 6 lines
hw/vfio/pci.c +3 -0
@@ -3461,6 +3588,13 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 
      device_class_set_props(dc, vfio_pci_dev_nohotplug_properties);
      dc->hotpluggable = false;
+    object_class_property_set_description(klass, /* 3.1 */
+                                          "ramfb",
+                                          "Add ramfb support");

"Enable ramfb to provide pre-boot graphics for devices enabling display option"

hw/vfio/pci.c static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data) · line 3596

Quoted 3 lines
hw/vfio/pci.c +3 -0
+    object_class_property_set_description(klass, /* 8.2 */
+                                          "x-ramfb-migrate",
+                                          "Add ramfb migration support");

Debug.

"Override default migration support for ramfb support"

Quoted 15 lines
hw/vfio/pci.c +1 -0
+
  }
 
  static const TypeInfo vfio_pci_nohotplug_dev_info = {
hw/vfio/platform.c +3 -0
index 1070a2113a17edb9ebafb5066e51ee2bc52a767d..8e646e543692221e86b16fecd8bf40316f064a7d 100644
@@ -674,6 +674,29 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data)
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
      /* Supported by TYPE_VIRT_MACHINE */
      dc->user_creatable = true;
+
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "host",

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 689

Quoted 10 lines
hw/vfio/platform.c +10 -0
+                                          "Host device name of assigned device");
+    object_class_property_set_description(klass, /* 2.6 */
+                                          "sysfsdev",
+                                          "Host sysfs path of assigned device");
+    object_class_property_set_description(klass, /* 2.4 and 2.5 */
+                                          "x-no-mmap",
+                                          "Disable MMAP for device. Allows to trace MMIO accesses");
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "mmap-timeout-ms",
+                                          "Timeout value in milliseconds to re-enable BAR mapping");

This is essentially the same as the vfio-pci INTx version, only used when we don't have a mechanism for EOI.

Quoted 8 lines

hw/vfio/platform.c static void vfio_platform_class_init(ObjectClass *klass, void *data) · line 692

Quoted 3 lines
hw/vfio/platform.c +3 -0
+    object_class_property_set_description(klass, /* 2.4 */
+                                          "x-irqfd",
+                                          "Use irqfd for IRQ handling");

Debug. Allow disabling irqfd support.

Maybe rather than trying to group debug options together they should just be explicitly labeled in the description, ex. "[DEBUG]"

I came to the same conclusion. If the property name or description is not clear I will add a label (DEBUG, NVIDIA, etc) and order the properties by QEMU version.

I find the QEMU version in which a property was introduced interesting to save. It's less tedious then digging with "git log -S".

May be should we introduce documentation for properties like the kernel has in Documentation/ABI/*/sysfs-* ?

Thanks,

C.