diff options
Diffstat (limited to 'arch/x86/mm/kaslr.c')
-rw-r--r-- | arch/x86/mm/kaslr.c | 4 |
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 | */ |
78 | static inline bool kaslr_memory_enabled(void) | 78 | static 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 */ |