[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180213174236.gv3ve7wdyrpzrcxi@node.shutemov.name>
Date: Tue, 13 Feb 2018 20:42:36 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: tglx@...utronix.de, linux-kernel@...r.kernel.org, hpa@...or.com,
luto@...capital.net, mingo@...nel.org,
kirill.shutemov@...ux.intel.com, gorcunov@...nvz.org, bp@...e.de,
peterz@...radead.org, torvalds@...ux-foundation.org,
willy@...radead.org
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/boot] x86/boot/compressed/64: Handle 5-level paging
boot if kernel is above 4G
On Tue, Feb 13, 2018 at 09:21:58AM -0800, tip-bot for Kirill A. Shutemov wrote:
> Commit-ID: 89674e91fcf51f77dc4e87b77c6840f31b85077d
> Gitweb: https://git.kernel.org/tip/89674e91fcf51f77dc4e87b77c6840f31b85077d
> Author: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> AuthorDate: Fri, 9 Feb 2018 17:22:28 +0300
> Committer: Ingo Molnar <mingo@...nel.org>
> CommitDate: Tue, 13 Feb 2018 18:16:22 +0100
>
> x86/boot/compressed/64: Handle 5-level paging boot if kernel is above 4G
>
> This patch addresses a shortcoming in current boot process on machines
> that supports 5-level paging.
>
> If a bootloader enables 64-bit mode with 4-level paging, we might need to
> switch over to 5-level paging. The switching requires the disabling
> paging. It works fine if kernel itself is loaded below 4G.
>
> But if the bootloader put the kernel above 4G (not sure if anybody does
> this), we would lose control as soon as paging is disabled, because the
> code becomes unreachable to the CPU.
>
> This patch implements a trampoline in lower memory to handle this
> situation.
>
> We only need the memory for a very short time, until the main kernel
> image sets up own page tables.
>
> We go through the trampoline even if we don't have to: if we're already
> in 5-level paging mode or if we don't need to switch to it. This way the
> trampoline gets tested on every boot.
>
> Debugged-by: "Kirill A. Shutemov" <kirill@...temov.name>
> Tested-by: "Kirill A. Shutemov" <kirill@...temov.name>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Cc: Andy Lutomirski <luto@...capital.net>
> Cc: Borislav Petkov <bp@...e.de>
> Cc: Cyrill Gorcunov <gorcunov@...nvz.org>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Matthew Wilcox <willy@...radead.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: linux-mm@...ck.org
> Link: http://lkml.kernel.org/r/20180209142228.21231-5-kirill.shutemov@linux.intel.com
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
Tested-by should be attributed to Andrei.
And please ingore my stand-alone fix that I've just posted.
--
Kirill A. Shutemov
Powered by blists - more mailing lists