drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map
commitfa7c7939b4
upstream. 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:effd924d2f
("drm/amdgpu: untie user ring ids from kernel ring ids v6") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bacbe44889
commit
955c907b97
@ -697,7 +697,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,
|
|||||||
struct amdgpu_queue_mgr *mgr);
|
struct amdgpu_queue_mgr *mgr);
|
||||||
int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
|
int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
|
||||||
struct amdgpu_queue_mgr *mgr,
|
struct amdgpu_queue_mgr *mgr,
|
||||||
int hw_ip, int instance, int ring,
|
u32 hw_ip, u32 instance, u32 ring,
|
||||||
struct amdgpu_ring **out_ring);
|
struct amdgpu_ring **out_ring);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,
|
|||||||
|
|
||||||
static int amdgpu_identity_map(struct amdgpu_device *adev,
|
static int amdgpu_identity_map(struct amdgpu_device *adev,
|
||||||
struct amdgpu_queue_mapper *mapper,
|
struct amdgpu_queue_mapper *mapper,
|
||||||
int ring,
|
u32 ring,
|
||||||
struct amdgpu_ring **out_ring)
|
struct amdgpu_ring **out_ring)
|
||||||
{
|
{
|
||||||
switch (mapper->hw_ip) {
|
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,
|
static int amdgpu_lru_map(struct amdgpu_device *adev,
|
||||||
struct amdgpu_queue_mapper *mapper,
|
struct amdgpu_queue_mapper *mapper,
|
||||||
int user_ring,
|
u32 user_ring,
|
||||||
struct amdgpu_ring **out_ring)
|
struct amdgpu_ring **out_ring)
|
||||||
{
|
{
|
||||||
int r, i, j;
|
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,
|
int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
|
||||||
struct amdgpu_queue_mgr *mgr,
|
struct amdgpu_queue_mgr *mgr,
|
||||||
int hw_ip, int instance, int ring,
|
u32 hw_ip, u32 instance, u32 ring,
|
||||||
struct amdgpu_ring **out_ring)
|
struct amdgpu_ring **out_ring)
|
||||||
{
|
{
|
||||||
int r, ip_num_rings;
|
int r, ip_num_rings;
|
||||||
|
Reference in New Issue
Block a user