]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: don't allow userspace to create a doorbell BO
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Aug 2023 19:03:55 +0000 (15:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Aug 2023 18:48:07 +0000 (14:48 -0400)
We need the domains in amdgpu_drm.h for the kernel driver to manage
the pool, but we don't want userspace using it until the code
is ready.  So reject for now.

Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 693b1fd1191a56c4a4c4f741b4e392f4c49d4484..ca4d2d430e28c8f559ba64be1cf3432a1fe5e289 100644 (file)
@@ -289,6 +289,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
        uint32_t handle, initial_domain;
        int r;
 
+       /* reject DOORBELLs until userspace code to use it is available */
+       if (args->in.domains & AMDGPU_GEM_DOMAIN_DOORBELL)
+               return -EINVAL;
+
        /* reject invalid gem flags */
        if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
                      AMDGPU_GEM_CREATE_NO_CPU_ACCESS |