linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
To: Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
Cc: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	X86 ML <x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Borislav Petkov <bp-l3A5Bk7waGM@public.gmane.org>,
	Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>,
	"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>,
	James Bottomley
	<James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>,
	Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	fwts-devel-nLRlyDuq1AZFpShjVBNYrg@public.gmane.org
Subject: Re: [PATCH 12/12] EFI: Runtime services virtual mapping
Date: Thu, 10 Oct 2013 13:34:53 +0100	[thread overview]
Message-ID: <20131010123453.GA12321@console-pimps.org> (raw)
In-Reply-To: <20131010085827.GA9929-fF5Pk5pvG8Y@public.gmane.org>

On Thu, 10 Oct, at 10:58:28AM, Borislav Petkov wrote:
> On Thu, Oct 10, 2013 at 04:14:34PM +0800, Dave Young wrote:
> > Even though I still have no idea why kernel text overlap with efi boot
> > region, anyway map the un-overlapped part is necessary though.
> >
> > I can post the kexec related patches after your mapping patches settle
> > down
> 
> Right, "settle down" being the key here.
> 
> Matt just mentioned on IRC that we might not need boot services mappings
> by the time we have to start the kexec kernel, which would mean, you
> don't have to do anything in efi_reserve_boot_services().

Dave, apologies for not discussing the whole Boot Services thing sooner.
I missed your questions.

We really should not be passing the EFI Boot Service regions via the
memmap to kexec at all, because by the time the kexec'd kernel is
running those pages that previously contained Boot Service code/data
will have likely been reused for something else.

Which, to answer your question, is why the Boot Service regions overlap
the kernel text in the kexec'd kernel - those regions have been
reallocated by the first kernel and now happen to contain the kernel
text of the kexec kernel.

The reason that we don't keep the Boot Service regions around forever is
because they can take up a considerable amount of memory, so the current
situation of free'ing them after we're sure the firmware isn't going to
reference them is still the right way to go, and simply not including
any Boot Service entries in the memory map passed to kexec should make
everything work OK.

> The question which needs answering first though is, how the whole efi
> thing is going to handle any functionality like calling into efi boot
> regions from runtime functions and such. Which hasn't really been tested
> and fw vendors don't really want to support that. But this is all bits
> and pieces I heard yesterday so it is all pretty wet and I'll let efi
> guys, i.e. the Matts and a couple of others :-), figure out this whole
> issue.

We currently treat the scenario where Runtime Services reference Boot
Service regions as a bug and either work around it (where we do
efi_reserve_boot_services() and efi_free_boot_services() around
SetVirtualAddressMap()) or we avoid calling those services altogether.

The spec is pretty clear that runtime drivers shouldn't be doing this,
and so far this approach has served us well.

There are only two reasons why we keep the Boot Services regions around
(for a short period) at all,

  1) To work around the aforementioned runtime firmware bugs
  2) To copy a ACPI BGRT image into kernel memory

I'm not sure whether the kexec kernel would care about the BGRT?

