Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
* [PATCH] remoteproc: Use %p for pointer formatting
@ 2026-09-18 10:46 Sebastian Andrzej Siewior
  2026-09-21 14:35 ` Mathieu Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-09-18 10:46 UTC (permalink / raw)
  To: linux-remoteproc; +Cc: Bjorn Andersson, Mathieu Poirier

Commit 276ec9934231e ("remoteproc: replace "%p" with "%pK"") introduced
the %pK in order to not leak kernel pointers.
Since commit ad67b74d2469d ("printk: hash addresses printed with
%p") pointers are hashed by default and the behaviour can be controller
by `hash_pointers' boot argument.
The policy on %p is to not introduce new ones.
Removing %pK makes it possible to remove its handling from the library.

I doubt printing the address of struct fw_rsc_hdr with an unknown type
brings any value. The va is printed already in debug output in other
places as %p so it makes probably no difference to remove it from
rproc_carveouts_show().

Use %p instead %pK for rproc_mem_entry::va, remove the address of the
unknown type.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/remoteproc/remoteproc_debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index b86c1d09c70c0..e8e7b6a3769b8 100644
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -347,8 +347,8 @@ static int rproc_rsc_table_show(struct seq_file *seq, void *p)
 			}
 			break;
 		default:
-			seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n",
-				   hdr->type, hdr);
+			seq_printf(seq, "Unknown resource type found: %d\n",
+				   hdr->type);
 			break;
 		}
 	}
@@ -367,7 +367,7 @@ static int rproc_carveouts_show(struct seq_file *seq, void *p)
 	list_for_each_entry(carveout, &rproc->carveouts, node) {
 		seq_puts(seq, "Carveout memory entry:\n");
 		seq_printf(seq, "\tName: %s\n", carveout->name);
-		seq_printf(seq, "\tVirtual address: %pK\n", carveout->va);
+		seq_printf(seq, "\tVirtual address: %p\n", carveout->va);
 		seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma);
 		seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da);
 		seq_printf(seq, "\tLength: 0x%zx Bytes\n\n", carveout->len);
-- 
2.55.0

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

* Re: [PATCH] remoteproc: Use %p for pointer formatting
  2026-09-18 10:46 [PATCH] remoteproc: Use %p for pointer formatting Sebastian Andrzej Siewior
@ 2026-09-21 14:35 ` Mathieu Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2026-09-21 14:35 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-remoteproc, Bjorn Andersson

On Fri, Sep 18, 2026 at 12:46:28PM +0200, Sebastian Andrzej Siewior wrote:
> Commit 276ec9934231e ("remoteproc: replace "%p" with "%pK"") introduced
> the %pK in order to not leak kernel pointers.
> Since commit ad67b74d2469d ("printk: hash addresses printed with
> %p") pointers are hashed by default and the behaviour can be controller
> by `hash_pointers' boot argument.
> The policy on %p is to not introduce new ones.
> Removing %pK makes it possible to remove its handling from the library.
> 
> I doubt printing the address of struct fw_rsc_hdr with an unknown type
> brings any value. The va is printed already in debug output in other
> places as %p so it makes probably no difference to remove it from
> rproc_carveouts_show().
> 
> Use %p instead %pK for rproc_mem_entry::va, remove the address of the
> unknown type.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/remoteproc/remoteproc_debugfs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>

Applied.

Thanks,
Mathieu
 
> diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
> index b86c1d09c70c0..e8e7b6a3769b8 100644
> --- a/drivers/remoteproc/remoteproc_debugfs.c
> +++ b/drivers/remoteproc/remoteproc_debugfs.c
> @@ -347,8 +347,8 @@ static int rproc_rsc_table_show(struct seq_file *seq, void *p)
>  			}
>  			break;
>  		default:
> -			seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n",
> -				   hdr->type, hdr);
> +			seq_printf(seq, "Unknown resource type found: %d\n",
> +				   hdr->type);
>  			break;
>  		}
>  	}
> @@ -367,7 +367,7 @@ static int rproc_carveouts_show(struct seq_file *seq, void *p)
>  	list_for_each_entry(carveout, &rproc->carveouts, node) {
>  		seq_puts(seq, "Carveout memory entry:\n");
>  		seq_printf(seq, "\tName: %s\n", carveout->name);
> -		seq_printf(seq, "\tVirtual address: %pK\n", carveout->va);
> +		seq_printf(seq, "\tVirtual address: %p\n", carveout->va);
>  		seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma);
>  		seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da);
>  		seq_printf(seq, "\tLength: 0x%zx Bytes\n\n", carveout->len);
> -- 
> 2.55.0

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

end of thread, other threads:[~2026-09-21 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-18 10:46 [PATCH] remoteproc: Use %p for pointer formatting Sebastian Andrzej Siewior
2026-09-21 14:35 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox