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: hao.a.wu@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Tue, 18 Jun 2019 19:22:32 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 19:22:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,391,1557212400"; d="scan'208,217";a="162068736" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 18 Jun 2019 19:22:31 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 19:22:31 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 19:22:30 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.185]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.156]) with mapi id 14.03.0439.000; Wed, 19 Jun 2019 10:22:29 +0800 From: "Wu, Hao A" To: "Zhang, Chao B" , "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: AQHVG7VR6eMCkTO7n0u0bLNotaV1Q6aXpV1wgAoMr4CAAIgbIP//gLCAgACYFqA= Date: Wed, 19 Jun 2019 02:22:28 +0000 Message-ID: References: <20190605154203.11012-1-wei6.xu@intel.com> <20190605154203.11012-6-wei6.xu@intel.com> In-Reply-To: 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: multipart/alternative; boundary="_000_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F268DSHSMSX104ccrcor_" --_000_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F268DSHSMSX104ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Zhang, Chao B Sent: Wednesday, June 19, 2019 9:13 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: OK that is a good point. We will follow up to clean this. Tks Hello Chao, I am not sure if the update still applies to the UEFI spec with regard to the description for the QueryCapsuleCapabilities service of EFI_RUNTIME_SE= RVICES. IMO, I think it is fine, but it would be better to double confirm. Best Regards, Hao Wu 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_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F268DSHSMSX104ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

From: Zhang, Chao B
Sent: Wednesday, June 19, 2019 9:13 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: Introduce PCD to control this feature.

 

Hi Hao:<= /p>

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

 

 

Hello Chao,

 

I am not sure if the = update still applies to the UEFI spec with regard to

the description for t= he QueryCapsuleCapabilities service of EFI_RUNT= IME_SERVICES.

 

  IMO, I think it is fine, but it would be better to double confirm.<= o:p>

 

Best Regards,

Hao Wu

 

 

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/CapsuleRuntimeDxe: 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/CapsuleRuntimeDxe: Introduce PCD to control this feature.

 

Hi Hao:<= /p>

  I think blocking UpdateCapsule interface is enough for Capsul= e in RAM.  QueryCapsuleCapabilities can = still be used to test capsules before delivering 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 QueryCapsuleCapabilities()=

function within this driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' s= ervice for

EFI_RUNTIME_SERVICES to reflect the fact that even QueryCapsuleCapabilities()=

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

 

/**

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

 

  ...

 

**/

 =

Best Regards,=

Hao Wu=

 =

 

From: Wu, H= ao 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/CapsuleRuntimeDxe: Introduce PCD to control this feature.

 

> -----Original&n= bsp;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 = QueryCapsuleCapabilities() 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/CapsuleRunt= imeDxe/CapsuleService.c
> b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService= .c
> index aaf819c4c6..53a1af44e2&n= bsp;100644
> --- a/MdeModulePkg/Universal/<= span class=3D"SpellE">CapsuleRuntimeDxe/Capsu= leService.c

> +++ b/MdeModulePkg= /Universal/CapsuleRuntimeDxe/CapsuleService.c
> @@ -2,11 +2,11 @= @
>    Capsule Runt= ime Driver produces two UEFI capsule runtime&= nbsp;services.
>    (UpdateCapsuleQueryCapsuleCapabi= lities)
>    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 "CapsuleService.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 (!PcdGetBool(PcdCapsuleInRamSupp= ort)) {
> +    return=  EFI_UNSUPPORTED;
> +  }
> +
>    //
>    // Capsule&n= bsp;Count can't be less than one.
>    //
>    if (CapsuleCount < 1) {
>      retur= n EFI_INVALID_PARAMETER;
> --
> 2.16.2.windows.1


--_000_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F268DSHSMSX104ccrcor_--