drm/amdgpu: Fix discovery offset check under VF
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix discovery offset check under VF
Discovery table may be kept at offset 0 by host driver. Remove the validation check.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
@@ -305,7 +305,7 @@ static int amdgpu_discovery_get_tmr_info(struct amdgpu_device *adev, adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].offset; adev->discovery.size = adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].size_kb <<10 ; -if (!adev->discovery.offset || !adev->discovery.size) +if (!adev->discovery.size)return -EINVAL ; }else { goto out;
Signature · 1 line
2.49.0
AMD General
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Tuesday, May 12, 2026 11:09 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Pan, Ellen <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix discovery offset check under VF
Discovery table may be kept at offset 0 by host driver. Remove the validation check.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
@@ -305,7 +305,7 @@ static int amdgpu_discovery_get_tmr_info(struct amdgpu_device *adev, adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].offset; adev->discovery.size = adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].size_kb <<10 ; -if (!adev->discovery.offset || !adev->discovery.size) +if (!adev->discovery.size)return -EINVAL ; }else { goto out;
--
2.49.0
Quoted 4 lines · Ellen
AMD General
Reviewed-by Ellen Pan <[email protected]>
Thanks for the review.
On a second check, the original issue was introduced with
7055e5157742 ("drm/amdgpu: New interface to get IP discovery binary v3")
Will update the tag before committing the change.
Thanks,
Lijo
Quoted 32 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Tuesday, May 12, 2026 11:09 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Pan, Ellen <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix discovery offset check under VFDiscovery table may be kept at offset 0 by host driver. Remove the validation check.
Fixes b69911681fd5 ("drm/amdgpu: fallback to default discovery offset/size in sriov guest")Signed-off-by Lijo Lazar <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1
-2@@ -305,7 +305,7 @@ static int amdgpu_discovery_get_tmr_info(struct amdgpu_device *adev, adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].offset; adev->discovery.size = adev->virt.crit_regn_tbl[AMD_SRIOV_MSG_IPD_TABLE_ID ].size_kb <<10 ; -if (!adev->discovery.offset || !adev->discovery.size) +if (!adev->discovery.size)return -EINVAL ; }else { goto out; --2.49.0