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 <af...@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 < > sigmaepsilo...@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...@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 > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel