OpenCloudOS-Kernel/drivers/gpu/host1x
Thierry Reding 961e3beae3 drm/tegra: Make job submission 64-bit safe
Job submission currently relies on the fact that struct drm_tegra_reloc
and struct host1x_reloc are the same size and uses a simple call to the
copy_from_user() function to copy them to kernel space. This causes the
handle to be stored in the buffer object field, which then needs a cast
to a 32 bit integer to resolve it to a proper buffer object pointer and
store it back in the buffer object field.

On 64-bit architectures that will no longer work, since pointers are 64
bits wide whereas handles will remain 32 bits. This causes the sizes of
both structures to because different and copying will no longer work.

Fix this by adding a new function, host1x_reloc_get_user(), that copies
the structures field by field.

While at it, use substructures for the command and target buffers in
struct host1x_reloc for better readability. Also use unsized types to
make it more obvious that this isn't part of userspace ABI.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-08-04 10:07:36 +02:00
..
hw gpu: host1x: handle the correct # of syncpt regs 2014-04-16 17:11:04 +02:00
Kconfig gpu: host1x: Increase compile test coverage 2013-12-19 09:29:51 +01:00
Makefile gpu: host1x: Add Tegra124 support 2013-12-19 09:29:52 +01:00
bus.c gpu: host1x: Rename internal functions for clarity 2014-06-05 23:10:30 +02:00
bus.h drm/tegra: Move subdevice infrastructure to host1x 2013-10-31 09:55:33 +01:00
cdma.c gpu: host1x: Expose syncpt and channel functionality 2013-10-31 09:20:11 +01:00
cdma.h gpu: host1x: Add channel support 2013-04-22 12:32:43 +02:00
channel.c gpu: host1x: Export public API 2013-12-19 09:29:50 +01:00
channel.h gpu: host1x: Expose syncpt and channel functionality 2013-10-31 09:20:11 +01:00
debug.c gpu: host1x: Fix build warnings 2013-12-19 09:29:52 +01:00
debug.h gpu: host1x: Add debug support 2013-04-22 12:32:46 +02:00
dev.c gpu: host1x: Add Tegra124 support 2013-12-19 09:29:52 +01:00
dev.h gpu: host1x: Add MIPI pad calibration support 2013-12-19 09:29:43 +01:00
intr.c gpu: host1x: Add channel support 2013-04-22 12:32:43 +02:00
intr.h gpu: host1x: Add channel support 2013-04-22 12:32:43 +02:00
job.c drm/tegra: Make job submission 64-bit safe 2014-08-04 10:07:36 +02:00
job.h gpu: host1x: Expose syncpt and channel functionality 2013-10-31 09:20:11 +01:00
mipi.c gpu: host1x: Fix more sparse warnings 2013-12-19 09:29:51 +01:00
syncpt.c gpu: host1x: export host1x_syncpt_incr_max() function 2014-04-04 09:12:49 +02:00
syncpt.h gpu: host1x: Add syncpoint base support 2013-10-31 09:55:48 +01:00