From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.3074.1574918949007743684 for ; Wed, 27 Nov 2019 21:29:09 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: zhichao.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 21:29:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,252,1571727600"; d="scan'208";a="261201989" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 27 Nov 2019 21:29:08 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 27 Nov 2019 21:29:08 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 27 Nov 2019 21:29:07 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0439.000; Thu, 28 Nov 2019 13:29:06 +0800 From: "Gao, Zhichao" To: "Ni, Ray" , Jeff Brasen , "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: AQHVpXoD9expQ+le40+VJ7UYZcxyJ6efgPWAgACMJJA= Date: Thu, 28 Nov 2019 05:29:05 +0000 Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B87BADE@SHSMSX101.ccr.corp.intel.com> References: <21cbc55c9d35ac799e4978a5dbdf4de3e650dace.1574896889.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C371494@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C371494@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhichao.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This bitmask value only affect the runtime service at runtime phase. So the= implementation should be after the ExitBootServices() called. I think the patch set is only implemented the basic setting of the variable= 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 >=20 > Jeff, > I think I forgot to ask a very basic question on the new variable > RuntimeServicesSupported. >=20 > What if the variable claims SetVariable() is not supported but OS still c= alls > SetVariable()? > I think to behave in a consistent way, SetVariable() should reject to ser= vice. > But I cannot find it in your patch. >=20 > The similar thing was done for OsIndications variable. > When firmware claims BOOT_TO_SETUP is not supported, the request is ignor= ed > even OS requests to boot to setup,. >=20 > I suggest we change all runtime services implementation to return unsuppo= rted > when the accordingly bit in the PCD is not set. >=20 > Thanks, > Ray >=20 >=20 > > -----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 = ## > > CONSUMES > > gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel = ## > > CONSUMES > > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut = ## > > CONSUMES > > + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported = ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor = ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision = ## > > 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" > > + = "BIT0 - GetTime
\n" > > + = "BIT1 - SetTime
\n" > > + = "BIT2 - > GetWakeupTime
\n" > > + = "BIT3 - > SetWakeupTime
\n" > > + = "BIT4 - GetVariable
\n" > > + > > + "BIT5 - > > GetNextVariableName
\n" > > + = "BIT6 - SetVariable
\n" > > + > > + "BIT7 - > > SetVirtualAddressMap
\n" > > + = "BIT8 - > ConvertPointer
\n" > > + > > + "BIT9 - > > GetNextHighMonotonicCount
\n" > > + = "BIT10 - ResetSystem
\n" > > + = "BIT11 - > UpdateCapsule
\n" > > + > > + "BIT12 - > > QueryCapsuleCapabilities
\n" > > + = "BIT13 - > QueryVariableInfo
" > > -- > > 2.7.4