]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service.
authorSiyuan Fu <siyuan.fu@intel.com>
Fri, 7 Feb 2020 06:35:01 +0000 (14:35 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 7 Feb 2020 07:43:00 +0000 (07:43 +0000)
Current UpdateCapsule service will reject all non-reset capsule images and
return EFI_OUT_OF_RESOURCE if the system is at runtime. This will block a
platform CapsuleLib from implementing ProcessCapsuleImage() with runtime
capsule processing capability.

This patch removes this restriction. The change is controled by a feature
PCD PcdSupportProcessCapsuleAtRuntime, and the default value is FALSE
which means not enable this feature.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2501

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c

index e840cebe2eae33cb8c8f03dfb713288e11fa3a88..91a3c608231cb62e4a5b0155e70be5eec6134165 100644 (file)
@@ -4,7 +4,7 @@
 # and libraries instances, which are used for those modules.\r
 #\r
 # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\r
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>\r
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
 # (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP<BR>\r
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
   # @Prompt Degrade 64-bit PCI MMIO BARs for legacy BIOS option ROMs\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|TRUE|BOOLEAN|0x0001003a\r
 \r
+  ## Indicates if the platform can support process non-reset capsule image at runtime.<BR><BR>\r
+  #   TRUE  - Supports process non-reset capsule image at runtime.<BR>\r
+  #   FALSE - Does not support process non-reset capsule image at runtime.<BR>\r
+  # @Prompt Enable process non-reset capsule image at runtime.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime|FALSE|BOOLEAN|0x00010079\r
+\r
 [PcdsFeatureFlag.IA32, PcdsFeatureFlag.ARM, PcdsFeatureFlag.AARCH64]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALSE|BOOLEAN|0x0001003a\r
 \r
index d9c7b1ac6cf0957ae869024714c81a4eb00bdd97..cc18e533228a4b52eabd76397b2ba6b599f3f65a 100644 (file)
@@ -4,7 +4,7 @@
 // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and library classes)\r
 // and libraries instances, which are used for those modules.\r
 //\r
-// Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>\r
 //\r
 // SPDX-License-Identifier: BSD-2-Clause-Patent\r
 //\r
                                                                                                    "TRUE  - All PCI MMIO BARs of a device will be located below 4 GB if it has an option ROM.<BR>"\r
                                                                                                    "FALSE - PCI MMIO BARs of a device may be located above 4 GB even if it has an option ROM.<BR>"\r
 \r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRuntime_PROMPT  #language en-US "Enable process non-reset capsule image at runtime."\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRuntime_HELP  #language en-US "Indicates if the platform can support process non-reset capsule image at runtime.<BR><BR>\n"\r
+                                                                                                   "TRUE  - Supports process non-reset capsule image at runtime.<BR>\n"\r
+                                                                                                   "FALSE - Does not support process non-reset capsule image at runtime.<BR>"\r
+\r
+\r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule_PROMPT  #language en-US "Status Code for Capsule subclass definitions"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule_HELP  #language en-US "Status Code for Capsule subclass definitions.<BR><BR>\n"\r
index 9da450722b51be96bdf6563e60cb610f2c3a603e..942eda235cf0ab33e4b5821d4e502a535123dbb3 100644 (file)
@@ -4,7 +4,7 @@
 #  It installs the Capsule Architectural Protocol defined in PI1.0a to signify\r
 #  the capsule runtime services are ready.\r
 #\r
-#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 ##\r
@@ -82,7 +82,8 @@
   gEdkiiVariableLockProtocolGuid\r
 \r
 [FeaturePcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset   ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset        ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime   ## CONSUMES\r
 \r
 [FeaturePcd.X64]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES\r
index 77b8f00062a65c833b1724ccc59ac86bd2517773..2fba22dec209f2d93cefbb5dcc34189332031aca 100644 (file)
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify\r
   the capsule runtime services are ready.\r
 \r
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -138,7 +138,7 @@ UpdateCapsule (
     // Platform specific update for the non-reset capsule image.\r
     //\r
     if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) == 0) {\r
-      if (EfiAtRuntime ()) {\r
+      if (EfiAtRuntime () && !FeaturePcdGet (PcdSupportProcessCapsuleAtRuntime)) {\r
         Status = EFI_OUT_OF_RESOURCES;\r
       } else {\r
         Status = ProcessCapsuleImage(CapsuleHeader);\r