Re: [PATCH] iommu/amd: add amd_iommu=relax_unity option for VFIO passthrough
From: Vasant Hegde
Date: Mon Mar 30 2026 - 06:09:47 EST
Hi Christos,
On 3/29/2026 3:02 AM, Christos Longros wrote:
> On some AMD motherboards (Gigabyte B650 Gaming X AX V2, X870E and
> others), VFIO passthrough of any PCI device fails with:
>
> "Firmware has requested this device have a 1:1 IOMMU mapping,
> rejecting configuring the device without a 1:1 mapping."
>
> These boards' IVRS tables include IVMD type 0x22 (range) entries
> spanning wide device ranges (e.g. devid 0x0000 to 0x0FFF, covering
> PCI buses 0-15). The entries exist for platform devices like IOAPIC
> and HPET, but they get applied to nearly every IOMMU group on the
> system. Since commit a48ce36e2786 ("iommu: Prevent RESV_DIRECT
> devices from blocking domains"), any device with IOMMU_RESV_DIRECT
> regions has require_direct=1 set, which prevents VFIO from claiming
> DMA ownership.
I don't have client system handy to verify. Do you have acpi dump?
I want to see IVMD flags are set.
>
> No PCI device can be passed through on affected boards -- not just
> the platform devices that need the identity mappings, but also
> endpoint devices like network adapters and GPUs.
>
> Intel handles a similar firmware over-specification with
> device_rmrr_is_relaxable(), which marks certain RMRR entries as
> IOMMU_RESV_DIRECT_RELAXABLE so VFIO can claim them. AMD has no
> equivalent.
May be we can do similar for pci devices instead of command line option?
-Vasant