linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Allow the trampoline to use EFI boot services RAM
@ 2016-08-10  9:29 Andy Lutomirski
  2016-08-10  9:29 ` [PATCH v2 1/5] x86/boot: Run reserve_bios_regions() after we initialize the memory map Andy Lutomirski
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Andy Lutomirski @ 2016-08-10  9:29 UTC (permalink / raw)
  To: H. Peter Anvin, x86
  Cc: Mario Limonciello, Matthew Garrett, Borislav Petkov,
	Matt Fleming, linux-kernel, Andy Lutomirski

As currently configured, my laptop cannot boot any existing kernel
because the real mode trampoline can't be reserved.  The ranges in
which it could live are rejected by the kernel: one is EFI boot
services data and the other is above the EBDA.

Allowing use of RAM between the EBDA and 640k is scary: there are
probably many quirky BIOSes out there, and, as currently structured,
it would be awkward to allow it just on EFI boots because we
currently reserve that range before we figure out whether we're
using EFI.

This series fixes it the other way: it allow the trampoline to live
in boot services memory.  It achieves this by deferring the panic
due to failure to reserve a trampoline until early_initcall time
and then adjusting the EFI boot services quirk to reserve space
for the trampoline if we haven't already found it a home.

I'm hoping this is okay for 4.8 even though it's late: it fixes
a boot failure and it's fairly conservative -- the only significant
changes in behavior should be on systems that currently fail to boot.

I'm not currently proposing it for stable because AFAIK I'm the
only person to have seen this issue.  If it survives in Linus'
tree for a while, though, I might propose it for -stable later
on.

Andy Lutomirski (4):
  x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features
    directly
  x86/boot: Defer setup_real_mode() to early_initcall time
  x86/boot: Rework reserve_real_mode() to allow multiple tries
  x86/efi: Allocate a trampoline if needed in efi_free_boot_services()

Changes from v1:
 - Fix comment in the last patch (hpa)
 - Add missing first patch (I can't count...)
 - Rebase to v4.8-rc1, uneventfully

Andy Lutomirski (5):
  x86/boot: Run reserve_bios_regions() after we initialize the memory
    map
  x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features
    directly
  x86/boot: Defer setup_real_mode() to early_initcall time
  x86/boot: Rework reserve_real_mode() to allow multiple tries
  x86/efi: Allocate a trampoline if needed in efi_free_boot_services()

 arch/x86/include/asm/realmode.h | 10 ++++++++-
 arch/x86/kernel/head32.c        |  2 --
 arch/x86/kernel/head64.c        |  1 -
 arch/x86/kernel/setup.c         | 19 ++++++++++-------
 arch/x86/platform/efi/quirks.c  | 21 ++++++++++++++++++
 arch/x86/realmode/init.c        | 47 ++++++++++++++++++++++++++++++-----------
 6 files changed, 76 insertions(+), 24 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-08-11 16:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10  9:29 [PATCH v2 0/5] Allow the trampoline to use EFI boot services RAM Andy Lutomirski
2016-08-10  9:29 ` [PATCH v2 1/5] x86/boot: Run reserve_bios_regions() after we initialize the memory map Andy Lutomirski
2016-08-11 11:57   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-08-10  9:29 ` [PATCH v2 2/5] x86/boot: Synchronize trampoline_cr4_features and mmu_cr4_features directly Andy Lutomirski
2016-08-11 11:58   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-08-10  9:29 ` [PATCH v2 3/5] x86/boot: Defer setup_real_mode() to early_initcall time Andy Lutomirski
2016-08-11 11:58   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-08-10  9:29 ` [PATCH v2 4/5] x86/boot: Rework reserve_real_mode() to allow multiple tries Andy Lutomirski
2016-08-11 11:59   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-08-10  9:29 ` [PATCH v2 5/5] x86/efi: Allocate a trampoline if needed in efi_free_boot_services() Andy Lutomirski
2016-08-11 16:19   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-08-10 12:28 ` [PATCH v2 0/5] Allow the trampoline to use EFI boot services RAM Ingo Molnar
2016-08-10 13:21   ` Andy Lutomirski
2016-08-10 16:08     ` Mario_Limonciello
2016-08-10 12:30 ` Ingo Molnar
2016-08-10 13:18   ` Andy Lutomirski
2016-08-11  8:52     ` Ingo Molnar
2016-08-11 10:36       ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).