diff options
author | Christian König <christian.koenig@amd.com> | 2018-02-28 15:39:46 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2018-02-28 20:04:32 +0100 |
commit | bca585b02f09e27d7adef8375630515711bd4802 (patch) | |
tree | c8b670e9a394240b6bfb0a2faf1bb2ed77a72219 | |
parent | ff0da7b32369a08c8a2f69cd4dcd046ad7a15bec (diff) |
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>
-rw-r--r-- | amdgpu/amdgpu_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index 9ff6ad16..fb2cfb57 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -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; |