All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: disable userptr if swiotlb is active
@ 2019-02-20 13:46 Christian König
       [not found] ` <20190220134654.15406-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2019-02-20 13:46 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Otherwise we can't be sure that we won't end up with a bounce buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d21dd2f369da..abc65633119b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -289,6 +289,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 	if (offset_in_page(args->addr | args->size))
 		return -EINVAL;
 
+	/* We can't do this when swiotlb is active */
+	if (adev->needs_swiotlb)
+		return -ENXIO;
+
 	/* reject unknown flag values */
 	if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
 	    AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: disable userptr if swiotlb is active
       [not found] ` <20190220134654.15406-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-20 14:47   ` Deucher, Alexander
  2019-02-20 17:02   ` Kuehling, Felix
  1 sibling, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2019-02-20 14:47 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1618 bytes --]

Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Wednesday, February 20, 2019 8:46 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH] drm/amdgpu: disable userptr if swiotlb is active

Otherwise we can't be sure that we won't end up with a bounce buffer.

Signed-off-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d21dd2f369da..abc65633119b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -289,6 +289,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
         if (offset_in_page(args->addr | args->size))
                 return -EINVAL;

+       /* We can't do this when swiotlb is active */
+       if (adev->needs_swiotlb)
+               return -ENXIO;
+
         /* reject unknown flag values */
         if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
             AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 2998 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: disable userptr if swiotlb is active
       [not found] ` <20190220134654.15406-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2019-02-20 14:47   ` Deucher, Alexander
@ 2019-02-20 17:02   ` Kuehling, Felix
       [not found]     ` <257989f9-7c9c-367b-3529-36b0bf81cfbc-5C7GfCeVMHo@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Kuehling, Felix @ 2019-02-20 17:02 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

I guess we'll need something similar for KFD? I don't think we've ever 
intentionally tested KFD with swiotlb. But I've seen some backtraces 
with swiotlb in them before. I wonder how badly broken it is ...

Regards,
   Felix

On 2019-02-20 8:46 a.m., Christian König wrote:
> Otherwise we can't be sure that we won't end up with a bounce buffer.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index d21dd2f369da..abc65633119b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -289,6 +289,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>   	if (offset_in_page(args->addr | args->size))
>   		return -EINVAL;
>   
> +	/* We can't do this when swiotlb is active */
> +	if (adev->needs_swiotlb)
> +		return -ENXIO;
> +
>   	/* reject unknown flag values */
>   	if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
>   	    AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: disable userptr if swiotlb is active
       [not found]     ` <257989f9-7c9c-367b-3529-36b0bf81cfbc-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-20 17:57       ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2019-02-20 17:57 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Well in the worst case you could end up having a bounce buffer mapped 
instead of the real page.

Christian.

Am 20.02.19 um 18:02 schrieb Kuehling, Felix:
> I guess we'll need something similar for KFD? I don't think we've ever
> intentionally tested KFD with swiotlb. But I've seen some backtraces
> with swiotlb in them before. I wonder how badly broken it is ...
>
> Regards,
>     Felix
>
> On 2019-02-20 8:46 a.m., Christian König wrote:
>> Otherwise we can't be sure that we won't end up with a bounce buffer.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
>>    1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> index d21dd2f369da..abc65633119b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> @@ -289,6 +289,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>>    	if (offset_in_page(args->addr | args->size))
>>    		return -EINVAL;
>>    
>> +	/* We can't do this when swiotlb is active */
>> +	if (adev->needs_swiotlb)
>> +		return -ENXIO;
>> +
>>    	/* reject unknown flag values */
>>    	if (args->flags & ~(AMDGPU_GEM_USERPTR_READONLY |
>>    	    AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_VALIDATE |

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-20 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 13:46 [PATCH] drm/amdgpu: disable userptr if swiotlb is active Christian König
     [not found] ` <20190220134654.15406-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-02-20 14:47   ` Deucher, Alexander
2019-02-20 17:02   ` Kuehling, Felix
     [not found]     ` <257989f9-7c9c-367b-3529-36b0bf81cfbc-5C7GfCeVMHo@public.gmane.org>
2019-02-20 17:57       ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.