linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Matt Fleming
	<matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>,
	"x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] efi: Use LocateHandleBuffer instead of LocateHandle
Date: Fri, 9 Sep 2016 13:59:51 +0200	[thread overview]
Message-ID: <20160909115951.GA29385@wunner.de> (raw)
In-Reply-To: <CAKv+Gu_kfnHfiBH__Wnvh39KMPj_-s39YyY=pT3roNv7iPPzrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Sep 09, 2016 at 11:52:32AM +0100, Ard Biesheuvel wrote:
> On 8 September 2016 at 01:02, Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> wrote:
> > Use LocateHandleBuffer instead of the LocateHandle + AllocatePool +
> > LocateHandle combo to save a bit on code.
> >
> > Usage of LocateHandle for UGA and GOP has been present in the efistub
> > since its introduction with commit 291f36325f9f ("x86, efi: EFI boot
> > stub support"). It was subsequently inherited by the PCI ROM retrieval
> > with commit dd5fc854de5f ("EFI: Stash ROMs if they're not in the PCI
> > BAR").
> >
> > One valid reason to not use LocateHandleBuffer would be if a specific
> > memory type is required for the buffer, and particularly if the buffer
> > needs to persist across ExitBootServices. The spec does not mandate
> > which type is used, edk2 seems to default to EfiBootServicesData.
> > In the three use cases modified by this commit (UGA, GOP, PCI), the
> > buffer is freed before ExitBootServices is called. Hence the memory
> > type is irrelevant.
> >
> > No functional change intended.
> >
> > Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
> > ---
> >
> 
> What is the oldest UEFI version we claim to support? For ARM, this is
> not an issue, but it appears that LocateHandleBuffer () was introduced
> in v1.10

That's a fair point. I couldn't find any older specs than 1.10, only found
some sources saying the 1.02 spec was pulled for legal reasons.

I did notice the 1.10 spec says "The LocateHandleBuffer() is a new version
of LocateHandle() that allocates the required buffer for the caller."

Note the word "new".

According to Wikipedia, "Intel's first Itanium workstations and servers,
released in 2000, implemented EFI 1.02. Hewlett-Packard's first Itanium 2
systems, released in 2002, implemented EFI 1.10".

Since this code is only used by x86 and arm (not ia64), were x86_32
systems with EFI < 1.10 actually shipped?

I vaguely recall that Apple was among the first vendors adopting EFI
for x86 in 2005, but I could be wrong.

Thanks,

Lukas

  parent reply	other threads:[~2016-09-09 11:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  0:02 [PATCH] efi: Use LocateHandleBuffer instead of LocateHandle Lukas Wunner
     [not found] ` <1d7915dc0dd328ca04088f6b8b3fcfad5cec55a0.1473275006.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-09-09 10:52   ` Ard Biesheuvel
     [not found]     ` <CAKv+Gu_kfnHfiBH__Wnvh39KMPj_-s39YyY=pT3roNv7iPPzrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-09 11:59       ` Lukas Wunner [this message]
     [not found]         ` <20160909115951.GA29385-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-10-03 19:32           ` Matt Fleming
     [not found]             ` <20161003193220.GI16071-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-10-04 12:56               ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu-UKr0bPjy_0tO0ThB6F4E1q-uKtktg+z5CRP=gX-oewg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-04 16:53                   ` Lukas Wunner
     [not found]                     ` <20161004165349.GA5019-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-10-05 16:25                       ` Ard Biesheuvel
     [not found]                         ` <CAKv+Gu-6yB_ZVC38S8yFZtB7vPfDZe1wp47bT+WxwpSSUN4OgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-06  9:32                           ` Lukas Wunner
     [not found]                             ` <20161006093200.GA6925-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-10-12 12:35                               ` Ard Biesheuvel
2016-10-04 21:33                   ` 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=20160909115951.GA29385@wunner.de \
    --to=lukas-jfq808j9c/izqb+pc5nmwq@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@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).