diff options
Diffstat (limited to 'arch/x86/platform/efi/efi_32.c')
-rw-r--r-- | arch/x86/platform/efi/efi_32.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 40e7cda52936..ed5b67338294 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c | |||
@@ -33,11 +33,10 @@ | |||
33 | 33 | ||
34 | /* | 34 | /* |
35 | * To make EFI call EFI runtime service in physical addressing mode we need | 35 | * To make EFI call EFI runtime service in physical addressing mode we need |
36 | * prolog/epilog before/after the invocation to disable interrupt, to | 36 | * prolog/epilog before/after the invocation to claim the EFI runtime service |
37 | * claim EFI runtime service handler exclusively and to duplicate a memory in | 37 | * handler exclusively and to duplicate a memory mapping in low memory space, |
38 | * low memory space say 0 - 3G. | 38 | * say 0 - 3G. |
39 | */ | 39 | */ |
40 | static unsigned long efi_rt_eflags; | ||
41 | 40 | ||
42 | void efi_sync_low_kernel_mappings(void) {} | 41 | void efi_sync_low_kernel_mappings(void) {} |
43 | void __init efi_dump_pagetable(void) {} | 42 | void __init efi_dump_pagetable(void) {} |
@@ -57,21 +56,24 @@ void __init efi_map_region(efi_memory_desc_t *md) | |||
57 | void __init efi_map_region_fixed(efi_memory_desc_t *md) {} | 56 | void __init efi_map_region_fixed(efi_memory_desc_t *md) {} |
58 | void __init parse_efi_setup(u64 phys_addr, u32 data_len) {} | 57 | void __init parse_efi_setup(u64 phys_addr, u32 data_len) {} |
59 | 58 | ||
60 | void __init efi_call_phys_prolog(void) | 59 | pgd_t * __init efi_call_phys_prolog(void) |
61 | { | 60 | { |
62 | struct desc_ptr gdt_descr; | 61 | struct desc_ptr gdt_descr; |
62 | pgd_t *save_pgd; | ||
63 | 63 | ||
64 | local_irq_save(efi_rt_eflags); | 64 | /* Current pgd is swapper_pg_dir, we'll restore it later: */ |
65 | 65 | save_pgd = swapper_pg_dir; | |
66 | load_cr3(initial_page_table); | 66 | load_cr3(initial_page_table); |
67 | __flush_tlb_all(); | 67 | __flush_tlb_all(); |
68 | 68 | ||
69 | gdt_descr.address = __pa(get_cpu_gdt_table(0)); | 69 | gdt_descr.address = __pa(get_cpu_gdt_table(0)); |
70 | gdt_descr.size = GDT_SIZE - 1; | 70 | gdt_descr.size = GDT_SIZE - 1; |
71 | load_gdt(&gdt_descr); | 71 | load_gdt(&gdt_descr); |
72 | |||
73 | return save_pgd; | ||
72 | } | 74 | } |
73 | 75 | ||
74 | void __init efi_call_phys_epilog(void) | 76 | void __init efi_call_phys_epilog(pgd_t *save_pgd) |
75 | { | 77 | { |
76 | struct desc_ptr gdt_descr; | 78 | struct desc_ptr gdt_descr; |
77 | 79 | ||
@@ -79,10 +81,8 @@ void __init efi_call_phys_epilog(void) | |||
79 | gdt_descr.size = GDT_SIZE - 1; | 81 | gdt_descr.size = GDT_SIZE - 1; |
80 | load_gdt(&gdt_descr); | 82 | load_gdt(&gdt_descr); |
81 | 83 | ||
82 | load_cr3(swapper_pg_dir); | 84 | load_cr3(save_pgd); |
83 | __flush_tlb_all(); | 85 | __flush_tlb_all(); |
84 | |||
85 | local_irq_restore(efi_rt_eflags); | ||
86 | } | 86 | } |
87 | 87 | ||
88 | void __init efi_runtime_mkexec(void) | 88 | void __init efi_runtime_mkexec(void) |