public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Matt Fleming
	<matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors
Date: Thu, 12 Feb 2015 15:16:07 +0000	[thread overview]
Message-ID: <20150212151607.GH1522@leverpostej> (raw)
In-Reply-To: <CAKv+Gu-NAKASZc4phj5x83mB8Ak4Gy2zYq-a0CDADEOTBD4pXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Feb 12, 2015 at 02:56:51PM +0000, Ard Biesheuvel wrote:
> On 12 February 2015 at 22:47, Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote:
> > On Thu, 12 Feb, at 06:39:46PM, Ard Biesheuvel wrote:
> >>
> >> I don't see how doing a single allocation could result in a single
> >> free region to be split into more than 1 occupied region + 2 free
> >> regions.
> >> So no, I don't think it is ...
> >
> > I don't think that's a guarantee we can make, nor is it something we
> > should rely upon.
> >
> > Please explain the user-visible failure that this patch fixes. Does your
> > machine refuse to boot?
> 
> I am running UEFI under QEMU and Xen primarily at the moment, and
> experimenting with various build options in Tianocore, One of the
> options is preallocating and freeing blocks of various memory types,
> in a way that should result in the final number of distinct regions to
> be much lower. It could result however in a free memory region to be
> carved up in three instead of two, and that is a failure I have seen
> occur.

The simple answer is that the machine will fail to boot, beause the
efi_get_memory_map helper will give up after one go, and propagate the
error. The arm-stub will give up when the error is encountered.

> > Why is the 'goto again' loop insufficient in
> > handling this scenario?
> >
> 
> Yes, that should solve it as well, so if you prefer I reinstate that,
> I can respin the patch. There is a theoretical possibility that it
> would take more than just one more iteration, but that is highly
> unlikely and it should still always complete.

Please reinstate the loop. It will make this far less fragile.

Thanks,
Mark.

  parent reply	other threads:[~2015-02-12 15:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  5:24 [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors Ard Biesheuvel
     [not found] ` <1423718659-795-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-02-12  8:21   ` Roy Franz
2015-02-12 10:22   ` Mark Rutland
2015-02-12 10:39     ` Ard Biesheuvel
     [not found]       ` <CAKv+Gu88vzPpXoSEs1ZSQbO7wsqh7NRSZc=iSpC9D6vzus7f8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-12 10:56         ` Mark Rutland
2015-02-12 14:47         ` Matt Fleming
     [not found]           ` <20150212144727.GD4665-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-02-12 14:56             ` Ard Biesheuvel
     [not found]               ` <CAKv+Gu-NAKASZc4phj5x83mB8Ak4Gy2zYq-a0CDADEOTBD4pXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-12 15:16                 ` Mark Rutland [this message]
2015-02-12 15:31                   ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu_Z0Upoy0J-hxf0i7Oen00tb-TENJ9CszdEtTHsb5pGSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-13 16:04                       ` Matt Fleming
     [not found]                         ` <20150213160448.GA30567-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-02-13 16:23                           ` Ard Biesheuvel
2015-02-13 16:34                           ` Mark Rutland
2015-02-13 16:33                       ` Mark Rutland

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=20150212151607.GH1522@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=roy.franz-QSEj5FYQhm4dnm+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