linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM64: 4 level page table translation for 4KB pages
Date: Mon, 31 Mar 2014 13:45:51 +0100	[thread overview]
Message-ID: <20140331124551.GF29871@arm.com> (raw)
In-Reply-To: <20140331113113.GE29871@arm.com>

On Mon, Mar 31, 2014 at 12:31:14PM +0100, Catalin Marinas wrote:
> On Mon, Mar 31, 2014 at 07:56:53AM +0100, Arnd Bergmann wrote:
> > On Monday 31 March 2014 12:51:07 Jungseok Lee wrote:
> > > Current ARM64 kernel cannot support 4KB pages for 40-bit physical address
> > > space described in [1] due to one major issue + one minor issue.
> > > 
> > > Firstly, kernel logical memory map (0xffffffc000000000-0xffffffffffffffff)
> > > cannot cover DRAM region from 544GB to 1024GB in [1]. Specifically, ARM64
> > > kernel fails to create mapping for this region in map_mem function
> > > (arch/arm64/mm/mmu.c) since __phys_to_virt for this region reaches to
> > > address overflow. I've used 3.14-rc8+Fast Models to validate the statement.
[...]
> > a) always use a four-level page table in kernel space, regardless of
> > whether we do it in user space. We can move the kernel mappings down
> > in address space either by one 512GB entry to 0xffffff0000000000, or
> > to match the 64k-page location at 0xfffffc0000000000, or all the way
> > to to 0xfffc000000000000. In any case, we can have all the dynamic
> > mappings within one 512GB area and pretend we have a three-level
> > page table for them, while the rest of DRAM is mapped statically at
> > early boot time using 512GB large pages.
> 
> That's a workaround but we end up with two (or more) kernel pgds - one
> for vmalloc, ioremap etc. and another (static) one for the kernel linear
> mapping. So far there isn't any memory mapping carved out but we have to
> be careful in the future.
> 
> However, kernel page table walking would be a bit slower with 4-levels.

Yet another approach would be to enable 4-levels of page tables (no
nopud.h) in the kernel with pgd_offset_k doing the right thing for 4
levels but user space configured to 3-levels only and pgd_offset
returning 0 while pud_offset does what pgd_offset currently implements
for 3 levels.

This solves the page table walk latency for user but not for kernel.
Anyway, if the hardware memory map is so sparse (a real SoC, not the
spec), I don't think we have other ways to support it with 3-levels of
page table for the kernel, unless we hack __virt_to_phys/__phys_to_virt.

-- 
Catalin

  reply	other threads:[~2014-03-31 12:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31  3:51 [RFC] ARM64: 4 level page table translation for 4KB pages Jungseok Lee
2014-03-31  6:56 ` Arnd Bergmann
2014-03-31 11:31   ` Catalin Marinas
2014-03-31 12:45     ` Catalin Marinas [this message]
2014-03-31 12:58       ` Arnd Bergmann
2014-03-31 15:00         ` Catalin Marinas
2014-03-31 12:53     ` Arnd Bergmann
2014-03-31 15:27       ` Catalin Marinas
2014-03-31 23:11         ` Arnd Bergmann
2014-04-01 13:23           ` Catalin Marinas
2014-04-02  3:58             ` Jungseok Lee
2014-04-02  9:01               ` Catalin Marinas
2014-04-02 15:24                 ` Catalin Marinas
2014-04-02 22:41                   ` Jungseok Lee
2014-04-03  2:15                   ` Sungjinn Chung
2014-04-03  8:38                     ` Catalin Marinas
2014-04-03  9:14                       ` Sungjinn Chung
2014-04-03  9:17                         ` Catalin Marinas
2014-04-01  0:44         ` 정성진
2014-04-01  9:46           ` Catalin Marinas
2014-04-01 10:13             ` 정성진
2014-04-01 11:22               ` Catalin Marinas
2014-04-01 23:35                 ` Sungjinn Chung
2014-04-01  0:42     ` Jungseok Lee

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=20140331124551.GF29871@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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).