aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/Makefile3
-rw-r--r--arch/x86/boot/compressed/eboot.c8
-rw-r--r--arch/x86/boot/compressed/eboot.h16
-rw-r--r--arch/x86/include/asm/efi.h24
-rw-r--r--arch/x86/include/asm/pgtable_64_types.h2
-rw-r--r--arch/x86/mm/dump_pagetables.c3
-rw-r--r--arch/x86/platform/efi/efi_64.c3
-rw-r--r--drivers/firmware/efi/Makefile2
-rw-r--r--fs/efivarfs/super.c11
9 files changed, 46 insertions, 26 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 65516ab0cabe..d999398928bc 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -47,7 +47,8 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
47 47
48$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone 48$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
49 49
50vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o 50vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \
51 $(objtree)/drivers/firmware/efi/libstub/lib.a
51 52
52$(obj)/vmlinux: $(vmlinux-objs-y) FORCE 53$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
53 $(call if_changed,ld) 54 $(call if_changed,ld)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 1acf605a646d..92b9a5f2aed6 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -21,8 +21,10 @@ static efi_system_table_t *sys_table;
21 21
22static struct efi_config *efi_early; 22static struct efi_config *efi_early;
23 23
24#define efi_call_early(f, ...) \ 24__pure const struct efi_config *__efi_early(void)
25 efi_early->call(efi_early->f, __VA_ARGS__); 25{
26 return efi_early;
27}
26 28
27#define BOOT_SERVICES(bits) \ 29#define BOOT_SERVICES(bits) \
28static void setup_boot_services##bits(struct efi_config *c) \ 30static void setup_boot_services##bits(struct efi_config *c) \
@@ -285,8 +287,6 @@ void efi_char16_printk(efi_system_table_t *table, efi_char16_t *str)
285 } 287 }
286} 288}
287 289
288#include "../../../../drivers/firmware/efi/libstub/efi-stub-helper.c"
289
290static void find_bits(unsigned long mask, u8 *pos, u8 *size) 290static void find_bits(unsigned long mask, u8 *pos, u8 *size)
291{ 291{
292 u8 first, len; 292 u8 first, len;
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h
index c88c31ecad12..d487e727f1ec 100644
--- a/arch/x86/boot/compressed/eboot.h
+++ b/arch/x86/boot/compressed/eboot.h
@@ -103,20 +103,4 @@ struct efi_uga_draw_protocol {
103 void *blt; 103 void *blt;
104}; 104};
105 105
106struct efi_config {
107 u64 image_handle;
108 u64 table;
109 u64 allocate_pool;
110 u64 allocate_pages;
111 u64 get_memory_map;
112 u64 free_pool;
113 u64 free_pages;
114 u64 locate_handle;
115 u64 handle_protocol;
116 u64 exit_boot_services;
117 u64 text_output;
118 efi_status_t (*call)(unsigned long, ...);
119 bool is64;
120} __packed;
121
122#endif /* BOOT_COMPRESSED_EBOOT_H */ 106#endif /* BOOT_COMPRESSED_EBOOT_H */
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 9b11757975d0..25bce45c6fc4 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -158,6 +158,30 @@ static inline efi_status_t efi_thunk_set_virtual_address_map(
158} 158}
159#endif /* CONFIG_EFI_MIXED */ 159#endif /* CONFIG_EFI_MIXED */
160 160
161
162/* arch specific definitions used by the stub code */
163
164struct efi_config {
165 u64 image_handle;
166 u64 table;
167 u64 allocate_pool;
168 u64 allocate_pages;
169 u64 get_memory_map;
170 u64 free_pool;
171 u64 free_pages;
172 u64 locate_handle;
173 u64 handle_protocol;
174 u64 exit_boot_services;
175 u64 text_output;
176 efi_status_t (*call)(unsigned long, ...);
177 bool is64;
178} __packed;
179
180__pure const struct efi_config *__efi_early(void);
181
182#define efi_call_early(f, ...) \
183 __efi_early()->call(__efi_early()->f, __VA_ARGS__);
184
161extern bool efi_reboot_required(void); 185extern bool efi_reboot_required(void);
162 186
163#else 187#else
diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
index 7166e25ecb57..602b6028c5b6 100644
--- a/arch/x86/include/asm/pgtable_64_types.h
+++ b/arch/x86/include/asm/pgtable_64_types.h
@@ -63,6 +63,8 @@ typedef struct { pteval_t pte; } pte_t;
63#define MODULES_LEN (MODULES_END - MODULES_VADDR) 63#define MODULES_LEN (MODULES_END - MODULES_VADDR)
64#define ESPFIX_PGD_ENTRY _AC(-2, UL) 64#define ESPFIX_PGD_ENTRY _AC(-2, UL)
65#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT) 65#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
66#define EFI_VA_START ( -4 * (_AC(1, UL) << 30))
67#define EFI_VA_END (-68 * (_AC(1, UL) << 30))
66 68
67#define EARLY_DYNAMIC_PAGE_TABLES 64 69#define EARLY_DYNAMIC_PAGE_TABLES 64
68 70
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index 95a427e57887..1a8053d1012e 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -76,6 +76,9 @@ static struct addr_marker address_markers[] = {
76# ifdef CONFIG_X86_ESPFIX64 76# ifdef CONFIG_X86_ESPFIX64
77 { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, 77 { ESPFIX_BASE_ADDR, "ESPfix Area", 16 },
78# endif 78# endif
79# ifdef CONFIG_EFI
80 { EFI_VA_END, "EFI Runtime Services" },
81# endif
79 { __START_KERNEL_map, "High Kernel Mapping" }, 82 { __START_KERNEL_map, "High Kernel Mapping" },
80 { MODULES_VADDR, "Modules" }, 83 { MODULES_VADDR, "Modules" },
81 { MODULES_END, "End Modules" }, 84 { MODULES_END, "End Modules" },
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index 35aecb6042fb..17e80d829df0 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -48,8 +48,7 @@ static unsigned long efi_flags __initdata;
48 * We allocate runtime services regions bottom-up, starting from -4G, i.e. 48 * We allocate runtime services regions bottom-up, starting from -4G, i.e.
49 * 0xffff_ffff_0000_0000 and limit EFI VA mapping space to 64G. 49 * 0xffff_ffff_0000_0000 and limit EFI VA mapping space to 64G.
50 */ 50 */
51static u64 efi_va = -4 * (1UL << 30); 51static u64 efi_va = EFI_VA_START;
52#define EFI_VA_END (-68 * (1UL << 30))
53 52
54/* 53/*
55 * Scratch space used for switching the pagetable in the EFI stub 54 * Scratch space used for switching the pagetable in the EFI stub
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
index aef6a95adef5..d8be608a9f3b 100644
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
@@ -7,4 +7,4 @@ obj-$(CONFIG_EFI_VARS_PSTORE) += efi-pstore.o
7obj-$(CONFIG_UEFI_CPER) += cper.o 7obj-$(CONFIG_UEFI_CPER) += cper.o
8obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o 8obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o
9obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o 9obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o
10obj-$(CONFIG_EFI_ARM_STUB) += libstub/ 10obj-$(CONFIG_EFI_STUB) += libstub/
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 0a48886e069c..6dad1176ec52 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -236,6 +236,7 @@ static void efivarfs_kill_sb(struct super_block *sb)
236} 236}
237 237
238static struct file_system_type efivarfs_type = { 238static struct file_system_type efivarfs_type = {
239 .owner = THIS_MODULE,
239 .name = "efivarfs", 240 .name = "efivarfs",
240 .mount = efivarfs_mount, 241 .mount = efivarfs_mount,
241 .kill_sb = efivarfs_kill_sb, 242 .kill_sb = efivarfs_kill_sb,
@@ -244,17 +245,23 @@ static struct file_system_type efivarfs_type = {
244static __init int efivarfs_init(void) 245static __init int efivarfs_init(void)
245{ 246{
246 if (!efi_enabled(EFI_RUNTIME_SERVICES)) 247 if (!efi_enabled(EFI_RUNTIME_SERVICES))
247 return 0; 248 return -ENODEV;
248 249
249 if (!efivars_kobject()) 250 if (!efivars_kobject())
250 return 0; 251 return -ENODEV;
251 252
252 return register_filesystem(&efivarfs_type); 253 return register_filesystem(&efivarfs_type);
253} 254}
254 255
256static __exit void efivarfs_exit(void)
257{
258 unregister_filesystem(&efivarfs_type);
259}
260
255MODULE_AUTHOR("Matthew Garrett, Jeremy Kerr"); 261MODULE_AUTHOR("Matthew Garrett, Jeremy Kerr");
256MODULE_DESCRIPTION("EFI Variable Filesystem"); 262MODULE_DESCRIPTION("EFI Variable Filesystem");
257MODULE_LICENSE("GPL"); 263MODULE_LICENSE("GPL");
258MODULE_ALIAS_FS("efivarfs"); 264MODULE_ALIAS_FS("efivarfs");
259 265
260module_init(efivarfs_init); 266module_init(efivarfs_init);
267module_exit(efivarfs_exit);