<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Reviewed-by: oak zeng <oak.zeng@amd.com><br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
<div id="ms-outlook-mobile-signature">
<div><br>
</div>
Get <a href="https://aka.ms/AAb9ysg">Outlook for Android</a></div>
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Felix Kuehling <felix.kuehling@amd.com><br>
<b>Sent:</b> Friday, May 21, 2021 9:47:17 AM<br>
<b>To:</b> Christian König <ckoenig.leichtzumerken@gmail.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH v2 3/3] drm/amdgpu: Workaround IOMMU driver bug</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 2021-05-21 um 4:41 a.m. schrieb Christian König:<br>
> Am 21.05.21 um 04:22 schrieb Felix Kuehling:<br>
>> The intel IOMMU driver causes kernel oopses or internal errors flooding<br>
>> kernel log when mapping larger SG tables. Limiting the size of<br>
>> userptr BOs<br>
>> to 6GB seems to avoid this.<br>
>><br>
>> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
><br>
> CC whoever is the maintainer of the Intel IOMMU driver?<br>
><br>
> Would be nice to have that bug fixed instead.<br>
<br>
Yeah, I'm not ready to submit this hack. I want to run some more<br>
experiments to see what's going on.<br>
<br>
Regards,<br>
  Felix<br>
<br>
<br>
><br>
> Christian.<br>
><br>
>> ---<br>
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++<br>
>>   1 file changed, 3 insertions(+)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>> index 2b8b89535198..3becf9d9f8fd 100644<br>
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>> @@ -1409,6 +1409,9 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(<br>
>>           domain = alloc_domain = AMDGPU_GEM_DOMAIN_GTT;<br>
>>           alloc_flags = 0;<br>
>>       } else if (flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {<br>
>> +        /* workaround IOMMU driver bug */<br>
>> +        if (size >= (6ULL << 30))<br>
>> +            return -ENOMEM;<br>
>>           domain = AMDGPU_GEM_DOMAIN_GTT;<br>
>>           alloc_domain = AMDGPU_GEM_DOMAIN_CPU;<br>
>>           alloc_flags = AMDGPU_GEM_CREATE_PREEMPTIBLE;<br>
><br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7C123862fb48234bfa897008d91c5ef74d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637572016476523870%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2HM3hcsYI7i5LWoaiyOUlWLvUHAhCdudGsBrpT7E73Y%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7C123862fb48234bfa897008d91c5ef74d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637572016476523870%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2HM3hcsYI7i5LWoaiyOUlWLvUHAhCdudGsBrpT7E73Y%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>