Skip to contentSkip to conversation

EFI changes for v3.13

GIT PULL Ingo Molnar 1 participant 1 message Nov 11, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus,

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

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

# HEAD: 88392e9dd5a524b8194f1045369c7d0eb16d9f32 Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/efi

Main changes:

- Add support for earlyprintk=efi which uses the EFI framebuffer. Very useful for debugging boot problems.

- EFI stub support for large memory maps (more than 128 entries)

- EFI ARM support - this was mostly done by generalizing x86 <-> ARM platform differences, such as by moving x86 EFI code into drivers/firmware/efi/ and sharing it with ARM.

- Documentation updates

- misc fixes

out-of-topic modifications in x86-efi-for-linus:
--------------------------------------------------
arch/ia64/include/asm/io.h # d02d054: ia64: add early_memremap() alias
arch/ia64/kernel/efi.c # 272686b: efi: x86: ia64: provide a generic
drivers/firmware/efi/efi-stub-helper.c# c158c3b: boot, efi: Remove redundant memse
# 4e28308: efi: resolve warnings found on AR # 6a5fe77: efi: Fix types in EFI calls to ma # 36f8961: efi: Renames in handle_cmdline_fi # 46f4582: efi: Generalize handle_ramdisks() # 0e1cadb: efi: Allow efi_free() to be calle # 1c089c6: efi: generalize efi_get_memory_ma # 86cc653: efi: Rename __get_map() to efi_ge # 5fef387: efi: Move unicode to ASCII conver # 4a9f3a7: efi: Generalize relocate_kernel() # c6866d7: efi: Move relocate_kernel() to sh # 38dd9c0: efi: Enforce minimum alignment of # 40e4530: efi: Rename memory allocation/fre # 876dc36: efi: Add system table pointer arg # 7721da4: efi: Move common EFI stub code fr
drivers/firmware/efi/efi.c # 258f6fd: efi: x86: make efi_lookup_mapped_

                                   # 272686b: efi: x86: ia64: provide a generic

drivers/firmware/efi/efivars.c # 6f9dd30: efivars: Mark local function as s

Thanks,

Ingo

------------------>
Bart Kuivenhoven (1):
x86 efi: bugfix interrupt disabling sequence

Bojan Prtvar (1):
efivars: Mark local function as static

Leif Lindholm (4):
ia64: add early_memremap() alias for early_ioremap()
efi: x86: ia64: provide a generic efi_config_init()
efi: x86: make efi_lookup_mapped_addr() a common function x86/efi: Fix config_table_type array termination

Linn Crosetto (1):
x86: EFI stub support for large memory maps

Matt Fleming (1):
x86/efi: Add EFI framebuffer earlyprintk support

Roy Franz (18):
EFI stub documentation updates
efi: Add proper definitions for some EFI function pointers.
efi: Move common EFI stub code from x86 arch code to common location
efi: Add system table pointer argument to shared functions.
efi: Rename memory allocation/free functions
efi: Enforce minimum alignment of 1 page on allocations.
efi: Move relocate_kernel() to shared file.
efi: Generalize relocate_kernel() for use by other architectures.
efi: Move unicode to ASCII conversion to shared function.
efi: Rename __get_map() to efi_get_memory_map()
efi: generalize efi_get_memory_map()
efi: use efi_get_memory_map() to get final map for x86
efi: Allow efi_free() to be called with size of 0
efi: Generalize handle_ramdisks() and rename to handle_cmdline_files().
efi: Renames in handle_cmdline_files() to complete generalization.
efi: Fix types in EFI calls to match EFI function definitions.
efi: resolve warnings found on ARM compile
boot, efi: Remove redundant memset()

 Documentation/{x86 => }/efi-stub.txt   |   0
 Documentation/kernel-parameters.txt    |   8 +-
 arch/ia64/include/asm/io.h             |   1 +
 arch/ia64/kernel/efi.c                 |  54 +--
 arch/x86/Kconfig                       |   2 +-
 arch/x86/Kconfig.debug                 |  10 +
 arch/x86/boot/compressed/eboot.c       | 789 ++++++++-------------------------
 arch/x86/boot/compressed/eboot.h       |   9 -
 arch/x86/include/asm/efi.h             |   2 +
 arch/x86/kernel/early_printk.c         |   7 +
 arch/x86/platform/efi/Makefile         |   1 +
 arch/x86/platform/efi/early_printk.c   | 191 ++++++++
 arch/x86/platform/efi/efi.c            | 126 +-----
 drivers/firmware/efi/efi-stub-helper.c | 636 ++++++++++++++++++++++++++
 drivers/firmware/efi/efi.c             | 140 ++++++
 drivers/firmware/efi/efivars.c         |   2 +-
 include/linux/efi.h                    |  58 ++-
 17 files changed, 1245 insertions(+), 791 deletions(-)
 rename Documentation/{x86 => }/efi-stub.txt (100%)
 create mode 100644 arch/x86/platform/efi/early_printk.c
 create mode 100644 drivers/firmware/efi/efi-stub-helper.c
Documentation/efi-stub.txt renamed from Documentation/x86/efi-stub.txt +0 -0
similarity index 100%
rename from Documentation/x86/efi-stub.txt
rename to Documentation/efi-stub.txt
Documentation/kernel-parameters.txt +5 -3
index 7f9d4f5..7a0f202 100644
@@ -792,6 +792,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 	earlyprintk=	[X86,SH,BLACKFIN,ARM]
 			earlyprintk=vga
+			earlyprintk=efi
 			earlyprintk=xen
 			earlyprintk=serial[,ttySn[,baudrate]]
 			earlyprintk=serial[,0x...[,baudrate]]
@@ -805,7 +806,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			Append ",keep" to not disable it when the real console
 			takes over.
 
