From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] arm64: defconfig: enable 48-bit VA by default
Date: Fri, 31 Jul 2015 14:22:39 +0100 [thread overview]
Message-ID: <20150731132238.GP407@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAKv+Gu_KL6F=9DpV=ZqYUgY9wjBF+FBodnLMBw=ZOFo6xK7-2w@mail.gmail.com>
On Fri, Jul 31, 2015 at 03:10:39PM +0200, Ard Biesheuvel wrote:
> On 31 July 2015 at 14:53, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > On Thu, Jul 30, 2015 at 09:27:03PM +0200, Ard Biesheuvel wrote:
> >> On 30 July 2015 at 12:13, Catalin Marinas <catalin.marinas@arm.com> wrote:
> >> > On Wed, Jul 29, 2015 at 08:49:57PM +0000, Stuart Yoder wrote:
> >> >> > From: Ard Biesheuvel [mailto:ard.biesheuvel at linaro.org]
> >> [...]
> >> >> > To be honest, I think this is poorly designed, and I am not sure we
> >> >> > should cater for such configurations in the defconfig.
> >> >>
> >> >> Agree, if this is a one-off weird platform then we shouldn't.
> >> >>
> >> >> But, the 'Principles of ARM Memory Maps' doc proposes this:
> >> >> 2 GB at 0x8000_0000
> >> >> 30 GB at 0x8_8000_0000
> >> >> 480 GB at 0x88_0000_0000
> >> >
> >> > I'm not particularly recommending this layout, at least not without some
> >> > clarifications on DRAM aliases (I'll ping people internally about it
> >> > again). The original layout pre-dates ARMv8, it was meant for ARMv7/LPAE
> >> > and all the memory beyond 32-bit was highmem anyway. It was later
> >> > updated for AArch64 but only to allow 44/48-bit PA (a few sections
> >> > added).
> >>
> >> As an aside, is there any reason why the direct mapping *must* be a
> >> linear mapping?
> >> Other than the performance concerns regarding
> >> phys_to_virt/virt_to_phys, I mean?
> >
> > Mostly performance concerns. You could compact the physical range into a
> > smaller virtual one but the conversion will be costly, especially if you
> > want to make it multi-platform (having to look-up memory ranges,
> > memblock offsets). This would affect page table entry setup, code that
> > requires a page structure (like virt_to_page) and anything else doing
> > the virt/phys conversion.
> >
> > I tried something like that for RealView PBX in the past but it was
> > hard-coded (no multi-platform at the time). See
> > arch/arm/mach-realview/include/mach/memory.h.
>
> Yes, that looks vaguely like what I had in mind.
>
> IOW, we could partition the direct mapping just like the ARM
> recommendation, i.e.,
>
> 0 - 2 GB
> 2 - 32 GB
> 32 - 512 GB
>
> but default to 1:1 correspondence, so that
>
> PHYS_OFFSET = PHYS_OFFSET0 = memstart_addr
> PHYS_OFFSET1 = memstart_addr + 2 GB
> PHYS_OFFSET2 = memstart_addr + 32 GB
>
> and only if the ARM recommended physical memory map is detected (with
> memstart_addr @ 0x8000_0000), switch to
>
> PHYS_OFFSET = PHYS_OFFSET0 = memstart_addr
> PHYS_OFFSET1 = memstart_addr + 30 GB
> PHYS_OFFSET2 = memstart_addr + 480 GB
I don't really like such complexity when all you need on arm64 is to
enable 48-bit VA (though it would be interesting to benchmark it).
> I guess such a special case would be out of the question for one-off
> crazy designs like Freescale, but since this is the layout recommended
> by ARM itself, I suppose we could try and support it a bit better.
I'm trying to get the layout fixed before it spreads any further ;).
Interestingly, SBSA doesn't mention this document at all.
--
Catalin
next prev parent reply other threads:[~2015-07-31 13:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 19:49 [RFC] arm64: defconfig: enable 48-bit VA by default Stuart Yoder
2015-07-23 12:44 ` Marc Zyngier
2015-07-23 13:59 ` Stuart Yoder
2015-07-29 19:27 ` Stuart Yoder
2015-07-29 19:51 ` Ard Biesheuvel
2015-07-29 20:49 ` Stuart Yoder
2015-07-29 20:57 ` Arnd Bergmann
2015-07-29 20:58 ` Ard Biesheuvel
2015-07-30 10:13 ` Catalin Marinas
2015-07-30 14:52 ` Stuart Yoder
2015-07-30 16:12 ` Catalin Marinas
2015-07-30 16:32 ` Stuart Yoder
2015-07-30 16:41 ` Catalin Marinas
2015-07-30 17:45 ` Ard Biesheuvel
2015-07-30 18:10 ` Stuart Yoder
2015-08-07 19:01 ` Stuart Yoder
2015-08-08 8:20 ` Ard Biesheuvel
2015-08-13 19:24 ` Stuart Yoder
2015-08-14 12:15 ` Ard Biesheuvel
2015-08-14 13:24 ` Catalin Marinas
2015-08-14 13:55 ` Ard Biesheuvel
2015-08-14 15:37 ` Catalin Marinas
2015-07-30 19:27 ` Ard Biesheuvel
2015-07-31 12:53 ` Catalin Marinas
2015-07-31 13:10 ` Ard Biesheuvel
2015-07-31 13:22 ` Catalin Marinas [this message]
2015-07-31 13:30 ` Ard Biesheuvel
2015-08-01 21:08 ` Arnd Bergmann
2015-08-02 6:19 ` Ard Biesheuvel
2015-08-03 8:00 ` Arnd Bergmann
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=20150731132238.GP407@e104818-lin.cambridge.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).