From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3AC72223972C6 for ; Wed, 7 Feb 2018 03:39:19 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 03:45:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="28101901" Received: from shzintpr01.sh.intel.com (HELO [10.253.24.48]) ([10.239.4.80]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 03:45:01 -0800 To: Ruiyu Ni , edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao , star.zeng@intel.com References: <20180202064530.407028-1-ruiyu.ni@intel.com> <20180202064530.407028-5-ruiyu.ni@intel.com> From: "Zeng, Star" Message-ID: Date: Wed, 7 Feb 2018 19:44:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180202064530.407028-5-ruiyu.ni@intel.com> Subject: Re: [PATCH 04/10] MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler 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, 07 Feb 2018 11:39:20 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Some minor comments added below except Laszlo's. With them handled, Reviewed-by: Star Zeng On 2018/2/2 14:45, Ruiyu Ni wrote: > From: Michael D Kinney > > Add support for platform specific reset filters and platform > specific reset handlers to ResetSystem(). A filter may modify > the reset type and reset data and call ResetSystem() with the > modified parameters. A handler performs the reset action. > > The support for platform specific filters and platform specific > handlers is based on the Reset Notification feature added to the > UEFI 2.7 Specification. > > Platform specific reset filters are processed first so the final > reset type and reset data can be determined. In the DXE Phase > The UEFI Reset Notifications are processed second so all UEFI > Drivers that have registered for a Reset Notification can perform > any required clean up actions. The platform specific reset > handlers are processed third. If there are no registered > platform specific reset handlers or none of them reset the > platform, then the default reset action based on the > ResetSystemLib is performed. > > In the PEI Phase, filters are handlers are registered through Should be "filters and handlers"? > the folloiwng 2 PPIs that are based on > EFI_RESET_NOTIFICATION_PROTOCOL. > * gEdkiiPlatformSpecificResetFilterPpiGuid > * gEdkiiPlatformSpecificResetFilterPpiGuid > > In the DXE Phase, filters are handlers are registered through Should be "filters and handlers"? > the folloiwng 2 Protocols that are based on > EFI_RESET_NOTIFICATION_PROTOCOL. > * gEdkiiPlatformSpecificResetFilterProtocolGuid > * gEdkiiPlatformSpecificResetFilterProtocolGuid > > Cc: Liming Gao > Reviewed-by: Ruiyu Ni > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Michael D Kinney > --- [...] > + // > + // call reset notification functions registered through the > + // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL. Should be EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL? Thanks, Star > + // > + for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies) > + ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link) > + ; Link = GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link) > + ) { > + Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link); > + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); > + } > } > > switch (ResetType) { > diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h > index 75cdd88896..ea5660274b 100644 > --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h > +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h > @@ -20,6 +20,8 @@ > > #include > #include > +#include > +#include > #include > > #include > @@ -34,6 +36,11 @@ > #include > #include > > +// > +// The maximum recurstion depth to ResetSystem() by reset notification handlers > +// > +#define MAX_RESET_NOTIFY_DEPTH 10 > + > typedef struct { > UINT32 Signature; > LIST_ENTRY Link; > diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > index 11233757c2..da9e8e118b 100644 > --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > @@ -55,9 +55,10 @@ [Guids] > > > [Protocols] > - gEfiResetArchProtocolGuid ## PRODUCES > - gEfiResetNotificationProtocolGuid ## PRODUCES > - > + gEfiResetArchProtocolGuid ## PRODUCES > + gEfiResetNotificationProtocolGuid ## PRODUCES > + gEdkiiPlatformSpecificResetFilterProtocolGuid ## PRODUCES > + gEdkiiPlatformSpecificResetHandlerProtocolGuid ## PRODUCES > > [Depex] > TRUE >