On 8/30/26 22:51, Mario Limonciello wrote:
Add support for the AMD IOMMU Performance Optimization (PerfOpt)
feature as defined in the AMD I/O Virtualization Technology (IOMMU)
Specification, Section 3.4.9 (MMIO Offset 016Ch).
This feature allows privileged integrated I/O devices (GPUs) to bypass
the IOMMU when directly accessing system memory. The IOMMU only
enforces the IR/IW permission bits without GPA->SPA translations.
Drivers will opt into this behavior, and enable amdgpu to turn this
feature on when an integrated GPU is already in identity mode.
If a user prefers to keep it always off (even with identity mode)
there is also a module parameter to force it off.
Mario Limonciello (2):
iommu/amd: Add PerfOpt IOMMU performance optimization support
drm/amdgpu: Enable PerfOpt IOMMU perf optimization when GPU in
identity domain
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 41 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 ++
drivers/iommu/amd/amd_iommu.h | 3 +
drivers/iommu/amd/amd_iommu_types.h | 7 +
drivers/iommu/amd/init.c | 43 +++++
drivers/iommu/amd/iommu.c | 214 +++++++++++++++++++++
include/linux/amd-iommu.h | 11 ++
8 files changed, 332 insertions(+)
Hi Mario,
The Legion Go 2 has a significant performance degradation when IOMMU is
ON and VRAM is set to auto in the BIOS. I applied these to linux-next
and compared to 7.2 neptune on the Legion Go 2 and got the following
results:
Game: Avowed
With patches:
Go 2| Vram: 2GB, IOMMU: Off, FPS: 35-40, Frame Time: consistent
Go 2| Vram: 2GB, IOMMU: On, FPS: 35-40, Frame Time: consistent
Go 2| Vram: Auto, IOMMU: Off, FPS: 35-40, Frame Time: consistent
Go 2| Vram: Auto, IOMMU: On, FPS: 35-40, Frame Time: consistent
Without Patches:
Go 2| Vram: 2GB, IOMMU: Off, FPS: 35-40, Frame Time: consistent
Go 2| Vram: 2GB, IOMMU: On, FPS: 35-40, Frame Time: consistent
Go 2| Vram: Auto, IOMMU: Off, FPS: 35-40, Frame Time: consistent
Go 2| Vram: Auto, IOMMU: On, FPS: 20, Frame Time: inconsistent
Overall, this seems to fix the performance issue with IOMMU when BIOS is
in the factory default setting.
Tested-by: Derek J. Clark <[email protected]>