Skip to content

Commit c8f5ed6

Browse files
committed
Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI updates from Ingo Molnar: "The main EFI changes in this cycle were: - Use 32-bit alignment for efi_guid_t - Allow the SetVirtualAddressMap() call to be omitted - Implement earlycon=efifb based on existing earlyprintk code - Various minor fixes and code cleanups from Sai, Ard and me" * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: Fix build error due to enum collision between efi.h and ima.h efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation x86: Make ARCH_USE_MEMREMAP_PROT a generic Kconfig symbol efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted efi: Replace GPL license boilerplate with SPDX headers efi/fdt: Apply more cleanups efi: Use 32-bit alignment for efi_guid_t efi/memattr: Don't bail on zero VA if it equals the region's PA x86/efi: Mark can_free_region() as an __init function
2 parents 3717f61 + 5c418dc commit c8f5ed6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+393
-567
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,9 +1078,15 @@
10781078
specified address. The serial port must already be
10791079
setup and configured. Options are not yet supported.
10801080

1081+
efifb,[options]
1082+
Start an early, unaccelerated console on the EFI
1083+
memory mapped framebuffer (if available). On cache
1084+
coherent non-x86 systems that use system memory for
1085+
the framebuffer, pass the 'ram' option so that it is
1086+
mapped with the correct attributes.
1087+
10811088
earlyprintk= [X86,SH,ARM,M68k,S390]
10821089
earlyprintk=vga
1083-
earlyprintk=efi
10841090
earlyprintk=sclp
10851091
earlyprintk=xen
10861092
earlyprintk=serial[,ttySn[,baudrate]]

arch/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ config HAVE_ARCH_PREL32_RELOCATIONS
895895
architectures, and don't require runtime relocation on relocatable
896896
kernels.
897897

898+
config ARCH_USE_MEMREMAP_PROT
899+
bool
900+
898901
source "kernel/gcov/Kconfig"
899902

900903
source "scripts/gcc-plugins/Kconfig"

arch/x86/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ config AMD_MEM_ENCRYPT
15101510
bool "AMD Secure Memory Encryption (SME) support"
15111511
depends on X86_64 && CPU_SUP_AMD
15121512
select DYNAMIC_PHYSICAL_MASK
1513+
select ARCH_USE_MEMREMAP_PROT
15131514
---help---
15141515
Say yes to enable support for the encryption of system memory.
15151516
This requires an AMD processor that supports Secure Memory
@@ -1529,10 +1530,6 @@ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
15291530
If set to N, then the encryption of system memory can be
15301531
activated with the mem_encrypt=on command line option.
15311532

1532-
config ARCH_USE_MEMREMAP_PROT
1533-
def_bool y
1534-
depends on AMD_MEM_ENCRYPT
1535-
15361533
# Common NUMA Features
15371534
config NUMA
15381535
bool "Numa Memory Allocation and Scheduler Support"

arch/x86/Kconfig.debug

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ config EARLY_PRINTK_DBGP
4040
with klogd/syslogd or the X server. You should normally say N here,
4141
unless you want to debug such a crash. You need usb debug device.
4242

43-
config EARLY_PRINTK_EFI
44-
bool "Early printk via the EFI framebuffer"
45-
depends on EFI && EARLY_PRINTK
46-
select FONT_SUPPORT
47-
---help---
48-
Write kernel log output directly into the EFI framebuffer.
49-
50-
This is useful for kernel debugging when your machine crashes very
51-
early before the console code is initialized.
52-
5343
config EARLY_PRINTK_USB_XDBC
5444
bool "Early printk via the xHCI debug port"
5545
depends on EARLY_PRINTK && PCI

arch/x86/include/asm/efi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ static inline bool efi_runtime_supported(void)
170170
return false;
171171
}
172172

173-
extern struct console early_efi_console;
174173
extern void parse_efi_setup(u64 phys_addr, u32 data_len);
175174

176175
extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);