-			Only vga or serial or usb debug port at a time.
+			Only one of vga, efi, serial, or usb debug port can
+			be used at a time.
 
 			Currently only ttyS0 and ttyS1 may be specified by
 			name.  Other I/O ports may be explicitly specified
@@ -819,8 +821,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			Interaction with the standard serial driver is not
 			very good.
 
-			The VGA output is eventually overwritten by the real
-			console.
+			The VGA and EFI output is eventually overwritten by
+			the real console.
 
 			The xen output can only be used by Xen PV guests.
 
arch/ia64/include/asm/io.h +1 -0
index 74a7cc3..0d2bcb3 100644
@@ -424,6 +424,7 @@ extern void __iomem * ioremap(unsigned long offset, unsigned long size);
 extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
 extern void iounmap (volatile void __iomem *addr);
 extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size);
+#define early_memremap(phys_addr, size)        early_ioremap(phys_addr, size)
 extern void early_iounmap (volatile void __iomem *addr, unsigned long size);
 static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned long size)
 {
arch/ia64/kernel/efi.c +11 -43

93 lines not on this page · raw message

arch/x86/Kconfig +1 -1
index b32ebf9..ec65b51 100644
@@ -1579,7 +1579,7 @@ config EFI_STUB
           This kernel feature allows a bzImage to be loaded directly
 	  by EFI firmware without the use of a bootloader.
 
-	  See Documentation/x86/efi-stub.txt for more information.
+	  See Documentation/efi-stub.txt for more information.
 
 config SECCOMP
 	def_bool y
arch/x86/Kconfig.debug +10 -0
index 78d91af..0f3621e 100644
@@ -59,6 +59,16 @@ config EARLY_PRINTK_DBGP
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash. You need usb debug device.
 
+config EARLY_PRINTK_EFI
+	bool "Early printk via the EFI framebuffer"
+	depends on EFI && EARLY_PRINTK
+	select FONT_SUPPORT
+	---help---
+	  Write kernel log output directly into the EFI framebuffer.
+
+	  This is useful for kernel debugging when your machine crashes very
+	  early before the console code is initialized.
+
 config X86_PTDUMP
 	bool "Export kernel pagetable layout to userspace via debugfs"
 	depends on DEBUG_KERNEL
arch/x86/boot/compressed/eboot.c +187 -602

921 lines not on this page · raw message

arch/x86/boot/compressed/eboot.h +0 -9
index e5b0a8f..81b6b65 100644
@@ -11,9 +11,6 @@
 
 #define DESC_TYPE_CODE_DATA	(1 << 0)
 
-#define EFI_PAGE_SIZE		(1UL << EFI_PAGE_SHIFT)
-#define EFI_READ_CHUNK_SIZE	(1024 * 1024)
-
 #define EFI_CONSOLE_OUT_DEVICE_GUID    \
 	EFI_GUID(0xd3b36f2c, 0xd551, 0x11d4, 0x9a, 0x46, 0x0, 0x90, 0x27, \
 		  0x3f, 0xc1, 0x4d)
@@ -62,10 +59,4 @@ struct efi_uga_draw_protocol {
 	void *blt;
 };
 
-struct efi_simple_text_output_protocol {
-	void *reset;
-	void *output_string;
-	void *test_string;
-};
-
 #endif /* BOOT_COMPRESSED_EBOOT_H */
arch/x86/include/asm/efi.h +2 -0
index 0062a01..65c6e6e 100644
@@ -109,6 +109,8 @@ static inline bool efi_is_native(void)
 	return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT);
 }
 
+extern struct console early_efi_console;
+
 #else
 /*
  * IF EFI is not configured, have the EFI calls return -ENOSYS.
arch/x86/kernel/early_printk.c +7 -0
index d15f575..6d3d200 100644
@@ -17,6 +17,8 @@
 #include <asm/mrst.h>
 #include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
+#include <linux/efi.h>
+#include <asm/efi.h>
 
 /* Simple VGA output */
 #define VGABASE		(__ISA_IO_base + 0xb8000)
@@ -234,6 +236,11 @@ static int __init setup_early_printk(char *buf)
 			early_console_register(&early_hsu_console, keep);
 		}
 #endif
+#ifdef CONFIG_EARLY_PRINTK_EFI
+		if (!strncmp(buf, "efi", 3))
+			early_console_register(&early_efi_console, keep);
+#endif
+
 		buf++;
 	}
 	return 0;
arch/x86/platform/efi/Makefile +1 -0
index 6db1cc4..b7b0b35 100644
@@ -1,2 +1,3 @@
 obj-$(CONFIG_EFI) 		+= efi.o efi_$(BITS).o efi_stub_$(BITS).o
 obj-$(CONFIG_ACPI_BGRT) += efi-bgrt.o
+obj-$(CONFIG_EARLY_PRINTK_EFI)	+= early_printk.o
arch/x86/platform/efi/early_printk.c new file +191 -0

191 lines not on this page · raw message

arch/x86/platform/efi/efi.c +10 -116

162 lines not on this page · raw message

drivers/firmware/efi/efi-stub-helper.c new file +636 -0

636 lines not on this page · raw message

drivers/firmware/efi/efi.c +140 -0

154 lines not on this page · raw message

drivers/firmware/efi/efivars.c +1 -1
index 8a7432a..933eb02 100644
@@ -564,7 +564,7 @@ static int efivar_sysfs_destroy(struct efivar_entry *entry, void *data)
 	return 0;
 }
 
-void efivars_sysfs_exit(void)
+static void efivars_sysfs_exit(void)
 {
 	/* Remove all entries and destroy */
 	__efivar_entry_iter(efivar_sysfs_destroy, &efivar_sysfs_list, NULL, NULL);
include/linux/efi.h +42 -16

133 lines not on this page · raw message