Skip to contentSkip to conversation

drm/amdgpu: fix off by one in amdgpu_vm_handle_fault

PATCH In review Christian König 4 participants 4 messages Nov 2, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix off by one in amdgpu_vm_handle_fault

The value is inclusive, not exclusive.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index dc0bc550e42b..fdbe7d4e8b8b 100644
@@ -3351,7 +3351,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
 	}
 
 	r = amdgpu_vm_bo_update_mapping(adev, adev, vm, true, false, NULL, addr,
-					addr + 1, flags, value, NULL, NULL,
+					addr, flags, value, NULL, NULL,
 					NULL);
 	if (r)
 		goto error_unlock;
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 2020-11-02 um 11:23 a.m. schrieb Christian König:

Quoted 3 lines

The value is inclusive, not exclusive.

Quoted 9 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index dc0bc550e42b..fdbe7d4e8b8b 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid, · line 3357

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -3351,7 +3351,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
 	}
 
 	r = amdgpu_vm_bo_update_mapping(adev, adev, vm, true, false, NULL, addr,
-					addr + 1, flags, value, NULL, NULL,
+					addr, flags, value, NULL, NULL,
 					NULL);
 	if (r)
 		goto error_unlock;

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Christian König
Quoted 13 lines · Christian König

The value is inclusive, not exclusive.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index dc0bc550e42b..fdbe7d4e8b8b 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid, · line 3352

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -3351,7 +3351,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
        }
 

Might want to add a comment here about the value being inclusive.

Alex

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -2
        r = amdgpu_vm_bo_update_mapping(adev, adev, vm, true, false, NULL, addr,
-                                       addr + 1, flags, value, NULL, NULL,
+                                       addr, flags, value, NULL, NULL,
                                        NULL);
        if (r)
                goto error_unlock;
--

2.25.1

Quoted 4 lines

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

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

#3 lore raw
In reply to Christian König

[AMD Public Use]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian König
Sent: Monday, November 2, 2020 9:54 PM
To: [email protected]
Cc: Kuehling, Felix <[email protected]>
Subject: [PATCH] drm/amdgpu: fix off by one in amdgpu_vm_handle_fault

The value is inclusive, not exclusive.

Looks good to me: Reviewed-by: Madhav Chauhan <[email protected]>

Regards,
Madhav

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index dc0bc550e42b..fdbe7d4e8b8b 100644
@@ -3351,7 +3351,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
 	}
 
 	r = amdgpu_vm_bo_update_mapping(adev, adev, vm, true, false, NULL, addr,
-					addr + 1, flags, value, NULL, NULL,
+					addr, flags, value, NULL, NULL,
 					NULL);
 	if (r)
 		goto error_unlock;
Signature · 10 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cmadhav.chauhan%40amd.com%7C38fd51f6e3a74e7016e908d87f4bb334%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637399310420807189%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=wanWs7XSQCWerT1e8wYxZHqymam2LpqyytPbeUs%2FzDQ%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx