aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorHuang, Ying <ying.huang@intel.com>2008-01-30 07:32:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:11 -0500
commit8b2cb7a8f531d6ca72a8aff873b9bb1c6b3122ba (patch)
treef53edab6bdc4e1f39ef2cea8d13f15242617262e /arch/x86/kernel
parentbfd074e05bdb69652d24ebc60b126899174ca788 (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/x86/kernel')
-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
4 files changed, 15 insertions, 30 deletions
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