habanalabs: allow memory allocations larger than 4GB
authorOded Gabbay <oded.gabbay@gmail.com>
Tue, 26 Feb 2019 22:19:18 +0000 (00:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 15:00:20 +0000 (16:00 +0100)
commit230afe74d139f37ba5e344ad4e53d65911d12188
tree0102fcdc091178a3f2cafe94220bb2dab6cfdc3e
parentc5b9f97ce54dafc1d32080da5015b95cb41eb315
habanalabs: allow memory allocations larger than 4GB

This patch increase the size field in the uapi structure of the Memory
IOCTL from 32-bit to 64-bit. This is to allow the user to allocate and/or
map memory in chunks that are larger then 4GB.

Goya's device memory (DRAM) can be up to 16GB, and for certain
topologies, the user may want an allocation that is larger than 4GB.

This change doesn't break current user-space because there was a "pad"
field in the uapi structure right after the size field. Changing the size
field to be 64-bit and removing the pad field maintains compatibility with
current user-space.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/memory.c
include/uapi/misc/habanalabs.h