Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v2] Documentation/printk-formats: Remove notes about %pK
@ 2026-10-19  8:30 Sebastian Andrzej Siewior
  0 siblings, 0 replies; only message in thread
From: Sebastian Andrzej Siewior @ 2026-10-19  8:30 UTC (permalink / raw)
  To: linux-doc
  Cc: Andy Shevchenko, Petr Mladek, Steven Rostedt, Rasmus Villemoes,
	Sergey Senozhatsky, Jonathan Corbet, Shuah Khan, Randy Dunlap,
	Alex Shi, Yanteng Si, Dongliang Mu

The %pK is slowly vanishing from drivers. The %p already prints hashed
output unless overridden at bootime. It is not obvious for the user which
output is using %pK and which does not.

Some people pointed out that this documentation encourages people to use
it so here is the removal. I also update the translation since the block
looks the same.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

I intend to send the admin-guide/sysctl/kernel.rst bits with the removal
from vsnprintf itself. I am down to 5 drivers (as of next-20261014).
If you think that this documentation should remain as long as the
interface is available then I can postpone this.

v1…v2: https://lore.kernel.org/all/20261015133553.kGn_nU-F@linutronix.de/
  - Don't remove the whole %p paragraph for the zh_CN translation.
    Noticed by Andy Shevchenko.

 Documentation/core-api/printk-formats.rst     | 20 -------------------
 .../zh_CN/core-api/printk-formats.rst         | 15 --------------
 2 files changed, 35 deletions(-)

diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index 57e887ff24bc8..9c188d135cc6f 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -89,10 +89,6 @@ more information for debugging, use %p and boot the kernel with the
 addresses unmodified. If you *really* always want the unmodified address, see
 %px below.
 
-If (and only if) you are printing addresses as a content of a virtual file in
-e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a
-userspace process, use the %pK modifier described below instead of %p or %px.
-
 Error Pointers
 --------------
 
@@ -152,22 +148,6 @@ results in printing a string. For direct use in regular vsnprintf() the (k)
 and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(),
 for example, it reads the memory it is pointing to without faulting.
 
-Kernel Pointers
----------------
-
-::
-
-	%pK	01234567 or 0123456789abcdef
-
-For printing kernel pointers which should be hidden from unprivileged
-users. The behaviour of %pK depends on the kptr_restrict sysctl - see
-Documentation/admin-guide/sysctl/kernel.rst for more details.
-
-This modifier is *only* intended when producing content of a file read by
-userspace from e.g. procfs or sysfs, not for dmesg. Please refer to the
-section about %p above for discussion about how to manage hashing pointers
-in printk().
-
 Unmodified Addresses
 --------------------
 
diff --git a/Documentation/translations/zh_CN/core-api/printk-formats.rst b/Documentation/translations/zh_CN/core-api/printk-formats.rst
index 96a917ecc93f2..5922c8ef9b299 100644
--- a/Documentation/translations/zh_CN/core-api/printk-formats.rst
+++ b/Documentation/translations/zh_CN/core-api/printk-formats.rst
@@ -92,11 +92,6 @@ 希地址。如果不可能,而且打印地址的目的是为调试提供更
 用 ``no_hash_pointers`` 参数启动内核,这将打印所有未修改的%p地址。如果你 *真的* 想知
 道未修改的地址,请看下面的%px。
 
-如果(也只有在)你将地址作为虚拟文件的内容打印出来,例如在procfs或sysfs中(使用
-seq_printf(),而不是printk())由用户空间进程读取,使用下面描述的%pK修饰符,不
-要用%p或%px。
-
-
 错误指针
 --------
 
@@ -148,16 +143,6 @@ 来自BPF / tracing追踪的探查指针
 定符的结果是打印一个字符串。对于直接在常规的vsnprintf()中使用时,(k)和(u)注释被忽略,但是,当
 在BPF的bpf_trace_printk()之外使用时,它会读取它所指向的内存,不会出现错误。
 
-内核指针
---------
-
-::
-
-	%pK	01234567 or 0123456789abcdef
-
-用于打印应该对非特权用户隐藏的内核指针。%pK的行为取决于kptr_restrict sysctl——详见
-Documentation/admin-guide/sysctl/kernel.rst。
-
 未经修改的地址
 --------------
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-19  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19  8:30 [PATCH v2] Documentation/printk-formats: Remove notes about %pK Sebastian Andrzej Siewior

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