habanalabs: Add an option to map CB to device MMU
authorTomer Tayar <ttayar@habana.ai>
Thu, 9 Jul 2020 13:17:48 +0000 (16:17 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 22 Sep 2020 15:49:54 +0000 (18:49 +0300)
commitef6a0f6caa4a5dbfbb42b642e23fb06182798d30
treec55f87fb98e6845c184515282f2d169c3e9cb2dc
parentfa8641a14f2841e1712e554ebfa58f1ac7b7db1b
habanalabs: Add an option to map CB to device MMU

There are cases in which the device should access the host memory of a
CB through the device MMU, and thus this memory should be mapped.
The patch adds a flag to the CB IOCTL, in which a user can ask the
driver to perform the mapping when creating a CB.
The mapping is allowed only if a dedicated VA range was allocated for
the specific ASIC.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/command_buffer.c
drivers/misc/habanalabs/common/context.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c
include/uapi/misc/habanalabs.h