[edk2-devel] [Patch] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service.

Siyuan, Fu posted 1 patch 4 years, 2 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
[edk2-devel] [Patch] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service.
Posted by Siyuan, Fu 4 years, 2 months ago
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.

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>
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
---
 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index 77b8f00062..99a52f053d 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify
   the capsule runtime services are ready.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -138,11 +138,7 @@ UpdateCapsule (
     // Platform specific update for the non-reset capsule image.
     //
     if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) == 0) {
-      if (EfiAtRuntime ()) {
-        Status = EFI_OUT_OF_RESOURCES;
-      } else {
-        Status = ProcessCapsuleImage(CapsuleHeader);
-      }
+      Status = ProcessCapsuleImage(CapsuleHeader);
       if (EFI_ERROR(Status)) {
         return Status;
       }
-- 
2.19.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53691): https://edk2.groups.io/g/devel/message/53691
Mute This Topic: https://groups.io/mt/70964254/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service.
Posted by Liming Gao 4 years, 2 months ago
Siyuan:
  I suggest to introduce new FeaturePcd to control this behavior. And, PCD default value is FALSE to keep current behavior without change.

Thanks
Liming
> -----Original Message-----
> From: Fu, Siyuan <siyuan.fu@intel.com>
> Sent: Tuesday, February 4, 2020 10:37 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [Patch] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service.
> 
> 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.
> 
> 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>
> Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
> ---
>  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> index 77b8f00062..99a52f053d 100644
> --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -4,7 +4,7 @@
>    It installs the Capsule Architectural Protocol defined in PI1.0a to signify
>    the capsule runtime services are ready.
> 
> -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -138,11 +138,7 @@ UpdateCapsule (
>      // Platform specific update for the non-reset capsule image.
>      //
>      if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) == 0) {
> -      if (EfiAtRuntime ()) {
> -        Status = EFI_OUT_OF_RESOURCES;
> -      } else {
> -        Status = ProcessCapsuleImage(CapsuleHeader);
> -      }
> +      Status = ProcessCapsuleImage(CapsuleHeader);
>        if (EFI_ERROR(Status)) {
>          return Status;
>        }
> --
> 2.19.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53987): https://edk2.groups.io/g/devel/message/53987
Mute This Topic: https://groups.io/mt/70964254/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-