Re: [PATCHv7 07/19] x86/mm: Make virtual memory layout movable for CONFIG_X86_5LEVEL

From: Ingo Molnar
Date: Thu Sep 28 2017 - 04:19:48 EST



* Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> We need to be able to adjust virtual memory layout at runtime to be able
> to switch between 4- and 5-level paging at boot-time.
>
> KASLR already has movable __VMALLOC_BASE, __VMEMMAP_BASE and __PAGE_OFFSET.
> Let's re-use it.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/kaslr.h | 4 ----
> arch/x86/include/asm/page_64.h | 4 ++++
> arch/x86/include/asm/page_64_types.h | 2 +-
> arch/x86/include/asm/pgtable_64_types.h | 2 +-
> arch/x86/kernel/head64.c | 9 +++++++++
> arch/x86/mm/kaslr.c | 8 --------
> 6 files changed, 15 insertions(+), 14 deletions(-)

> +#if defined(CONFIG_RANDOMIZE_MEMORY) || defined(CONFIG_X86_5LEVEL)
> +#if defined(CONFIG_RANDOMIZE_MEMORY) || defined(CONFIG_X86_5LEVEL)
> +#if defined(CONFIG_RANDOMIZE_MEMORY) || defined(CONFIG_X86_5LEVEL)

Yeah, so this calls for a new, properly named Kconfig helper variable.

Thanks,

Ingo