QEMU Software Patches and Configurations#
QEMU Patches#
This section provides information about the QEMU patches that support I/O virtualization on the Grace platform.
Upstream QEMU#
The tables in this section list QEMU patches that are upstream, which means that the patches are accepted into the main QEMU branch.
Note
There might be circumstances where additional, dependent patches are required to support the patches in these tables (for example, when the patch listed is part of a larger series). There might also be situations where not all of the patches in the series were taken upstream. These patches will be documented in a future mailing list discussion.
The LKML discussion and Git description are pulled directly from their respective source and are intended to help with searches and comparisons. These strings might contain spelling and grammatical errors.
QEMU I/O Virtualization: GPU Passthrough#
The following table contains patches that are required for QEMU GPU virtualization support, which includes GPU passthrough and vGPU, on the Grace platform. GPU passthrough also requires the following core SMMU virtualization patches.
QEMU-Devel ML Discussion |
Git Commit |
Git Description |
Minimum QEMU Release |
|---|---|---|---|
qom: new object to associate device to NUMA node |
v9.0 |
||
hw/acpi: Implement the SRAT GI affinity structure |
|||
hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle. |
v9.2 |
||
hw/arm/virt: Support larger highmem MMIO regions |
v10.0 |
QEMU I/O Virtualization: Core SMMU#
The following table contains patches that are required for QEMU SMMU virtualization support (SMMUv3 and IOMMUFD) on the Grace platform.
QEMU-Devel ML Discussion |
Git Commit |
Git Description |
Minimum QEMU Release |
|---|---|---|---|
scripts/update-linux-headers: Add iommufd.h |
v8.2.0 |
||
linux-headers: Add iommufd.h |
|||
vfio/common: Move IOMMU agnostic helpers to a separate file |
|||
vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any |
|||
vfio/common: Introduce vfio_container_add|del_section_window() |
|||
vfio/common: Extract out vfio_kvm_device_[add/del]_fd |
|||
vfio/pci: Introduce vfio_[attach/detach]_device |
|||
vfio/platform: Use vfio_[attach/detach]_device |
|||
vfio/ap: Use vfio_[attach/detach]_device |
|||
vfio/ccw: Use vfio_[attach/detach]_device |
|||
vfio/common: Move VFIO reset handler registration to a group agnostic function |
|||
vfio/common: Introduce a per container device list |
|||
vfio/common: Store the parent container in VFIODevice |
|||
vfio/common: Introduce a global VFIODevice list |
|||
vfio/common: Move legacy VFIO backend code into separate container.c |
|||
backends/iommufd: Introduce the iommufd object |
v9.0 |
||
util/char_dev: Add open_cdev() |
|||
vfio/common: return early if space isn’t empty |
|||
vfio/iommufd: Implement the iommufd backend |
|||
vfio/iommufd: Relax assert check for iommufd backend |
|||
vfio/iommufd: Add support for iova_ranges and pgsizes |
|||
vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info |
|||
vfio/pci: Introduce a vfio pci hot reset interface |
|||
vfio/iommufd: Enable pci hot reset through iommufd cdev interface |
|||
vfio/pci: Allow the selection of a given iommu backend |
|||
vfio/pci: Make vfio cdev pre-openable by passing a file handle |
|||
vfio/platform: Allow the selection of a given iommu backend |
|||
vfio/platform: Make vfio cdev pre-openable by passing a file handle |
|||
vfio/ap: Allow the selection of a given iommu backend |
|||
vfio/ap: Make vfio cdev pre-openable by passing a file handle |
|||
vfio/ccw: Allow the selection of a given iommu backend |
|||
vfio/ccw: Make vfio cdev pre-openable by passing a file handle |
|||
vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks |
|||
hw/arm: Activate IOMMUFD for virt machines |
|||
kconfig: Activate IOMMUFD for s390x machines |
|||
hw/i386: Activate IOMMUFD for q35 machines |
|||
vfio/pci: Move VFIODevice initializations in vfio_instance_init |
|||
vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init |
|||
vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init |
|||
vfio/ccw: Move VFIODevice initializations in vfio_ccw_instance_init |
|||
vfio: Introduce a helper function to initialize VFIODevice |
|||
docs/devel: Add VFIO iommufd backend documentation |
|||
backends: Introduce HostIOMMUDevice abstract |
v9.1 |
||
backends/host_iommu_device: Introduce HostIOMMUDeviceCaps |
|||
vfio/container: Introduce TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO device |
|||
backends/iommufd: Introduce TYPE_HOST_IOMMU_DEVICE_IOMMUFD[_VFIO] devices |
|||
range: Introduce range_get_last_bit() |
|||
vfio/container: Implement HostIOMMUDeviceClass::realize() handler |
|||
backends/iommufd: Introduce helper function iommufd_backend_get_device_info() |
|||
vfio/iommufd: Implement HostIOMMUDeviceClass::realize() handler |
|||
vfio/container: Implement HostIOMMUDeviceClass::get_cap() handler |
|||
backends/iommufd: Implement HostIOMMUDeviceClass::get_cap() handler |
|||
vfio: Create host IOMMU device instance |
|||
hw/pci: Introduce helper function pci_device_get_iommu_bus_devfn() |
|||
hw/pci: Introduce pci_device_[set|unset]_iommu_device() |
|||
vfio/pci: Pass HostIOMMUDevice to vIOMMU |
|||
intel_iommu: Extract out vtd_cap_init() to initialize cap/ecap |
|||
intel_iommu: Implement [set|unset]_iommu_device() callbacks |
|||
intel_iommu: Check compatibility with host IOMMU capabilities |
|||
intel_iommu: Use the latest fault reasons defined by spec |
v10.0 |
||
intel_iommu: Make pasid entry type check accurate |
|||
intel_iommu: Add a placeholder variable for scalable mode stage-1 translation |
|||
intel_iommu: Flush stage-2 cache in PASID-selective PASID-based iotlb invalidation |
|||
intel_iommu: Rename slpte to pte |
|||
intel_iommu: Implement stage-1 translation |
|||
intel_iommu: Check if the input address is canonical |
|||
intel_iommu: Check stage-1 translation result with interrupt range |
|||
intel_iommu: Set accessed and dirty bits during stage-1 translation |
|||
intel_iommu: Flush stage-1 cache in iotlb invalidation |
|||
intel_iommu: Process PASID-based iotlb invalidation |
|||
intel_iommu: Add an internal API to find an address space with PASID |
|||
intel_iommu: Add support for PASID-based device IOTLB invalidation |
|||
intel_iommu: piotlb invalidation should notify unmap |
|||
tests/acpi: q35: allow DMAR acpi table changes |
|||
intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2 |
|||
tests/acpi: q35: Update host address width in DMAR |
|||
intel_iommu: Introduce a property x-flts for stage-1 translation |
|||
intel_iommu: Introduce a property to control FS1GP cap bit setting |
|||
tests/qtest: Add intel-iommu test |
|||
backends/iommufd: Add a helper to invalidate user-managed HWPT |
v10.1 |
||
vfio/iommufd: Add properties and handlers to TYPE_HOST_IOMMU_DEVICE_IOMMUFD |
|||
vfio/iommufd: Implement [at|de]tach_hwpt handlers |
|||
vfio/iommufd: Save vendor specific device info |
|||
pcie: Add helper to declare PASID capability for a pcie device |
|||
pcie: Helper functions to check if PASID is enabled |
|||
pcie: Helper function to check if ATS is enabled |
|||
pcie: Add a helper to declare the PRI capability for a pcie device |
|||
pcie: Helper functions to check to check if PRI is enabled |
|||
pci: Cache the bus mastering status in the device |
|||
pci: Add an API to get IOMMU’s min page size and virtual address width |
|||
memory: Store user data pointer in the IOMMU notifiers |
|||
pci: Add a pci-level initialization function for IOMMU notifiers |
|||
pci: Add a pci-level API for ATS |
|||
pci: Add a PCI-level API for PRI |
|||
hw/arm/virt-acpi-build: Don’t create ITS id mappings by default |
|||
hw/arm/smmu-common: Check SMMU has PCIe Root Complex association |
v10.2 |
||
hw/arm/virt-acpi-build: Re-arrange SMMUv3 IORT build |
|||
hw/arm/virt-acpi-build: Update IORT for multiple smmuv3 devices |
|||
hw/arm/virt: Factor out common SMMUV3 dt bindings code |
|||
hw/arm/virt: Add an SMMU_IO_LEN macro |
|||
hw/pci: Introduce pci_setup_iommu_per_bus() for per-bus IOMMU ops retrieval |
|||
hw/arm/virt: Allow user-creatable SMMUv3 dev instantiation |
|||
qemu-options.hx: Document the arm-smmuv3 device |
|||
bios-tables-test: Allow for smmuv3 test data. |
|||
qtest/bios-tables-test: Add tests for legacy smmuv3 and smmuv3 device |
|||
qtest/bios-tables-test: Update tables for smmuv3 tests |
|||
tests/qtest/bios-tables-test: Prepare for _DSM change in the DSDT table |
|||
hw/pci-host/gpex-acpi: Fix _DSM function 0 support return value |
|||
tests/qtest/bios-tables-test: Update DSDT blobs after GPEX _DSM change |
|||
backends/iommufd: Introduce iommufd_backend_alloc_viommu |
v11.0 |
||
backends/iommufd: Introduce iommufd_backend_alloc_vdev |
|||
hw/arm/smmu-common: Factor out common helper functions and export |
|||
hw/arm/smmu-common: Make iommu ops part of SMMUState |
|||
hw/arm/smmuv3-accel: Introduce smmuv3 accel device |
|||
hw/arm/smmuv3-accel: Initialize shared system address space |
|||
hw/pci/pci: Move pci_init_bus_master() after adding device to bus |
|||
hw/pci/pci: Add optional supports_address_space() callback |
|||
hw/pci-bridge/pci_expander_bridge: Move TYPE_PXB_PCIE_DEV to header |
|||
hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd |
|||
hw/arm/smmuv3: Implement get_viommu_cap() callback |
|||
hw/arm/smmuv3-accel: Add set/unset_iommu_device callback |
|||
hw/arm/smmuv3: propagate smmuv3_cmdq_consume() errors to caller |
|||
hw/arm/smmuv3-accel: Add nested vSTE install/uninstall support |
|||
hw/arm/smmuv3-accel: Install SMMUv3 GBPA based hwpt |
|||
hw/pci/pci: Introduce a callback to retrieve the MSI doorbell GPA directly |
|||
hw/arm/smmuv3-accel: Implement get_msi_direct_gpa callback |
|||
hw/arm/virt: Set msi-gpa property |
|||
hw/arm/smmuv3-accel: Add support to issue invalidation cmd to host |
|||
hw/arm/smmuv3: Initialize ID registers early during realize() |
|||
hw/arm/smmuv3-accel: Get host SMMUv3 hw info and validate |
|||
hw/pci-host/gpex: Allow to generate preserve boot config DSM #5 |
|||
hw/arm/virt: Set PCI preserve_config for accel SMMUv3 |
|||
tests/qtest/bios-tables-test: Prepare for IORT revison upgrade |
|||
hw/arm/virt-acpi-build: Add IORT RMR regions to handle MSI nested binding |
|||
tests/qtest/bios-tables-test: Update IORT blobs after revision upgrade |
|||
hw/arm/smmuv3: Block migration when accel is enabled |
|||
hw/arm/smmuv3: Add accel property for SMMUv3 device |
|||
hw/arm/smmuv3-accel: Add a property to specify RIL support |
|||
hw/arm/smmuv3-accel: Add support for ATS |
|||
hw/arm/smmuv3-accel: Add property to specify OAS bits |
|||
backends/iommufd: Retrieve PASID width from iommufd_backend_get_device_info() |
|||
backends/iommufd: Add get_pasid_info() callback |
|||
hw/pci: Add helper to insert PCIe extended capability at a fixed offset |
|||
hw/pci: Factor out common PASID capability initialization |
|||
hw/vfio/pci: Synthesize PASID capability for vfio-pci devices |
|||
hw/arm/smmuv3-accel: Make SubstreamID support configurable |
|||
linux-headers: Update to Linux v6.19-rc1 |
|||
hw/vfio: Add helper to retrieve device feature |
|||
hw/vfio/region: Create dmabuf for PCI BAR per region |
|||
hw/vfio: sort and validate sparse mmap regions by offset |
|||
vfio: Add Error ** parameter to vfio_region_setup() |
|||
hw/vfio: align mmap to power-of-2 of region size for hugepfnmap |
|||
hw/arm/smmuv3-accel: Check ATS compatibility between host and guest |
|||
hw/arm/smmuv3-accel: Change “ats” property type to OnOffAuto |
|||
hw/arm/smmuv3-accel: Change “ril” property type to OnOffAuto |
|||
qdev: Add a SsidSizeMode property type |
|||
hw/arm/smmuv3-accel: Change “ssidsize” property type to SsidSizeMode |
|||
qdev: Add an OasMode property type |
|||
hw/arm/smmuv3-accel: Change “oas” property type to OasMode |
|||
qemu-options.hx: Document arm-smmuv3 device’s accel properties |
QEMU I/O Virtualization: vEVENTQ#
The following table contains patches that are required for QEMU vEVENTQ support on the Grace platform.
QEMU-Devel ML Discussion |
Git Commit |
Git Description |
Minimum QEMU Release |
|---|---|---|---|
backends/iommufd: Introduce iommufd_backend_alloc_veventq |
v11.0 |
||
hw/arm/smmuv3-accel: Add viommu free helper |
|||
hw/arm/smmuv3-accel: Allocate vEVENTQ for accelerated SMMUv3 devices |
|||
hw/arm/smmuv3: Introduce a helper function for event propagation |
|||
hw/arm/smmuv3-accel: Read and propagate host vIOMMU events |
QEMU Workarounds#
The following tables provide information about the QEMU patches that are required to resolve known issues, and these patches are not upstream.
QEMU I/O Virtualization: Workarounds#
The following table contains patches that resolve known issues and enable functions that are required for GPU virtualization support on the Grace platform.
Git Commit |
Git Description |
Impact |
|---|---|---|
NVIDIA: SAUCE: hw/acpi/pci.c: preserve generic initiator insertion order |
Fixes non-deterministic ordering of generic initiator entries in the VM’s SRAT table, ensuring NUMA proximity domains appear in command-line order. |
|
NVIDIA: SAUCE: Reset gpu_id each time building DSDT |
Fixes an assertion failure when building ACPI DSDT tables on systems with multiple GPUs, caused by the gpu_id counter exceeding valid ACPI segment name bounds. |