public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
	Roy Franz <roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: EFI_STUB fails to boot non-EFI on arm64
Date: Wed, 28 May 2014 21:42:39 +0100	[thread overview]
Message-ID: <20140528204239.GV4179@bivouac.eciton.net> (raw)
In-Reply-To: <20140528184043.GB20523-5wv7dgnIgG8@public.gmane.org>

On Wed, May 28, 2014 at 07:40:43PM +0100, Will Deacon wrote:
> > Well, but (for the output part) my patch already did that?
> > If the "Getting parameters from FDT:\n" was too verbose, we could
> > just drop it, and have the same effect on output.
> 
> It's the pr_err which is annoying, not the "Getting parameters from FDT:\n"
> message. Why should I have an error logged to my console when I was never
> intending to boot using EFI anyway?

The pr_err would now only be triggered if some UEFI properties were
present and not others. I.e. if the UEFI stub loader failed miserably
without detecting it, or something corrupted the DT later on. We would
then be the proud owners of a system in an undefined state.

> > Thing is - there is not really any error case available anywhere
> > during the execution of efi_init() and its branches other than:
> > - Information required for UEFI boot cannot be found.
> > - Information exists, but is invalid.
> > - Failed to early_memremap some UEFI regions into the kernel.
> > which all amounts to "UEFI not available or something went wrong",
> > rather than "UEFI failed to initialise".
> 
> Fine, but in this case the DT had the relevant properties which is a good
> indication that the user was at least *trying* to boot using EFI, no?

Having a partial/invalid DT is going to cause undefined behaviour
regardless of your method of booting.

And if the data provided proved inaccessible or broken, the symptom
would be a complete lack of memblocks. So it may in fact not be
possible for that pr_err to ever make it to the console :)

> > If efi_init returns successfully, EFI_BOOT is set, and testable using
> > the efi_enabled() macro.
> > 
> > The proper "UEFI failed to initialise" bit does not come until the
> > early_initcall arm64_enter_virtual_mode(), and is indicated not by
> > a return value, but by setting the flag indicating that
> > EFI_RUNTIME_SERVICES are available, which is checked later in core
> > code using the efi_enabled() macro.
> 
> Sorry, I naively assumed that with a name like efi_init it might, you know,
> initialise EFI? ;)

Name cargo-culted from ia64/x86 by me, and from me by Mark :)

> > So moving the call to efi_get_fdt_params() would have little effect
> > other than adding a third call site for UEFI bits in setup_arch().
> 
> I don't mind having the extra call site if it allows us to distinguish
> errors from information.

And I still don't see how an extra call site in setup_arch would make
this more possible than it already is (with my suggested patch to the
current version of the code).

/
    Leif

  parent reply	other threads:[~2014-05-28 20:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  9:45 EFI_STUB fails to boot non-EFI on arm64 Catalin Marinas
     [not found] ` <20140523094513.GC9252-5wv7dgnIgG8@public.gmane.org>
2014-05-23 13:16   ` Leif Lindholm
     [not found]     ` <20140523131656.GR4179-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2014-05-23 13:24       ` Matt Fleming
2014-05-23 13:47       ` Catalin Marinas
     [not found]         ` <20140523134720.GA9256-5wv7dgnIgG8@public.gmane.org>
2014-05-23 15:03           ` Leif Lindholm
     [not found]             ` <20140523150331.GS4179-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2014-05-23 15:17               ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu-4ExoNfGVJzUK4v06XD5V3nYfRetoefY0RuFsN1CUOzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-23 15:45                   ` Leif Lindholm
     [not found]                     ` <20140523154551.GT4179-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2014-05-23 18:03                       ` Roy Franz
2014-05-23 19:43                       ` Ard Biesheuvel
2014-05-28 15:59               ` Will Deacon
     [not found]                 ` <20140528155931.GA20523-5wv7dgnIgG8@public.gmane.org>
2014-05-28 18:05                   ` Leif Lindholm
     [not found]                     ` <20140528180525.GU4179-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2014-05-28 18:40                       ` Will Deacon
     [not found]                         ` <20140528184043.GB20523-5wv7dgnIgG8@public.gmane.org>
2014-05-28 20:42                           ` Leif Lindholm [this message]
2014-07-08  9:21               ` Catalin Marinas
     [not found]                 ` <20140708092100.GA21320-5wv7dgnIgG8@public.gmane.org>
2014-07-08 11:09                   ` Leif Lindholm

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=20140528204239.GV4179@bivouac.eciton.net \
    --to=leif.lindholm-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@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