From: "Dionna Glaze" <dionnaglaze@google.com>
To: gaoliming <gaoliming@byosoft.com.cn>
Cc: devel@edk2.groups.io,
Michael D Kinney <michael.d.kinney@intel.com>,
Ard Biesheuvel <ardb@kernel.org>,
Gerd Hoffman <kraxel@redhat.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Robert Phelps <robert@ami.com>
Subject: Re: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot
Date: Tue, 6 Dec 2022 21:27:53 -0800 [thread overview]
Message-ID: <CAAH4kHaPPgq_m0GU9PvPevBfnHmGfaH48xHXCP5heBdB-bX+4Q@mail.gmail.com> (raw)
In-Reply-To: <039e01d909da$f4f29780$ded7c680$@byosoft.com.cn>
On Tue, Dec 6, 2022 at 5:26 PM gaoliming <gaoliming@byosoft.com.cn> wrote:
>
> Dionna:
> I add my comments below.
>
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Dionna Glaze
> > via groups.io
> > 发送时间: 2022年11月9日 5:16
> > 收件人: devel@edk2.groups.io
> > 抄送: Dionna Glaze <dionnaglaze@google.com>; Michael D Kinney
> > <michael.d.kinney@intel.com>; Ard Biesheuvel <ardb@kernel.org>; Gerd
> > Hoffman <kraxel@redhat.com>; Jiewen Yao <jiewen.yao@intel.com>
> > 主题: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after
> > ReadyToBoot
> >
> > The Uefi v2.9 specification adds this event group in section 3.1.7,
> > with its GUID defined in the Related Definitions section of
> > EFI_BOOT_SERVICES.CreateEventEx() in chapter 7.
> >
> > Cc: "Michael D Kinney" <michael.d.kinney@intel.com>
> > Cc: Ard Biesheuvel <ardb@kernel.org>
> > Cc: Gerd Hoffman <kraxel@redhat.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> >
> > Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
> > ---
> > MdePkg/Include/Library/UefiLib.h | 2 ++
> > MdePkg/Library/UefiLib/UefiLib.inf | 1 +
> > MdePkg/Library/UefiLib/UefiNotTiano.c | 18 ++++++++++++++++++
> > 3 files changed, 21 insertions(+)
> >
> > diff --git a/MdePkg/Include/Library/UefiLib.h
> > b/MdePkg/Include/Library/UefiLib.h
> > index be7da7fdf7..2c3342351e 100644
> > --- a/MdePkg/Include/Library/UefiLib.h
> > +++ b/MdePkg/Include/Library/UefiLib.h
> > @@ -890,6 +890,8 @@ UnicodeStringDisplayLength (
> > /**
> > Create, Signal, and Close the Ready to Boot event using
> > EfiSignalEventReadyToBoot().
> >
> > + If successful, then create, signal and close the After Ready to Boot event.
> > +
> > This function abstracts the signaling of the Ready to Boot Event. The
> > Framework moved
> > from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> > the caller
> > from how this event is created to prevent to code form having to change
> > with the
> > diff --git a/MdePkg/Library/UefiLib/UefiLib.inf
> > b/MdePkg/Library/UefiLib/UefiLib.inf
> > index 01ed92092d..5c4064eafa 100644
> > --- a/MdePkg/Library/UefiLib/UefiLib.inf
> > +++ b/MdePkg/Library/UefiLib/UefiLib.inf
> > @@ -60,6 +60,7 @@
> > gEfiGlobalVariableGuid ##
> > SOMETIMES_CONSUMES ## Variable
> > gEfiAcpi20TableGuid ##
> > SOMETIMES_CONSUMES ## SystemTable
> > gEfiAcpi10TableGuid ##
> > SOMETIMES_CONSUMES ## SystemTable
> > + gEfiEventAfterReadyToBootGuid ##
> > SOMETIMES_CONSUMES ## Event
> >
> > [Protocols]
> > gEfiDriverBindingProtocolGuid ##
> > SOMETIMES_PRODUCES
> > diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c
> > b/MdePkg/Library/UefiLib/UefiNotTiano.c
> > index d84e91fd01..04fe42f9f7 100644
> > --- a/MdePkg/Library/UefiLib/UefiNotTiano.c
> > +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c
> > @@ -208,6 +208,8 @@ EfiCreateEventReadyToBootEx (
> > /**
> > Create, Signal, and Close the Ready to Boot event using
> > EfiSignalEventReadyToBoot().
> >
> > + If successful, then create, signal and close the After Ready to Boot event.
> > +
> > This function abstracts the signaling of the Ready to Boot Event. The
> > Framework moved
> > from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> > the caller
> > from how this event is created to prevent to code form having to change
> > with the
> > @@ -222,11 +224,27 @@ EfiSignalEventReadyToBoot (
> > {
> > EFI_STATUS Status;
> > EFI_EVENT ReadyToBootEvent;
> > + EFI_EVENT AfterReadyToBootEvent;
> >
> > Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent);
> > if (!EFI_ERROR (Status)) {
> > gBS->SignalEvent (ReadyToBootEvent);
> > gBS->CloseEvent (ReadyToBootEvent);
> > + return;
> > + }
> > +
> Return should not be here. This means ReadyToBoot event creates successfully and return.
> But, the behavior should be ReadyToBoot and AfterReadyToBoot event both trig.
>
Thanks Gao, given Michael's feedback about this patch not making much
sense in the series that adds before_exit_boot_services, we decided to
go ahead and consider v1 of this series as final. Let's let Robert
Phelps take it from here, since they appear to need it such that
they're in a better position to test their implementation.
> Thanks
> Liming
> > + /* Then immediately signal the after ready to boot event group */
> > + Status = gBS->CreateEventEx (
> > + EVT_NOTIFY_SIGNAL,
> > + TPL_CALLBACK,
> > + EfiEventEmptyFunction,
> > + NULL,
> > + &gEfiEventAfterReadyToBootGuid,
> > + AfterReadyToBootEvent
> > + );
> > + if (!EFI_ERROR(Status)) {
> > + gBS->SignalEvent (AfterReadyToBootEvent);
> > + gBS->CloseEvent (AfterReadyToBootEvent);
> > }
> > }
> >
> > --
> > 2.38.1.431.g37b22c650d-goog
> >
> >
> >
> >
> >
>
>
>
--
-Dionna Glaze, PhD (she/her)
prev parent reply other threads:[~2022-12-07 5:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 21:15 [PATCH v2 0/4] SEV-SNP accepted memory and BeforeExitBootServices Dionna Glaze
2022-11-08 21:15 ` [PATCH v2 1/4] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe Dionna Glaze
2022-11-08 21:15 ` [PATCH v2 2/4] MdePkg: Add event groups for boot events Dionna Glaze
2022-11-08 21:15 ` [PATCH v2 3/4] MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices Dionna Glaze
2022-11-08 21:15 ` [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot Dionna Glaze
2022-11-09 17:08 ` Michael D Kinney
2022-11-09 17:11 ` [edk2-devel] " Dionna Glaze
2022-11-09 17:31 ` Michael D Kinney
2022-11-09 17:42 ` Dionna Glaze
2022-12-07 1:26 ` 回复: " gaoliming
2022-12-07 5:27 ` Dionna Glaze [this message]
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=CAAH4kHaPPgq_m0GU9PvPevBfnHmGfaH48xHXCP5heBdB-bX+4Q@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