-- 
Matt Fleming, Intel Open Source Technology Center

  parent reply	other threads:[~2013-10-10 12:34 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 14:54 [PATCH 00/11] EFI runtime services virtual mapping Borislav Petkov
     [not found] ` <1379602494-26684-1-git-send-email-bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
2013-09-19 14:54   ` [PATCH 01/11] efi: Simplify EFI_DEBUG Borislav Petkov
2013-09-19 14:54   ` [PATCH 02/11] efi: Remove EFI_PAGE_SHIFT and EFI_PAGE_SIZE Borislav Petkov
     [not found]     ` <1379602494-26684-3-git-send-email-bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
2013-09-20 10:42       ` Matt Fleming
2013-09-21 15:21         ` Leif Lindholm
2013-09-21 15:41           ` Borislav Petkov
2013-09-21 15:50             ` Borislav Petkov
2013-09-21 16:01               ` Leif Lindholm
     [not found]                 ` <20130921160121.GI2737-GZEopFhza0F985/tl1ce8aaDwS/vmuI7@public.gmane.org>
2013-09-21 16:03                   ` Borislav Petkov
     [not found]             ` <20130921154143.GC1587-fF5Pk5pvG8Y@public.gmane.org>
2013-09-21 15:59               ` Leif Lindholm
2013-09-19 14:54   ` [PATCH 05/11] x86, pageattr: Add a PUD pagetable populating function Borislav Petkov
2013-09-19 14:54   ` [PATCH 09/11] x86, pageattr: Add last levels of error path Borislav Petkov
2013-09-20  7:29   ` [PATCH 00/11] EFI runtime services virtual mapping Dave Young
     [not found]     ` <20130920072904.GA21922-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-20  8:19       ` Dave Young
     [not found]         ` <20130920081940.GC21922-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-20  9:33           ` Borislav Petkov
2013-09-20 10:07             ` Dave Young
2013-09-20  9:05       ` Borislav Petkov
     [not found]         ` <20130920090544.GA9574-fF5Pk5pvG8Y@public.gmane.org>
2013-09-20  9:44           ` Matt Fleming
2013-09-20  9:49           ` Matt Fleming
     [not found]             ` <20130920094913.GG4785-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-09-20 10:02               ` Borislav Petkov
2013-09-20 11:51           ` Dave Young
2013-09-20 12:29           ` Matt Fleming
     [not found]             ` <20130920122915.GB21381-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-09-20 14:04               ` Dave Young
2013-09-19 14:54 ` [PATCH 03/11] x86, pageattr: Lookup address in an arbitrary PGD Borislav Petkov
2013-09-19 14:54 ` [PATCH 04/11] x86, pageattr: Add a PGD pagetable populating function Borislav Petkov
2013-09-19 14:54 ` [PATCH 06/11] x86, pageattr: Add a PMD " Borislav Petkov
2013-09-19 14:54 ` [PATCH 07/11] x86, pageattr: Add a PTE " Borislav Petkov
2013-09-19 14:54 ` [PATCH 08/11] x86, pageattr: Add a PUD error unwinding path Borislav Petkov
2013-09-19 14:54 ` [PATCH 10/11] x86, cpa: Map in an arbitrary pgd Borislav Petkov
2013-09-19 14:54 ` [PATCH 11/11] EFI: Runtime services virtual mapping Borislav Petkov
     [not found]   ` <1379602494-26684-12-git-send-email-bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
2013-09-21 11:39     ` [PATCH -v2] " Borislav Petkov
     [not found]       ` <20130921113929.GB1587-fF5Pk5pvG8Y@public.gmane.org>
2013-09-22 12:35         ` Dave Young
     [not found]           ` <20130922123515.GA7476-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-22 13:37             ` Borislav Petkov
     [not found]               ` <20130922133722.GC28718-fF5Pk5pvG8Y@public.gmane.org>
2013-09-22 14:00                 ` Dave Young
     [not found]                   ` <20130922140038.GB7476-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-22 14:31                     ` Dave Young
2013-09-22 15:27                 ` H. Peter Anvin
     [not found]                   ` <1ba7eca6-419c-4181-9927-9ba0927a6abf-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-09-22 16:38                     ` Borislav Petkov
2013-09-23  5:45                     ` Dave Young
2013-09-24  2:52                     ` Dave Young
     [not found]                       ` <20130924025209.GA5561-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-24  3:06                         ` H. Peter Anvin
     [not found]                           ` <2d27a1bc-eabf-4d45-8303-27ae58511b11-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-09-24  4:57                             ` Dave Young
     [not found]                               ` <20130924045705.GB5561-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-24  4:58                                 ` Dave Young
     [not found]                                   ` <20130924045818.GC5561-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-24  5:23                                     ` Dave Young
2013-09-24  8:57                                       ` Dave Young
2013-09-24  9:43                                 ` Borislav Petkov
     [not found]                                   ` <bd9528a453bce9b52ad4be75dcc0f034.squirrel-Fq0NhQX/+7ild1e1puMNDg@public.gmane.org>
2013-09-24 10:01                                     ` Dave Young
2013-09-24 12:45                                     ` Dave Young
2013-10-02 10:04                             ` Borislav Petkov
     [not found]                               ` <20131002100426.GB20568-fF5Pk5pvG8Y@public.gmane.org>
2013-10-02 15:43                                 ` H. Peter Anvin
     [not found]                                   ` <524C3F38.6050507-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-10-02 17:05                                     ` Borislav Petkov
     [not found]                                       ` <20131002170522.GA20647-fF5Pk5pvG8Y@public.gmane.org>
2013-10-02 17:32                                         ` H. Peter Anvin
     [not found]                                           ` <524C58A3.4090704-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-10-02 18:42                                             ` Borislav Petkov
     [not found]                                               ` <20131002184229.GE20568-fF5Pk5pvG8Y@public.gmane.org>
2013-10-02 18:46                                                 ` H. Peter Anvin
     [not found]                                                   ` <524C6A14.40905-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-10-04  9:42                                                     ` Borislav Petkov
     [not found]                                                       ` <20131004094247.GA6796-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-10-04 14:43                                                         ` H. Peter Anvin
     [not found]                                                           ` <89e0284e-89b5-42ad-8120-128ef1bf0152-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-10-04 14:50                                                             ` Borislav Petkov
2013-09-23  8:45         ` Borislav Petkov
2013-09-25  9:24         ` Borislav Petkov
2013-09-23  5:47       ` Dave Young
     [not found]         ` <20130923054741.GC7007-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-09-23  6:29           ` Borislav Petkov
     [not found]             ` <20130923062947.GA2527-fF5Pk5pvG8Y@public.gmane.org>
2013-09-23  7:08               ` Dave Young
2013-10-08 16:45 ` [PATCH 00/11] EFI runtime " Borislav Petkov
     [not found]   ` <20131008164551.GB16793-fF5Pk5pvG8Y@public.gmane.org>
2013-10-08 16:47     ` [PATCH 11/12] efi: Add an efi= kernel command line parameter Borislav Petkov
2013-10-28 11:02       ` Matt Fleming
2013-10-28 11:10         ` Borislav Petkov
2013-10-08 16:48     ` [PATCH 12/12] EFI: Runtime services virtual mapping Borislav Petkov
     [not found]       ` <20131008164831.GD16793-fF5Pk5pvG8Y@public.gmane.org>
2013-10-10  8:06         ` Dave Young
2013-10-10  8:14           ` Dave Young
     [not found]             ` <20131010081434.GB3692-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-10  8:58               ` Borislav Petkov
     [not found]                 ` <20131010085827.GA9929-fF5Pk5pvG8Y@public.gmane.org>
2013-10-10 12:34                   ` Matt Fleming [this message]
     [not found]                     ` <20131010123453.GA12321-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-10-11  6:24                       ` Dave Young
     [not found]                         ` <20131011062437.GA14115-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-11  7:41                           ` Borislav Petkov
     [not found]                             ` <20131011074144.GA18719-fF5Pk5pvG8Y@public.gmane.org>
2013-10-12  7:54                               ` Dave Young
     [not found]                                 ` <20131012075443.GD7550-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-12 10:13                                   ` Matt Fleming
     [not found]                                     ` <20131012101308.GI12321-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-10-12 10:30                                       ` Borislav Petkov
     [not found]                                         ` <20131012103054.GA13739-fF5Pk5pvG8Y@public.gmane.org>
2013-10-13  3:11                                           ` Dave Young
     [not found]                                             ` <20131013031126.GB1914-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
2013-10-13  9:25                                               ` Borislav Petkov
     [not found]                                                 ` <20131013092521.GA22866-fF5Pk5pvG8Y@public.gmane.org>
2013-10-14 15:58                                                   ` Borislav Petkov
     [not found]                                                     ` <20131014155851.GJ4009-fF5Pk5pvG8Y@public.gmane.org>
2013-10-21 12:47                                                       ` Dave Young
     [not found]                                                         ` <20131021124739.GA4515-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-21 13:37                                                           ` Borislav Petkov
     [not found]                                                             ` <20131021133741.GA5716-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-10-21 15:04                                                               ` Dave Young
     [not found]                                                                 ` <20131021150426.GB4515-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-22 11:18                                                                   ` Borislav Petkov
     [not found]                                                                     ` <20131022111857.GA10660-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-10-23  2:17                                                                       ` Dave Young
     [not found]                                                                         ` <20131023021730.GE4594-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-23 12:25                                                                           ` Borislav Petkov
     [not found]                                                                             ` <20131023122531.GA15848-K5JNixvcfoxupOikMc4+xw@public.gmane.org>
2013-10-23 12:37                                                                               ` Matthew Garrett
2013-10-23 12:51                                                                               ` Dave Young
     [not found]                                                                                 ` <20131023125131.GA5552-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-23 13:11                                                                                   ` Borislav Petkov
2013-10-26 15:50                                                               ` Matt Fleming
2013-10-13  3:06                                     ` Dave Young
2013-10-11 10:27                           ` Matt Fleming
     [not found]                             ` <20131011102706.GE12321-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-10-11 13:42                               ` Dave Young
     [not found]                                 ` <643121905.4545046.1381498954428.JavaMail.root-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-12  2:14                                   ` Dave Young
2013-10-14 15:57                                     ` Peter Jones
2013-10-16  6:27                                       ` Dave Young
2013-10-28 11:22         ` Matt Fleming
     [not found]           ` <20131028112246.GK1982-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-10-28 16:00             ` Borislav Petkov
2013-10-29  6:47         ` Dave Young
     [not found]           ` <20131029064720.GA16009-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-29  9:40             ` Borislav Petkov
     [not found]               ` <20131029094033.GA10972-fF5Pk5pvG8Y@public.gmane.org>
2013-10-30  9:32                 ` Dave Young
     [not found]                   ` <20131030093227.GA5791-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2013-10-30 10:45                     ` Borislav Petkov
     [not found]                       ` <20131030104526.GA13290-fF5Pk5pvG8Y@public.gmane.org>
2013-10-31  7:07                         ` Dave Young
2013-10-14 13:04     ` [PATCH 00/11] EFI runtime " 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=20131010123453.GA12321@console-pimps.org \
    --to=matt-hnk1s37rvnbexh+ff434mdi2o/jbrioy@public.gmane.org \
    --cc=James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org \
    --cc=bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org \
    --cc=bp-l3A5Bk7waGM@public.gmane.org \
    --cc=dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=fwts-devel-nLRlyDuq1AZFpShjVBNYrg@public.gmane.org \
    --cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
    --cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).