Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8820/1: mm: Stop printing the virtual memory layout

Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with
%p"), the virtual memory layout printed during boot up contains "ptrval"
instead of actual addresses:

Memory: 501296K/524288K available (6144K kernel code, 528K rwdata, 1944K rodata, 1024K init, 7584K bss, 22992K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0x(ptrval) - 0x(ptrval) (7136 kB)
.init : 0x(ptrval) - 0x(ptrval) (1024 kB)
.data : 0x(ptrval) - 0x(ptrval) ( 529 kB)
.bss : 0x(ptrval) - 0x(ptrval) (7585 kB)

Instead of changing the printing to "%px", and leaking virtual memory
layout information again, just remove the printing completely, cfr. e.g.
commits 071929dbdd865f77 ("arm64: Stop printing the virtual memory
layout") and 31833332f7987636 ("m68k/mm: Stop printing the virtual
memory layout").

All interesting information (actual section sizes) is already printed by
mem_init_print_info() just above anyway.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Geert Uytterhoeven and committed by
Russell King
1c31d4e9 091bb549

-49
-49
arch/arm/mm/init.c
··· 494 494 495 495 mem_init_print_info(NULL); 496 496 497 - #define MLK(b, t) b, t, ((t) - (b)) >> 10 498 - #define MLM(b, t) b, t, ((t) - (b)) >> 20 499 - #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) 500 - 501 - pr_notice("Virtual kernel memory layout:\n" 502 - " vector : 0x%08lx - 0x%08lx (%4ld kB)\n" 503 - #ifdef CONFIG_HAVE_TCM 504 - " DTCM : 0x%08lx - 0x%08lx (%4ld kB)\n" 505 - " ITCM : 0x%08lx - 0x%08lx (%4ld kB)\n" 506 - #endif 507 - " fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n" 508 - " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n" 509 - " lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n" 510 - #ifdef CONFIG_HIGHMEM 511 - " pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n" 512 - #endif 513 - #ifdef CONFIG_MODULES 514 - " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" 515 - #endif 516 - " .text : 0x%p" " - 0x%p" " (%4td kB)\n" 517 - " .init : 0x%p" " - 0x%p" " (%4td kB)\n" 518 - " .data : 0x%p" " - 0x%p" " (%4td kB)\n" 519 - " .bss : 0x%p" " - 0x%p" " (%4td kB)\n", 520 - 521 - MLK(VECTORS_BASE, VECTORS_BASE + PAGE_SIZE), 522 - #ifdef CONFIG_HAVE_TCM 523 - MLK(DTCM_OFFSET, (unsigned long) dtcm_end), 524 - MLK(ITCM_OFFSET, (unsigned long) itcm_end), 525 - #endif 526 - MLK(FIXADDR_START, FIXADDR_END), 527 - MLM(VMALLOC_START, VMALLOC_END), 528 - MLM(PAGE_OFFSET, (unsigned long)high_memory), 529 - #ifdef CONFIG_HIGHMEM 530 - MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) * 531 - (PAGE_SIZE)), 532 - #endif 533 - #ifdef CONFIG_MODULES 534 - MLM(MODULES_VADDR, MODULES_END), 535 - #endif 536 - 537 - MLK_ROUNDUP(_text, _etext), 538 - MLK_ROUNDUP(__init_begin, __init_end), 539 - MLK_ROUNDUP(_sdata, _edata), 540 - MLK_ROUNDUP(__bss_start, __bss_stop)); 541 - 542 - #undef MLK 543 - #undef MLM 544 - #undef MLK_ROUNDUP 545 - 546 497 /* 547 498 * Check boundaries twice: Some fundamental inconsistencies can 548 499 * be detected at build time already.