linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@amacapital.net>,
	Matt Fleming <matt@codeblueprint.co.uk>
Cc: Mario Limonciello <mario_limonciello@dell.com>,
	Borislav Petkov <bp@alien8.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>, X86 ML <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Matt Fleming <mfleming@suse.de>
Subject: Re: [PATCH v2 0/5] Allow the trampoline to use EFI boot services RAM
Date: Thu, 11 Aug 2016 10:52:25 +0200	[thread overview]
Message-ID: <20160811085225.GA4403@gmail.com> (raw)
In-Reply-To: <CALCETrUqbmCQrWLoxw7nVQAPsu5UQ-McJx9dCsicHmH=XzzFtQ@mail.gmail.com>


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Aug 10, 2016 3:31 PM, "Ingo Molnar" <mingo@kernel.org> wrote:
> >
> >
> > One side note:
> >
> > * Andy Lutomirski <luto@kernel.org> wrote:
> >
> > > 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.
> >
> > >   x86/efi: Allocate a trampoline if needed in efi_free_boot_services()
> >
> > Btw., this means that we first try to allocate the trampoline the old fashioned
> > way, and in the rare cases this fails we allocate it from the EFI data area,
> > right?
> 
> Yes, exactly.
> 
> >
> > This is problematic from the probability management POV: we are creating a rare
> > piece of code that will run only on a select few systems.
> >
> > I think it would be much better to allocate the trampoline from the EFI area on
> > all EFI systems by default. Is there any reason why that would not work?
> 
> I think most EFI systems don't have any boot services below 1MB, so
> that wouldn't work.
> 
> We could try allocating from EFI more generically, but that sounds
> much scarier.  The EFI memory map code is tangled with the e820 code
> and the memblock code, and I'd be nervous about confusing the e820
> code or accidentally allocating blacklisted RAM (EBDA,
> Sandybridge-quirked, etc.)  The code I wrote should only allocate the
> trampoline at a different address than current kernels in cases where
> current kernels would panic.
> 
> I don't like it either, but after scratching my head for a while I
> didn't come up with anything better.  At least the actual special case
> is only a couple lines of code.

Ok, fine enough to me!

Matt, is patch #5:

   [PATCH v2 5/5] x86/efi: Allocate a trampoline if needed in efi_free_boot_services()

looking good to you?

Thanks,

	Ingo

  reply	other threads:[~2016-08-11  8:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-08-11 10:36       ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160811085225.GA4403@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mario_limonciello@dell.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=mfleming@suse.de \
    --cc=mjg59@srcf.ucam.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).