Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/ras: Handle check address validity in SR-IOV

Handle check address validity command in SR-IOV
guest.

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jinzhou Su and committed by
Alex Deucher
9eaaae4c f0f23c31

+19 -7
+19 -7
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 42 42 #include "amdgpu_reset.h" 43 43 #include "amdgpu_psp.h" 44 44 #include "amdgpu_ras_mgr.h" 45 + #include "amdgpu_virt_ras_cmd.h" 45 46 46 47 #ifdef CONFIG_X86_MCE_AMD 47 48 #include <asm/mce.h> ··· 229 228 return 0; 230 229 231 230 if (amdgpu_sriov_vf(adev)) { 232 - if (amdgpu_virt_check_vf_critical_region(adev, address, &hit)) 233 - return -EPERM; 234 - return hit ? -EACCES : 0; 231 + if (amdgpu_uniras_enabled(adev)) { 232 + if (amdgpu_virt_ras_check_address_validity(adev, address, &hit)) 233 + return -EPERM; 234 + if (hit) 235 + return -EACCES; 236 + } else { 237 + if (amdgpu_virt_check_vf_critical_region(adev, address, &hit)) 238 + return -EPERM; 239 + return hit ? -EACCES : 0; 240 + } 235 241 } 236 242 237 243 if ((address >= adev->gmc.mc_vram_size) || 238 244 (address >= RAS_UMC_INJECT_ADDR_LIMIT)) 239 245 return -EFAULT; 240 246 241 - if (amdgpu_uniras_enabled(adev)) 242 - count = amdgpu_ras_mgr_lookup_bad_pages_in_a_row(adev, address, 243 - page_pfns, ARRAY_SIZE(page_pfns)); 244 - else 247 + if (amdgpu_uniras_enabled(adev)) { 248 + if (amdgpu_sriov_vf(adev)) 249 + count = amdgpu_virt_ras_convert_retired_address(adev, address, 250 + page_pfns, ARRAY_SIZE(page_pfns)); 251 + else 252 + count = amdgpu_ras_mgr_lookup_bad_pages_in_a_row(adev, address, 253 + page_pfns, ARRAY_SIZE(page_pfns)); 254 + } else 245 255 count = amdgpu_umc_lookup_bad_pages_in_a_row(adev, 246 256 address, page_pfns, ARRAY_SIZE(page_pfns)); 247 257