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.100, mailfrom: chao.b.zhang@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Tue, 18 Jun 2019 18:13:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 18:13:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,391,1557212400"; d="scan'208,217";a="170413009" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 18 Jun 2019 18:13:24 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 18:13:23 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 18:13:23 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.33]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.173]) with mapi id 14.03.0439.000; Wed, 19 Jun 2019 09:13:22 +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: AQHVG7VRmUBaCSiNJES3hDei5W33i6aXKSgAgAsOeUD//396gIAAiYMQ Date: Wed, 19 Jun 2019 01:13:21 +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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTVjN2Q1MmEtMDRkOC00YTZiLTg5NmMtZTYwMjgzM2E5MTMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS0IyQ3hYcVROSmFtcktVbVRVeTdYbkhSZEp5cmkyUktXdWdBVk5FVXU3OVE3Nmt3NDhVSVdLT29kM1dTeWVFKyJ9 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_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC4E0shsmsx102ccrcor_" --_000_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC4E0shsmsx102ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Hao: OK that is a good point. We will follow up to clean this. Tks From: Wu, Hao A Sent: Wednesday, June 19, 2019 9:00 AM To: Zhang, Chao B ; devel@edk2.groups.io; Xu, Wei6= Cc: Wang, Jian J Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: In= troduce PCD to control this feature. From: Zhang, Chao B Sent: Wednesday, June 19, 2019 8:42 AM To: Wu, Hao A; devel@edk2.groups.io; Xu, Wei6 Cc: Wang, Jian J Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntimeDxe: In= troduce PCD to control this feature. 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. Hello Chao, I am okay with the usage update for the function. But I think we need to update the comments for the QueryCapsuleCapabilitie= s() function within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' servi= ce for EFI_RUNTIME_SERVICES to reflect the fact that even QueryCapsuleCapabilitie= s() returns without error, the capsule may still be unsupported by UpdateCapsu= le(): /** Returns if the capsule can be supported via UpdateCapsule(). ... **/ Best Regards, Hao Wu From: Wu, Hao A Sent: Wednesday, June 12, 2019 3:49 PM To: devel@edk2.groups.io; Xu, Wei6 > Cc: Wang, Jian J >; Zh= ang, 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_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC4E0shsmsx102ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Hao:

   OK that is a good point. = We will follow up to clean this. Tks

 = ;

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

 

From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 8:42 AM
To: Wu, Hao A; devel@edk2.g= roups.io; Xu, Wei6
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch v2 5/7] MdeModulePkg/CapsuleRuntime= Dxe: Introduce PCD to control this feature.

 

Hi Hao:

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

 

Hello Chao,

 

I am ok= ay with the usage update for the function.

&n= bsp;

But I t= hink we need to update the comments for the QueryCapsuleCapabilities()=

functio= n within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' service for

EFI_RUN= TIME_SERVICES to reflect the fact that even QueryCapsuleCapabilities()=

returns= without error, the capsule may still be unsupported by UpdateCapsule():

&n= bsp;

/**

  = Returns if the capsule can be supported via UpdateCapsule().

&n= bsp;

  = ...

&n= bsp;

**/

 

Best Regards,

Hao Wu

 

 

From: Wu, Hao A
Sent: Wednesday, June 12, 2019 3:49 PM
To: devel@edk2.groups.io; Xu, Wei6 <wei6.xu@intel.com&= gt;
Cc: Wang, Jian J <jian.= j.wang@intel.com>; Zhang, Chao B <chao.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_FF72C7E4248F3C4E9BDF19D4918E90F24DEDC4E0shsmsx102ccrcor_--