Skip to contentSkip to conversation

drm/amdgpu: Fix discovery offset check under VF

PATCH In review Lijo Lazar 2 participants 3 messages May 12 – May 13

Subsystems (2)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

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.

Fixes b69911681fd5 ("drm/amdgpu: fallback to default discovery offset/size in sriov guest")
---
 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
index bbb807a16a50..8e3b6a4050e9 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

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.

Fixes b69911681fd5 ("drm/amdgpu: fallback to default discovery offset/size in sriov guest")
---
 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
index bbb807a16a50..8e3b6a4050e9 100644
@@ -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

#2 lore raw
Quoted 4 lines · Ellen

AMD General

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 VF

Discovery 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")
---
  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
index bbb807a16a50..8e3b6a4050e9 100644
@@ -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