linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-doc@vger.kernel.org, tglx@linutronix.de,
	kirill.shutemov@linux.intel.com, thgarnie@google.com,
	corbet@lwn.net
Subject: Re: [PATCH v2 1/3] x86/KASLR: Update document about KERNEL_IMAGE_SIZE
Date: Wed, 3 Oct 2018 16:43:37 +0800	[thread overview]
Message-ID: <20181003084337.GA5140@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20181003075223.GA3029@gmail.com>

On 10/03/18 at 09:52am, Ingo Molnar wrote:
> 
> * Baoquan He <bhe@redhat.com> wrote:
> 
> > Currently CONFIG_RANDOMIZE_BASE=y is default set, update the relevant
> > document about KERNEL_IMAGE_SIZE.
> 
> Suggested wording:
> 
>   x86/KASLR: Update KERNEL_IMAGE_SIZE description
>   
>   Currently CONFIG_RANDOMIZE_BASE=y is set by default, which makes some of the
>   old comments above the KERNEL_IMAGE_SIZE definition out of date. Update them
>   to the current state of affairs.

Thanks, will update with this.

> 
> > Signed-off-by: Baoquan He <bhe@redhat.com>
> > ---
> >  arch/x86/include/asm/page_64_types.h | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
> > index 6afac386a434..2288ceabdb9c 100644
> > --- a/arch/x86/include/asm/page_64_types.h
> > +++ b/arch/x86/include/asm/page_64_types.h
> > @@ -61,9 +61,10 @@
> >  /*
> >   * Kernel image size is limited to 1GiB due to the fixmap living in the
> >   * next 1GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S). Use
> > - * 512MiB by default, leaving 1.5GiB for modules once the page tables
> > - * are fully set up. If kernel ASLR is configured, it can extend the
> > - * kernel page table mapping, reducing the size of the modules area.
> > + * 1 GiB by default, leaving 1 GiB for modules once the page tables are
> > + * fully set up. If kernel ASLR is not configured, it can shrink the
> > + * kernel page table mapping to decrease the size of kernel area to 512
> > + * MiB, increase the size of the modules area to 1.5 GiB.
> >   */
> 
> I've prettified that comment some more:

Thanks, will use them.

> 
>  /*
>   * Maximum kernel image size is limited to 1 GiB, due to the fixmap living
>   * in the next 1 GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S).
>   *
>   * On KASLR use 1 GiB by default, leaving 1 GiB for modules once the
>   * page tables are fully set up.
>   *
>   * If KASLR is disabled we can shrink it to 0.5 GiB and increase the size
>   * of the modules area to 1.5 GiB.
>   */
> 
> >  #if defined(CONFIG_RANDOMIZE_BASE)
> >  #define KERNEL_IMAGE_SIZE	(1024 * 1024 * 1024)
> 
> BTW., while at it, shouldn't we make that:
> 
>    #ifdef CONFIG_RANDOMIZE_BASE

Yes, makes sense, will change.

> 
> ?
> 
> Thanks,
> 
> 	Ingo

  reply	other threads:[~2018-10-03  8:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 23:58 [PATCH v2 0/3] x86/mm/doc: Clean up mm.txt Baoquan He
2018-09-26 23:58 ` [PATCH v2 1/3] x86/KASLR: Update document about KERNEL_IMAGE_SIZE Baoquan He
2018-10-03  7:52   ` Ingo Molnar
2018-10-03  8:43     ` Baoquan He [this message]
2018-09-26 23:58 ` [PATCH v2 2/3] x86/mm/doc: Clean up the memory region layout descriptions Baoquan He
2018-10-02  9:14   ` Ingo Molnar
2018-10-03  8:45     ` Baoquan He
2018-09-26 23:58 ` [PATCH v2 3/3] x86/doc/kaslr.txt: Create a separate part of document abourt KASLR at the end of file Baoquan He

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=20181003084337.GA5140@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=corbet@lwn.net \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).