Am 09.11.2017 um 15:59 schrieb Michel Dänzer:
On 09/11/17 03:49 PM, Christian König wrote:
Similar to the CPU address space the VA on Vega10 has a hole in it.
[...]

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 4710e51099c2..81c34132fbd5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -561,6 +561,17 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
                return -EINVAL;
        }
+ if (args->va_address >= AMDGPU_VA_HOLE_START &&
+           args->va_address < AMDGPU_VA_HOLE_END) {
+               dev_err(&dev->pdev->dev,
+                       "va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
+                       args->va_address, AMDGPU_VA_HOLE_START,
+                       AMDGPU_VA_HOLE_END);
+               return -EINVAL;
+       }
This should probably be dev_dbg instead of dev_err, to prevent buggy (or
malicious) userspace from spamming dmesg.

Good point, and yes we have quite a number of other issues like that one.

Going to fix this in v2 of the patches.

Christian.

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

Reply via email to