diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-11-16 04:48:53 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-11-16 04:48:53 -0500 |
| commit | 595247f61f9840222a4dec4baefd66ad6d5b0d6a (patch) | |
| tree | c5cd38244fdac8ba3c119038f1116b7a5829c0f5 | |
| parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) | |
| parent | 8266e31ed0fedb7ee16ebc86e80468f7cc1bbb4e (diff) | |
Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/efi
Pull EFI updates for v3.19 from Matt Fleming:
- Support module unload for efivarfs - Mathias Krause
- Another attempt at moving x86 to libstub taking advantage of the
__pure attribute - Ard Biesheuvel
- Add EFI runtime services section to ptdump - Mathias Krause
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | arch/x86/boot/compressed/Makefile | 3 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/eboot.c | 8 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/eboot.h | 16 | ||||
| -rw-r--r-- | arch/x86/include/asm/efi.h | 24 | ||||
| -rw-r--r-- | arch/x86/include/asm/pgtable_64_types.h | 2 | ||||
| -rw-r--r-- | arch/x86/mm/dump_pagetables.c | 3 | ||||
| -rw-r--r-- | arch/x86/platform/efi/efi_64.c | 3 | ||||
| -rw-r--r-- | drivers/firmware/efi/Makefile | 2 | ||||
| -rw-r--r-- | fs/efivarfs/super.c | 11 |
9 files changed, 46 insertions, 26 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 704f58aa79cd..20db5b3609de 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
| @@ -35,7 +35,8 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o | |||
| 35 | 35 | ||
| 36 | $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone | 36 | $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone |
| 37 | 37 | ||
| 38 | vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o | 38 | vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \ |
| 39 | $(objtree)/drivers/firmware/efi/libstub/lib.a | ||
| 39 | 40 | ||
| 40 | $(obj)/vmlinux: $(vmlinux-objs-y) FORCE | 41 | $(obj)/vmlinux: $(vmlinux-objs-y) FORCE |
| 41 | $(call if_changed,ld) | 42 | $(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 | ||
| 22 | static struct efi_config *efi_early; | 22 | static 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) \ |
| 28 | static void setup_boot_services##bits(struct efi_config *c) \ | 30 | static 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 | |||
| 290 | static void find_bits(unsigned long mask, u8 *pos, u8 *size) | 290 | static 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 | ||
| 106 | struct 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 | |||
| 164 | struct 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 | |||
| 161 | extern bool efi_reboot_required(void); | 185 | extern 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 | */ |
| 51 | static u64 efi_va = -4 * (1UL << 30); | 51 | static 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 | |||
| 7 | obj-$(CONFIG_UEFI_CPER) += cper.o | 7 | obj-$(CONFIG_UEFI_CPER) += cper.o |
| 8 | obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o | 8 | obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o |
| 9 | obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o | 9 | obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o |
| 10 | obj-$(CONFIG_EFI_ARM_STUB) += libstub/ | 10 | obj-$(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 | ||
| 238 | static struct file_system_type efivarfs_type = { | 238 | static 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 = { | |||
| 244 | static __init int efivarfs_init(void) | 245 | static __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 | ||
| 256 | static __exit void efivarfs_exit(void) | ||
| 257 | { | ||
| 258 | unregister_filesystem(&efivarfs_type); | ||
| 259 | } | ||
| 260 | |||
| 255 | MODULE_AUTHOR("Matthew Garrett, Jeremy Kerr"); | 261 | MODULE_AUTHOR("Matthew Garrett, Jeremy Kerr"); |
| 256 | MODULE_DESCRIPTION("EFI Variable Filesystem"); | 262 | MODULE_DESCRIPTION("EFI Variable Filesystem"); |
| 257 | MODULE_LICENSE("GPL"); | 263 | MODULE_LICENSE("GPL"); |
| 258 | MODULE_ALIAS_FS("efivarfs"); | 264 | MODULE_ALIAS_FS("efivarfs"); |
| 259 | 265 | ||
| 260 | module_init(efivarfs_init); | 266 | module_init(efivarfs_init); |
| 267 | module_exit(efivarfs_exit); | ||
