drm/vmwgfx: Make the object handles idr-generated
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 26 Sep 2018 13:50:13 +0000 (15:50 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 27 Sep 2018 14:14:18 +0000 (16:14 +0200)
commitc7eae62666ade1c8c9960085911e420227144d5a
tree0013d1212a78270d4d112911ace94bdcbfe1a3bf
parentb1d05b4fc6b8f2bf5d802cb08c87d96802c4c7ba
drm/vmwgfx: Make the object handles idr-generated

Instead of generating user-space object handles based on a, possibly
processed, hash of the kernel address of the object, use idr to generate
and lookup those handles. This might improve somewhat on security since
we loose all connections to the object's kernel address. Also idr is
designed to do just this.

As a todo-item, since user-space handles are now generated in sequence,
we can probably use a much simpler hash function to hash them.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
drivers/gpu/drm/vmwgfx/ttm_lock.c
drivers/gpu/drm/vmwgfx/ttm_object.c
drivers/gpu/drm/vmwgfx/ttm_object.h
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
drivers/gpu/drm/vmwgfx/vmwgfx_context.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c