public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Michael Zimmermann <sigmaepsilon92@gmail.com>
To: Andrew Fish <afish@apple.com>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	edk2-devel-01 <edk2-devel@lists.01.org>,
	 Leif Lindholm <leif.lindholm@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: 'fastboot boot' TPL
Date: Wed, 28 Feb 2018 08:56:59 +0100	[thread overview]
Message-ID: <CAN9vWDJsQ+p2Do0CFsUc9b420agrFNF6KOv3MVJ0ycyDpJXRwA@mail.gmail.com> (raw)
In-Reply-To: <A08BC49D-25F3-45D3-AF22-4A4E5F706D93@apple.com>

I feel like both of you misunderstood my intention.
As I said in my initial mail, I'm not arguing the spec - I know that
StartImage must be called from TPL_APPLICATION.

I'm just discussing a bug inside EmbeddedPkg/Application/AndroidFastboot -
because they actually do call StartImage from TPL_CALLBACK.
As I proposed in my initial mail, we should not only fix that, but also add
tpl ASSERTs inside several BootServices to prevent this from happening in
future.

Thanks
Michael

On Wed, Feb 28, 2018 at 8:42 AM, Andrew Fish <afish@apple.com> wrote:

> Violating the spec is undefined behavior. If it works that is bad luck, or
> good luck depending on your point of view.
>
> Sent from my iPhone
>
> > On Feb 27, 2018, at 11:33 PM, Michael Zimmermann <
> sigmaepsilon92@gmail.com> wrote:
> >
> > Are you sure?
> >
> > If you look at this file:
> > https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/
> Application/AndroidFastboot/AndroidFastbootApp.c
> >
> > The DataReady Event is a TPL_CALLBACK event.
> > From there the call chain goes as follows:
> > AcceptCmd -> HandleBoot -> BootAndroidBootImg -> StartEfiApplication ->
> > "gBS->StartImage"
> >
> > Thanks
> > Michael
> >
> >> On Wed, Feb 28, 2018 at 8:29 AM, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> >>
> >>> On 2/28/2018 2:06 PM, Michael Zimmermann wrote:
> >>>
> >>> From looking at the code it seems to me that StartImage is called from
> >>> TPL_CALLBACK.
> >>> According to the Spec StartImage can only be called from <TPL_CALLBACK.
> >>>
> >>> If the current code actually works it means that there are at least 3
> >>> problems that should be addressed:
> >>> - call StartImage from TPL_APPLICATION
> >>> - ASSERT the tpl in LoadImage and StartImage
> >>> - ASSERT the tpl in ExitBootServices
> >>>
> >>> Thanks
> >>> Michael
> >>> _______________________________________________
> >>> edk2-devel mailing list
> >>> edk2-devel@lists.01.org
> >>> https://lists.01.org/mailman/listinfo/edk2-devel
> >>>
> >>> NO, LoadImage and StartImage are called at TPL_APPLICATION.
> >>
> >> --
> >> Thanks,
> >> Ray
> >>
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
>


  reply	other threads:[~2018-02-28  7:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  6:06 'fastboot boot' TPL Michael Zimmermann
2018-02-28  7:29 ` Ni, Ruiyu
2018-02-28  7:33   ` Michael Zimmermann
2018-02-28  7:42     ` Andrew Fish
2018-02-28  7:56       ` Michael Zimmermann [this message]
2018-02-28  8:10         ` Ard Biesheuvel
2018-02-28  8:15           ` Michael Zimmermann
2018-02-28  8:19             ` Ard Biesheuvel
2018-02-28 10:10               ` Michael Zimmermann
2018-02-28 12:11               ` Laszlo Ersek

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-list 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=CAN9vWDJsQ+p2Do0CFsUc9b420agrFNF6KOv3MVJ0ycyDpJXRwA@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /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