From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: chao.b.zhang@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Tue, 18 Jun 2019 17:41:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 17:41:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,390,1557212400"; d="scan'208,217";a="311199190" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 18 Jun 2019 17:41:56 -0700 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 17:41:56 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 17:41:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.33]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.156]) with mapi id 14.03.0439.000; Wed, 19 Jun 2019 08:41:54 +0800 From: "Zhang, Chao B" To: "Wu, Hao A" , "devel@edk2.groups.io" , "Xu, Wei6" CC: "Wang, Jian J" 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: AQHVG7VRmUBaCSiNJES3hDei5W33i6aXKSgAgAsOeUA= Date: Wed, 19 Jun 2019 00:41:53 +0000 Message-ID: References: <20190605154203.11012-1-wei6.xu@intel.com> <20190605154203.11012-6-wei6.xu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmNlZWQzNDYtYmI4ZS00MTBiLWJkMGEtYmUxYWUzZjViZTUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoid0VDU2ZRYUtmTkp3ZU9wSVA1MVh3SjhtMVhkdklzdEVsem42STZZNGRrU0ZOS1RRTExcL29GSUNZR3BwQWgrNEYifQ== dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: chao.b.zhang@intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC48Bshsmsx102ccrcor_" --_000_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC48Bshsmsx102ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Hao: I think blocking UpdateCapsule interface is enough for Capsule in RAM. = QueryCapsuleCapabilities can still be used to test capsules before deliveri= ng by different sources. From: Wu, Hao A Sent: Wednesday, June 12, 2019 3:49 PM To: devel@edk2.groups.io; Xu, Wei6 Cc: Wang, Jian J ; Zhang, Chao B Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: In= troduce PCD to control this feature. > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@ed= k2.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. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1852 > > 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 > > 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(-) > > 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 > > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ## > SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ## > SOMETIMES_CONSUMES # Populate Image requires reset support. > + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ## > CONSUMES > > [Pcd.X64] > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize > ## SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## > SOMETIMES_CONSUMES > > 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. > > -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 > > **/ > > #include "CapsuleService.h" > @@ -69,10 +69,18 @@ UpdateCapsule ( > BOOLEAN NeedReset; > BOOLEAN InitiateReset; > CHAR16 CapsuleVarName[30]; > CHAR16 *TempVarName; > > + // > + // 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 --_000_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC48Bshsmsx102ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Hao:

  I think blocking UpdateCapsule = interface is enough for Capsule in RAM.  QueryCaps= uleCapabilities can still be used to test capsules before delivering by different sources= .

 = ;

From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Zhang, Chao B <c= hao.b.zhang@intel.com>
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntime= Dxe: Introduce PCD to control this feature.

 

> -----Original Message-= ----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of&nb= sp;Xu,
> Wei6
> Sent: Wednesday, June&nbs= p;05, 2019 11:42 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J;&nb= sp;Wu, Hao A; Zhang, Chao B; Xu, Wei6
> Subject: [edk2-devel][Patch&nb= sp;v2 5/7] MdeModulePkg/CapsuleRuntimeDxe:
> Introduce PCD to con= trol this feature.

> BZ: https://bugzilla.tianocore.org/show= _bug.cgi?id=3D1852

> Introduce PcdCapsuleInRamSuppo= rt to turn on/off Capsule In Ram feature= .
> Platform could choose&nbs= p;to drop CapsulePei/CapsuleX64 and not to su= pport
> Capsule In Ram.

For this patch, it only&nb= sp;affects UpdateCapsule(). Do we need to upd= ate the
behavior for QueryCapsuleCapabilitie= s() as well?

Best Regards,
Hao Wu



