AMD-GFX Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] gpu/drm: Replace "%p" with "%pK"
@ 2020-06-30  7:36 Tiezhu Yang
  2020-06-30  8:05 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Tiezhu Yang @ 2020-06-30  7:36 UTC (permalink / raw)
  To: Alex Deucher, Christian König; +Cc: linux-kernel, amd-gfx

When I update the latest kernel, I see the following "____ptrval____" boot
messages. Use "%pK" instead of "%p" so that the cpu address can be printed
when the kptr_restrict sysctl is set to 1.

Both radeon_fence_driver_start_ring() and amdgpu_fence_driver_start_ring()
have this similar issue, fix them.

[    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
[    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu addr 0x0000000040056038 and cpu addr 0x(____ptrval____)

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 ++---
 drivers/gpu/drm/radeon/radeon_fence.c     | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index d878fe7..d4d1e8c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -422,9 +422,8 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,
 	ring->fence_drv.irq_type = irq_type;
 	ring->fence_drv.initialized = true;
 
-	DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr "
-		      "0x%016llx, cpu addr 0x%p\n", ring->name,
-		      ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
+	DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr 0x%016llx, cpu addr 0x%pK\n",
+		      ring->name, ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 43f2f93..c51b094 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -865,7 +865,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring)
 	}
 	radeon_fence_write(rdev, atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
 	rdev->fence_drv[ring].initialized = true;
-	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%p\n",
+	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%pK\n",
 		 ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr);
 	return 0;
 }
-- 
2.1.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm: Replace "%p" with "%pK"
  2020-06-30  7:36 [PATCH] gpu/drm: Replace "%p" with "%pK" Tiezhu Yang
@ 2020-06-30  8:05 ` Christian König
  2020-06-30 12:14   ` Tiezhu Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2020-06-30  8:05 UTC (permalink / raw)
  To: Tiezhu Yang, Alex Deucher; +Cc: linux-kernel, amd-gfx

Am 30.06.20 um 09:36 schrieb Tiezhu Yang:
> When I update the latest kernel, I see the following "____ptrval____" boot
> messages. Use "%pK" instead of "%p" so that the cpu address can be printed
> when the kptr_restrict sysctl is set to 1.
>
> Both radeon_fence_driver_start_ring() and amdgpu_fence_driver_start_ring()
> have this similar issue, fix them.
>
> [    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
> [    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu addr 0x0000000040056038 and cpu addr 0x(____ptrval____)

We can probably just completely drop the CPU address here.

Christian.

>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 ++---
>   drivers/gpu/drm/radeon/radeon_fence.c     | 2 +-
>   2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index d878fe7..d4d1e8c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -422,9 +422,8 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,
>   	ring->fence_drv.irq_type = irq_type;
>   	ring->fence_drv.initialized = true;
>   
> -	DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr "
> -		      "0x%016llx, cpu addr 0x%p\n", ring->name,
> -		      ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
> +	DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr 0x%016llx, cpu addr 0x%pK\n",
> +		      ring->name, ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
>   	return 0;
>   }
>   
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 43f2f93..c51b094 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -865,7 +865,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring)
>   	}
>   	radeon_fence_write(rdev, atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
>   	rdev->fence_drv[ring].initialized = true;
> -	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%p\n",
> +	dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%pK\n",
>   		 ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr);
>   	return 0;
>   }

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm: Replace "%p" with "%pK"
  2020-06-30  8:05 ` Christian König
@ 2020-06-30 12:14   ` Tiezhu Yang
  2020-06-30 13:01     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Tiezhu Yang @ 2020-06-30 12:14 UTC (permalink / raw)
  To: Christian König, Alex Deucher; +Cc: linux-kernel, amd-gfx

