Skip to content

Commit 1ed511f

Browse files
Xiang Liualexdeucher
authored andcommitted
drm/amdgpu: Check VF critical region before RAS poison injection
Check VF critical region before RAS poison injection to ensure that the poison injection will not hit the VF critical region. Signed-off-by: Xiang Liu <xiang.liu@amd.com> Reviewed-by: Shravan Kumar Gande <Shravankumar.Gande@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 4bfa860 commit 1ed511f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,17 @@ static int amdgpu_check_address_validity(struct amdgpu_device *adev,
219219
struct amdgpu_vram_block_info blk_info;
220220
uint64_t page_pfns[32] = {0};
221221
int i, ret, count;
222+
bool hit = false;
222223

223224
if (amdgpu_ip_version(adev, UMC_HWIP, 0) < IP_VERSION(12, 0, 0))
224225
return 0;
225226

227+
if (amdgpu_sriov_vf(adev)) {
228+
if (amdgpu_virt_check_vf_critical_region(adev, address, &hit))
229+
return -EPERM;
230+
return hit ? -EACCES : 0;
231+
}
232+
226233
if ((address >= adev->gmc.mc_vram_size) ||
227234
(address >= RAS_UMC_INJECT_ADDR_LIMIT))
228235
return -EFAULT;

0 commit comments

Comments
 (0)