x86/boot/KASLR: Add two new functions for 1GB huge pages handling
authorBaoquan He <bhe@redhat.com>
Mon, 25 Jun 2018 03:16:55 +0000 (11:16 +0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 3 Jul 2018 08:50:12 +0000 (10:50 +0200)
commit9b912485e0e74a74e042e4f2dd87f262e46fcdf1
tree958fdd1263e6ba9726a29967e9798e43b8ce4692
parent021c91791a5e7e85c567452f1be3e4c2c6cb6063
x86/boot/KASLR: Add two new functions for 1GB huge pages handling

Introduce two new functions: parse_gb_huge_pages() and process_gb_huge_pages(),
which handle a conflict between KASLR and huge pages of 1GB.

These two functions will be used in the next patch:

- parse_gb_huge_pages() is used to parse kernel command-line to get
  how many 1GB huge pages have been specified. A static global
  variable 'max_gb_huge_pages' is added to store the number.

- process_gb_huge_pages() is used to skip as many 1GB huge pages
  as possible from the passed in memory region according to the
  specified number.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: douly.fnst@cn.fujitsu.com
Cc: fanc.fnst@cn.fujitsu.com
Cc: indou.takao@jp.fujitsu.com
Cc: keescook@chromium.org
Cc: lcapitulino@redhat.com
Cc: yasu.isimatu@gmail.com
Link: http://lkml.kernel.org/r/20180625031656.12443-2-bhe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/boot/compressed/kaslr.c