lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Jan 2018 16:48:00 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...e.de>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/kexec: Make kexec work in 5-level paging mode

On Mon, Jan 29, 2018 at 03:59:27AM -0800, Matthew Wilcox wrote:
> On Mon, Jan 29, 2018 at 02:08:45PM +0300, Kirill A. Shutemov wrote:
> > I've missed that we need to change relocate_kernel() to set CR4.LA57
> > flag if the kernel has 5-level paging enabled.
> > 
> > I avoided to use ifdef CONFIG_X86_5LEVEL here and inferred if we need to
> > enabled 5-level paging from previous CR4 value. This way the code is
> > ready for boot-time switching between paging modes.
> 
> Forgive me if I'm missing something ... can you kexec a 5-level kernel
> from a 4-level kernel or vice versa?

With this patch you can kexec from 4-to-5 and from 5-to-5 in addition to
current 4-to-4. 4-to-5 basically takes the same path as UEFI boot in new
kernel.

I think I will be able to make 5-to-4 work too, when boot-time switching
code will be upstream, assuming both kernels are build from the tree with
boot-time switching support and the new kernel is loaded below 128TiB.

For 5-to-4, kernel decompression code of the new kernel starts on 5-level
paging identity mapping constructed by caller. Decompression code then
would switch over to 4-level paging via 32-bit trampoline (we cannot
switch between 4- and 5-level paging directly) and proceed as in normal
boot.

Let me check.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