arch/x86/kernel/early_printk.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,6 @@ static int __init setup_early_printk(char *buf)
388388
if (!strncmp(buf, "xen", 3))
389389
early_console_register(&xenboot_console, keep);
390390
#endif
391-
#ifdef CONFIG_EARLY_PRINTK_EFI
392-
if (!strncmp(buf, "efi", 3))
393-
early_console_register(&early_efi_console, keep);
394-
#endif
395391
#ifdef CONFIG_EARLY_PRINTK_USB_XDBC
396392
if (!strncmp(buf, "xdbc", 4))
397393
early_xdbc_parse_parameter(buf + 4);

arch/x86/mm/ioremap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ bool phys_mem_access_encrypted(unsigned long phys_addr, unsigned long size)
705705
return arch_memremap_can_ram_remap(phys_addr, size, 0);
706706
}
707707

708-
#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT
708+
#ifdef CONFIG_AMD_MEM_ENCRYPT
709709
/* Remap memory with encryption */
710710
void __init *early_memremap_encrypted(resource_size_t phys_addr,
711711
unsigned long size)
@@ -747,7 +747,7 @@ void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
747747

748748
return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP);
749749
}
750-
#endif /* CONFIG_ARCH_USE_MEMREMAP_PROT */
750+
#endif /* CONFIG_AMD_MEM_ENCRYPT */
751751

752752
static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
753753

arch/x86/platform/efi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ OBJECT_FILES_NON_STANDARD_efi_thunk_$(BITS).o := y
33
OBJECT_FILES_NON_STANDARD_efi_stub_$(BITS).o := y
44

55
obj-$(CONFIG_EFI) += quirks.o efi.o efi_$(BITS).o efi_stub_$(BITS).o
6-
obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o
76
obj-$(CONFIG_EFI_MIXED) += efi_thunk_$(BITS).o

arch/x86/platform/efi/early_printk.c

Lines changed: 0 additions & 240 deletions
This file was deleted.

arch/x86/platform/efi/quirks.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
304304
* - Not within any part of the kernel
305305
* - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
306306
*/
307-
static bool can_free_region(u64 start, u64 size)
307+
static __init bool can_free_region(u64 start, u64 size)
308308
{
309309
if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
310310
return false;
@@ -717,7 +717,7 @@ void efi_recover_from_page_fault(unsigned long phys_addr)
717717
* "efi_mm" cannot be used to check if the page fault had occurred
718718
* in the firmware context because efi=old_map doesn't use efi_pgd.
719719
*/
720-
if (efi_rts_work.efi_rts_id == NONE)
720+
if (efi_rts_work.efi_rts_id == EFI_NONE)
721721
return;
722722

723723
/*
@@ -742,7 +742,7 @@ void efi_recover_from_page_fault(unsigned long phys_addr)
742742
* because this case occurs *very* rarely and hence could be improved
743743
* on a need by basis.
744744
*/
745-
if (efi_rts_work.efi_rts_id == RESET_SYSTEM) {
745+
if (efi_rts_work.efi_rts_id == EFI_RESET_SYSTEM) {
746746
pr_info("efi_reset_system() buggy! Reboot through BIOS\n");
747747
machine_real_restart(MRR_BIOS);
748748
return;

drivers/firmware/efi/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,9 @@ config EFI_DEV_PATH_PARSER
198198
bool
199199
depends on ACPI
200200
default n
201+
202+
config EFI_EARLYCON
203+
def_bool y
204+
depends on SERIAL_EARLYCON && !ARM && !IA64
205+
select FONT_SUPPORT
206+
select ARCH_USE_MEMREMAP_PROT

drivers/firmware/efi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ arm-obj-$(CONFIG_EFI) := arm-init.o arm-runtime.o
3030
obj-$(CONFIG_ARM) += $(arm-obj-y)
3131
obj-$(CONFIG_ARM64) += $(arm-obj-y)
3232
obj-$(CONFIG_EFI_CAPSULE_LOADER) += capsule-loader.o
33+
obj-$(CONFIG_EFI_EARLYCON) += earlycon.o
3334
obj-$(CONFIG_UEFI_CPER_ARM) += cper-arm.o
3435
obj-$(CONFIG_UEFI_CPER_X86) += cper-x86.o

0 commit comments

Comments
 (0)