lkml.org 
[lkml]   [2017]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv7 12/19] x86/mm: Adjust virtual address space layout in early boot.
On Thu, Sep 28, 2017 at 10:31:55AM +0200, Ingo Molnar wrote:
>
> * Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote:
>
> > We need to adjust virtual address space to support switching between
> > paging modes.
> >
> > The adjustment happens in __startup_64().
>
> > +#ifdef CONFIG_X86_5LEVEL
> > + if (__read_cr4() & X86_CR4_LA57) {
> > + pgtable_l5_enabled = 1;
> > + pgdir_shift = 48;
> > + ptrs_per_p4d = 512;
> > + }
> > +#endif
>
> So CR4 really sucks as a parameter passing interface - was it us who enabled LA57
> in the early boot code, right? Couldn't we add a flag which gets set there, or
> something?

It's not necessary that we enabled LA57. At least I tried to write code
that doesn't assume this. We enable it if bootloader haven't done this
already for us.

What is so awful about using CR4 as passing interface? It's one-time
check, so performance shouldn't be an issue.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2017-09-28 15:27    [W:0.103 / U:3.948 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site