提交 860ec7c6 编写于 作者: C Christian Borntraeger 提交者: Martin Schwidefsky

s390/debug: use pK for kernel pointers

the s390 debug feature (/sys/kernel/debug/s390dbf/) shows the kernel
pointer of the calling function even for kptr_restrict == 2. Let us
use pK instead of p.

This hides the kernel addresses for kptr_restrict == 2:

root@host $ echo 2 >  /proc/sys/kernel/kptr_restrict
root@host $ tail -n1  /sys/kernel/debug/s390dbf/cio_msg/sprintf
00 01511461280:386645 2 - 00 0000000000000000  snsid: device 0.0.3f68: rc=0 3990/e9 3390/0c

root@host $ echo 1 >  /proc/sys/kernel/kptr_restrict
root@host $ tail -n1  /sys/kernel/debug/s390dbf/cio_msg/sprintf
00 01511461280:386645 2 - 00 000000000071171c  snsid: device 0.0.3f68: rc=0 3990/e9 3390/0c

root@host $ echo 0 >  /proc/sys/kernel/kptr_restrict
root@host $ tail -n1  /sys/kernel/debug/s390dbf/cio_msg/sprintf
00 01511461280:386645 2 - 00 000000000071171c  snsid: device 0.0.3f68: rc=0 3990/e9 3390/0c
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 53c4ab70
...@@ -1392,7 +1392,7 @@ int debug_dflt_header_fn(debug_info_t *id, struct debug_view *view, ...@@ -1392,7 +1392,7 @@ int debug_dflt_header_fn(debug_info_t *id, struct debug_view *view,
else else
except_str = "-"; except_str = "-";
caller = (unsigned long) entry->caller; caller = (unsigned long) entry->caller;
rc += sprintf(out_buf, "%02i %011ld:%06lu %1u %1s %02i %p ", rc += sprintf(out_buf, "%02i %011ld:%06lu %1u %1s %02i %pK ",
area, sec, usec, level, except_str, area, sec, usec, level, except_str,
entry->id.fields.cpuid, (void *)caller); entry->id.fields.cpuid, (void *)caller);
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册