Skip to contentSkip to conversation

EFI changes for v4.8

GIT PULL Ingo Molnar 1 participant 1 message Jul 25, 2016

Subsystems (5)
Arm (32-bit) x86 arm64 EFI +1 more subsystems
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest efi-core-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-core-for-linus

# HEAD: 7fb2b43c3252c9177825a0a49138cd16144b6b5e efi: Reorganize the GUID table to make it easier to read

The biggest change in this cycle were SGI/UV related changes that clean up and fix UV boot quirks and problems. There's also various smaller cleanups and refinements.

Thanks,

Ingo

------------------>
Alex Thorlton (3):
efi: Convert efi_call_virt() to efi_call_virt_pointer() x86/uv: Update uv_bios_call() to use efi_call_virt_pointer() x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros

Arnd Bergmann (1):
x86/efi: Remove the unused efi_get_time() function

Colin Ian King (1):
x86/efi: Remove unused variable 'efi'

Compostella, Jeremy (1):
efibc: Report more information in the error messages

Ingo Molnar (1):
efi: Reorganize the GUID table to make it easier to read

Peter Jones (1):
efi: Document #define FOO_PROTOCOL_GUID layout

 arch/arm/include/asm/efi.h              |   4 +-
 arch/arm64/include/asm/efi.h            |   4 +-
 arch/x86/boot/compressed/eboot.c        |   2 -
 arch/x86/include/asm/efi.h              |   9 +-
 arch/x86/platform/efi/efi.c             |  15 ---
 arch/x86/platform/efi/efi_64.c          |  21 ++--
 arch/x86/platform/uv/bios_uv.c          |   3 +-
 drivers/firmware/efi/efibc.c            |   4 +-
 drivers/firmware/efi/runtime-wrappers.c |  53 ++-------
 include/linux/efi.h                     | 200 +++++++++++++++-----------------
 10 files changed, 125 insertions(+), 190 deletions(-)
arch/arm/include/asm/efi.h +2 -2
index a708fa1f0905..766bf9b78160 100644
@@ -28,10 +28,10 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
 #define arch_efi_call_virt_setup()	efi_virtmap_load()
 #define arch_efi_call_virt_teardown()	efi_virtmap_unload()
 
-#define arch_efi_call_virt(f, args...)					\
+#define arch_efi_call_virt(p, f, args...)				\
 ({									\
 	efi_##f##_t *__f;						\
-	__f = efi.systab->runtime->f;					\
+	__f = p->f;							\
 	__f(args);							\
 })
 
arch/arm64/include/asm/efi.h +2 -2
index 622db3c6474e..bd887663689b 100644
@@ -23,10 +23,10 @@ int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
 	efi_virtmap_load();						\
 })
 
-#define arch_efi_call_virt(f, args...)					\
+#define arch_efi_call_virt(p, f, args...)				\
 ({									\
 	efi_##f##_t *__f;						\
-	__f = efi.systab->runtime->f;					\
+	__f = p->f;							\
 	__f(args);							\
 })
 
arch/x86/boot/compressed/eboot.c +0 -2
index 52fef606bc54..ff574dad95cc 100644
@@ -757,7 +757,6 @@ struct boot_params *make_boot_params(struct efi_config *c)
 	struct boot_params *boot_params;
 	struct apm_bios_info *bi;
 	struct setup_header *hdr;
-	struct efi_info *efi;
 	efi_loaded_image_t *image;
 	void *options, *handle;
 	efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
@@ -800,7 +799,6 @@ struct boot_params *make_boot_params(struct efi_config *c)
 	memset(boot_params, 0x0, 0x4000);
 
 	hdr = &boot_params->hdr;
-	efi = &boot_params->efi_info;
 	bi = &boot_params->apm_bios_info;
 
 	/* Copy the second sector to boot_params */
arch/x86/include/asm/efi.h +4 -5
index 78d1e7467eae..55b4596ef688 100644
@@ -41,10 +41,9 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
 /*
  * Wrap all the virtual calls in a way that forces the parameters on the stack.
  */
-#define arch_efi_call_virt(f, args...)					\
+#define arch_efi_call_virt(p, f, args...)				\
 ({									\
-	((efi_##f##_t __attribute__((regparm(0)))*)			\
-		efi.systab->runtime->f)(args);				\
+	((efi_##f##_t __attribute__((regparm(0)))*) p->f)(args);	\
 })
 
 #define efi_ioremap(addr, size, type, attr)	ioremap_cache(addr, size)
@@ -81,8 +80,8 @@ struct efi_scratch {
 	}								\
 })
 
-#define arch_efi_call_virt(f, args...)					\
-	efi_call((void *)efi.systab->runtime->f, args)			\
+#define arch_efi_call_virt(p, f, args...)				\
+	efi_call((void *)p->f, args)					\
 
 #define arch_efi_call_virt_teardown()					\
 ({									\
arch/x86/platform/efi/efi.c +0 -15
index f93545e7dc54..d898b334ff46 100644
@@ -98,21 +98,6 @@ static efi_status_t __init phys_efi_set_virtual_address_map(
 	return status;
 }
 
-void efi_get_time(struct timespec *now)
-{
-	efi_status_t status;
-	efi_time_t eft;
-	efi_time_cap_t cap;
-
-	status = efi.get_time(&eft, &cap);
-	if (status != EFI_SUCCESS)
-		pr_err("Oops: efitime: can't read time!\n");
-
-	now->tv_sec = mktime(eft.year, eft.month, eft.day, eft.hour,
-			     eft.minute, eft.second);
-	now->tv_nsec = 0;
-}
-
 void __init efi_find_mirror(void)
 {
 	efi_memory_desc_t *md;
arch/x86/platform/efi/efi_64.c +8 -13
index b226b3f497f1..5cb4301c4dcf 100644
@@ -466,22 +466,17 @@ extern efi_status_t efi64_thunk(u32, ...);
 #define efi_thunk(f, ...)						\
 ({									\
 	efi_status_t __s;						\
-	unsigned long flags;						\
-	u32 func;							\
+	unsigned long __flags;						\
+	u32 __func;							\
 									\
-	efi_sync_low_kernel_mappings();					\
-	local_irq_save(flags);						\
+	local_irq_save(__flags);					\
+	arch_efi_call_virt_setup();					\
 									\
-	efi_scratch.prev_cr3 = read_cr3();				\
-	write_cr3((unsigned long)efi_scratch.efi_pgt);			\
-	__flush_tlb_all();						\
+	__func = runtime_service32(f);					\
+	__s = efi64_thunk(__func, __VA_ARGS__);				\
 									\
-	func = runtime_service32(f);					\
-	__s = efi64_thunk(func, __VA_ARGS__);			\
-									\
-	write_cr3(efi_scratch.prev_cr3);				\
-	__flush_tlb_all();						\
-	local_irq_restore(flags);					\
+	arch_efi_call_virt_teardown();					\
+	local_irq_restore(__flags);					\
 									\
 	__s;								\
 })
arch/x86/platform/uv/bios_uv.c +1 -2
index 815fec6e05e2..66b2166ea4a1 100644
@@ -40,8 +40,7 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
 		 */
 		return BIOS_STATUS_UNIMPLEMENTED;
 
-	ret = efi_call((void *)__va(tab->function), (u64)which,
-			a1, a2, a3, a4, a5);
+	ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(uv_bios_call);
drivers/firmware/efi/efibc.c +2 -2
index 8dd0c7085e59..503bbe2a9d49 100644
@@ -37,13 +37,13 @@ static int efibc_set_variable(const char *name, const char *value)
 	size_t size = (strlen(value) + 1) * sizeof(efi_char16_t);
 
 	if (size > sizeof(entry->var.Data)) {
-		pr_err("value is too large");
+		pr_err("value is too large (%zu bytes) for '%s' EFI variable\n", size, name);
 		return -EINVAL;
 	}
 
 	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
 	if (!entry) {
-		pr_err("failed to allocate efivar entry");
+		pr_err("failed to allocate efivar entry for '%s' EFI variable\n", name);
 		return -ENOMEM;
 	}
 
drivers/firmware/efi/runtime-wrappers.c +10 -43

65 lines not on this page · raw message

include/linux/efi.h +96 -104

223 lines not on this page · raw message