diff options
author | Christian König <christian.koenig@amd.com> | 2014-07-22 11:42:20 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-08-05 08:53:37 -0400 |
commit | 33fa9fe3ddae48c552bce1ab33db0f2f49eb81ea (patch) | |
tree | ecfdfa5363402fead55ca0c4ef2c7a1195312de4 | |
parent | ed5cb43f8f68508c7c025b77bfd6a8aa81cd531e (diff) |
drm/radeon: fix R600_PTE_GART handling
That didn't worked correctly any more and opened up a security problem.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/cik_sdma.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si_dma.c | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index 4b2ab769cd99..d629cea865f2 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c | |||
@@ -771,8 +771,7 @@ void cik_sdma_vm_set_page(struct radeon_device *rdev, | |||
771 | 771 | ||
772 | trace_radeon_vm_set_page(pe, addr, count, incr, flags); | 772 | trace_radeon_vm_set_page(pe, addr, count, incr, flags); |
773 | 773 | ||
774 | /* XXX: How to distinguish between GART and other system memory pages? */ | 774 | if ((flags & R600_PTE_GART_MASK) == R600_PTE_GART_MASK) { |
775 | if (flags & R600_PTE_SYSTEM) { | ||
776 | uint64_t src = rdev->gart.table_addr + (addr >> 12) * 8; | 775 | uint64_t src = rdev->gart.table_addr + (addr >> 12) * 8; |
777 | while (count) { | 776 | while (count) { |
778 | unsigned bytes = count * 8; | 777 | unsigned bytes = count * 8; |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 89b63b9cff5e..fd878c7bb8f0 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -864,9 +864,9 @@ struct radeon_mec { | |||
864 | #define R600_PTE_FRAG_64KB (4 << 7) | 864 | #define R600_PTE_FRAG_64KB (4 << 7) |
865 | #define R600_PTE_FRAG_256KB (6 << 7) | 865 | #define R600_PTE_FRAG_256KB (6 << 7) |
866 | 866 | ||
867 | /* flags used for GART page table entries on R600+ */ | 867 | /* flags needed to be set so we can copy directly from the GART table */ |
868 | #define R600_PTE_GART ( R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED \ | 868 | #define R600_PTE_GART_MASK ( R600_PTE_READABLE | R600_PTE_WRITEABLE | \ |
869 | | R600_PTE_READABLE | R600_PTE_WRITEABLE) | 869 | R600_PTE_SYSTEM | R600_PTE_VALID ) |
870 | 870 | ||
871 | struct radeon_vm_pt { | 871 | struct radeon_vm_pt { |
872 | struct radeon_bo *bo; | 872 | struct radeon_bo *bo; |
diff --git a/drivers/gpu/drm/radeon/si_dma.c b/drivers/gpu/drm/radeon/si_dma.c index c9da34181b32..a26e842cf391 100644 --- a/drivers/gpu/drm/radeon/si_dma.c +++ b/drivers/gpu/drm/radeon/si_dma.c | |||
@@ -79,8 +79,7 @@ void si_dma_vm_set_page(struct radeon_device *rdev, | |||
79 | 79 | ||
80 | trace_radeon_vm_set_page(pe, addr, count, incr, flags); | 80 | trace_radeon_vm_set_page(pe, addr, count, incr, flags); |
81 | 81 | ||
82 | /* XXX: How to distinguish between GART and other system memory pages? */ | 82 | if ((flags & R600_PTE_GART_MASK) == R600_PTE_GART_MASK) { |
83 | if (flags & R600_PTE_SYSTEM) { | ||
84 | uint64_t src = rdev->gart.table_addr + (addr >> 12) * 8; | 83 | uint64_t src = rdev->gart.table_addr + (addr >> 12) * 8; |
85 | while (count) { | 84 | while (count) { |
86 | unsigned bytes = count * 8; | 85 | unsigned bytes = count * 8; |