drm/amdgpu: fix vm_cpu_update hit NULL pointer
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix vm_cpu_update hit NULL pointer
should use amdgpu_bo_map, otherwise you'll hit NULL pointer bug if with amdgpu_bo_kptr
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +3 -1
@@ -76,8 +76,10 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, {unsigned int i;uint64_t value; +void *ptr; - pe += (unsigned long )amdgpu_bo_kptr (bo); +amdgpu_bo_kmap (bo, &ptr); + pe += (unsigned long )ptr;trace_amdgpu_vm_set_ptes (pe, addr, count, incr, flags);
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1553232632-27710-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Am 22.03.19 um 06:30 schrieb Monk Liu:
Quoted 2 lines
should use
amdgpu_bo_map, otherwise you'll hit NULL pointer bug if withamdgpu_bo_kptr
Yeah that is a known problem. NAK to this one cause that would map the BO at the wrong time.
But in general I have a proper fix for this in the pipeline.
Christian.
Quoted 12 lines
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +0
-0@@ -76,8 +76,10 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, {
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, · line 85
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +3
-1unsigned int i;uint64_t value; +void *ptr; - pe += (unsigned long )amdgpu_bo_kptr (bo); +amdgpu_bo_kmap (bo, &ptr); + pe += (unsigned long )ptr;trace_amdgpu_vm_set_ptes (pe, addr, count, incr, flags);
_______________________________________________
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): 583e1755-3c2a-8677-dda0-2f10ed8fc09a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Hi Christian
Why it is the wrong time ? the pte/pd bo already reserved, some details maybe?
Thanks
/Monk
-----Original Message-----
From: Christian König <[email protected]>
Sent: Friday, March 22, 2019 11:43 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: fix vm_cpu_update hit NULL pointer
Am 22.03.19 um 06:30 schrieb Monk Liu:
Quoted 2 lines
should use
amdgpu_bo_map, otherwise you'll hit NULL pointer bug if withamdgpu_bo_kptr
Yeah that is a known problem. NAK to this one cause that would map the BO at the wrong time.
But in general I have a proper fix for this in the pipeline.
Christian.
Quoted 13 lines
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +0
-0@@ -76,8 +76,10 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, {
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, · line 85
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +3
-1unsigned int i;uint64_t value; +void *ptr; - pe += (unsigned long )amdgpu_bo_kptr (bo); +amdgpu_bo_kmap (bo, &ptr); + pe += (unsigned long )ptr;trace_amdgpu_vm_set_ptes (pe, addr, count, incr, flags);
_______________________________________________
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): BYAPR12MB33014544E9805DC79F9E3EA1845D0-ZGDeBxoHBPmRc1D8ZEEGsgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Hi Monk,
well it would certainly work, but for the error handling it's just not the best idea to do the mapping so late.
E.g. we should do the kmap for CPU based updates as well as the GTT map for SDMA based updates much more earlier to avoid rolling back all work again when we are interrupted by a signal for example.
Give me a moment to write a patch for this, it's basically the same thing as your patch just called from an earlier point.
Regards,
Christian.
Am 24.03.19 um 04:42 schrieb Liu, Monk:
Quoted 41 lines
Hi Christian
Why it is the wrong time ? the pte/pd bo already reserved, some details maybe?
Thanks
/Monk
-----Original Message-----
From: Christian König <[email protected]>
Sent: Friday, March 22, 2019 11:43 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: fixvm_cpu_updatehit NULL pointerAm 22.03.19 um 06:30 schrieb Monk Liu:
Quoted 2 lines
should use
amdgpu_bo_map, otherwise you'll hit NULL pointer bug if withamdgpu_bo_kptrYeah that is a known problem. NAK to this one cause that would map the BO at the wrong time.
But in general I have a proper fix for this in the pipeline.
Christian.
Quoted 20 lines
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +3
-1@@ -76,8 +76,10 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, {unsigned int i;uint64_t value; +void *ptr; - pe += (unsigned long )amdgpu_bo_kptr (bo); +amdgpu_bo_kmap (bo, &ptr); + pe += (unsigned long )ptr;
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p, · line 85
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c +0
-0trace_amdgpu_vm_set_ptes (pe, addr, count, incr, flags);_______________________________________________
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