From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: hao.a.wu@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Wed, 12 Jun 2019 00:49:23 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 00:49:23 -0700 X-ExtLoop1: 1 Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 12 Jun 2019 00:49:22 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 00:49:22 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 12 Jun 2019 00:49:21 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.185]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.72]) with mapi id 14.03.0439.000; Wed, 12 Jun 2019 15:49:20 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Xu, Wei6" CC: "Wang, Jian J" , "Zhang, Chao B" Subject: Re: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature. Thread-Topic: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature. Thread-Index: AQHVG7VR6eMCkTO7n0u0bLNotaV1Q6aXpV1w Date: Wed, 12 Jun 2019 07:49:20 +0000 Message-ID: References: <20190605154203.11012-1-wei6.xu@intel.com> <20190605154203.11012-6-wei6.xu@intel.com> In-Reply-To: <20190605154203.11012-6-wei6.xu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Xu= , > Wei6 > Sent: Wednesday, June 05, 2019 11:42 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B; Xu, Wei6 > Subject: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: > Introduce PCD to control this feature. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1852 >=20 > Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature. > Platform could choose to drop CapsulePei/CapsuleX64 and not to support > Capsule In Ram. For this patch, it only affects UpdateCapsule(). Do we need to update the behavior for QueryCapsuleCapabilities() as well? Best Regards, Hao Wu >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Chao B Zhang > Signed-off-by: Wei6 Xu > --- > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1 > + > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 10 > +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git > a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > index 338577e293..9da450722b 100644 > --- > a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > +++ > b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > @@ -88,10 +88,11 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## > CONSUMES >=20 > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ## > SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ## > SOMETIMES_CONSUMES # Populate Image requires reset support. > + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ## > CONSUMES >=20 > [Pcd.X64] > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize > ## SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## > SOMETIMES_CONSUMES >=20 > diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c > b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c > index aaf819c4c6..53a1af44e2 100644 > --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c > +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c > @@ -2,11 +2,11 @@ > Capsule Runtime Driver produces two UEFI capsule runtime services. > (UpdateCapsule, QueryCapsuleCapabilities) > It installs the Capsule Architectural Protocol defined in PI1.0a to s= ignify > the capsule runtime services are ready. >=20 > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ >=20 > #include "CapsuleService.h" > @@ -69,10 +69,18 @@ UpdateCapsule ( > BOOLEAN NeedReset; > BOOLEAN InitiateReset; > CHAR16 CapsuleVarName[30]; > CHAR16 *TempVarName; >=20 > + // > + // Check if platform support Capsule In RAM or not. > + // Platform could choose to drop CapsulePei/CapsuleX64 and do not > support Capsule In RAM. > + // > + if (!PcdGetBool(PcdCapsuleInRamSupport)) { > + return EFI_UNSUPPORTED; > + } > + > // > // Capsule Count can't be less than one. > // > if (CapsuleCount < 1) { > return EFI_INVALID_PARAMETER; > -- > 2.16.2.windows.1 >=20 >=20 >=20