amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"

The range is stored as exclusive, not inclusive. Subtracts one to get
the inclusive interval for the calculation. This fixes crashes when 32bit
addresses are in use.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
main
Christian König 2018-02-28 15:39:46 +01:00
parent ff0da7b323
commit bca585b02f
1 changed files with 2 additions and 2 deletions

View File

@ -323,9 +323,9 @@ int amdgpu_query_sw_info(amdgpu_device_handle dev, enum amdgpu_sw_info info,
switch (info) {
case amdgpu_sw_info_address32_hi:
if (dev->vamgr_high_32.va_max)
*val32 = dev->vamgr_high_32.va_max >> 32;
*val32 = (dev->vamgr_high_32.va_max - 1) >> 32;
else
*val32 = dev->vamgr_32.va_max >> 32;
*val32 = (dev->vamgr_32.va_max - 1) >> 32;
return 0;
}
return -EINVAL;