> Cc: Jian J Wang = ;<jian.j.wang@intel.com>=
> Cc: Hao A Wu &l= t;hao.a.wu@intel.com> > Cc: Chao B Zhang&nbs= p;<chao.b.zhang@intel.com&= gt;
> Signed-off-by: Wei6 Xu&nb= sp;<wei6.xu@intel.com>
> ---
>  MdeModulePkg/Universal/Capsul= eRuntimeDxe/CapsuleRuntimeDxe.inf |  1
> +
>  MdeModulePkg/Universal/Capsul= eRuntimeDxe/CapsuleService.c      | 10
> +++++++= ++-
>  2 files changed,&nb= sp;10 insertions(+), 1 deletion(-)

> diff --git
> a/MdeModulePkg/Universal/CapsuleRun= timeDxe/CapsuleRuntimeDxe.inf
> b/MdeModulePkg/Universal/CapsuleRun= timeDxe/CapsuleRuntimeDxe.inf
> index 338577e293..9da450722b&n= bsp;100644
> ---
> a/MdeModulePkg/Universal/CapsuleRun= timeDxe/CapsuleRuntimeDxe.inf
> +++
> b/MdeModulePkg/Universal/CapsuleRun= timeDxe/CapsuleRuntimeDxe.inf
> @@ -88,10 +88,11 = ;@@
>    gEfiMdeModulePkgT= okenSpaceGuid.PcdDxeIplSwitchToLongMode      = ##
> CONSUMES

>  [Pcd]
>    gEfiMdeModulePkgT= okenSpaceGuid.PcdMaxSizeNonPopulateCapsule   ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgT= okenSpaceGuid.PcdMaxSizePopulateCapsule      = ##
> SOMETIMES_CONSUMES # Popu= late Image requires reset support.
> +  gEfiMdeModulePkgTo= kenSpaceGuid.PcdCapsuleInRamSupport      &nbs= p;  ##
> CONSUMES

>  [Pcd.X64]
>    gEfiMdeModulePkgT= okenSpaceGuid.PcdCapsulePeiLongModeStackSize
> ## SOMETIMES_CONSUMES >    gEfiMdeModulePkgT= okenSpaceGuid.PcdUse1GPageTable       &n= bsp;        ##
> SOMETIMES_CONSUMES

> diff --git a/MdeModulePkg= /Universal/CapsuleRuntimeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRun= timeDxe/CapsuleService.c
> index aaf819c4c6..53a1af44e2&n= bsp;100644
> --- a/MdeModulePkg/Universal/C= apsuleRuntimeDxe/CapsuleService.c
> +++ b/MdeModulePkg= /Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @= @
>    Capsule Runt= ime Driver produces two UEFI capsule runtime&= nbsp;services.
>    (UpdateCapsule,&n= bsp;QueryCapsuleCapabilities)
>    It installs&= nbsp;the Capsule Architectural Protocol defined in=  PI1.0a to signify
>    the capsule&= nbsp;runtime services are ready.

> -Copyright (c) 2006 = - 2018, Intel Corporation. All rights reserve= d.<BR>
> +Copyright (c) 2006&n= bsp;- 2019, Intel Corporation. All rights res= erved.<BR>
>  SPDX-License-Identifier: = ;BSD-2-Clause-Patent

>  **/

>  #include "CapsuleSe= rvice.h"
> @@ -69,10 +69,18 = ;@@ UpdateCapsule (
>    BOOLEAN &nbs= p;            &= nbsp;    NeedReset;
>    BOOLEAN &nbs= p;            &= nbsp;    InitiateReset;
>    CHAR16  = ;            &n= bsp;     CapsuleVarName[30];
>    CHAR16  = ;            &n= bsp;     *TempVarName;

> +  //
> +  // Check = ;if platform support Capsule In RAM or n= ot.
> +  // Platform&n= bsp;could choose to drop CapsulePei/CapsuleX64 and=  do not
> support Capsule In R= AM.
> +  //
> +  if (!PcdGetBo= ol(PcdCapsuleInRamSupport)) {
> +    return=  EFI_UNSUPPORTED;
> +  }
> +
>    //
>    // Capsule&n= bsp;Count can't be less than one.
>    //
>    if (CapsuleC= ount < 1) {
>      retur= n EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1


--_000_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC48Bshsmsx102ccrcor_--