diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-01-30 07:32:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:11 -0500 |
commit | 8b2cb7a8f531d6ca72a8aff873b9bb1c6b3122ba (patch) | |
tree | f53edab6bdc4e1f39ef2cea8d13f15242617262e /arch | |
parent | bfd074e05bdb69652d24ebc60b126899174ca788 (diff) |
x86: 32-bit EFI runtime service support: fixes in sync with 64-bit support
support according to fixes of x86_64 support.
- Delete efi_rt_lock because it is used during system early boot,
before SMP is initialized.
- Change local_flush_tlb() to __flush_tlb_all() to flush global page
mapping.
- Clean up includes.
- Revise Kconfig description.
- Enable noefi kernel parameter on i386.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig | 19 | ||||
-rw-r--r-- | arch/x86/kernel/efi.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/efi_32.c | 25 | ||||
-rw-r--r-- | arch/x86/kernel/efi_64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 6 |
5 files changed, 23 insertions, 41 deletions
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 | ||
962 | config EFI | 962 | config 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 | ||
980 | config IRQBALANCE | 977 | config 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; | |||
55 | struct efi efi_phys __initdata; | 55 | struct efi efi_phys __initdata; |
56 | static efi_system_table_t efi_systab __initdata; | 56 | static efi_system_table_t efi_systab __initdata; |
57 | 57 | ||
58 | static int __init setup_noefi(char *arg) | ||
59 | { | ||
60 | efi_enabled = 0; | ||
61 | return 0; | ||
62 | } | ||
63 | early_param("noefi", setup_noefi); | ||
64 | |||
58 | static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) | 65 | static 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 | ||
51 | static unsigned long efi_rt_eflags; | 39 | static unsigned long efi_rt_eflags; |
52 | static DEFINE_SPINLOCK(efi_rt_lock); | ||
53 | static pgd_t efi_bak_pg_dir_pointer[2]; | 40 | static pgd_t efi_bak_pg_dir_pointer[2]; |
54 | 41 | ||
55 | void efi_call_phys_prelog(void) __acquires(efi_rt_lock) | 42 | void 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 | ||
98 | void efi_call_phys_epilog(void) __releases(efi_rt_lock) | 84 | void 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 @@ | |||
40 | static pgd_t save_pgd __initdata; | 40 | static pgd_t save_pgd __initdata; |
41 | static unsigned long efi_flags __initdata; | 41 | static unsigned long efi_flags __initdata; |
42 | 42 | ||
43 | static int __init setup_noefi(char *arg) | ||
44 | { | ||
45 | efi_enabled = 0; | ||
46 | return 0; | ||
47 | } | ||
48 | early_param("noefi", setup_noefi); | ||
49 | |||
50 | static void __init early_mapping_set_exec(unsigned long start, | 43 | static 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 |