Skip to content

Commit 7cc3afd

Browse files
committed
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 EFI changes from Ingo Molnar: "The main changes: - Add debug code to the dump EFI pagetable - Borislav Petkov - Make 1:1 runtime mapping robust when booting on machines with lots of memory - Borislav Petkov - Move the EFI facilities bits out of 'x86_efi_facility' and into efi.flags which is the standard architecture independent place to keep EFI state, by Matt Fleming. - Add 'EFI mixed mode' support: this allows 64-bit kernels to be booted from 32-bit firmware. This needs a bootloader that supports the 'EFI handover protocol'. By Matt Fleming" * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits) x86, efi: Abstract x86 efi_early calls x86/efi: Restore 'attr' argument to query_variable_info() x86/efi: Rip out phys_efi_get_time() x86/efi: Preserve segment registers in mixed mode x86/boot: Fix non-EFI build x86, tools: Fix up compiler warnings x86/efi: Re-disable interrupts after calling firmware services x86/boot: Don't overwrite cr4 when enabling PAE x86/efi: Wire up CONFIG_EFI_MIXED x86/efi: Add mixed runtime services support x86/efi: Firmware agnostic handover entry points x86/efi: Split the boot stub into 32/64 code paths x86/efi: Add early thunk code to go from 64-bit to 32-bit x86/efi: Build our own EFI services pointer table efi: Add separate 32-bit/64-bit definitions x86/efi: Delete dead code when checking for non-native x86/mm/pageattr: Always dump the right page table in an oops x86, tools: Consolidate #ifdef code x86/boot: Cleanup header.S by removing some #ifdefs efi: Use NULL instead of 0 for pointer ...
2 parents ad8946f + 204b0a1 commit 7cc3afd

File tree

29 files changed

+2452
-598
lines changed

29 files changed

+2452
-598
lines changed

arch/ia64/kernel/efi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ efi_init (void)
477477
char *cp, vendor[100] = "unknown";
478478
int i;
479479

480+
set_bit(EFI_BOOT, &efi.flags);
481+
set_bit(EFI_64BIT, &efi.flags);
482+
480483
/*
481484
* It's too early to be able to use the standard kernel command line
482485
* support...
@@ -529,6 +532,8 @@ efi_init (void)
529532
efi.systab->hdr.revision >> 16,
530533
efi.systab->hdr.revision & 0xffff, vendor);
531534

535+
set_bit(EFI_SYSTEM_TABLES, &efi.flags);
536+
532537
palo_phys = EFI_INVALID_TABLE_ADDR;
533538

534539
if (efi_config_init(arch_tables) != 0)
@@ -657,6 +662,8 @@ efi_enter_virtual_mode (void)
657662
return;
658663
}
659664

665+
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
666+
660667
/*
661668
* Now that EFI is in virtual mode, we call the EFI functions more
662669
* efficiently:

arch/x86/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,20 @@ config EFI_STUB
15851585

15861586
See Documentation/efi-stub.txt for more information.
15871587

1588+
config EFI_MIXED
1589+
bool "EFI mixed-mode support"
1590+
depends on EFI_STUB && X86_64
1591+
---help---
1592+
Enabling this feature allows a 64-bit kernel to be booted
1593+
on a 32-bit firmware, provided that your CPU supports 64-bit
1594+
mode.
1595+
1596+
Note that it is not possible to boot a mixed-mode enabled
1597+
kernel via the EFI boot stub - a bootloader that supports
1598+
the EFI handover protocol must be used.
1599+
1600+
If unsure, say N.
1601+
15881602
config SECCOMP
15891603
def_bool y
15901604
prompt "Enable seccomp to safely compute untrusted bytecode"

arch/x86/Kconfig.debug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ config X86_PTDUMP
8181
kernel.
8282
If in doubt, say "N"
8383

84+
config EFI_PGT_DUMP
85+
bool "Dump the EFI pagetable"
86+
depends on EFI && X86_PTDUMP
87+
---help---
88+
Enable this if you want to dump the EFI page table before
89+
enabling virtual mode. This can be used to debug miscellaneous
90+
issues with the mapping of the EFI runtime regions into that
91+
table.
92+
8493
config DEBUG_RODATA
8594
bool "Write protect kernel read-only data structures"
8695
default y

arch/x86/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ targets += voffset.h
8080
$(obj)/voffset.h: vmlinux FORCE
8181
$(call if_changed,voffset)
8282

83-
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
83+
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
8484

8585
quiet_cmd_zoffset = ZOFFSET $@
8686
cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@

0 commit comments

Comments
 (0)