aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch
new file mode 100644
index 00000000..42e23e47
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2241-drm-amdgpu-Use-unsigned-ring-indices-in-amdgpu_queue.patch
@@ -0,0 +1,71 @@
+From 8e3878a847b9777c8e1e756e57cb127b4eb31355 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
+Date: Wed, 22 Nov 2017 15:55:21 +0100
+Subject: [PATCH 2241/4131] drm/amdgpu: Use unsigned ring indices in
+ amdgpu_queue_mgr_map
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This matches the corresponding UAPI fields. Treating the ring index as
+signed could result in accessing random unrelated memory if the MSB was
+set.
+
+Fixes: effd924d2f3b ("drm/amdgpu: untie user ring ids from kernel ring
+ ids v6")
+Cc: stable@vger.kernel.org
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index 52c2a6e..3306501 100755
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -740,7 +740,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,
+ struct amdgpu_queue_mgr *mgr);
+ int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
+ struct amdgpu_queue_mgr *mgr,
+- int hw_ip, int instance, int ring,
++ u32 hw_ip, u32 instance, u32 ring,
+ struct amdgpu_ring **out_ring);
+
+ /*
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
+index 190e28c..93d8661 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
+@@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,
+
+ static int amdgpu_identity_map(struct amdgpu_device *adev,
+ struct amdgpu_queue_mapper *mapper,
+- int ring,
++ u32 ring,
+ struct amdgpu_ring **out_ring)
+ {
+ switch (mapper->hw_ip) {
+@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip)
+
+ static int amdgpu_lru_map(struct amdgpu_device *adev,
+ struct amdgpu_queue_mapper *mapper,
+- int user_ring, bool lru_pipe_order,
++ u32 user_ring, bool lru_pipe_order,
+ struct amdgpu_ring **out_ring)
+ {
+ int r, i, j;
+@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,
+ */
+ int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
+ struct amdgpu_queue_mgr *mgr,
+- int hw_ip, int instance, int ring,
++ u32 hw_ip, u32 instance, u32 ring,
+ struct amdgpu_ring **out_ring)
+ {
+ int r, ip_num_rings;
+--
+2.7.4
+