From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mx.groups.io with SMTP id smtpd.web10.8339.1670390885124421758 for ; Tue, 06 Dec 2022 21:28:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=qG81kHoy; spf=pass (domain: google.com, ip: 209.85.210.54, mailfrom: dionnaglaze@google.com) Received: by mail-ot1-f54.google.com with SMTP id p10-20020a9d76ca000000b0066d6c6bce58so10647392otl.7 for ; Tue, 06 Dec 2022 21:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=narntJwWlozmEjMHAAgRBFfnET3Txit1hqNyFsnVRVo=; b=qG81kHoyoFoO4dBK5AqNkaTRqYNrS1f8iQT+yOiaywF4TQEWacGxq2bfvBHUfJebkE Kx7BlpDU6n5DOCdMQyigVa1B+UuCadEE+2+3MEX6ONgvTNbJL1g2tu3sM37Z0UUT/lNF jHUYZPTrBH36bXrKRzH5Y6SV2nK0NR8XqQMIHw5x10AZgTFvsg8HOou1gzhhBnK9vpLf 8DCHDSRhgNROVwBkDgefFjwno3+tavd5JoHGUi0tyHcVxDXU3G7zuAEtZmFwa97o5cmZ BwjO2FjuwgOpZ78LMIk7F5yZ7sGAOxh7IQQ/yGatO7QosjOVmFL/MxVmitGtiuEA85Ml Od6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=narntJwWlozmEjMHAAgRBFfnET3Txit1hqNyFsnVRVo=; b=iFQXs19DVhrSmsGKvLI7vA5gCiRPid8B4pmxRDIx9lTl+pJ5LMxUkUOfCG6eTkbkmi 2dds5ctQyIBNRB9cBiAE2k6zWbaWXIXOhRUsV+Ig/8wx2eVXQMmO956dNTBumvcWjUfB WqmU9ZYTSTzeYRK5r9snVjEVRjXjoRnL15ILGV2An9OBwv2DkDXhyP0AkQGpLDb5PqKs IAQ9ECdiFLnTfIFfY5MKa5MqFg8qIBNKu5sLuvLL+Znd6vF6IhsrPlECn/E7eCm8YZ24 TLm6shaDJ20ML4FXAedjyBFidyGNuOcOZP5fKdzMMjhOj6bwEATgbL3nNLWY1DP0QAJy h0mA== X-Gm-Message-State: ANoB5plEHWh4i820jko9589+OrVg1dwP5ocZ2YYurUQ+5BCiQujLQ5tT zL/wz4YjZ6LocEmB/vOzPJlrgOHSTZZIgWcOkIyH9g== X-Google-Smtp-Source: AA0mqf79wbVeVnrwguzyxlkwO+o96bSc5lEM5EF0xM6uMo3+JvLn3OSm6C74y9k5BpSDBfaKIxl8oAYZyIzu7iVxXBc= X-Received: by 2002:a9d:6e19:0:b0:66c:a613:9804 with SMTP id e25-20020a9d6e19000000b0066ca6139804mr44011690otr.65.1670390884237; Tue, 06 Dec 2022 21:28:04 -0800 (PST) MIME-Version: 1.0 References: <20221108211557.3306520-1-dionnaglaze@google.com> <20221108211557.3306520-5-dionnaglaze@google.com> <039e01d909da$f4f29780$ded7c680$@byosoft.com.cn> In-Reply-To: <039e01d909da$f4f29780$ded7c680$@byosoft.com.cn> From: "Dionna Glaze" Date: Tue, 6 Dec 2022 21:27:53 -0800 Message-ID: Subject: Re: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot To: gaoliming Cc: devel@edk2.groups.io, Michael D Kinney , Ard Biesheuvel , Gerd Hoffman , Jiewen Yao , Robert Phelps Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 6, 2022 at 5:26 PM gaoliming wrote: > > Dionna: > I add my comments below. > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Dionna Glaze > > via groups.io > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B411=E6=9C=889=E6=97= =A5 5:16 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > =E6=8A=84=E9=80=81: Dionna Glaze ; Michael D Ki= nney > > ; Ard Biesheuvel ; Gerd > > Hoffman ; Jiewen Yao > > =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterRea= dyToBoot 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" > > Cc: Ard Biesheuvel > > Cc: Gerd Hoffman > > Cc: Jiewen Yao > > > > Signed-off-by: Dionna Glaze > > --- > > 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. Th= e > > Framework moved > > from a proprietary to UEFI 2.0 based mechanism. This library abstrac= ts > > the caller > > from how this event is created to prevent to code form having to cha= nge > > 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. Th= e > > Framework moved > > from a proprietary to UEFI 2.0 based mechanism. This library abstrac= ts > > the caller > > from how this event is created to prevent to code form having to cha= nge > > with the > > @@ -222,11 +224,27 @@ EfiSignalEventReadyToBoot ( > > { > > EFI_STATUS Status; > > EFI_EVENT ReadyToBootEvent; > > + EFI_EVENT AfterReadyToBootEvent; > > > > Status =3D EfiCreateEventReadyToBoot (&ReadyToBootEvent); > > if (!EFI_ERROR (Status)) { > > gBS->SignalEvent (ReadyToBootEvent); > > gBS->CloseEvent (ReadyToBootEvent); > > + return; > > + } > > + > Return should not be here. This means ReadyToBoot event creates successfu= lly and return. > But, the behavior should be ReadyToBoot and AfterReadyToBoot event both t= rig. > 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 =3D 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 > > > > > > > >=20 > > > > > --=20 -Dionna Glaze, PhD (she/her)