kaiser: allocate pgd with order 0 when pti=off
authorHugh Dickins <hughd@google.com>
Tue, 30 Jan 2018 02:17:58 +0000 (18:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 11:35:55 +0000 (12:35 +0100)
commit400d3c8b0c7f6c942cd9bf201da1f32da9bdcc9f
tree48b5cec979a971324254466d3aac42f70ac23c18
parentae1fc8de51b10dba40cbd54959b5ba0a311c0861
kaiser: allocate pgd with order 0 when pti=off

The 4.9.77 version of "x86/pti/efi: broken conversion from efi to kernel
page table" looked nicer than the 4.4.112 version, but was suboptimal on
machines booted with "pti=off" (or on AMD machines): it allocated pgd
with an order 1 page whatever the setting of kaiser_enabled.

Fix that by moving the definition of PGD_ALLOCATION_ORDER from
asm/pgalloc.h to asm/pgtable.h, which already defines kaiser_enabled.

Fixes: 1b92c48a2eeb ("x86/pti/efi: broken conversion from efi to kernel page table")
Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Steven Sistare <steven.sistare@oracle.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/pgalloc.h
arch/x86/include/asm/pgtable.h