Skip to contentSkip to conversation

amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"

PATCH In review Christian König 3 participants 5 messages Feb 28, 2018 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"

The 32bit address range end is exclusive, not inclusive. This fixes crashes when 32bit addresses are in use.

---
 amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
amdgpu/amdgpu_device.c +2 -2
index 9ff6ad16..fb2cfb57 100644
@@ -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;
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180228144111.1651-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 1 line · Christian König

The 32bit address range end is exclusive, not inclusive.

The other way around. :) Inclusive means [a,b], i.e. an interval including the endpoints, whereas exclusive means ]a,b[, i.e. an interval not including the endpoints. The patch changes the 32-bit address range endpoint from exclusive to inclusive.

Quoted 3 lines

This fixes crashes when 32bit addresses are in use.

With the above fixed,

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 2450a93d-fbf0-0a6c-e0b8-2432a401d531-otUistvHUpPR7s880joybQ@public.gmane.org

#4 lore raw

Am 28.02.2018 um 16:21 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 1 line

The 32bit address range end is exclusive, not inclusive.

The other way around. :) Inclusive means [a,b], i.e. an interval including the endpoints, whereas exclusive means ]a,b[, i.e. an interval not including the endpoints. The patch changes the 32-bit address range endpoint from exclusive to inclusive.

Actually that's not what I meant. How about this:

"The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation."

Quoted 8 lines
Quoted 3 lines

This fixes crashes when 32bit addresses are in use.

With the above fixed,

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 42d3a34d-2df5-2f9f-95b7-525957297cab-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#6 lore raw
Quoted 8 lines · Christian König

Am 28.02.2018 um 16:21 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 1 line

The 32bit address range end is exclusive, not inclusive.

The other way around. :) Inclusive means [a,b], i.e. an interval including the endpoints, whereas exclusive means ]a,b[, i.e. an interval not including the endpoints. The patch changes the 32-bit address range endpoint from exclusive to inclusive.

Quoted 4 lines

Actually that's not what I meant. How about this:

"The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation."

Sounds good to me, but I'll defer to native English speakers for the final verdict.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): b0b39019-e085-ea73-703b-fd41705d9c01-otUistvHUpPR7s880joybQ@public.gmane.org

#8 lore raw

Am 28.02.2018 um 16:40 schrieb Michel Dänzer:

Quoted 8 lines · Christian König
Quoted 7 lines

Am 28.02.2018 um 16:21 schrieb Michel Dänzer:

Quoted 6 lines · Christian König
Quoted 1 line

The 32bit address range end is exclusive, not inclusive.

The other way around. :) Inclusive means [a,b], i.e. an interval including the endpoints, whereas exclusive means ]a,b[, i.e. an interval not including the endpoints. The patch changes the 32-bit address range endpoint from exclusive to inclusive.

Quoted 6 lines
Quoted 4 lines

Actually that's not what I meant. How about this:

"The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation."

Sounds good to me, but I'll defer to native English speakers for the final verdict.

Since this is an important bug fix I'm going to commit it as long as nobody speaks up in the next two hours or so.

Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx