Thanks for the new version patch series.

With minor comments (I provided to V1) handled, Reviewed-by: Star Zeng 
<star.z...@intel.com> to the patch series. :)

For patch 007: "@param[in]  ResetType     Base reset type as defined in UEFI 
spec." needs to be removed in ResetUtilityLib.h

For patch 009: It changed EFI_SOFTWARE_RUNTIME_SERVICE to 
EFI_SOFTWARE_PEI_SERVICE, but forgets to change 'runtime' to 'PEI' in comments 
and change EFI_SW_RS_PC_RESET_SYSTEM to EFI_SW_PS_PC_RESET_SYSTEM.


Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Friday, February 9, 2018 12:16 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH v2 00/10] Formalize the reset system core design

The patches add/update two core modules that perform the reset action
  ResetSystemPei and ResetSystemRuntimeDxe

With the two core modules, every time a reset action is performed in either PEI 
phase or DXE phase, the accordingly registerred reset 
filter/notification/handler will be triggered.

Reset filters are processed first so the final reset type and reset data can be 
determined.  Reset Notifications are processed second so all components that 
have registered for a Reset Notification can perform any required clean up 
actions. Reset handlers are processed third.  If there are no registered reset 
handlers or none of them resets the platform, then the default reset action 
based on the ResetSystemLib is performed.

The v2 changes against v2 are attached in the end of this mail. 

Bret Barkelew (1):
  MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

Michael D Kinney (6):
  MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()
  MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first
  MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c
  MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler
  MdeModulePkg: Add ResetSystemLib instances that call core services
  MdeModulePkg: Add ResetUtility librray class and BASE instance

Ruiyu Ni (3):
  MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message
  MdePkg/UefiRuntimeLib: Support more module types.
  MdeModulePkg: Add ResetSystemPei PEIM

 MdeModulePkg/Core/Pei/Reset/Reset.c                |  67 ++--
 MdeModulePkg/Include/Library/ResetUtilityLib.h     | 111 ++++++
 .../Include/Ppi/PlatformSpecificResetFilter.h      |  31 ++
 .../Include/Ppi/PlatformSpecificResetHandler.h     |  29 ++
 .../Ppi/PlatformSpecificResetNotification.h        |  32 ++
 .../Include/Protocol/PlatformSpecificResetFilter.h |  31 ++
 .../Protocol/PlatformSpecificResetHandler.h        |  29 ++
 .../Library/DxeResetSystemLib/DxeResetSystemLib.c  |  98 ++++++
 .../DxeResetSystemLib/DxeResetSystemLib.inf        |  39 +++
 .../DxeResetSystemLib/DxeResetSystemLib.uni        |  21 ++
 .../Library/PeiResetSystemLib/PeiResetSystemLib.c  |  98 ++++++
 .../PeiResetSystemLib/PeiResetSystemLib.inf        |  39 +++
 .../PeiResetSystemLib/PeiResetSystemLib.uni        |  21 ++
 .../Library/ResetUtilityLib/ResetUtility.c         | 220 ++++++++++++
 .../Library/ResetUtilityLib/ResetUtilityLib.inf    |  40 +++
 MdeModulePkg/MdeModulePkg.dec                      |  20 ++
 MdeModulePkg/MdeModulePkg.dsc                      |   7 +
 MdeModulePkg/MdeModulePkg.uni                      |   7 +-
 .../Universal/ResetSystemPei/ResetSystem.c         | 371 +++++++++++++++++++++
 .../Universal/ResetSystemPei/ResetSystem.h         | 130 ++++++++
 .../ResetSystemPei.inf}                            |  45 ++-
 .../Universal/ResetSystemPei/ResetSystemPei.uni    |  20 ++
 .../ResetSystemPei/ResetSystemPeiExtra.uni         |  20 ++
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  |  91 ++++-
 .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |   7 +
 .../ResetSystemRuntimeDxe.inf                      |   7 +-
 MdePkg/Include/Library/PeiServicesLib.h            |  24 ++
 MdePkg/Library/PeiServicesLib/PeiServicesLib.c     |  26 ++
 MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf   |   4 +-
 29 files changed, 1615 insertions(+), 70 deletions(-)  create mode 100644 
MdeModulePkg/Include/Library/ResetUtilityLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetFilter.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformSpecificResetHandler.h
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
 create mode 100644 MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.uni
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
 create mode 100644 MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
 create mode 100644 MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
 copy MdeModulePkg/Universal/{ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf 
=> ResetSystemPei/ResetSystemPei.inf} (50%)  create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.uni
 create mode 100644 
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPeiExtra.uni
diff --git a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h

index 0f1432f5f8..1f728387b7 100644
--- a/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetFilter.h
@@ -3,9 +3,9 @@
   for ResetSystem().  A reset filter evaluates the parameters passed to
   ResetSystem() and converts a ResetType of EfiResetPlatformSpecific to a
   non-platform specific reset type.  The registered filters are processed 
before
-  EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PPI handlers.
+  EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI handlers.
 
-  Copyright (c) 2017 Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018 Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials are licensed and made available 
under
   the terms and conditions of the BSD License that accompanies this 
distribution.
   The full text of the license may be found at diff --git 
a/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
index d5f1350c69..8d938abb02 100644
--- a/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetHandler.h
@@ -1,9 +1,9 @@
 /** @file
   This PPI provides services to register a platform specific handler for
   ResetSystem().  The registered handlers are processed after
-  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications.
+  EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PPI notifications.
 
-  Copyright (c) 2017 Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018 Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials are licensed and made available 
under
   the terms and conditions of the BSD License that accompanies this 
distribution.
   The full text of the license may be found at diff --git 
a/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h 
b/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
index ea53e24133..cf6d1f18a6 100644
--- a/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
+++ b/MdeModulePkg/Include/Ppi/PlatformSpecificResetNotification.h
@@ -1,9 +1,10 @@
 /** @file
   This PPI provides services to register a platform specific notification 
callback for
   ResetSystem().  The registered handlers are processed after
-  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications.
+  EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI notifications and before  
+ EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PPI notifications.
 
-  Copyright (c) 2017 Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018 Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2017 Microsoft Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials are licensed and made available 
under diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c 
b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
index 70ee1175d5..ea452e3231 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
@@ -1,7 +1,7 @@
 /** @file
   DXE Reset System Library instance that calls gRT->ResetSystem().
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+ reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at @@ -13,9 +13,7 @@  **/
 
 #include <PiDxe.h>
-
 #include <Library/ResetSystemLib.h>
-#include <Library/DebugLib.h>
 #include <Library/UefiRuntimeLib.h>
 
 /**
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf 
b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
index f2e04cfd00..6eb2766b93 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  DXE Reset System Library instance that calls gRT->ResetSystem().
 #
-#  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+reserved.<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made 
available under the terms and conditions of the BSD License @@ -35,6 +35,5 @@ 
[Packages]
   MdeModulePkg/MdeModulePkg.dec
 
 [LibraryClasses]
-  DebugLib
   UefiRuntimeLib
 
diff --git a/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c 
b/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
index b7e10110b0..30225d73a5 100644
--- a/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
+++ b/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.c
@@ -1,7 +1,7 @@
 /** @file
   PEI Reset System Library instance that calls the ResetSystem2() PEI Service.
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+ reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at @@ -13,9 +13,7 @@  **/
 
 #include <PiPei.h>
-
 #include <Library/ResetSystemLib.h>
-#include <Library/DebugLib.h>
 #include <Library/PeiServicesLib.h>
 
 /**
diff --git a/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf 
b/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
index e82ec6b2b6..b1b9388c63 100644
--- a/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
+++ b/MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  PEI Reset System Library instance that calls the ResetSystem2() PEI Service.
 #
-#  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+reserved.<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made 
available under the terms and conditions of the BSD License @@ -35,6 +35,5 @@ 
[Packages]
   MdeModulePkg/MdeModulePkg.dec
 
 [LibraryClasses]
-  DebugLib
   PeiServicesLib
 
diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c 
b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
index 5bbe002be0..90de94ca9b 100644
--- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
+++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c
@@ -37,7 +37,6 @@ typedef struct {
         are not initialized. For DXE, you can add gEfiResetArchProtocolGuid
         to your DEPEX.
 
-  @param[in]  ResetType     Base reset type as defined in UEFI spec.
   @param[in]  ResetSubtype  GUID pointer for the reset subtype to be used.
 
 **/
@@ -90,7 +89,7 @@ GetResetPlatformSpecificGuid (
   }
 
   //
-  // Determine the number of bytes in in the Null-terminated Unicode string
+  // Determine the number of bytes in the Null-terminated Unicode 
+ string
   // at the beginning of ResetData including the Null terminator.
   //
   ResetDataStringSize = StrnSizeS (ResetData, (DataSize / sizeof (CHAR16))); 
diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf 
b/MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
index 7a403749c5..2a4e53a8a6 100644
--- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
@@ -1,10 +1,7 @@
 ## @file
 # This file contains the Reset Utility functions.
 #
-#  The application pops up a menu showing all the boot options referenced by 
-#  BootOrder NV variable and user can choose to boot from one of them.
-#
-#  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+reserved.<BR>
 #  Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>  #  
This program and the accompanying materials  #  are licensed and made available 
under the terms and conditions of the BSD License diff --git 
a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 
297b02ffa9..0695ce607e 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -54,6 +54,9 @@ [LibraryClasses]
   ##  @libraryclass  Defines a set of methods to reset whole system.
   ResetSystemLib|Include/Library/ResetSystemLib.h
 
+  ##  @libraryclass  Defines a set of helper functions for resetting the 
system.
+  ResetUtilityLib|Include/Library/ResetUtilityLib.h
+
   ##  @libraryclass  Defines a set of methods related do S3 mode.
   #   This library class is no longer used and modules using this library 
should
   #   directly locate EFI_PEI_S3_RESUME_PPI defined in PI 1.2 specification.
@@ -1422,8 +1425,8 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
   # @Prompt CapsuleMax value in capsule report variable.
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0xFFFF|UINT16|0x00000107
 
-  ## Indicates the allowable maximum number of Reset Filters or Reset Handlers 
in PEI phase.
-  # @Prompt Maximum Number of PEI Reset Filters or Reset Handlers.
+  ## Indicates the allowable maximum number of Reset Filters, Reset 
Notifications or Reset Handlers in PEI phase.
+  # @Prompt Maximum Number of PEI Reset Filters, Reset Notifications or Reset 
Handlers.
   
gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies|0x10|UINT32|0x00000109
 
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] diff --git 
a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index 
0e068422e4..d8cc7416c5 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -4,7 +4,7 @@
 // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and library 
classes)  // and libraries instances, which are used for those modules.
 //
-// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2007 - 2018, Intel Corporation. All rights 
+reserved.<BR>
 //
 // This program and the accompanying materials are licensed and made available 
under  // the terms and conditions of the BSD License that accompanies this 
distribution.
@@ -1059,6 +1059,11 @@
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleMax_HELP  #language en-US 
"CapsuleMax value in capsule report variable."
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaximumPeiResetNotifies_PROMPT  
#language en-US "Maximum Number of PEI Reset Filters, Reset Notifications or 
Reset Handlers."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaximumPeiResetNotifies_HELP  
#language en-US "Indicates the allowable maximum number of Reset Filters, 
<BR>\n"
+                                                                               
             "Reset Notifications or Reset Handlers in PEI phase."
+
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdRecoveryFileName_PROMPT  
#language en-US "Recover file name in PEI phase"
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdRecoveryFileName_HELP  #language 
en-US "This is recover file name in PEI phase.\n"
diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
index 4dfe303f77..c2ee592d56 100644
--- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
+++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.c
@@ -80,13 +80,13 @@ EFI_PEI_PPI_DESCRIPTOR mPpiListReset[] = {
   Register a notification function to be called when ResetSystem() is called.
 
   The RegisterResetNotify() function registers a notification function that is 
called when
-  ResetSystem()is called and prior to completing the reset of the platform.
+  ResetSystem() is called and prior to completing the reset of the platform.
   The registered functions must not perform a platform reset themselves. These
   notifications are intended only for the notification of components which may 
need some
   special-purpose maintenance prior to the platform resetting.
   The list of registered reset notification functions are processed if 
ResetSystem()is called
   before ExitBootServices(). The list of registered reset notification 
functions is ignored if
-  ResetSystem()is called after ExitBootServices().
+  ResetSystem() is called after ExitBootServices().
 
   @param[in]  This              A pointer to the 
EFI_RESET_NOTIFICATION_PROTOCOL instance.
   @param[in]  ResetFunction     Points to the function to be called when a 
ResetSystem() is executed.
@@ -312,7 +312,7 @@ ResetSystem2 (
     //
     // Indicate reset system runtime service is called.
     //
-    REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | 
EFI_SW_RS_PC_RESET_SYSTEM));
+    REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_SERVICE | 
+ EFI_SW_RS_PC_RESET_SYSTEM));
   }
 
   //
diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h 
b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
index b623a4c381..8e9f872056 100644
--- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
+++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights 
+ reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License @@ -34,7 +34,7 @@
 
 
 //
-// The maximum recurstion depth to ResetSystem() by reset notification handlers
+// The maximum recursion depth to ResetSystem() by reset notification 
+handlers
 //
 #define MAX_RESET_NOTIFY_DEPTH 10
 
diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c 
b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
index 4b5af76999..2c795426f5 100644
--- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
+++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
@@ -294,7 +294,7 @@ ResetSystem (
       }
       //
       // call reset notification functions registered through the 
-      // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL.
+      // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.
       //
       for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies)
           ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)

--
2.16.1.windows.1

_______________________________________________
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

Reply via email to