diff options
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 733864a653ab..d74ac33290ae 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -122,8 +122,6 @@ | |||
122 | unsigned long max_low_pfn_mapped; | 122 | unsigned long max_low_pfn_mapped; |
123 | unsigned long max_pfn_mapped; | 123 | unsigned long max_pfn_mapped; |
124 | 124 | ||
125 | bool __read_mostly kaslr_enabled = false; | ||
126 | |||
127 | #ifdef CONFIG_DMI | 125 | #ifdef CONFIG_DMI |
128 | RESERVE_BRK(dmi_alloc, 65536); | 126 | RESERVE_BRK(dmi_alloc, 65536); |
129 | #endif | 127 | #endif |
@@ -427,11 +425,6 @@ static void __init reserve_initrd(void) | |||
427 | } | 425 | } |
428 | #endif /* CONFIG_BLK_DEV_INITRD */ | 426 | #endif /* CONFIG_BLK_DEV_INITRD */ |
429 | 427 | ||
430 | static void __init parse_kaslr_setup(u64 pa_data, u32 data_len) | ||
431 | { | ||
432 | kaslr_enabled = (bool)(pa_data + sizeof(struct setup_data)); | ||
433 | } | ||
434 | |||
435 | static void __init parse_setup_data(void) | 428 | static void __init parse_setup_data(void) |
436 | { | 429 | { |
437 | struct setup_data *data; | 430 | struct setup_data *data; |
@@ -457,9 +450,6 @@ static void __init parse_setup_data(void) | |||
457 | case SETUP_EFI: | 450 | case SETUP_EFI: |
458 | parse_efi_setup(pa_data, data_len); | 451 | parse_efi_setup(pa_data, data_len); |
459 | break; | 452 | break; |
460 | case SETUP_KASLR: | ||
461 | parse_kaslr_setup(pa_data, data_len); | ||
462 | break; | ||
463 | default: | 453 | default: |
464 | break; | 454 | break; |
465 | } | 455 | } |
@@ -842,14 +832,15 @@ static void __init trim_low_memory_range(void) | |||
842 | static int | 832 | static int |
843 | dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) | 833 | dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) |
844 | { | 834 | { |
845 | if (kaslr_enabled) | 835 | if (kaslr_enabled()) { |
846 | pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", | 836 | pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", |
847 | (unsigned long)&_text - __START_KERNEL, | 837 | (unsigned long)&_text - __START_KERNEL, |
848 | __START_KERNEL, | 838 | __START_KERNEL, |
849 | __START_KERNEL_map, | 839 | __START_KERNEL_map, |
850 | MODULES_VADDR-1); | 840 | MODULES_VADDR-1); |
851 | else | 841 | } else { |
852 | pr_emerg("Kernel Offset: disabled\n"); | 842 | pr_emerg("Kernel Offset: disabled\n"); |
843 | } | ||
853 | 844 | ||
854 | return 0; | 845 | return 0; |
855 | } | 846 | } |