From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by mx.groups.io with SMTP id smtpd.web12.4765.1575309074312016387 for ; Mon, 02 Dec 2019 09:51:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NRHNFQ/K; spf=pass (domain: nvidia.com, ip: 203.18.50.4, mailfrom: jbrasen@nvidia.com) Received: from hkpgpgate102.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 03 Dec 2019 01:51:11 +0800 Received: from HKMAIL102.nvidia.com ([10.18.16.11]) by hkpgpgate102.nvidia.com (PGP Universal service); Mon, 02 Dec 2019 09:51:11 -0800 X-PGP-Universal: processed; by hkpgpgate102.nvidia.com on Mon, 02 Dec 2019 09:51:11 -0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 2 Dec 2019 17:51:11 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.55) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 2 Dec 2019 17:51:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QLd9og5zz7vo41+ltrNeNBcNH8whlADlE0JKRiK2QzsRPg5k4IISHFaTHCsahqrBUNOa0+INqfJNTjVDF3s+DPk7S3hDZY2u5FHb6sS4JvutFVkC7wbUBIG2nbBq0qE/kWg0xOqA7P3t0c1kHxJVRK/tCTE4xJzTU54Lv49Oo+ExY6fwSxspr8kj7K6MeIzyv0adiosdwEv6+YbUA3qWaPahKmbu6ukIXuqDT/tTqtjAvAPNARF4HIB1q0kyuBla6+at7neE+qZ8r1G+HATPnuLMXB9U++E2/dEjuXSiwViZ1fQ9N/LIz+fAwTJfaePXvuwX8c5Vn99MhjMZ/vzcBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KFR/66KDjzROb77gjOYTnVC8tcKS0hKOtOREnY5qgJA=; b=f9kENuJ7NF0l/q6bbHp+NhfVcSxLjwLBPP4Y2csvhQGInz1QGne2pwDm06WyH4VNkyWSRhmQsDR3ljwkwiX3QXq8SFrpQYNSlYUBknq925+0gVr6vbfb2kYTzL8hTmcwVK4tuKREI4C/DmJ9h6bZ9GNygJLKPGeaUeo5Xc9yh7wI+NiVTyUApk30aVDcIRVf+EusST/g7N0Ne2MXv7wq3kcei8n9jpp5ia7uwbvkH1nR7XJPWFSLFv9AobjSe+gY6QB5/RxpA1Y+vrFySJjiUhBRU27QjHatH+0Vi5ATXio1QalCPHAuft/rdsEZsNNAXEy2I8FeSzQjS2PXSy0mvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from BYAPR12MB3462.namprd12.prod.outlook.com (20.178.196.208) by BYAPR12MB3510.namprd12.prod.outlook.com (20.179.94.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Mon, 2 Dec 2019 17:51:08 +0000 Received: from BYAPR12MB3462.namprd12.prod.outlook.com ([fe80::9db4:6485:70b:7134]) by BYAPR12MB3462.namprd12.prod.outlook.com ([fe80::9db4:6485:70b:7134%5]) with mapi id 15.20.2495.014; Mon, 2 Dec 2019 17:51:08 +0000 From: "Jeff Brasen" To: "Gao, Zhichao" , "Ni, Ray" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Wu, Hao A" , "Kinney, Michael D" Subject: Re: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Topic: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Index: AQHVpXoHrYY7nvWUdkWKH185nsdfKaegBxGAgAAHeoCABxhdyA== Date: Mon, 2 Dec 2019 17:51:08 +0000 Message-ID: References: <21cbc55c9d35ac799e4978a5dbdf4de3e650dace.1574896889.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C371494@SHSMSX104.ccr.corp.intel.com>,<3CE959C139B4C44DBEA1810E3AA6F9000B87BADE@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <3CE959C139B4C44DBEA1810E3AA6F9000B87BADE@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jbrasen@nvidia.com; x-originating-ip: [216.228.112.21] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ccaef493-c151-4249-07b7-08d77750360a x-ms-traffictypediagnostic: BYAPR12MB3510: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0239D46DB6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(376002)(346002)(366004)(39860400002)(396003)(13464003)(189003)(199004)(53546011)(66476007)(66556008)(186003)(229853002)(256004)(76116006)(86362001)(64756008)(66446008)(14444005)(66946007)(55016002)(54906003)(110136005)(19627405001)(6246003)(105004)(6436002)(316002)(4326008)(25786009)(8676002)(446003)(478600001)(102836004)(11346002)(33656002)(71200400001)(71190400001)(5660300002)(3846002)(26005)(6116002)(54896002)(2906002)(8936002)(9686003)(66066001)(81166006)(52536014)(74316002)(81156014)(6506007)(7736002)(99286004)(7696005)(14454004)(2501003)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR12MB3510;H:BYAPR12MB3462.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Y3CiXaZG5g6j7WPj1OrLRiDH7YIIZ0ZE38QW5YiUTnIn8+y9GPPQZH4zUG0ybJjOLgkrESygeJxP7YDBh5ofSgsiuSjftZ53rk/65TLoFwPOeO1KMyOEprJL/BBMdJrxQUio+zC6zWkg7txmRbpwfDDULJ2l/w9sEtvcw3RV3VrL6060DvThE9Wi0wVfe3hYPgdcjsVfYpe7td/VcdfHn1x+ckcM1oxBJUzfMFuhJ40RKydiv8XjHmyEjgbHtheSrcMeuWqsBc28gs4yrH/CBaoHeziC/rL2NG9zo20BSSmdS6xHWz7EImeFK+uSODpMWdzUJQTJH2IfQvZSlm+7SzCEm6/HlhCl9LE1mpGw0GESnHu1GLI74tiFZmr5YBOsIdiAm9UR8fEXz+rmpk8Q+xCkYxBYRdvxQ5FKb54HvwgVO1nBByZaUKGrucrf1S2c x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ccaef493-c151-4249-07b7-08d77750360a X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2019 17:51:08.2061 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DNCcunj+ou10WcDjWQBp9dfmTSNWv1PnXu8sxq2nysZ4vgsbcEmNy2zjECmsypDkCVpt6ctdy6BMtB7i6JZfpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3510 Return-Path: jbrasen@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1575309072; bh=tD8F9Gdt0r6qBWlMTZ9+bhTvZYSBlLiPqqjp7UoFxhc=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: authentication-results:x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-forefront-prvs:x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type; b=NRHNFQ/K8zQMhLwrAHZzuHLCYaONHpBsSNCeo/tKg2oweY6RHF70kOosNGOvdHvgm wAGxaOroyI3fnjZV40xcHI3+AwVSLVkKhcUluhEDTzsR/hFUVR71o+45Z8cmdta/cD BFZucreP7Bv6SxUS+wKliflrA0Pjls8rNWQsdtkZfwjB9qsDzJ32mP/l1S3qCsGtqR naux0XgcWO584OBb2COppRbFVyfRFSxzt8YC0Al3rkh3SXv35VMPqzt6a9m95SGOos 1MfaWHrzXpM/qYjxdz92l+82jmDjtQQbaf8fusOWPlBwZyeVHWONjyodc0ZEOFyIFS yIHybTTvKQ+/w== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR12MB346227DFCB640329D8327125CB430BYAPR12MB3462namp_" --_000_BYAPR12MB346227DFCB640329D8327125CB430BYAPR12MB3462namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I will work on a patch to variable services and other runtime services th= at have centrallized implementations to have them check the value of this= =20variable during ExitBootServices and then return unsupported if the bi= t is not set. Thanks, Jeff ________________________________ From: Gao, Zhichao Sent: Wednesday, November 27, 2019 10:29 PM To: Ni, Ray ; Jeff Brasen ; devel@e= dk2.groups.io Cc: Gao, Liming ; Wu, Hao A ; K= inney, Michael D Subject: RE: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSuppo= rted variable This bitmask value only affect the runtime service at runtime phase. So t= he implementation should be after the ExitBootServices() called. I think the patch set is only implemented the basic setting of the variab= le but no implementation of the RuntimeServices. Thanks, Zhichao > -----Original Message----- > From: Ni, Ray > Sent: Thursday, November 28, 2019 1:02 PM > To: Jeff Brasen ; devel@edk2.groups.io > Cc: Gao, Liming ; Wu, Hao A ;= > Gao, Zhichao ; Kinney, Michael D > > Subject: RE: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set > RuntimeServicesSupported variable > > Jeff, > I think I forgot to ask a very basic question on the new variable > RuntimeServicesSupported. > > What if the variable claims SetVariable() is not supported but OS still= =20calls > SetVariable()? > I think to behave in a consistent way, SetVariable() should reject to s= ervice. > But I cannot find it in your patch. > > The similar thing was done for OsIndications variable. > When firmware claims BOOT_TO_SETUP is not supported, the request is ign= ored > even OS requests to boot to setup,. > > I suggest we change all runtime services implementation to return unsup= ported > when the accordingly bit in the PCD is not set. > > Thanks, > Ray > > > > -----Original Message----- > > From: Jeff Brasen > > Sent: Thursday, November 28, 2019 7:25 AM > > To: devel@edk2.groups.io > > Cc: Gao, Liming ; Kinney, Michael D > > ; Wu, Hao A ; Ni, Ray= > > ; Gao, Zhichao ; > > jbrasen@nvidia.com > > Subject: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set > > RuntimeServicesSupported variable > > > > Add support for initializing and setting the UEFI 2.8 global variable= > > RuntimeServicesSupported based on the value of a PCD. > > > > Change-Id: I8fbd404d492ff8278466edde8aa37d203537318c > > Signed-off-by: Jeff Brasen > > --- > > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + > > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 > > +++++++++++++++++++++++++++++++- > > MdePkg/MdePkg.dec | 18 ++++++++++++++++ > > MdePkg/MdePkg.uni | 17 ++++++++++++++++ > > 4 files changed, 70 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > index 9310b4d..52ec04f 100644 > > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > @@ -90,6 +90,7 @@ > > gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang = =20 ## > > CONSUMES > > gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel = =20 ## > > CONSUMES > > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut = =20 ## > > CONSUMES > > + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported = =20 ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor = =20 ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision = =20 ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand > > ## CONSUMES > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > index d387dbe..16bc593 100644 > > --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > @@ -40,7 +40,8 @@ CHAR16 *mReadOnlyVariables[] =3D { > > EFI_LANG_CODES_VARIABLE_NAME, > > EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, > > EFI_HW_ERR_REC_SUPPORT_VARIABLE_NAME, > > - EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME > > + EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, > > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME > > }; > > > > CHAR16 *mBdsLoadOptionName[] =3D { > > @@ -626,6 +627,33 @@ BdsFormalizeOSIndicationVariable ( > > > > /** > > > > + Formalize RuntimeServicesSupported variable. > > + > > +**/ > > +VOID > > +BdsFormalizeRuntimeServicesSupportedVariable ( > > + VOID > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT16 RuntimeServicesSupported; > > + > > + RuntimeServicesSupported =3D PcdGet16 (PcdRuntimeServicesSupported= ); > > + Status =3D gRT->SetVariable ( > > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, > > + &gEfiGlobalVariableGuid, > > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > > EFI_VARIABLE_RUNTIME_ACCESS, > > + sizeof(RuntimeServicesSupported), > > + &RuntimeServicesSupported > > + ); > > + // > > + // Platform needs to make sure setting volatile variable before > > + calling 3rd > > party code shouldn't fail. > > + // > > + ASSERT_EFI_ERROR (Status); > > +} > > + > > +/** > > + > > Validate variables. > > > > **/ > > @@ -645,6 +673,11 @@ BdsFormalizeEfiGlobalVariable ( > > // Validate OSIndication related variable. > > // > > BdsFormalizeOSIndicationVariable (); > > + > > + // > > + // Validate Runtime Services Supported variable. > > + // > > + BdsFormalizeRuntimeServicesSupportedVariable (); > > } > > > > /** > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index > > d022cc5..cdcb2f9 100644 > > --- a/MdePkg/MdePkg.dec > > +++ b/MdePkg/MdePkg.dec > > @@ -2297,5 +2297,23 @@ > > # @Prompt Boot Timeout (s) > > > > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0x00 > > 00002c > > > > + ## Bitmask of supported runtime services
# BIT0 - GetTime = # > > + BIT1 - SetTime # BIT2 - GetWakeupTime # BIT3 - SetWakeupTime= > > + # BIT4 - GetVariable # BIT5 - GetNextVariableName # BIT6 - > > + SetVariable # BIT7 - SetVirtualAddressMap # BIT8 - > > + ConvertPointer # BIT9 - GetNextHighMonotonicCount # BIT10 - > > + ResetSystem # BIT11 - UpdateCapsule # BIT12 - > > + QueryCapsuleCapabilites # BIT13 - QueryVariableInfo # @Prompt > > + Supported Runtime services bitmask. > > + > > gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported|0x3FFF|UINT16 > > |0x0000002e > > + > > [UserExtensions.TianoCore."ExtraFiles"] > > MdePkgExtra.uni > > diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index > > 5c1fa24..1edf681 100644 > > --- a/MdePkg/MdePkg.uni > > +++ b/MdePkg/MdePkg.uni > > @@ -413,3 +413,20 @@ > > > > #string > > STR_gEfiMdePkgTokenSpaceGuid_PcdUartDefaultReceiveFifoDepth_HELP > > #language en-US "Indicates the receive FIFO depth of UART > > controller.

" > > > > +#string > > STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_PROMPT > > #language en-US "Supported Runtime Services bitmask" > > + > > +#string > > STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_HELP > > #language en-US "Bitmask of supported runtime services

\n" > > + = =20 "BIT0 - GetTime
\n" > > + = =20 "BIT1 - SetTime
\n" > > + = =20 "BIT2 - > GetWakeupTime
\n" > > + = =20 "BIT3 - > SetWakeupTime
\n" > > + = =20 "BIT4 - GetVariable
\n" > > + > > + "BIT5 - > > GetNextVariableName
\n" > > + = =20 "BIT6 - SetVariable
\n" > > + > > + "BIT7 - > > SetVirtualAddressMap
\n" > > + = =20 "BIT8 - > ConvertPointer
\n" > > + > > + "BIT9 - > > GetNextHighMonotonicCount
\n" > > + = =20 "BIT10 - ResetSystem
\n" > > + = =20 "BIT11 - > UpdateCapsule
\n" > > + > > + "BIT12 - > > QueryCapsuleCapabilities
\n" > > + = =20 "BIT13 - > QueryVariableInfo
" > > -- > > 2.7.4 -------------------------------------------------------------------------= ---------- This email message is for the sole use of the intended recipient(s) and m= ay contain confidential information. Any unauthorized review, use, disclosure or di= stribution is prohibited. If you are not the intended recipient, please contact the= =20sender by reply email and destroy all copies of the original message. -------------------------------------------------------------------------= ---------- --_000_BYAPR12MB346227DFCB640329D8327125CB430BYAPR12MB3462namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I will work on a patch to variable services and other runtime services th= at have centrallized implementations to have them check the value of this= =20variable during ExitBootServices and then return unsupported if the bi= t is not set.

Thanks,

Jeff


From: Gao, Zhichao <= zhichao.gao@intel.com>
Sent: Wednesday, November 27, 2019 10:29 PM
To: Ni, Ray <ray.ni@intel.com>; Jeff Brasen <jbrasen@nvid= ia.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Gao, Liming <liming.gao@intel.com>; Wu, Hao A <hao.a.= wu@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com> Subject: RE: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServic= esSupported variable
 
This bitmask value only affect the runtime servi= ce at runtime phase. So the implementation should be after the ExitBootSe= rvices() called.
I think the patch set is only implemented the basic setting of the variab= le but no implementation of the RuntimeServices.

Thanks,
Zhichao

> -----Original Message-----
> From: Ni, Ray
> Sent: Thursday, November 28, 2019 1:02 PM
> To: Jeff Brasen <jbrasen@nvidia.com>; devel@edk2.groups.io
= > Cc: Gao, Liming <liming.gao@intel.com>; Wu, Hao A <hao.a.wu= @intel.com>;
> Gao, Zhichao <zhichao.gao@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: RE: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set
> RuntimeServicesSupported variable
>
> Jeff,
> I think I forgot to ask a very basic question on the new variable > RuntimeServicesSupported.
>
> What if the variable claims SetVariable() is not supported but OS st= ill calls
> SetVariable()?
> I think to behave in a consistent way, SetVariable() should reject t= o service.
> But I cannot find it in your patch.
>
> The similar thing was done for OsIndications variable.
> When firmware claims BOOT_TO_SETUP is not supported, the request is = ignored
> even OS requests to boot to setup,.
>
> I suggest we change all runtime services implementation to return un= supported
> when the accordingly bit in the PCD is not set.
>
> Thanks,
> Ray
>
>
> > -----Original Message-----
> > From: Jeff Brasen <jbrasen@nvidia.com>
> > Sent: Thursday, November 28, 2019 7:25 AM
> > To: devel@edk2.groups.io
> > Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D=
> > <michael.d.kinney@intel.com>; Wu, Hao A <hao.a.wu@inte= l.com>; Ni, Ray
> > <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.co= m>;
> > jbrasen@nvidia.com
> > Subject: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set
> > RuntimeServicesSupported variable
> >
> > Add support for initializing and setting the UEFI 2.8 global va= riable
> > RuntimeServicesSupported based on the value of a PCD.
> >
> > Change-Id: I8fbd404d492ff8278466edde8aa37d203537318c
> > Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> > ---
> >  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  1 +<= br> > > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35
> > ++++++++++++= 3;++++++++++++++&= #43;+++-
> >  MdePkg/MdePkg.dec      &nbs= p;            = ;     | 18 ++++++++&#= 43;+++++++
> >  MdePkg/MdePkg.uni      &nbs= p;            = ;     | 17 ++++++++&#= 43;+++++++
> >  4 files changed, 70 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > index 9310b4d..52ec04f 100644
> > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > @@ -90,6 +90,7 @@
> >    gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefau= ltPlatformLang         ##
> > CONSUMES
> >    gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorReco= rdLevel           =      ##
> > CONSUMES
> >    gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeO= ut            = ;         ##
> > CONSUMES
> > +  gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupporte= d            =     ##
> > CONSUMES
> >    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVen= dor           &nbs= p;        ##
> > CONSUMES
> >    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRev= ision           &n= bsp;      ##
> > CONSUMES
> >    gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnec= tOnDemand
> > ## CONSUMES
> > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> > b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> > index d387dbe..16bc593 100644
> > --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> > +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> > @@ -40,7 +40,8 @@ CHAR16  *mReadOnlyVariables[] =3D {<= br> > >    EFI_LANG_CODES_VARIABLE_NAME,
> >    EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME,
> >    EFI_HW_ERR_REC_SUPPORT_VARIABLE_NAME,
> > -  EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME
> > +  EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME,
> > +  EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME
> >    };
> >
> >  CHAR16 *mBdsLoadOptionName[] =3D {
> > @@ -626,6 +627,33 @@ BdsFormalizeOSIndicationVariable (
= > >
> >  /**
> >
> > +  Formalize RuntimeServicesSupported variable.
> > +
> > +**/
> > +VOID
> > +BdsFormalizeRuntimeServicesSupportedVariable (
> > +  VOID
> > +  )
> > +{
> > +  EFI_STATUS       = ;            =    Status;
> > +  UINT16       &nb= sp;           &nbs= p;      RuntimeServicesSupported;
> > +
> > +  RuntimeServicesSupported =3D PcdGet16 (PcdRuntimeSe= rvicesSupported);
> > + Status =3D gRT->SetVariable (
> > +         &nbs= p;        EFI_RUNTIME_SERVICES_SUPPORT= ED_VARIABLE_NAME,
> > +         &nbs= p;        &gEfiGlobalVariableGuid,=
> > +         &nbs= p;        EFI_VARIABLE_BOOTSERVICE_ACC= ESS |
> > EFI_VARIABLE_RUNTIME_ACCESS,
> > +         &nbs= p;        sizeof(RuntimeServicesSuppor= ted),
> > +         &nbs= p;        &RuntimeServicesSupporte= d
> > +         &nbs= p;        );
> > +  //
> > +  // Platform needs to make sure setting volatile var= iable before
> > + calling 3rd
> > party code shouldn't fail.
> > +  //
> > +  ASSERT_EFI_ERROR (Status);
> > +}
> > +
> > +/**
> > +
> >    Validate variables.
> >
> >  **/
> > @@ -645,6 +673,11 @@ BdsFormalizeEfiGlobalVariable (
> >    // Validate OSIndication related variable. > >    //
> >    BdsFormalizeOSIndicationVariable ();
> > +
> > +  //
> > +  // Validate Runtime Services Supported variable. > > +  //
> > +  BdsFormalizeRuntimeServicesSupportedVariable (); > >  }
> >
> >  /**
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > d022cc5..cdcb2f9 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -2297,5 +2297,23 @@
> >    # @Prompt Boot Timeout (s)
> >
> > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0= x00
> > 00002c
> >
> > +  ## Bitmask of supported runtime services<BR>&= nbsp; #  BIT0  - GetTime  #
> > + BIT1  - SetTime  #  BIT2  - GetWakeup= Time  #  BIT3  - SetWakeupTime
> > + #  BIT4  - GetVariable  #  BIT5 = =20- GetNextVariableName  #  BIT6  -
> > + SetVariable  #  BIT7  - SetVirtualAddressM= ap  #  BIT8  -
> > + ConvertPointer  #  BIT9  - GetNextHighMono= tonicCount  #  BIT10 -
> > + ResetSystem  #  BIT11 - UpdateCapsule  #&n= bsp; BIT12 -
> > + QueryCapsuleCapabilites  #  BIT13 - QueryVariab= leInfo  # @Prompt
> > + Supported Runtime services bitmask.
> > +
> > gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported|0x3FFF|UIN= T16
> > |0x0000002e
> > +
> >  [UserExtensions.TianoCore."ExtraFiles"]
> >    MdePkgExtra.uni
> > diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index
> > 5c1fa24..1edf681 100644
> > --- a/MdePkg/MdePkg.uni
> > +++ b/MdePkg/MdePkg.uni
> > @@ -413,3 +413,20 @@
> >
> >  #string
> > STR_gEfiMdePkgTokenSpaceGuid_PcdUartDefaultReceiveFifoDepth_HEL= P
> > #language en-US "Indicates the receive FIFO depth of UART<= br> > > controller.<BR><BR>"
> >
> > +#string
> > STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_PROMPT=
> > #language en-US "Supported Runtime Services bitmask"<= br> > > +
> > +#string
> > STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_HELP > > #language en-US "Bitmask of supported runtime services<= BR><BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT0  - GetTime<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT1  - SetTime<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT2  -
> GetWakeupTime<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT3  -
> SetWakeupTime<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT4  - GetVariable<BR>\n"
> > +
> > + "BIT5  -
> > GetNextVariableName<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT6  - SetVariable<BR>\n"
> > +
> > + "BIT7  -
> > SetVirtualAddressMap<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT8  -
> ConvertPointer<BR>\n"
> > +
> > + "BIT9  -
> > GetNextHighMonotonicCount<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT10 - ResetSystem<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT11 -
> UpdateCapsule<BR>\n"
> > +
> > + "BIT12 -
> > QueryCapsuleCapabilities<BR>\n"
> > +         &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;   "BIT13 -
> QueryVariableInfo<BR>"
> > --
> > 2.7.4


This email message is for the sole use of the intended recipient(s) = and may=20 contain confidential information.  Any unauthorized review, use, dis= closure=20 or distribution is prohibited.  If you are not the intended recipien= t,=20 please contact the sender by reply email and destroy all copies of the or= iginal=20 message.

--_000_BYAPR12MB346227DFCB640329D8327125CB430BYAPR12MB3462namp_--