From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.1094.1581057724208117562 for ; Thu, 06 Feb 2020 22:42:04 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 22:42:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,412,1574150400"; d="scan'208";a="264889052" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 06 Feb 2020 22:42:02 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 22:42:02 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 7 Feb 2020 14:42:00 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Fri, 7 Feb 2020 14:42:00 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Fu, Siyuan" CC: "Wu, Hao A" Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service. Thread-Topic: [edk2-devel] [PATCH v2] MdeModulePkg/Capsule: Remove RT restriction in UpdateCapsule service. Thread-Index: AQHV3YFN2BJRCaL5uEeDchOWyTLI9KgPSF3w Date: Fri, 7 Feb 2020 06:42:00 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Siyuan, F= u > Sent: Friday, February 7, 2020 2:39 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Gao, Liming > Subject: [edk2-devel] [PATCH v2] MdeModulePkg/Capsule: Remove RT restric= tion in UpdateCapsule service. >=20 > V2: > Add feature PCD for this change. >=20 > Current UpdateCapsule service will reject all non-reset capsule images a= nd > 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. >=20 > This patch removes this restriction. The change is controled by a featur= e > PCD PcdSupportProcessCapsuleAtRuntime, and the default value is FALSE > which means not enable this feature. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2501 >=20 > Cc: Hao A Wu > Cc: Liming Gao > Signed-off-by: Siyuan Fu > --- > 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(-) >=20 > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.d= ec > 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= |BOOLEAN|0x0001003a >=20 > + ## Indicates if the platform can support process non-reset capsule im= age at runtime.

> + # TRUE - Supports process non-reset capsule image at runtime.
> + # FALSE - Does not support process non-reset capsule image at runti= me.
> + # @Prompt Enable process non-reset capsule image at runtime. > + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime|FALS= E|BOOLEAN|0x00010079 > + > [PcdsFeatureFlag.IA32, PcdsFeatureFlag.ARM, PcdsFeatureFlag.AARCH64] > gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALS= E|BOOLEAN|0x0001003a >=20 > diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.u= ni > 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 = library 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 = located below 4 GB if it has an option > ROM.
" > = "FALSE - PCI MMIO BARs of a device may be locat= ed above 4 GB even if it has an > option ROM.
" >=20 > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRu= ntime_PROMPT #language en-US "Enable process > non-reset capsule image at runtime." > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSupportProcessCapsuleAtRu= ntime_HELP #language en-US "Indicates if the > platform can support process non-reset capsule image at runtime.

= \n" > + = "TRUE - Supports process non-reset capsule ima= ge at runtime.
\n" > + = "FALSE - Does not support process non-reset cap= sule image at runtime.
" > + > + > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule= _PROMPT #language en-US "Status Code for Capsule > subclass definitions" >=20 > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdStatusCodeSubClassCapsule= _HELP #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 = signify > # 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 ## CONS= UMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset ##= CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdSupportProcessCapsuleAtRuntime ##= CONSUMES >=20 > [FeaturePcd.X64] > gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONS= UMES > diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c > b/MdeModulePkg/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 s= ignify > 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 (PcdSupportProcessCapsuleAt= Runtime)) { > Status =3D EFI_OUT_OF_RESOURCES; > } else { > Status =3D ProcessCapsuleImage(CapsuleHeader); > -- > 2.19.1.windows.1 >=20 >=20 >=20