lkml.org 
[lkml]   [2017]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCHv1, RFC 0/8] Boot-time switching between 4- and 5-level paging
    On Thu, May 25, 2017 at 4:24 PM, Linus Torvalds
    <torvalds@linux-foundation.org> wrote:
    > On Thu, May 25, 2017 at 1:33 PM, Kirill A. Shutemov
    > <kirill.shutemov@linux.intel.com> wrote:
    >> Here' my first attempt to bring boot-time between 4- and 5-level paging.
    >> It looks not too terrible to me. I've expected it to be worse.
    >
    > If I read this right, you just made it a global on/off thing.
    >
    > May I suggest possibly a different model entirely? Can you make it a
    > per-mm flag instead?
    >
    > And then we
    >
    > (a) make all kthreads use the 4-level page tables
    >
    > (b) which means that all the init code uses the 4-level page tables
    >
    > (c) which means that all those checks for "start_secondary" etc can
    > just go away, because those all run with 4-level page tables.
    >
    > Or is it just much too expensive to switch between 4-level and 5-level
    > paging at run-time?
    >

    Even ignoring expensiveness, I'm not convinced it's practical. AFAICT
    you can't atomically switch the paging mode and CR3, so either you
    need some magic page table with trampoline that works in both modes
    (which is presumably doable with some trickery) or you need to flip
    paging off. Good luck if an NMI hits in the mean time. There was
    code like that once upon a time for EFI mixed mode, but it got deleted
    due to triple-faults.

    Doing this in switch_mm() sounds painful.

    \
     
     \ /
      Last update: 2017-05-26 02:41    [W:4.491 / U:0.212 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site