public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: "matt@console-pimps.org" <matt@console-pimps.org>
To: Zachary Bobroff <zacharyb@ami.com>
Cc: 'Jan Beulich' <jbeulich@suse.com>,
	"matt.fleming@intel.com" <matt.fleming@intel.com>,
	"mjg59@srcf.ucam.org" <mjg59@srcf.ucam.org>,
	Joey Lee <JLee@suse.com>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86, efi: retry ExitBootServices() on failure
Date: Wed, 19 Jun 2013 09:43:29 +0100	[thread overview]
Message-ID: <20130619084329.GA5386@console-pimps.org> (raw)
In-Reply-To: <7BD74F8E52BFD147B6C83AE7A1E893FFE286040C@atlms1.us.megatrends.com>

On Tue, 18 Jun, at 10:12:22PM, Zachary Bobroff wrote:
> > Okay, I'm fine with that aspect then. Let's hope everyone plays by
> > that rule.
> This is all according to specification, so if they are not following
> these rules they should be corrected.  The link to where the current
> public version of the specification is available is here:
> http://www.uefi.org/specs/agreement
 
While I agree that the vendor should be informed if their implementation
deviates from the spec in some way, the Linux kernel usually still needs
to support these nonconforming machines once they end up in the hands of
consumers (which is often the point at which we discover these kinds of
issues). Sadly, we're still not in a position where firmware updates can
be applied from OEMs ubiquitously, either because machines are End of
Life'd or because the update needs to be run from Windows.

We tend to adopt the approach of: let's try this until we get reports of
a class of machines where this solution doesn't work.

Though I do find it refreshing to hear engineers talking about the UEFI
spec in such black and white terms. That is certainly the ideal we
should be aiming for.

> > Why by one? Splitting some 'free memory' block may result in an
> > increase by more then one afaict. Assuming the increment can only be
> > one is >implying you having knowledge of the allocator
> > implementation and behavior, which shouldn't be made use of in
> > kernel code.
> We had to actually increment it by two to get it to work correctly.
> This is all based upon the use of the low_alloc routine in the linux
> kernel file.  I agree there is still some outstanding issue based upon
> this, but we put it through several different types of tests and it
> continued to work correctly.  The truest solution would be to us the
> AllocateMaxAddress parameter when using AllocatePages. 

[...]

> It was my understanding that the point of this was to allocate the
> memory map below a certain address in memory because the kernel
> required it.  Matt, can you comment here?  I am not aware of what
> address it needs to be below, but using this function should do the
> trick.  Also, if you want to inform me better of what memory ceiling
> restrictions there are at this early stage of the kernel, I can
> rewrite the file without the need of the low_alloc routine entirely.

The most important restriction is that all allocations in the EFI boot
stub need to be below the 1GB mark, because only the first 1GB of
virtual memory is mapped, unless certain flags are set in the xloadflags
field of the boot_params header. See Documentation/x86/boot.txt.

Further to that, I think I remember some restrictions on the location of
the cmdline pointer - that it needs to be below 0xa0000. Again,
Documentation/x86/boot.xt should have all the info you need.

-- 
Matt Fleming, Intel Open Source Technology Center

  reply	other threads:[~2013-06-19  8:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11  6:52 [PATCH] x86, efi: retry ExitBootServices() on failure Matt Fleming
     [not found] ` <1370933558-10128-1-git-send-email-matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-06-11  7:22   ` Matt Fleming
2013-06-13 16:00   ` joeyli
     [not found]     ` <1371139233.6523.272.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-06-17  9:21       ` Matt Fleming
     [not found]         ` <20130617092107.GA5440-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-06-17  9:46           ` Jan Beulich
2013-06-17 10:17             ` Matt Fleming
     [not found]               ` <20130617101745.GB8569-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-06-17 10:41                 ` joeyli
2013-06-17 11:02                 ` Jan Beulich
2013-06-17 12:30                   ` Matt Fleming
2013-06-18  0:18                     ` Zachary Bobroff
2013-06-18  2:47                       ` joeyli
2013-06-18  4:20                         ` Zachary Bobroff
     [not found]                           ` <B0277B82-F2C5-4BA9-B42C-F554E12F6961-gH/BEeFdNRQ@public.gmane.org>
2013-06-18  7:34                             ` joeyli
2013-06-18 13:03                       ` Jan Beulich
2013-06-18 22:12                         ` Zachary Bobroff
2013-06-19  8:43                           ` matt [this message]
2013-06-19  8:53                             ` H. Peter Anvin
2013-06-20 18:04                               ` Zachary Bobroff
2013-06-26 13:12                                 ` matt
  -- strict thread matches above, loose matches on Subject: below --
2013-05-22 14:15 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=20130619084329.GA5386@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=JLee@suse.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@suse.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=stable@vger.kernel.org \
    --cc=zacharyb@ami.com \
    /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