mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 09:40:27 +02:00
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>
This commit is contained in:
parent
4bfa860993
commit
1ed511fb76
1 changed files with 7 additions and 0 deletions
|
|
@ -219,10 +219,17 @@ static int amdgpu_check_address_validity(struct amdgpu_device *adev,
|
|||
struct amdgpu_vram_block_info blk_info;
|
||||
uint64_t page_pfns[32] = {0};
|
||||
int i, ret, count;
|
||||
bool hit = false;
|
||||
|
||||
if (amdgpu_ip_version(adev, UMC_HWIP, 0) < IP_VERSION(12, 0, 0))
|
||||
return 0;
|
||||
|
||||
if (amdgpu_sriov_vf(adev)) {
|
||||
if (amdgpu_virt_check_vf_critical_region(adev, address, &hit))
|
||||
return -EPERM;
|
||||
return hit ? -EACCES : 0;
|
||||
}
|
||||
|
||||
if ((address >= adev->gmc.mc_vram_size) ||
|
||||
(address >= RAS_UMC_INJECT_ADDR_LIMIT))
|
||||
return -EFAULT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue