[kernel: 71/85] tweak the UEFI patch set (try mfleming's "big arse revert")

Adam Williamson adamwill at fedoraproject.org
Wed Nov 26 20:54:43 UTC 2014


commit b95cabdfcf0d34bca4f086e102a27bc22d56e99c
Author: Adam Williamson <awilliam at redhat.com>
Date:   Tue Sep 23 08:17:22 2014 -0700

    tweak the UEFI patch set (try mfleming's "big arse revert")

 UEFI-big-arse-revert.patch |  166 ++++++++++++++++++++++++++++++++++++++++++++
 kernel.spec                |   10 ++-
 2 files changed, 172 insertions(+), 4 deletions(-)
---
diff --git a/UEFI-big-arse-revert.patch b/UEFI-big-arse-revert.patch
new file mode 100644
index 0000000..495ab89
--- /dev/null
+++ b/UEFI-big-arse-revert.patch
@@ -0,0 +1,166 @@
+From 8054c405f0acc8ecb74b7e29675a1e6894afedb0 Mon Sep 17 00:00:00 2001
+From: Matt Fleming <matt.fleming at intel.com>
+Date: Tue, 23 Sep 2014 10:37:43 +0100
+Subject: [PATCH] Revert "efi/x86: efistub: Move shared dependencies to
+ <asm/efi.h>"
+
+This reverts commit f23cf8bd5c1f ("efi/x86: efistub: Move shared
+dependencies to <asm/efi.h>") as well as the x86 parts of commit
+f4f75ad5741f ("efi: efistub: Convert into static library").
+
+The road leading to these two reverts is long and winding.
+
+The above two commits were merged during the v3.17 merge window and
+turned the common EFI boot stub code into a static library. This
+necessitated making some symbols global in the x86 boot stub which
+introduced new entries into the early boot GOT.
+
+The problem was that we weren't fixing up the newly created GOT entries
+before invoking the EFI boot stub, which sometimes resulted in hangs or
+resets. This failure was reported by Maarten on his Macbook pro.
+
+The proposed fix was commit 9cb0e394234d ("x86/efi: Fixup GOT in all
+boot code paths"). However, that caused issues for Linus when booting
+his Sony Vaio Pro 11. It was subsequently reverted in commit
+f3670394c29f.
+
+So that leaves us back with Maarten's Macbook pro not booting.
+
+At this stage in the release cycle the least risky option is to revert
+the x86 EFI boot stub to the pre-merge window code structure where we
+explicitly #include efi-stub-helper.c instead of linking with the static
+library. The arm64 code remains unaffected.
+
+We can take another swing at the x86 parts for v3.18.
+
+Conflicts:
+	arch/x86/include/asm/efi.h
+
+Cc: H. Peter Anvin <hpa at zytor.com>
+Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>,
+Cc: Josh Boyer <jwboyer at fedoraproject.org>
+Cc: Maarten Lankhorst <maarten.lankhorst at canonical.com>
+Cc: Ingo Molnar <mingo at kernel.org>
+Cc: Linus Torvalds <torvalds at linux-foundation.org>
+Signed-off-by: Matt Fleming <matt.fleming at intel.com>
+---
+ arch/x86/boot/compressed/Makefile |  3 +--
+ arch/x86/boot/compressed/eboot.c  |  7 ++++++-
+ arch/x86/boot/compressed/eboot.h  | 16 ++++++++++++++++
+ arch/x86/include/asm/efi.h        | 24 ------------------------
+ drivers/firmware/efi/Makefile     |  2 +-
+ 5 files changed, 24 insertions(+), 28 deletions(-)
+
+diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
+index 7a801a310e37..0fcd9133790c 100644
+--- a/arch/x86/boot/compressed/Makefile
++++ b/arch/x86/boot/compressed/Makefile
+@@ -33,8 +33,7 @@ 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 \
+-				$(objtree)/drivers/firmware/efi/libstub/lib.a
++	VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
+ endif
+ 
+ $(obj)/vmlinux: $(VMLINUX_OBJS) FORCE
+diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
+index dca9842d8f91..b04f1e0e3fab 100644
+--- a/arch/x86/boot/compressed/eboot.c
++++ b/arch/x86/boot/compressed/eboot.c
+@@ -19,7 +19,10 @@
+ 
+ static efi_system_table_t *sys_table;
+ 
+-struct efi_config *efi_early;
++static struct efi_config *efi_early;
++
++#define efi_call_early(f, ...)						\
++	efi_early->call(efi_early->f, __VA_ARGS__);
+ 
+ #define BOOT_SERVICES(bits)						\
+ static void setup_boot_services##bits(struct efi_config *c)		\
+@@ -280,6 +283,8 @@ 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;
+diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h
+index d487e727f1ec..c88c31ecad12 100644
+--- a/arch/x86/boot/compressed/eboot.h
++++ b/arch/x86/boot/compressed/eboot.h
+@@ -103,4 +103,20 @@ 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 */
+diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
+index 044a2fd3c5fe..0ec241ede5a2 100644
+--- a/arch/x86/include/asm/efi.h
++++ b/arch/x86/include/asm/efi.h
+@@ -159,30 +159,6 @@ 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;
+-
+-extern struct efi_config *efi_early;
+-
+-#define efi_call_early(f, ...)						\
+-	efi_early->call(efi_early->f, __VA_ARGS__);
+-
+ extern bool efi_reboot_required(void);
+ 
+ #else
+diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
+index d8be608a9f3b..aef6a95adef5 100644
+--- a/drivers/firmware/efi/Makefile
++++ b/drivers/firmware/efi/Makefile
+@@ -7,4 +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/
++obj-$(CONFIG_EFI_ARM_STUB)		+= libstub/
+-- 
+1.9.3
+
+
diff --git a/kernel.spec b/kernel.spec
index 0855b3e..673b78a 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -635,10 +635,11 @@ Patch31010: 0001-ACPI-temporary-dep-solution-for-battery-support.patch
 # Add SDIO ID for the V8P wireless adapter to ath6kl driver
 Patch31200: support-Dell-OEM-chipset-found-in-Venue-8-Pro-SDIO-I.patch
 
-# UEFI boot fixes from Matt Fleming, fix
+# UEFI boot fixes from Matt Fleming, try to fix
 # https://bugzilla.kernel.org/show_bug.cgi?id=84241
 Patch31201: x86-efi-only-load-initrd-above-4g-on-second-try.patch
-Patch21202: x86-efi-fixup-got-in-all-boot-code-paths.patch
+#Patch21202: x86-efi-fixup-got-in-all-boot-code-paths.patch
+Patch21203: UEFI-big-arse-revert.patch
 
 # END OF AWB PATCH DEFINITIONS
 
@@ -1383,8 +1384,9 @@ ApplyPatch kernel-arm64.patch -R
 # AWB (BAYTRAIL) PATCH APPLICATIONS
 ApplyPatch 0001-ACPI-temporary-dep-solution-for-battery-support.patch
 ApplyPatch support-Dell-OEM-chipset-found-in-Venue-8-Pro-SDIO-I.patch
-ApplyPatch x86-efi-only-load-initrd-above-4g-on-second-try.patch
-ApplyPatch x86-efi-fixup-got-in-all-boot-code-paths.patch
+#ApplyPatch x86-efi-only-load-initrd-above-4g-on-second-try.patch
+#ApplyPatch x86-efi-fixup-got-in-all-boot-code-paths.patch
+ApplyPatch UEFI-big-arse-revert.patch
 
 # END OF AWB (BAYTRAIL) PATCH APPLICATIONS
 


More information about the scm-commits mailing list