diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2017-11-22 09:55:21 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-28 17:44:14 -0500 |
commit | fa7c7939b4bf112cd06ba166b739244077898990 (patch) | |
tree | db5b7742c26247e7d67aab43cca8952ec25777f3 | |
parent | 89ce6e0afee8eafa679093207dabd717af9d09c5 (diff) |
drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map
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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 | ||||
-rw-r--r-- | 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 c25cedff4915..0b14b5373783 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -717,7 +717,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev, | |||
717 | struct amdgpu_queue_mgr *mgr); | 717 | struct amdgpu_queue_mgr *mgr); |
718 | int amdgpu_queue_mgr_map(struct amdgpu_device *adev, | 718 | int amdgpu_queue_mgr_map(struct amdgpu_device *adev, |
719 | struct amdgpu_queue_mgr *mgr, | 719 | struct amdgpu_queue_mgr *mgr, |
720 | int hw_ip, int instance, int ring, | 720 | u32 hw_ip, u32 instance, u32 ring, |
721 | struct amdgpu_ring **out_ring); | 721 | struct amdgpu_ring **out_ring); |
722 | 722 | ||
723 | /* | 723 | /* |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c index 190e28cb827e..93d86619e802 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, | |||
63 | 63 | ||
64 | static int amdgpu_identity_map(struct amdgpu_device *adev, | 64 | static int amdgpu_identity_map(struct amdgpu_device *adev, |
65 | struct amdgpu_queue_mapper *mapper, | 65 | struct amdgpu_queue_mapper *mapper, |
66 | int ring, | 66 | u32 ring, |
67 | struct amdgpu_ring **out_ring) | 67 | struct amdgpu_ring **out_ring) |
68 | { | 68 | { |
69 | switch (mapper->hw_ip) { | 69 | switch (mapper->hw_ip) { |
@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip) | |||
121 | 121 | ||
122 | static int amdgpu_lru_map(struct amdgpu_device *adev, | 122 | static int amdgpu_lru_map(struct amdgpu_device *adev, |
123 | struct amdgpu_queue_mapper *mapper, | 123 | struct amdgpu_queue_mapper *mapper, |
124 | int user_ring, bool lru_pipe_order, | 124 | u32 user_ring, bool lru_pipe_order, |
125 | struct amdgpu_ring **out_ring) | 125 | struct amdgpu_ring **out_ring) |
126 | { | 126 | { |
127 | int r, i, j; | 127 | int r, i, j; |
@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev, | |||
208 | */ | 208 | */ |
209 | int amdgpu_queue_mgr_map(struct amdgpu_device *adev, | 209 | int amdgpu_queue_mgr_map(struct amdgpu_device *adev, |
210 | struct amdgpu_queue_mgr *mgr, | 210 | struct amdgpu_queue_mgr *mgr, |
211 | int hw_ip, int instance, int ring, | 211 | u32 hw_ip, u32 instance, u32 ring, |
212 | struct amdgpu_ring **out_ring) | 212 | struct amdgpu_ring **out_ring) |
213 | { | 213 | { |
214 | int r, ip_num_rings; | 214 | int r, ip_num_rings; |