From nobody Tue Apr 23 22:14:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54001+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54001+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581057544299333.0728404845519; Thu, 6 Feb 2020 22:39:04 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id DulRYY1788612xx4TVzlp4dR; Thu, 06 Feb 2020 22:39:03 -0800 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.1081.1581057543321130196 for ; Thu, 06 Feb 2020 22:39:03 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 22:39:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,412,1574150400"; d="scan'208";a="226388290" X-Received: from shwdeopenpsi787.ccr.corp.intel.com ([10.239.158.56]) by fmsmga008.fm.intel.com with ESMTP; 06 Feb 2020 22:39:02 -0800 From: "Siyuan, Fu" To: devel@edk2.groups.io Cc: Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service. Date: Fri, 7 Feb 2020 14:38:58 +0800 Message-Id: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,siyuan.fu@intel.com X-Gm-Message-State: aGZU8RLHI1fYunqBtpPf238Kx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581057543; bh=lGkMzznSE/vuCblPw/kZV2U42jdU/YsQG2fG1achGvs=; h=Cc:Date:From:Reply-To:Subject:To; b=P6ID3xbJhM+YbYANyvXf7mzuKmJ36akxCFalBp3ZwRxXBkAindqoFyMEmHru3RHlhd5 U15EypGdL1iV9X9I3MqSZC7Zk8GILZkOgIrIr8O+rrbHi4mNLYvXrbX/v2v6geuNhu592 CJpIVshm//b/xUzm6va1QCTlG8NsDCtP9YE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" V2: Add feature PCD for this change. 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=3D2501 Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Siyuan Fu Reviewed-by: Liming Gao --- MdeModulePkg/MdeModulePkg.dec | 8 +++++++- MdeModulePkg/MdeModulePkg.uni | 9 ++++++++- .../Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 5 +++-- .../Universal/CapsuleRuntimeDxe/CapsuleService.c | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index e840cebe2e..91a3c60823 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -4,7 +4,7 @@ # and libraries instances, which are used for those modules. # # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. -# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
# Copyright (c) 2016, Linaro Ltd. All rights reserved.
# (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
# Copyright (c) 2017, AMD Incorporated. All rights reserved.
@@ -870,6 +870,12 @@ # @Prompt Degrade 64-bit PCI MMIO BARs for legacy BIOS option ROMs gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|TRUE|BO= OLEAN|0x0001003a =20 + ## Indicates if the platform can support process non-reset capsule image= at runtime.

+ # TRUE - Supports process non-reset capsule image at runtime.
+ # FALSE - Does not support process non-reset capsule image at runtime.=
+ # @Prompt Enable process non-reset capsule image at runtime. + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime|FALSE|B= OOLEAN|0x00010079 + [PcdsFeatureFlag.IA32, PcdsFeatureFlag.ARM, PcdsFeatureFlag.AARCH64] gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALSE|B= OOLEAN|0x0001003a =20 diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index d9c7b1ac6c..cc18e53322 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -4,7 +4,7 @@ // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and lib= rary classes) // and libraries instances, which are used for those modules. // -// Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+// Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
// // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -1009,6 +1009,13 @@ = "TRUE - All PCI MMIO BARs of a device will be loc= ated below 4 GB if it has an option ROM.
" = "FALSE - PCI MMIO BARs of a device may be located = above 4 GB even if it has an option ROM.
" =20 +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRunti= me_PROMPT #language en-US "Enable process non-reset capsule image at runti= me." + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRunti= me_HELP #language en-US "Indicates if the platform can support process non= -reset capsule image at runtime.

\n" + = "TRUE - Supports process non-reset capsule image = at runtime.
\n" + = "FALSE - Does not support process non-reset capsul= e image at runtime.
" + + #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule_PR= OMPT #language en-US "Status Code for Capsule subclass definitions" =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule_HE= LP #language en-US "Status Code for Capsule subclass definitions.

\= n" diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf= b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf index 9da450722b..942eda235c 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf @@ -4,7 +4,7 @@ # It installs the Capsule Architectural Protocol defined in PI1.0a to sig= nify # the capsule runtime services are ready. # -# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -82,7 +82,8 @@ gEdkiiVariableLockProtocolGuid =20 [FeaturePcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset ## CO= NSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime ## CO= NSUMES =20 [FeaturePcd.X64] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONSUMES diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/Md= eModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 77b8f00062..2fba22dec2 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 sign= ify the capsule runtime services are ready. =20 -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -138,7 +138,7 @@ UpdateCapsule ( // Platform specific update for the non-reset capsule image. // if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) =3D=3D= 0) { - if (EfiAtRuntime ()) { + if (EfiAtRuntime () && !FeaturePcdGet (PcdSupportProcessCapsuleAtRun= time)) { Status =3D EFI_OUT_OF_RESOURCES; } else { Status =3D ProcessCapsuleImage(CapsuleHeader); --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54001): https://edk2.groups.io/g/devel/message/54001 Mute This Topic: https://groups.io/mt/71045750/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-