From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c0f::22e; helo=mail-ot0-x22e.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-ot0-x22e.google.com (mail-ot0-x22e.google.com [IPv6:2607:f8b0:4003:c0f::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 48C3822352296 for ; Tue, 27 Feb 2018 23:50:54 -0800 (PST) Received: by mail-ot0-x22e.google.com with SMTP id w2so1434357otg.2 for ; Tue, 27 Feb 2018 23:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MT3qXUrOmkOo7g79Pdy75EaZHWTf5WfMVJZRHBQyZ8k=; b=OD7rTlyvPGhJAExmwVl10WKGHXoXjyFadLlZ75kHNsUDFBqXPo4g7H/J5lfAh7Ikea 9vJuzJZA+b6vHPVx1ZqUjtfWshNGWGX4cTSNy8m1+78T1yeAXB5MpUNC1qIllTdR2hCA AMfQtbL5u2tNnCuhel1kTypZE66rTpD0FxSuPgb3sBxPT+59EBqz0usHb5omg+BogphG 6Xt01v4crW6t4YCKZ4Z6I0pZhtL5HCF8ZulpkFO1eyoJ5w7YzQX8i+vFqSQcNsSY0pDp wL27UqzEp+UMUa0t0SbbkNobMxtEQgobNJhoYIRN/QrPNVOOJoebLLMBTgp7Sz/0h2vZ y4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MT3qXUrOmkOo7g79Pdy75EaZHWTf5WfMVJZRHBQyZ8k=; b=jV5fQ1onmZqAo4xYlyWj31+kBck2/ikXBCM8fV/dCOvKzmoDKRh2vhB4sbk30Oz6Gp +7iUjysmBQJRahwAyv6a2vlat2BGW0q+8D+OzowzSt83X+HGYmbPH29Hykk78vgkWqQo xge6PrnCxaBbMMIg9Dd2C4GOV5pUoPRdxdAmEVLaWCRrEVzoJtK5htCE0X1tQuURtagV F90cnfT8e8FyBDXfBSWOXXzEOB+9F++ibdan8iDUlCL8SVUask646G0nzwZy9diSTizJ eOW4R/ZaBZxBqRAFf3ZCroZVyiLDZfWGdxvu9d4rBauiy32DRx+yxU/AWQtZQxoCtYY1 W1kQ== X-Gm-Message-State: APf1xPCN1pnzMrIQg0qJaqdQXtLVDI1LJSFS0Baggn0JY9dcIP7nEcZM 2135yr3tgmmRTGFOrWVpwHVZiS3BtXQjKM5Qj8k= X-Google-Smtp-Source: AG47ELtCSjv/xLH8+V8N5X420X85Ug9KDjYA+2heHWD9loLZaN4VvlPPrqDVjMIeh659SmMRU01bQa6fco69WvlKJYM= X-Received: by 10.157.41.239 with SMTP id g44mr11647573otd.19.1519804620480; Tue, 27 Feb 2018 23:57:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.31.116 with HTTP; Tue, 27 Feb 2018 23:56:59 -0800 (PST) In-Reply-To: References: <26da6afd-102b-0006-c6b7-a10d8e13f96e@Intel.com> From: Michael Zimmermann Date: Wed, 28 Feb 2018 08:56:59 +0100 Message-ID: To: Andrew Fish Cc: "Ni, Ruiyu" , edk2-devel-01 , Leif Lindholm , Ard Biesheuvel X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: 'fastboot boot' TPL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 07:50:54 -0000 Content-Type: text/plain; charset="UTF-8" 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 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 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 >>> > >>> 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 >