Baoquan He 0925dda596 x86/mm/KASLR: Use only one PUD entry for real mode trampoline
The current code builds identity mapping for the real mode trampoline by
borrowing page tables from the direct mapping section if KASLR is
enabled. It copies present entries of the first PUD table in 4-level paging
mode, or the first P4D table in 5-level paging mode.

However, there's only a very small area under low 1 MB reserved for the
real mode trampoline in reserve_real_mode() so it makes no sense to build
up a really large mapping for it.

Reduce it to one PUD (1GB) entry. This matches the randomization
granularity in 4-level paging mode and allows to change the randomization
granularity in 5-level paging mode from 512GB to 1GB later.

[ tglx: Massaged changelog and comments ]

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: dave.hansen@linux.intel.com
Cc: luto@kernel.org
Cc: peterz@infradead.org
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: keescook@chromium.org
Cc: thgarnie@google.com
Link: https://lkml.kernel.org/r/20190308025616.21440-2-bhe@redhat.com
2019-04-05 22:13:00 +02:00
..
2019-03-07 18:32:03 -08:00
2018-01-05 15:23:01 +01:00
2019-02-18 17:49:30 +01:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2019-03-12 10:04:01 -07:00
2018-10-31 08:54:16 -07:00
2018-12-03 19:10:18 +01:00
2019-03-22 13:31:28 +01:00
2019-03-06 23:24:52 +01:00