mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Minfei Huang <mnfhuang@gmail.com>
Cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Avoid overlap the fixmap area on i386
Date: Tue, 28 Oct 2014 12:06:03 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1410281159590.5308@nanos> (raw)
In-Reply-To: <6B680A9E-6CE9-4C96-934B-CB01DCB58278@gmail.com>

On Thu, 23 Oct 2014, Minfei Huang wrote:

> From: Minfei Huang <mnfhuang@gmail.com>
> 
> It is a problem when configuring high memory off where the vmalloc
> reserve area could end up overlapping the early_ioremap fixmap
> area on i386.
> 
> The ordering of the VMALLOC_RESERVE space is:
> FIXADDR_TOP
>                        fixed_addresses
> FIXADDR_START
>                        early_ioremap fixed addresses
> FIXADDR_BOOT_START
>                        Persistent kmap area
> PKMAP_BASE
> VMALLOC_END
>                        Vmalloc area
> VMALLOC_START
> high_memory
> 
> The available address we can use is lower than FIXADDR_BOOT_START. So
> We will set the kmap boundary below the FIXADDR_BOOT_START, if configure
> the high memory.
> 
> If we configure the high memory, the vmalloc reserve area should end
> up to PKMAP_BASE, otherwise should end up to FIXADDR_BOOT_START.

Which is not really a problem, because the FIXADDR_BOOT area is only
used during boot for early_ioremap() and it's unused when ioremap() is
functional. vmalloc becomes available after early boot so the
FIXADDR_BOOT area is available for reuse.

Though in the highmem case the PKMAP area is not overlapping the
FIXADDR_BOOT area. So having the !highmem case use the same layout
(minus the PKMAP area) makes sense.

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
> arch/x86/include/asm/pgtable_32_types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
> index ed5903b..2ac5fc8 100644
> --- a/arch/x86/include/asm/pgtable_32_types.h
> +++ b/arch/x86/include/asm/pgtable_32_types.h
> @@ -43,7 +43,7 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */
> #ifdef CONFIG_HIGHMEM
> # define VMALLOC_END	(PKMAP_BASE - 2 * PAGE_SIZE)
> #else
> -# define VMALLOC_END	(FIXADDR_START - 2 * PAGE_SIZE)
> +# define VMALLOC_END	(FIXADDR_BOOT_START - 2 * PAGE_SIZE)
> #endif
> 
> #define MODULES_VADDR	VMALLOC_START
> -- 
> 1.8.3.1

  reply	other threads:[~2014-10-28 11:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 15:36 Minfei Huang
2014-10-28 11:06 ` Thomas Gleixner [this message]
2014-10-28 17:24   ` H. Peter Anvin
2014-10-28 17:29     ` Thomas Gleixner
2014-10-29  3:14       ` H. Peter Anvin
2014-10-29  4:30         ` Minfei Huang
2014-10-28 11:24 ` [tip:x86/mm] x86/mm: " tip-bot for Minfei Huang

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=alpine.DEB.2.11.1410281159590.5308@nanos \
    --to=tglx@linutronix.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mnfhuang@gmail.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

all inboxes | Powered by JetHome®