aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/kaslr.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /arch/x86/mm/kaslr.c
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'arch/x86/mm/kaslr.c')
-rw-r--r--arch/x86/mm/kaslr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c
index 26dccd6c0df1..bda8d5eef04d 100644
--- a/arch/x86/mm/kaslr.c
+++ b/arch/x86/mm/kaslr.c
@@ -77,7 +77,7 @@ static inline unsigned long get_padding(struct kaslr_memory_region *region)
77 */ 77 */
78static inline bool kaslr_memory_enabled(void) 78static inline bool kaslr_memory_enabled(void)
79{ 79{
80 return kaslr_enabled() && !config_enabled(CONFIG_KASAN); 80 return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
81} 81}
82 82
83/* Initialize base and padding for each memory region randomized with KASLR */ 83/* Initialize base and padding for each memory region randomized with KASLR */
@@ -97,7 +97,7 @@ void __init kernel_randomize_memory(void)
97 * add padding if needed (especially for memory hotplug support). 97 * add padding if needed (especially for memory hotplug support).
98 */ 98 */
99 BUG_ON(kaslr_regions[0].base != &page_offset_base); 99 BUG_ON(kaslr_regions[0].base != &page_offset_base);
100 memory_tb = ((max_pfn << PAGE_SHIFT) >> TB_SHIFT) + 100 memory_tb = DIV_ROUND_UP(max_pfn << PAGE_SHIFT, 1UL << TB_SHIFT) +
101 CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING; 101 CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING;
102 102
103 /* Adapt phyiscal memory region size based on available memory */ 103 /* Adapt phyiscal memory region size based on available memory */