]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon/kms: r600/r700 command stream checker
authorJerome Glisse <jglisse@redhat.com>
Wed, 10 Feb 2010 22:30:05 +0000 (22:30 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 11 Feb 2010 09:03:45 +0000 (19:03 +1000)
commite5dc673cff16f1c7e5fe5f3d29c6205ae6ca8074
tree14ec50b2d934c3dafac313b5adf53df1e32be107
parent93630c63158d9bab20cc7dca091e2d01fd2e1113
drm/radeon/kms: r600/r700 command stream checker

This patch add cs checker to r600/r700 hw. Command stream checking
will rewrite some of the cs value in order to restrict GPU access
to BO size. This doesn't break old userspace but just enforce safe
value. It should break any things that was using the r600/r700 cs
ioctl to do forbidden things (malicious software), though we are
not aware of such things.

Here is the list of thing we check :
- enforcing resource size
- enforcing color buffer slice tile max, will restrict cb access
- enforcing db buffer slice tile max, will restrict db access

We don't check for shader bigger than the BO in which they are
supposed to be, such use would lead to GPU lockup and is harmless
from security POV, as far as we can tell (note that even checking
for this wouldn't prevent someone to write bogus shader that lead
to lockup).

This patch has received as much testing as humanly possible with
old userspace to check that it didn't break such configuration.
However not all the applications out there were tested, thus it
might broke some odd, rare applications.

[airlied: fix rules for cs checker for parallel builds]

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/Makefile
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_cp.c
drivers/gpu/drm/radeon/r600_cs.c
drivers/gpu/drm/radeon/r600d.h
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_drv.h
drivers/gpu/drm/radeon/reg_srcs/r600 [new file with mode: 0644]
drivers/gpu/drm/radeon/rv770.c