All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Laura Abbott <labbott@redhat.com>,
	Will Deacon <will.deacon@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] arm64: Stop printing the virtual memory layout
Date: Thu, 18 Jan 2018 12:01:31 -0800	[thread overview]
Message-ID: <94d6b5c8-07c4-32b5-9746-646b0021d2e9@gmail.com> (raw)
In-Reply-To: <20171219192810.22537-1-labbott@redhat.com>

On 12/19/2017 11:28 AM, Laura Abbott wrote:
> Printing kernel addresses should be done in limited circumstances, mostly
> for debugging purposes. Printing out the virtual memory layout at every
> kernel bootup doesn't really fall into this category so delete the prints.
> There are other ways to get the same information.

This really has some value when debugging systems, could we possibly
just hide that behind an appropriate configuration option instead of
completely removing this?

> 
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> Follow up to my previous proposal to switch all these to %px
> ---
>  arch/arm64/mm/init.c | 43 -------------------------------------------
>  1 file changed, 43 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5960bef0170d..672094ed7e07 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -599,49 +599,6 @@ void __init mem_init(void)
>  
>  	mem_init_print_info(NULL);
>  
> -#define MLK(b, t) b, t, ((t) - (b)) >> 10
> -#define MLM(b, t) b, t, ((t) - (b)) >> 20
> -#define MLG(b, t) b, t, ((t) - (b)) >> 30
> -#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
> -
> -	pr_notice("Virtual kernel memory layout:\n");
> -#ifdef CONFIG_KASAN
> -	pr_notice("    kasan   : 0x%16lx - 0x%16lx   (%6ld GB)\n",
> -		MLG(KASAN_SHADOW_START, KASAN_SHADOW_END));
> -#endif
> -	pr_notice("    modules : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		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",
> -		MLK_ROUNDUP(_text, _etext));
> -	pr_notice("    .rodata : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__start_rodata, __init_begin));
> -	pr_notice("      .init : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__init_begin, __init_end));
> -	pr_notice("      .data : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(_sdata, _edata));
> -	pr_notice("       .bss : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__bss_start, __bss_stop));
> -	pr_notice("    fixed   : 0x%16lx - 0x%16lx   (%6ld KB)\n",
> -		MLK(FIXADDR_START, FIXADDR_TOP));
> -	pr_notice("    PCI I/O : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		MLM(PCI_IO_START, PCI_IO_END));
> -#ifdef CONFIG_SPARSEMEM_VMEMMAP
> -	pr_notice("    vmemmap : 0x%16lx - 0x%16lx   (%6ld GB maximum)\n",
> -		MLG(VMEMMAP_START, VMEMMAP_START + VMEMMAP_SIZE));
> -	pr_notice("              0x%16lx - 0x%16lx   (%6ld MB actual)\n",
> -		MLM((unsigned long)phys_to_page(memblock_start_of_DRAM()),
> -		    (unsigned long)virt_to_page(high_memory)));
> -#endif
> -	pr_notice("    memory  : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		MLM(__phys_to_virt(memblock_start_of_DRAM()),
> -		    (unsigned long)high_memory));
> -
> -#undef MLK
> -#undef MLM
> -#undef MLK_ROUNDUP
> -
>  	/*
>  	 * Check boundaries twice: Some fundamental inconsistencies can be
>  	 * detected at build time already.
> 


-- 
Florian

WARNING: multiple messages have this Message-ID (diff)
From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Stop printing the virtual memory layout
Date: Thu, 18 Jan 2018 12:01:31 -0800	[thread overview]
Message-ID: <94d6b5c8-07c4-32b5-9746-646b0021d2e9@gmail.com> (raw)
In-Reply-To: <20171219192810.22537-1-labbott@redhat.com>

On 12/19/2017 11:28 AM, Laura Abbott wrote:
> Printing kernel addresses should be done in limited circumstances, mostly
> for debugging purposes. Printing out the virtual memory layout at every
> kernel bootup doesn't really fall into this category so delete the prints.
> There are other ways to get the same information.

This really has some value when debugging systems, could we possibly
just hide that behind an appropriate configuration option instead of
completely removing this?

> 
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> Follow up to my previous proposal to switch all these to %px
> ---
>  arch/arm64/mm/init.c | 43 -------------------------------------------
>  1 file changed, 43 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5960bef0170d..672094ed7e07 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -599,49 +599,6 @@ void __init mem_init(void)
>  
>  	mem_init_print_info(NULL);
>  
> -#define MLK(b, t) b, t, ((t) - (b)) >> 10
> -#define MLM(b, t) b, t, ((t) - (b)) >> 20
> -#define MLG(b, t) b, t, ((t) - (b)) >> 30
> -#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
> -
> -	pr_notice("Virtual kernel memory layout:\n");
> -#ifdef CONFIG_KASAN
> -	pr_notice("    kasan   : 0x%16lx - 0x%16lx   (%6ld GB)\n",
> -		MLG(KASAN_SHADOW_START, KASAN_SHADOW_END));
> -#endif
> -	pr_notice("    modules : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		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",
> -		MLK_ROUNDUP(_text, _etext));
> -	pr_notice("    .rodata : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__start_rodata, __init_begin));
> -	pr_notice("      .init : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__init_begin, __init_end));
> -	pr_notice("      .data : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(_sdata, _edata));
> -	pr_notice("       .bss : 0x%p" " - 0x%p" "   (%6ld KB)\n",
> -		MLK_ROUNDUP(__bss_start, __bss_stop));
> -	pr_notice("    fixed   : 0x%16lx - 0x%16lx   (%6ld KB)\n",
> -		MLK(FIXADDR_START, FIXADDR_TOP));
> -	pr_notice("    PCI I/O : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		MLM(PCI_IO_START, PCI_IO_END));
> -#ifdef CONFIG_SPARSEMEM_VMEMMAP
> -	pr_notice("    vmemmap : 0x%16lx - 0x%16lx   (%6ld GB maximum)\n",
> -		MLG(VMEMMAP_START, VMEMMAP_START + VMEMMAP_SIZE));
> -	pr_notice("              0x%16lx - 0x%16lx   (%6ld MB actual)\n",
> -		MLM((unsigned long)phys_to_page(memblock_start_of_DRAM()),
> -		    (unsigned long)virt_to_page(high_memory)));
> -#endif
> -	pr_notice("    memory  : 0x%16lx - 0x%16lx   (%6ld MB)\n",
> -		MLM(__phys_to_virt(memblock_start_of_DRAM()),
> -		    (unsigned long)high_memory));
> -
> -#undef MLK
> -#undef MLM
> -#undef MLK_ROUNDUP
> -
>  	/*
>  	 * Check boundaries twice: Some fundamental inconsistencies can be
>  	 * detected at build time already.
> 


-- 
Florian

  parent reply	other threads:[~2018-01-18 20:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 19:28 [PATCH] arm64: Stop printing the virtual memory layout Laura Abbott
2017-12-19 19:28 ` Laura Abbott
2017-12-19 21:04 ` Kees Cook
2017-12-19 21:04   ` Kees Cook
2017-12-19 22:18   ` Laura Abbott
2017-12-19 22:18     ` Laura Abbott
2018-01-09 23:02   ` Kees Cook
2018-01-09 23:02     ` Kees Cook
2018-01-15 18:18     ` Catalin Marinas
2018-01-15 18:18       ` Catalin Marinas
2018-01-15 20:00       ` Kees Cook
2018-01-15 20:00         ` Kees Cook
2018-01-18 20:01 ` Florian Fainelli [this message]
2018-01-18 20:01   ` Florian Fainelli
2018-01-18 20:20   ` Russell King - ARM Linux
2018-01-18 20:20     ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94d6b5c8-07c4-32b5-9746-646b0021d2e9@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.