aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt2
-rw-r--r--Documentation/x86_64/boot-options.txt4
-rw-r--r--arch/x86/Kconfig19
-rw-r--r--arch/x86/kernel/efi.c7
-rw-r--r--arch/x86/kernel/efi_32.c25
-rw-r--r--arch/x86/kernel/efi_64.c7
-rw-r--r--arch/x86/kernel/setup_32.c6
7 files changed, 25 insertions, 45 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index b3f20beea411..e7910f8b4fcc 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1169,6 +1169,8 @@ and is between 256 and 4096 characters. It is defined in the file
1169 1169
1170 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. 1170 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects.
1171 1171
1172 noefi [X86-32,X86-64] Disable EFI runtime services support.
1173
1172 noexec [IA-64] 1174 noexec [IA-64]
1173 1175
1174 noexec [X86-32,X86-64] 1176 noexec [X86-32,X86-64]
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 638bf46ca059..34abae4e9442 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -306,8 +306,4 @@ Debugging
306 newfallback: use new unwinder but fall back to old if it gets 306 newfallback: use new unwinder but fall back to old if it gets
307 stuck (default) 307 stuck (default)
308 308
309EFI
310
311 noefi Disable EFI support
312
313Miscellaneous 309Miscellaneous
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d89b94528153..fa6fa52248d9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -961,21 +961,18 @@ config MTRR
961 961
962config EFI 962config EFI
963 def_bool n 963 def_bool n
964 prompt "Boot from EFI support" 964 prompt "EFI runtime service support"
965 depends on ACPI 965 depends on ACPI
966 ---help--- 966 ---help---
967 This enables the kernel to boot on EFI platforms using 967 This enables the kernel to use EFI runtime services that are
968 system configuration information passed to it from the firmware.
969 This also enables the kernel to use any EFI runtime services that are
970 available (such as the EFI variable services). 968 available (such as the EFI variable services).
971 969
972 This option is only useful on systems that have EFI firmware 970 This option is only useful on systems that have EFI firmware.
973 and will result in a kernel image that is ~8k larger. In addition, 971 In addition, you should use the latest ELILO loader available
974 you must use the latest ELILO loader available at 972 at <http://elilo.sourceforge.net> in order to take advantage
975 <http://elilo.sourceforge.net> in order to take advantage of 973 of EFI runtime services. However, even with this option, the
976 kernel initialization using EFI information (neither GRUB nor LILO know 974 resultant kernel should continue to boot on existing non-EFI
977 anything about EFI). However, even with this option, the resultant 975 platforms.
978 kernel should continue to boot on existing non-EFI platforms.
979 976
980config IRQBALANCE 977config IRQBALANCE
981 def_bool y 978 def_bool y
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 0a61522e85c7..2939b015c2ed 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -55,6 +55,13 @@ struct efi_memory_map memmap;
55struct efi efi_phys __initdata; 55struct efi efi_phys __initdata;
56static efi_system_table_t efi_systab __initdata; 56static efi_system_table_t efi_systab __initdata;
57 57
58static int __init setup_noefi(char *arg)
59{
60 efi_enabled = 0;
61 return 0;
62}
63early_param("noefi", setup_noefi);
64
58static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) 65static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
59{ 66{
60 return efi_call_virt2(get_time, tm, tc); 67 return efi_call_virt2(get_time, tm, tc);
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c
index 30f937116288..afd2c3b039d6 100644
--- a/arch/x86/kernel/efi_32.c
+++ b/arch/x86/kernel/efi_32.c
@@ -20,27 +20,15 @@
20 */ 20 */
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/mm.h>
25#include <linux/types.h> 23#include <linux/types.h>
26#include <linux/time.h>
27#include <linux/spinlock.h>
28#include <linux/bootmem.h>
29#include <linux/ioport.h> 24#include <linux/ioport.h>
30#include <linux/module.h>
31#include <linux/efi.h> 25#include <linux/efi.h>
32#include <linux/kexec.h>
33 26
34#include <asm/setup.h>
35#include <asm/io.h> 27#include <asm/io.h>
36#include <asm/page.h> 28#include <asm/page.h>
37#include <asm/pgtable.h> 29#include <asm/pgtable.h>
38#include <asm/processor.h>
39#include <asm/desc.h>
40#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
41 31
42#define PFX "EFI: "
43
44/* 32/*
45 * To make EFI call EFI runtime service in physical addressing mode we need 33 * To make EFI call EFI runtime service in physical addressing mode we need
46 * prelog/epilog before/after the invocation to disable interrupt, to 34 * prelog/epilog before/after the invocation to disable interrupt, to
@@ -49,16 +37,14 @@
49 */ 37 */
50 38
51static unsigned long efi_rt_eflags; 39static unsigned long efi_rt_eflags;
52static DEFINE_SPINLOCK(efi_rt_lock);
53static pgd_t efi_bak_pg_dir_pointer[2]; 40static pgd_t efi_bak_pg_dir_pointer[2];
54 41
55void efi_call_phys_prelog(void) __acquires(efi_rt_lock) 42void efi_call_phys_prelog(void)
56{ 43{
57 unsigned long cr4; 44 unsigned long cr4;
58 unsigned long temp; 45 unsigned long temp;
59 struct desc_ptr gdt_descr; 46 struct desc_ptr gdt_descr;
60 47
61 spin_lock(&efi_rt_lock);
62 local_irq_save(efi_rt_eflags); 48 local_irq_save(efi_rt_eflags);
63 49
64 /* 50 /*
@@ -88,14 +74,14 @@ void efi_call_phys_prelog(void) __acquires(efi_rt_lock)
88 /* 74 /*
89 * After the lock is released, the original page table is restored. 75 * After the lock is released, the original page table is restored.
90 */ 76 */
91 local_flush_tlb(); 77 __flush_tlb_all();
92 78
93 gdt_descr.address = __pa(get_cpu_gdt_table(0)); 79 gdt_descr.address = __pa(get_cpu_gdt_table(0));
94 gdt_descr.size = GDT_SIZE - 1; 80 gdt_descr.size = GDT_SIZE - 1;
95 load_gdt(&gdt_descr); 81 load_gdt(&gdt_descr);
96} 82}
97 83
98void efi_call_phys_epilog(void) __releases(efi_rt_lock) 84void efi_call_phys_epilog(void)
99{ 85{
100 unsigned long cr4; 86 unsigned long cr4;
101 struct desc_ptr gdt_descr; 87 struct desc_ptr gdt_descr;
@@ -119,10 +105,9 @@ void efi_call_phys_epilog(void) __releases(efi_rt_lock)
119 /* 105 /*
120 * After the lock is released, the original page table is restored. 106 * After the lock is released, the original page table is restored.
121 */ 107 */
122 local_flush_tlb(); 108 __flush_tlb_all();
123 109
124 local_irq_restore(efi_rt_eflags); 110 local_irq_restore(efi_rt_eflags);
125 spin_unlock(&efi_rt_lock);
126} 111}
127 112
128/* 113/*
@@ -135,7 +120,7 @@ void __init efi_map_memmap(void)
135 memmap.map = bt_ioremap((unsigned long) memmap.phys_map, 120 memmap.map = bt_ioremap((unsigned long) memmap.phys_map,
136 (memmap.nr_map * memmap.desc_size)); 121 (memmap.nr_map * memmap.desc_size));
137 if (memmap.map == NULL) 122 if (memmap.map == NULL)
138 printk(KERN_ERR PFX "Could not remap the EFI memmap!\n"); 123 printk(KERN_ERR "Could not remap the EFI memmap!\n");
139 124
140 memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size); 125 memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
141} 126}
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index f2000dbc7195..269de2e049a3 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -40,13 +40,6 @@
40static pgd_t save_pgd __initdata; 40static pgd_t save_pgd __initdata;
41static unsigned long efi_flags __initdata; 41static unsigned long efi_flags __initdata;
42 42
43static int __init setup_noefi(char *arg)
44{
45 efi_enabled = 0;
46 return 0;
47}
48early_param("noefi", setup_noefi);
49
50static void __init early_mapping_set_exec(unsigned long start, 43static void __init early_mapping_set_exec(unsigned long start,
51 unsigned long end, 44 unsigned long end,
52 int executable) 45 int executable)
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 2e805da337a2..704550fdb84c 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -648,9 +648,6 @@ void __init setup_arch(char **cmdline_p)
648 printk(KERN_INFO "BIOS-provided physical RAM map:\n"); 648 printk(KERN_INFO "BIOS-provided physical RAM map:\n");
649 print_memory_map(memory_setup()); 649 print_memory_map(memory_setup());
650 650
651 if (efi_enabled)
652 efi_init();
653
654 copy_edd(); 651 copy_edd();
655 652
656 if (!boot_params.hdr.root_flags) 653 if (!boot_params.hdr.root_flags)
@@ -677,6 +674,9 @@ void __init setup_arch(char **cmdline_p)
677 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 674 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
678 *cmdline_p = command_line; 675 *cmdline_p = command_line;
679 676
677 if (efi_enabled)
678 efi_init();
679
680 max_low_pfn = setup_memory(); 680 max_low_pfn = setup_memory();
681 681
682#ifdef CONFIG_VMI 682#ifdef CONFIG_VMI