Commit 81395481 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI updates from Ingo Molnar:
 "Changes in this cycle are:

   - 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)"

* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, ptdump: Add section for EFI runtime services
  efi/x86: Move x86 back to libstub
  efivarfs: Allow unloading when build as module
parents 206f18f2 595247f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o

$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone

vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
vmlinux-objs-$(CONFIG_EFI_STUB) += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o \
	$(objtree)/drivers/firmware/efi/libstub/lib.a

$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
	$(call if_changed,ld)
+4 −4
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ 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__);
__pure const struct efi_config *__efi_early(void)
{
	return efi_early;
}

#define BOOT_SERVICES(bits)						\
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)
	}
}

#include "../../../../drivers/firmware/efi/libstub/efi-stub-helper.c"

static void find_bits(unsigned long mask, u8 *pos, u8 *size)
{
	u8 first, len;
+0 −16
Original line number Diff line number Diff line
@@ -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 */
+24 −0
Original line number Diff line number Diff line
@@ -158,6 +158,30 @@ static inline efi_status_t efi_thunk_set_virtual_address_map(
}
#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;

__pure const struct efi_config *__efi_early(void);

#define efi_call_early(f, ...)						\
	__efi_early()->call(__efi_early()->f, __VA_ARGS__);

extern bool efi_reboot_required(void);

#else
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ typedef struct { pteval_t pte; } pte_t;
#define MODULES_LEN   (MODULES_END - MODULES_VADDR)
#define ESPFIX_PGD_ENTRY _AC(-2, UL)
#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
#define EFI_VA_START	 ( -4 * (_AC(1, UL) << 30))
#define EFI_VA_END	 (-68 * (_AC(1, UL) << 30))

#define EARLY_DYNAMIC_PAGE_TABLES	64

Loading