On 06/30/2020 04:05 PM, Christian König wrote:
> Am 30.06.20 um 09:36 schrieb Tiezhu Yang:
>> When I update the latest kernel, I see the following "____ptrval____" 
>> boot
>> messages. Use "%pK" instead of "%p" so that the cpu address can be 
>> printed
>> when the kptr_restrict sysctl is set to 1.
>>
>> Both radeon_fence_driver_start_ring() and 
>> amdgpu_fence_driver_start_ring()
>> have this similar issue, fix them.
>>
>> [    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu 
>> addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
>> [    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu 
>> addr 0x0000000040056038 and cpu addr 0x(____ptrval____)
>
> We can probably just completely drop the CPU address here.

OK, maybe the CPU address is not much useful. If nobody has any objections,
I will send v2 to remove the debug info about CPU address.

Thanks,
Tiezhu

>
> Christian.
>
>>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 ++---
>>   drivers/gpu/drm/radeon/radeon_fence.c     | 2 +-
>>   2 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>> index d878fe7..d4d1e8c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>> @@ -422,9 +422,8 @@ int amdgpu_fence_driver_start_ring(struct 
>> amdgpu_ring *ring,
>>       ring->fence_drv.irq_type = irq_type;
>>       ring->fence_drv.initialized = true;
>>   -    DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr "
>> -              "0x%016llx, cpu addr 0x%p\n", ring->name,
>> -              ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
>> +    DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr 
>> 0x%016llx, cpu addr 0x%pK\n",
>> +              ring->name, ring->fence_drv.gpu_addr, 
>> ring->fence_drv.cpu_addr);
>>       return 0;
>>   }
>>   diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
>> b/drivers/gpu/drm/radeon/radeon_fence.c
>> index 43f2f93..c51b094 100644
>> --- a/drivers/gpu/drm/radeon/radeon_fence.c
>> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
>> @@ -865,7 +865,7 @@ int radeon_fence_driver_start_ring(struct 
>> radeon_device *rdev, int ring)
>>       }
>>       radeon_fence_write(rdev, 
>> atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
>>       rdev->fence_drv[ring].initialized = true;
>> -    dev_info(rdev->dev, "fence driver on ring %d use gpu addr 
>> 0x%016llx and cpu addr 0x%p\n",
>> +    dev_info(rdev->dev, "fence driver on ring %d use gpu addr 
>> 0x%016llx and cpu addr 0x%pK\n",
>>            ring, rdev->fence_drv[ring].gpu_addr, 
>> rdev->fence_drv[ring].cpu_addr);
>>       return 0;
>>   }

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu/drm: Replace "%p" with "%pK"
  2020-06-30 12:14   ` Tiezhu Yang
@ 2020-06-30 13:01     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2020-06-30 13:01 UTC (permalink / raw)
  To: Tiezhu Yang, Alex Deucher; +Cc: linux-kernel, amd-gfx

Am 30.06.20 um 14:14 schrieb Tiezhu Yang:
> On 06/30/2020 04:05 PM, Christian König wrote:
>> Am 30.06.20 um 09:36 schrieb Tiezhu Yang:
>>> When I update the latest kernel, I see the following 
>>> "____ptrval____" boot
>>> messages. Use "%pK" instead of "%p" so that the cpu address can be 
>>> printed
>>> when the kptr_restrict sysctl is set to 1.
>>>
>>> Both radeon_fence_driver_start_ring() and 
>>> amdgpu_fence_driver_start_ring()
>>> have this similar issue, fix them.
>>>
>>> [    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu 
>>> addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
>>> [    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu 
>>> addr 0x0000000040056038 and cpu addr 0x(____ptrval____)
>>
>> We can probably just completely drop the CPU address here.
>
> OK, maybe the CPU address is not much useful. If nobody has any 
> objections,
> I will send v2 to remove the debug info about CPU address.

The CPU address was useful in the past, but isn't any more. We now have 
a debugfs file to read the current fence values.

Please go ahead and send a patch to just remove printing them.

Thanks,
Christian.

>
> Thanks,
> Tiezhu
>
>>
>> Christian.
>>
>>>
>>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 5 ++---
>>>   drivers/gpu/drm/radeon/radeon_fence.c     | 2 +-
>>>   2 files changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c 
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>>> index d878fe7..d4d1e8c 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
>>> @@ -422,9 +422,8 @@ int amdgpu_fence_driver_start_ring(struct 
>>> amdgpu_ring *ring,
>>>       ring->fence_drv.irq_type = irq_type;
>>>       ring->fence_drv.initialized = true;
>>>   -    DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr "
>>> -              "0x%016llx, cpu addr 0x%p\n", ring->name,
>>> -              ring->fence_drv.gpu_addr, ring->fence_drv.cpu_addr);
>>> +    DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr 
>>> 0x%016llx, cpu addr 0x%pK\n",
>>> +              ring->name, ring->fence_drv.gpu_addr, 
>>> ring->fence_drv.cpu_addr);
>>>       return 0;
>>>   }
>>>   diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
>>> b/drivers/gpu/drm/radeon/radeon_fence.c
>>> index 43f2f93..c51b094 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_fence.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
>>> @@ -865,7 +865,7 @@ int radeon_fence_driver_start_ring(struct 
>>> radeon_device *rdev, int ring)
>>>       }
>>>       radeon_fence_write(rdev, 
>>> atomic64_read(&rdev->fence_drv[ring].last_seq), ring);
>>>       rdev->fence_drv[ring].initialized = true;
>>> -    dev_info(rdev->dev, "fence driver on ring %d use gpu addr 
>>> 0x%016llx and cpu addr 0x%p\n",
>>> +    dev_info(rdev->dev, "fence driver on ring %d use gpu addr 
>>> 0x%016llx and cpu addr 0x%pK\n",
>>>            ring, rdev->fence_drv[ring].gpu_addr, 
>>> rdev->fence_drv[ring].cpu_addr);
>>>       return 0;
>>>   }
>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30  7:36 [PATCH] gpu/drm: Replace "%p" with "%pK" Tiezhu Yang
2020-06-30  8:05 ` Christian König
2020-06-30 12:14   ` Tiezhu Yang
2020-06-30 13:01     ` Christian König

AMD-GFX Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/amd-gfx/0 amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ https://lore.kernel.org/amd-gfx \
		amd-gfx@lists.freedesktop.org
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.amd-gfx


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git