efistub: convert into static library
v3 cover efistub: convert into static library
This is v3 of the series to change the #include "../../../../xxx.c" pattern into a static library linked into either the kernel (arm64) or a separate boot decompressor (x86, ARM).
Changes since v2:
- make sure that removals of 'static' modifiers occur in a way that doesn't break bisect (i.e., definition + all declarations in the same patch)
- avoid ia64 breakage (which does not use the stub) by building it conditionally on CONFIG_EFI_STUB not CONFIG_EFI
Changes since v1:
- added patch #1 to change EFI_ERROR, it is not a result code defined by UEFI so it should only be returned by get_dram_base() and efi_entry()
- added a section to libstub Makefile to clean CFLAGS of stack protecter and other options that are inappropriate for the stub
- rebased onto the UEFI Runtime Services NEON patches (re)posted earlier today
Ard Biesheuvel (5):
efi/arm64: Avoid EFI_ERROR as a generic return code efi/x86: efistub: Move shared dependencies to <asm/efi.h> efi/arm64: efistub: Move shared dependencies to <asm/efi.h>
efi: efistub: refactor stub components
efi: efistub: convert into static library
arch/arm64/Kconfig | 5 ++
arch/arm64/Makefile | 1 +
arch/arm64/include/asm/efi.h | 12 ++++
arch/arm64/kernel/efi-stub.c | 48 +++-----------
arch/x86/boot/compressed/Makefile | 3 +-
arch/x86/boot/compressed/eboot.c | 20 ++----
arch/x86/boot/compressed/eboot.h | 16 -----
arch/x86/include/asm/efi.h | 25 ++++++++
drivers/firmware/efi/Kconfig | 3 +
drivers/firmware/efi/Makefile | 1 +
drivers/firmware/efi/libstub/Makefile | 26 ++++++++
drivers/firmware/efi/{ => libstub}/arm-stub.c | 32 ++++++----
.../firmware/efi/{ => libstub}/efi-stub-helper.c | 74 +++++++++++-----------
drivers/firmware/efi/libstub/efistub.h | 42 ++++++++++++
drivers/firmware/efi/{ => libstub}/fdt.c | 20 +++---
include/linux/efi.h | 42 ++++++++++++
16 files changed, 242 insertions(+), 128 deletions(-)
create mode 100644 drivers/firmware/efi/libstub/Makefile
rename drivers/firmware/efi/{ => libstub}/arm-stub.c (93%)
rename drivers/firmware/efi/{ => libstub}/efi-stub-helper.c (88%)
create mode 100644 drivers/firmware/efi/libstub/efistub.h
rename drivers/firmware/efi/{ => libstub}/fdt.c (94%)Signature · 1 line
1.8.3.2
PATCH v3 1/5 efi/arm64: Avoid EFI_ERROR as a generic return code
As EFI_ERROR is not a UEFI result code but a local invention only intended to allow get_dram_base() to signal failure, we should not use it elsewhere.
Replace with EFI_LOAD_ERROR.
--- arch/arm64/kernel/efi-stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/efi-stub.c +1 -1
@@ -69,7 +69,7 @@ static efi_status_t handle_kernel_image(efi_system_table_t *sys_table,if (*image_addr != (dram_base +TEXT_OFFSET )) {pr_efi_err (sys_table,"Failed to alloc kernel memory\n" );efi_free (sys_table, kernel_memsize, *image_addr); -return EFI_ERROR ; +return EFI_LOAD_ERROR ; } *image_size = kernel_memsize; }
Signature · 1 line
1.8.3.2
PATCH v3 1/5 efi/arm64: Avoid EFI_ERROR as a generic return code
Quoted 26 lines · Ard Biesheuvel
As
EFI_ERRORis not a UEFI result code but a local invention only intended to allowget_dram_base()to signal failure, we should not use it elsewhere.Replace with
EFI_LOAD_ERROR.Signed-off-by Ard Biesheuvel <[email protected]>Signed-off-by Matt Fleming <[email protected]>--- arch/arm64/kernel/efi-stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/efi-stub.c +1
-2@@ -69,7 +69,7 @@ static efi_status_t handle_kernel_image(efi_system_table_t *sys_table,if (*image_addr != (dram_base +TEXT_OFFSET )) {pr_efi_err (sys_table,"Failed to alloc kernel memory\n" );efi_free (sys_table, kernel_memsize, *image_addr); -return EFI_ERROR ; +return EFI_LOAD_ERROR ; } *image_size = kernel_memsize; } --
Quoted 2 lines
1.8.3.2
Looks good.
PATCH v3 2/5 efi/x86: efistub: Move shared dependencies to <asm/efi.h>
In reply to Ard BiesheuvelThis moves definitions depended upon both by code under arch/x86/boot and under drivers/firmware/efi to <asm/efi.h>. This is in preparation of turning the stub code under drivers/firmware/efi into a static library.
--- arch/x86/boot/compressed/eboot.c | 5 +---- arch/x86/boot/compressed/eboot.h | 16 ---------------- arch/x86/include/asm/efi.h | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 20 deletions(-)
arch/x86/boot/compressed/eboot.c +1 -4
@@ -19,10 +19,7 @@static efi_system_table_t *sys_table; -static struct efi_config *efi_early; - -#define efi_call_early (f, ...) \ - efi_early->call(efi_early->f, __VA_ARGS__); +struct efi_config *efi_early;#define BOOT_SERVICES (bits) \ static void setup_boot_services##bits(struct efi_config *c) \
arch/x86/boot/compressed/eboot.h +0 -16
@@ -103,20 +103,4 @@ struct efi_uga_draw_protocol { void *blt; }; -struct efi_config { -u64 image_handle; -u64 table; -u64 allocate_pool; -u64 allocate_pages; -u64 get_memory_map; -u64 free_pool; -u64 free_pages; -u64 locate_handle; -u64 handle_protocol; -u64 exit_boot_services; -u64 text_output; -efi_status_t (*call)(unsigned long , ...); -bool is64; -} __packed; -#endif /* BOOT_COMPRESSED_EBOOT_H */
arch/x86/include/asm/efi.h +25 -0
@@ -158,6 +158,31 @@ static inline efi_status_t efi_thunk_set_virtual_address_map( return EFI_SUCCESS; }#endif /* CONFIG_EFI_MIXED */ + + +/* arch specific definitions used by the stub code */ + +struct efi_config { +u64 image_handle; +u64 table; +u64 allocate_pool; +u64 allocate_pages; +u64 get_memory_map; +u64 free_pool; +u64 free_pages; +u64 locate_handle; +u64 handle_protocol; +u64 exit_boot_services; +u64 text_output; +efi_status_t (*call)(unsigned long , ...); +bool is64; +} __packed; + +extern struct efi_config *efi_early; + +#define efi_call_early (f, ...) \ + efi_early->call(efi_early->f, __VA_ARGS__); +#else /* * IF EFI is not configured, have the EFI calls return -ENOSYS.
Signature · 1 line
1.8.3.2
PATCH v3 3/5 efi/arm64: efistub: Move shared dependencies to <asm/efi.h>
In reply to Ard BiesheuvelThis moves definitions depended upon both by code under arch/arm64/boot and under drivers/firmware/efi to <asm/efi.h>. This is in preparation of turning the stub code under drivers/firmware/efi into a static library.
--- arch/arm64/include/asm/efi.h | 12 ++++++++++++ arch/arm64/kernel/efi-stub.c | 11 +---------- 2 files changed, 13 insertions(+), 10 deletions(-)
arch/arm64/include/asm/efi.h +12 -0
@@ -32,4 +32,16 @@ extern void efi_idmap_init(void);kernel_neon_end (); \ }) +/* arch specific definitions used by the stub code */ + +/* +* AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from +* start of kernel and may not cross a 2MiB boundary. We set alignment to +* 2MiB so we know it won't cross a 2MiB boundary. +*/ +#define EFI_FDT_ALIGN SZ_2M/* used by allocate_new_fdt_and_exit_boot() */ +#define MAX_FDT_OFFSET SZ_512M + +#define efi_call_early (f, ...) sys_table_arg->boottime->f(__VA_ARGS__) +#endif /* _ASM_EFI_H */
arch/arm64/kernel/efi-stub.c +1 -10
@@ -10,19 +10,10 @@* */ #include <linux/efi.h> +#include <asm/efi.h> #include <linux/libfdt.h> #include <asm/sections.h> -/* -* AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from -* start of kernel and may not cross a 2MiB boundary. We set alignment to -* 2MiB so we know it won't cross a 2MiB boundary. -*/ -#define EFI_FDT_ALIGN SZ_2M/* used by allocate_new_fdt_and_exit_boot() */ -#define MAX_FDT_OFFSET SZ_512M - -#define efi_call_early (f, ...) sys_table_arg->boottime->f(__VA_ARGS__) -static void efi_char16_printk (efi_system_table_t *sys_table_arg,efi_char16_t *str);
Signature · 1 line
1.8.3.2
PATCH v3 4/5 efi: efistub: refactor stub components
In reply to Ard BiesheuvelIn order to move from the #include "../../../xxxxx.c" anti-pattern used by both the x86 and arm64 versions of the stub to a static library linked into either the kernel proper (arm64) or a separate boot executable (x86), there is some prepatory work required.
This patch does the following:
- move forward declarations of functions shared between the arch specific and the generic parts of the stub to include/linux/efi.h
- move forward declarations of functions shared between various .c files of the generic stub code to a new local header file called "efistub.h"
- add #includes to all .c files which were formerly relying on the #includor to include the correct header files
- remove all static modifiers from functions which will need to be externally visible once we move to a static library
--- arch/arm64/kernel/efi-stub.c | 29 ++++--------- arch/x86/boot/compressed/eboot.c | 13 +++--- drivers/firmware/efi/arm-stub.c | 32 +++++++++------ drivers/firmware/efi/efi-stub-helper.c | 74 +++++++++++++++++----------------- drivers/firmware/efi/efistub.h | 42 +++++++++++++++++++ drivers/firmware/efi/fdt.c | 20 +++++---- include/linux/efi.h | 42 +++++++++++++++++++ 7 files changed, 164 insertions(+), 88 deletions(-) create mode 100644 drivers/firmware/efi/efistub.h
arch/arm64/kernel/efi-stub.c +7 -22
@@ -11,36 +11,21 @@*/ #include <linux/efi.h> #include <asm/efi.h> -#include <linux/libfdt.h> #include <asm/sections.h> -static void efi_char16_printk (efi_system_table_t *sys_table_arg, -efi_char16_t *str); - -static efi_status_t efi_open_volume (efi_system_table_t *sys_table, -void *__image,void **__fh); -static efi_status_t efi_file_close (void *handle); - -static efi_status_t -efi_file_read (void *handle,unsigned long *size,void *addr); - -static efi_status_t -efi_file_size (efi_system_table_t *sys_table,void *__fh, -efi_char16_t *filename_16,void **handle,u64 *file_sz); -/* Include shared EFI stub code */ #include "../../../drivers/firmware/efi/efi-stub-helper.c" #include "../../../drivers/firmware/efi/fdt.c" #include "../../../drivers/firmware/efi/arm-stub.c" -static efi_status_t handle_kernel_image (efi_system_table_t *sys_table, -unsigned long *image_addr, -unsigned long *image_size, -unsigned long *reserve_addr, -unsigned long *reserve_size, -unsigned long dram_base, -efi_loaded_image_t *image) +efi_status_t handle_kernel_image (efi_system_table_t *sys_table, +unsigned long *image_addr, +unsigned long *image_size, +unsigned long *reserve_addr, +unsigned long *reserve_size, +unsigned long dram_base, +efi_loaded_image_t *image) {efi_status_t status;unsigned long kernel_size, kernel_memsize =0 ;
arch/x86/boot/compressed/eboot.c +6 -7
@@ -45,8 +45,7 @@ static void setup_boot_services##bits(struct efi_config *c) \BOOT_SERVICES (32 );BOOT_SERVICES (64 ); -static void efi_printk (efi_system_table_t *,char *); -static void efi_char16_printk (efi_system_table_t *,efi_char16_t *); +void efi_char16_printk (efi_system_table_t *,efi_char16_t *); static efi_status_t __file_size32(void *__fh, efi_char16_t *filename_16,
@@ -153,7 +152,7 @@ grow:return status; } -static efi_status_t +efi_status_t efi_file_size (efi_system_table_t *sys_table,void *__fh,efi_char16_t *filename_16,void **handle,u64 *file_sz) {
@@ -163,7 +162,7 @@ efi_file_size(efi_system_table_t *sys_table, void *__fh,return __file_size32 (__fh, filename_16, handle, file_sz); } -static inline efi_status_t +efi_status_t efi_file_read (void *handle,unsigned long *size,void *addr) {unsigned long func;
@@ -181,7 +180,7 @@ efi_file_read(void *handle, unsigned long *size, void *addr) } } -static inline efi_status_t efi_file_close (void *handle) +efi_status_t efi_file_close (void *handle) {if (efi_early->is64) {efi_file_handle_64_t *fh = handle;
@@ -246,7 +245,7 @@ static inline efi_status_t __open_volume64(void *__image, void **__fh)return status; } -static inline efi_status_t +efi_status_t efi_open_volume (efi_system_table_t *sys_table,void *__image,void **__fh) {if (efi_early->is64)
@@ -255,7 +254,7 @@ efi_open_volume(efi_system_table_t *sys_table, void *__image, void **__fh)return __open_volume32 (__image, __fh); } -static void efi_char16_printk (efi_system_table_t *table,efi_char16_t *str) +void efi_char16_printk (efi_system_table_t *table,efi_char16_t *str) {unsigned long output_string;size_t offset;
drivers/firmware/efi/arm-stub.c +19 -13
@@ -12,6 +12,11 @@* */ +#include <linux/efi.h> +#include <asm/efi.h> + +#include "efistub.h" +static int __init efi_secureboot_enabled (efi_system_table_t *sys_table_arg) {static efi_guid_t const var_guid__initconst =EFI_GLOBAL_VARIABLE_GUID ;
@@ -36,8 +41,8 @@ static int __init efi_secureboot_enabled(efi_system_table_t *sys_table_arg) } } -static efi_status_t efi_open_volume (efi_system_table_t *sys_table_arg, -void *__image,void **__fh) +efi_status_t efi_open_volume (efi_system_table_t *sys_table_arg, +void *__image,void **__fh) {efi_file_io_interface_t *io;efi_loaded_image_t *image = __image;
@@ -60,14 +65,15 @@ static efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, *__fh = fh;return status; } -static efi_status_t efi_file_close (void *handle) + +efi_status_t efi_file_close (void *handle) {efi_file_handle_t *fh = handle;return fh->close (handle); } -static efi_status_t +efi_status_t efi_file_read (void *handle,unsigned long *size,void *addr) {efi_file_handle_t *fh = handle;
@@ -76,7 +82,7 @@ efi_file_read(void *handle, unsigned long *size, void *addr) } -static efi_status_t +efi_status_t efi_file_size (efi_system_table_t *sys_table_arg,void *__fh,efi_char16_t *filename_16,void **handle,u64 *file_sz) {
@@ -129,7 +135,7 @@ grow: -static void efi_char16_printk (efi_system_table_t *sys_table_arg, +void efi_char16_printk (efi_system_table_t *sys_table_arg,efi_char16_t *str) {struct efi_simple_text_output_protocol *out;
@@ -145,13 +151,13 @@ static void efi_char16_printk(efi_system_table_t *sys_table_arg,* must be reserved. On failure it is required to free all * all allocations it has made. */ -static efi_status_t handle_kernel_image (efi_system_table_t *sys_table, -unsigned long *image_addr, -unsigned long *image_size, -unsigned long *reserve_addr, -unsigned long *reserve_size, -unsigned long dram_base, -efi_loaded_image_t *image); +efi_status_t handle_kernel_image (efi_system_table_t *sys_table, +unsigned long *image_addr, +unsigned long *image_size, +unsigned long *reserve_addr, +unsigned long *reserve_size, +unsigned long dram_base, +efi_loaded_image_t *image);/* * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint * that is described in the PE/COFF header. Most of the code is the same
drivers/firmware/efi/efi-stub-helper.c +36 -38
136 lines not on this page · raw message
drivers/firmware/efi/efistub.h new file +42 -0
42 lines not on this page · raw message
drivers/firmware/efi/fdt.c +12 -8
@@ -10,13 +10,17 @@* */ -static efi_status_t update_fdt (efi_system_table_t *sys_table,void *orig_fdt, -unsigned long orig_fdt_size, -void *fdt,int new_fdt_size,char *cmdline_ptr, -u64 initrd_addr,u64 initrd_size, -efi_memory_desc_t *memory_map, -unsigned long map_size,unsigned long desc_size, -u32 desc_ver) +#include <linux/efi.h> +#include <linux/libfdt.h> +#include <asm/efi.h> + +efi_status_t update_fdt (efi_system_table_t *sys_table,void *orig_fdt, +unsigned long orig_fdt_size, +void *fdt,int new_fdt_size,char *cmdline_ptr, +u64 initrd_addr,u64 initrd_size, +efi_memory_desc_t *memory_map, +unsigned long map_size,unsigned long desc_size, +u32 desc_ver) {int node, prev;int status;
@@ -255,7 +259,7 @@ fail:return EFI_LOAD_ERROR ; } -static void *get_fdt (efi_system_table_t *sys_table) +void *get_fdt (efi_system_table_t *sys_table) {efi_guid_t fdt_guid =DEVICE_TREE_GUID ;efi_config_table_t *tables;
include/linux/efi.h +42 -0
46 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH v3 5/5 efi: efistub: convert into static library
In reply to Ard BiesheuvelThis patch changes both x86 and arm64 efistub implementations from #including shared .c files under drivers/firmware/efi to building the shared code as a static library.
The x86 code uses a stub built into the boot executable which uncompresses the kernel at boot time. In this case, the library is linked into the decompressor.
In the arm64 case, the stub is part of the kernel proper so the library is linked into the kernel proper as well.
---
arch/arm64/Kconfig | 5 +++++
arch/arm64/Makefile | 1 +
arch/arm64/kernel/efi-stub.c | 6 -----
arch/x86/boot/compressed/Makefile | 3 ++-
arch/x86/boot/compressed/eboot.c | 2 --
drivers/firmware/efi/Kconfig | 3 +++
drivers/firmware/efi/Makefile | 1 +
drivers/firmware/efi/libstub/Makefile | 26 ++++++++++++++++++++++
drivers/firmware/efi/{ => libstub}/arm-stub.c | 0
.../firmware/efi/{ => libstub}/efi-stub-helper.c | 0
drivers/firmware/efi/{ => libstub}/efistub.h | 0
drivers/firmware/efi/{ => libstub}/fdt.c | 0
12 files changed, 38 insertions(+), 9 deletions(-)
create mode 100644 drivers/firmware/efi/libstub/Makefile
rename drivers/firmware/efi/{ => libstub}/arm-stub.c (100%)
rename drivers/firmware/efi/{ => libstub}/efi-stub-helper.c (100%)
rename drivers/firmware/efi/{ => libstub}/efistub.h (100%)
rename drivers/firmware/efi/{ => libstub}/fdt.c (100%)arch/arm64/Kconfig +5 -0
@@ -292,6 +292,9 @@ config CMDLINE_FORCE This is useful if you cannot or don't want to change the command-line options your boot loader passes to the kernel. +config EFI_STUB + bool + config EFI bool "UEFI runtime support" depends on OF && !CPU_BIG_ENDIAN
@@ -299,6 +302,8 @@ config EFI select UCS2_STRING select EFI_PARAMS_FROM_FDT select EFI_RUNTIME_WRAPPERS + select EFI_STUB + select EFI_ARMSTUB default y help This option provides support for runtime services provided
arch/arm64/Makefile +1 -0
@@ -48,6 +48,7 @@ core-$(CONFIG_XEN) += arch/arm64/xen/ core-$(CONFIG_CRYPTO) += arch/arm64/crypto/ libs-y := arch/arm64/lib/ $(libs-y) libs-y += $(LIBGCC) +libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/ # Default target when executing plain make KBUILD_IMAGE := Image.gz
arch/arm64/kernel/efi-stub.c +0 -6
@@ -13,12 +13,6 @@#include <asm/efi.h> #include <asm/sections.h> -/* Include shared EFI stub code */ -#include "../../../drivers/firmware/efi/efi-stub-helper.c" -#include "../../../drivers/firmware/efi/fdt.c" -#include "../../../drivers/firmware/efi/arm-stub.c" - - efi_status_t handle_kernel_image(efi_system_table_t *sys_table, unsigned long *image_addr, unsigned long *image_size,
arch/x86/boot/compressed/Makefile +2 -1
@@ -33,7 +33,8 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone ifeq ($(CONFIG_EFI_STUB), y) - VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o + VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \ + $(objtree)/drivers/firmware/efi/libstub/lib.a endif $(obj)/vmlinux: $(VMLINUX_OBJS) FORCE
arch/x86/boot/compressed/eboot.c +0 -2
@@ -280,8 +280,6 @@ void efi_char16_printk(efi_system_table_t *table, efi_char16_t *str) } } -#include "../../../../drivers/firmware/efi/efi-stub-helper.c" -static void find_bits (unsigned long mask,u8 *pos,u8 *size) {u8 first, len;
drivers/firmware/efi/Kconfig +3 -0
@@ -57,6 +57,9 @@ config EFI_PARAMS_FROM_FDT config EFI_RUNTIME_WRAPPERS bool +config EFI_ARMSTUB + bool + endmenu config UEFI_CPER
drivers/firmware/efi/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-$(CONFIG_EFI_VARS_PSTORE) += efi-pstore.o obj-$(CONFIG_UEFI_CPER) += cper.o obj-$(CONFIG_EFI_RUNTIME_MAP) += runtime-map.o obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o +obj-$(CONFIG_EFI_STUB) += libstub/
drivers/firmware/efi/libstub/Makefile new file +26 -0
@@ -0,0 +1,26 @@ +# +# The stub may be linked into the kernel proper or into a separate boot binary, +# but in either case, it executes before the kernel does (with MMU disabled) so +# things like ftrace and stack-protector are likely to cause trouble if left +# enabled, even if doing so doesn't break the build. +# +cflags-$(CONFIG_X86_32) := -march=i386 +cflags-$(CONFIG_X86_64) := -mcmodel=small +cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 \ + -fPIC -fno-strict-aliasing -mno-red-zone \ + -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING + +cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) +cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ + -fno-builtin -fpic -mno-single-pic-base + +KBUILD_CFLAGS := $(cflags-y) \ + $(call cc-option,-ffreestanding) \ + $(call cc-option,-fno-stack-protector) + +GCOV_PROFILE := n + +lib-y := efi-stub-helper.o +lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o + +CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/
drivers/firmware/efi/libstub/arm-stub.c renamed from drivers/firmware/efi/arm-stub.c +0 -0
drivers/firmware/efi/libstub/efi-stub-helper.c renamed from drivers/firmware/efi/efi-stub-helper.c +0 -0
drivers/firmware/efi/libstub/efistub.h renamed from drivers/firmware/efi/efistub.h +0 -0
drivers/firmware/efi/libstub/fdt.c renamed from drivers/firmware/efi/fdt.c +0 -0
Signature · 1 line
1.8.3.2
v3 cover efistub: convert into static library
In reply to Ard BiesheuvelQuoted 38 lines · Ard Biesheuvel
This is v3 of the series to change the #include "
../../../../xxx.c" pattern into a static library linked into either the kernel (arm64) or a separate boot decompressor (x86, ARM).Changes since v2:
- make sure that removals of 'static' modifiers occur in a way that doesn't break bisect (i.e., definition + all declarations in the same patch)
- avoid ia64 breakage (which does not use the stub) by building it conditionally onCONFIG_EFI_STUBnotCONFIG_EFIChanges since v1:
- added patch #1 to changeEFI_ERROR, it is not a result code defined by UEFI so it should only be returned byget_dram_base()andefi_entry()
- added a section to libstubMakefileto clean CFLAGS of stack protecter and other options that are inappropriate for the stub
- rebased onto the UEFI Runtime Services NEON patches (re)posted earlier todayArd Biesheuvel (5):
efi/arm64: AvoidEFI_ERRORas a generic return code efi/x86: efistub: Move shared dependencies to <asm/efi.h> efi/arm64: efistub: Move shared dependencies to <asm/efi.h>
efi: efistub: refactor stub components
efi: efistub: convert into static libraryarch/arm64/Kconfig | 5 ++ arch/arm64/Makefile | 1 + arch/arm64/include/asm/efi.h | 12 ++++ arch/arm64/kernel/efi-stub.c | 48 +++----------- arch/x86/boot/compressed/Makefile | 3 +- arch/x86/boot/compressed/eboot.c | 20 ++---- arch/x86/boot/compressed/eboot.h | 16 ----- arch/x86/include/asm/efi.h | 25 ++++++++ drivers/firmware/efi/Kconfig | 3 + drivers/firmware/efi/Makefile | 1 + drivers/firmware/efi/libstub/Makefile | 26 ++++++++ drivers/firmware/efi/{ => libstub}/arm-stub.c | 32 ++++++---- .../firmware/efi/{ => libstub}/efi-stub-helper.c | 74 +++++++++++----------- drivers/firmware/efi/libstub/efistub.h | 42 ++++++++++++
Quoted 8 lines
drivers/firmware/efi/{ => libstub}/fdt.c | 20 +++---
include/linux/efi.h | 42 ++++++++++++
16 files changed, 242 insertions(+), 128 deletions(-)
create mode 100644 drivers/firmware/efi/libstub/Makefile
rename drivers/firmware/efi/{ => libstub}/arm-stub.c (93%)
rename drivers/firmware/efi/{ => libstub}/efi-stub-helper.c (88%)
create mode 100644 drivers/firmware/efi/libstub/efistub.h
rename drivers/firmware/efi/{ => libstub}/fdt.c (94%)Thanks Ard, queued up for v3.17.
Signature · 1 line
Matt Fleming, Intel Open Source Technology Center