Skip to contentSkip to conversation

arm64: Switch to %px for printing some addresses at bootup

RFC PATCH In review Laura Abbott 2 participants 3 messages Dec 14, 2017 arm64

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 arm64: Switch to %px for printing some addresses at bootup

With the move to stricter %p printing, several of the addresses are no longer printed out. Switch to %px so they always get printed.

---
I'll admit to finding the new %p restrictions particularly irritating here because I like seeing the print out of the virtual addresses for debugging and checking. It might also be worth discussing whether we should be printing anything out?

---
 arch/arm64/mm/init.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/mm/init.c +5 -5
index 5960bef0170d..9be53e050f50 100644
@@ -613,15 +613,15 @@ void __init mem_init(void)
 		MLM(MODULES_VADDR, MODULES_END));
 	pr_notice("    vmalloc : 0x%16lx - 0x%16lx   (%6ld GB)\n",
 		MLG(VMALLOC_START, VMALLOC_END));
-	pr_notice("      .text : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+	pr_notice("      .text : 0x%px" " - 0x%px" "   (%6ld KB)\n",
 		MLK_ROUNDUP(_text, _etext));
-	pr_notice("    .rodata : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+	pr_notice("    .rodata : 0x%px" " - 0x%px" "   (%6ld KB)\n",
 		MLK_ROUNDUP(__start_rodata, __init_begin));
-	pr_notice("      .init : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+	pr_notice("      .init : 0x%px" " - 0x%px" "   (%6ld KB)\n",
 		MLK_ROUNDUP(__init_begin, __init_end));
-	pr_notice("      .data : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+	pr_notice("      .data : 0x%px" " - 0x%px" "   (%6ld KB)\n",
 		MLK_ROUNDUP(_sdata, _edata));
-	pr_notice("       .bss : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+	pr_notice("       .bss : 0x%px" " - 0x%px" "   (%6ld KB)\n",
 		MLK_ROUNDUP(__bss_start, __bss_stop));
 	pr_notice("    fixed   : 0x%16lx - 0x%16lx   (%6ld KB)\n",
 		MLK(FIXADDR_START, FIXADDR_TOP));
Signature · 1 line
2.14.3
#1 lore raw
Quoted 9 lines · Laura Abbott

With the move to stricter %p printing, several of the addresses are no longer printed out. Switch to %px so they always get printed.

---
I'll admit to finding the new %p restrictions particularly irritating here because I like seeing the print out of the virtual addresses for debugging and checking. It might also be worth discussing whether we should be printing anything out?

If they're always printed at boot, I think they should likely be removed...

-Kees

Quoted 32 lines
---
 arch/arm64/mm/init.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/mm/init.c +5 -6
index 5960bef0170d..9be53e050f50 100644
@@ -613,15 +613,15 @@ void __init mem_init(void)
                MLM(MODULES_VADDR, MODULES_END));
        pr_notice("    vmalloc : 0x%16lx - 0x%16lx   (%6ld GB)\n",
                MLG(VMALLOC_START, VMALLOC_END));
-       pr_notice("      .text : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .text : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                MLK_ROUNDUP(_text, _etext));
-       pr_notice("    .rodata : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("    .rodata : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                MLK_ROUNDUP(__start_rodata, __init_begin));
-       pr_notice("      .init : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .init : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                MLK_ROUNDUP(__init_begin, __init_end));
-       pr_notice("      .data : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .data : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                MLK_ROUNDUP(_sdata, _edata));
-       pr_notice("       .bss : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("       .bss : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                MLK_ROUNDUP(__bss_start, __bss_stop));
        pr_notice("    fixed   : 0x%16lx - 0x%16lx   (%6ld KB)\n",
                MLK(FIXADDR_START, FIXADDR_TOP));
--

2.14.3

Signature · 2 lines
Kees Cook
Pixel Security
#2 lore raw
Quoted 11 lines · Kees Cook
Quoted 9 lines · Laura Abbott

With the move to stricter %p printing, several of the addresses are no longer printed out. Switch to %px so they always get printed.

---
I'll admit to finding the new %p restrictions particularly irritating here because I like seeing the print out of the virtual addresses for debugging and checking. It might also be worth discussing whether we should be printing anything out?

Quoted 4 lines

If they're always printed at boot, I think they should likely be removed...

-Kees

Yeah, I suspected as much. I'll submit a patch to just remove it unless someone has a counter proposal.

Thanks,
Laura

Quoted 35 lines
Quoted 32 lines
---
  arch/arm64/mm/init.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/mm/init.c +5 -6
index 5960bef0170d..9be53e050f50 100644
@@ -613,15 +613,15 @@ void __init mem_init(void)
                 MLM(MODULES_VADDR, MODULES_END));
         pr_notice("    vmalloc : 0x%16lx - 0x%16lx   (%6ld GB)\n",
                 MLG(VMALLOC_START, VMALLOC_END));
-       pr_notice("      .text : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .text : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                 MLK_ROUNDUP(_text, _etext));
-       pr_notice("    .rodata : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("    .rodata : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                 MLK_ROUNDUP(__start_rodata, __init_begin));
-       pr_notice("      .init : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .init : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                 MLK_ROUNDUP(__init_begin, __init_end));
-       pr_notice("      .data : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("      .data : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                 MLK_ROUNDUP(_sdata, _edata));
-       pr_notice("       .bss : 0x%p" " - 0x%p" "   (%6ld KB)\n",
+       pr_notice("       .bss : 0x%px" " - 0x%px" "   (%6ld KB)\n",
                 MLK_ROUNDUP(__bss_start, __bss_stop));
         pr_notice("    fixed   : 0x%16lx - 0x%16lx   (%6ld KB)\n",
                 MLK(FIXADDR_START, FIXADDR_TOP));
--

2.14.3