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.88, mailfrom: hao.a.wu@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Tue, 18 Jun 2019 18:00:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 18:00:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,390,1557212400"; d="scan'208,217";a="358454345" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 18 Jun 2019 18:00:01 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) 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:00:01 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 18:00:01 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.185]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.76]) with mapi id 14.03.0439.000; Wed, 19 Jun 2019 08:59:59 +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: AQHVG7VR6eMCkTO7n0u0bLNotaV1Q6aXpV1wgAoMr4CAAIgbIA== Date: Wed, 19 Jun 2019 00:59:59 +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_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F2636SHSMSX104ccrcor_" --_000_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F2636SHSMSX104ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; 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_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F2636SHSMSX104ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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: 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 us= age update for the function.

 

But I think we need t= o update the comments for the QueryCapsuleCapabilities()=

function within this = driver and the 'EFI_QUERY_CAPSULE_CAPABILITIES' service 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, 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/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_B80AF82E9BFB8E4FBD8C89DA810C6A093C8F2636SHSMSX104ccrcor_--