Skip to contentSkip to conversation

drm/amdgpu: Take IOMMU remapping into account for p2p checks

PATCH Superseded Rahul Jain 1 participant 1 message Aug 14, 2024

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Rahul Jain

author
#0 lore raw

PATCH v2 1/1 drm/amdgpu: Take IOMMU remapping into account for p2p checks

when trying to enable p2p the amdgpu_device_is_peer_accessible() checks the condition where address_mask overlaps the aper_base and hence returns 0, due to which the p2p disables for this platform

IOMMU should remap the BAR addresses so the device can access them. Hence check if iommu_remap and return true.

v2: (Alex)
- Fix as per review comments
- add new function amdgpu_device_check_iommu_remap to check if iommu remap

---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 46 +++++++++++++++++++---
 2 files changed, 42 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 -0
index f3980b40f2ce..618b44f5df85 100644
@@ -1138,6 +1138,8 @@ struct amdgpu_device {
 
 	bool				ram_is_direct_mapped;
 
+	bool                            iommu_remap;
+
 	struct list_head                ras_list;
 
 	struct ip_discovery_top         *ip_top;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +40 -6

65 lines not on this page · raw message

Signature · 1 line
2.34.1