Skip to content

hw/arm/smmuv3-accel: Use shared system address space#25

Open
mmhonap wants to merge 1 commit into
NVIDIA:nvidia_unstable-10.1from
mmhonap:msi_as_fix
Open

hw/arm/smmuv3-accel: Use shared system address space#25
mmhonap wants to merge 1 commit into
NVIDIA:nvidia_unstable-10.1from
mmhonap:msi_as_fix

Conversation

@mmhonap

@mmhonap mmhonap commented Jun 16, 2026

Copy link
Copy Markdown

Commit a509f10 reverted using get_msi_address_space() callback for MSI address space in kvm_arch_fixup_msi_route() and switched back to pci_device_iommu_address_space(). Previous commits ensures that if there is an IOMMU address space present it uses it will use msi_direct_gpa() directly to retrive the MSI GPA.

However, in this unstable-10.1 branch, get_address_space() callback returns system "address_space_memory" for vfio-pci devices which will force kvm_arch_fixup_msi_route() to return early without actually retriveing the MSI GPA.

The accel SMMMUv3 design has changed when we introduced msi_direct_gpa() and makes use of a shared_as_sysmem instead of address_space_memory. This will make sure that a proper MSI GPA will be returned in the above case. Please see upstream commit: 7d79312 ("hw/arm/smmuv3-accel: Initialize shared system address space").

Also, sharing a single system AddressSpace ensures that all devices behind accelerated SMMUv3s use the same system address space pointer.

Hence, backport the shared_as_sysmem related changes.

[Shameer: Backport based on upstream commit 7d79312]
Fixes: a509f10 ("Revert hw/pci/pci: Introduce optional get_msi_address_space() callback")

@nvmochs

nvmochs commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

@mmhonap

nit: In the commit message, Backoprt -> Backport

Other than that, I think this looks good.

Commit a509f10 reverted using get_msi_address_space() callback for
MSI address space in kvm_arch_fixup_msi_route() and switched back to
pci_device_iommu_address_space(). Previous commits ensures that if there
is an IOMMU address space present it uses it will use msi_direct_gpa()
directly to retrive the MSI GPA.

However, in this unstable-10.1 branch, get_address_space() callback
returns system "address_space_memory" for vfio-pci devices which
will force kvm_arch_fixup_msi_route() to return early without
actually retriveing the MSI GPA.

The accel SMMMUv3 design has changed when we introduced msi_direct_gpa()
and makes use of a shared_as_sysmem instead of address_space_memory.
This will make sure that a proper MSI GPA will be returned in the
above case. Please see upstream commit: 7d79312 ("hw/arm/smmuv3-accel:
Initialize shared system address space").

Also, sharing a single system AddressSpace ensures that all devices behind
accelerated SMMUv3s use the same system address space pointer.

Hence, backport the shared_as_sysmem related changes.

[Shameer: Backport based on upstream commit 7d79312]
Fixes: a509f10 ("Revert hw/pci/pci: Introduce optional get_msi_address_space() callback")
Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>
Signed-off-by: Manish Honap <mhonap@nvidia.com>
@mmhonap

mmhonap commented Jun 17, 2026

Copy link
Copy Markdown
Author

Updated the commit message.

@shamiali2008

Copy link
Copy Markdown

This is fine with me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants