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.web11.20200.1574316755497675632 for ; Wed, 20 Nov 2019 22:12:35 -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 orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2019 22:12:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,224,1571727600"; d="scan'208";a="218975110" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 20 Nov 2019 22:12:34 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 20 Nov 2019 22:12:32 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 20 Nov 2019 22:12:32 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.149]) with mapi id 14.03.0439.000; Thu, 21 Nov 2019 14:12:30 +0800 From: "Gao, Zhichao" To: "Ni, Ray" , Jeff Brasen , "edk2-devel@lists.01.org" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Kinney, Michael D" , "Wu, Hao A" Subject: Re: [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Topic: [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Index: AQHVm9wezWm1zghcQ0aa6T83s1BDOqeUny2AgACOLAA= Date: Thu, 21 Nov 2019 06:12:29 +0000 Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B8793B4@SHSMSX101.ccr.corp.intel.com> References: <7be9cf3d3ebaf8e367763ef72e1473c690cfdd5a.1573839532.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C367F0D@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C367F0D@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFlZTU0NzUtNGE5ZS00NjFiLTgwMDUtMDM1Y2JmNzBmYTcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWTJnekJaRERQb3h5ODNPejhmcHcwdWFwSlJ6TWlBN1BUXC9jaU1iS0J4VGdOajliNWN6UUZmNFNKT0lwdU9kcmIifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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 Agree with Ray, and we should update the uni file at the same time when add= the new pcd. Thanks, Zhichao > -----Original Message----- > From: Ni, Ray > Sent: Thursday, November 21, 2019 11:13 AM > To: Jeff Brasen ; edk2-devel@lists.01.org; > devel@edk2.groups.io > Cc: Gao, Liming ; Kinney, Michael D > ; Wu, Hao A ; Gao, > Zhichao > Subject: RE: [PATCH 3/3] MdeModulePkg/BdsDxe: Set > RuntimeServicesSupported variable >=20 > Jeff, > I suggest you add the PCD definition to MdePkg.dec because this PCD just = maps > to the spec defined variable RuntimeServicesSupported. >=20 > And can you put this PCD to [PcdsFixedAtBuild, PcdsPatchableInModule] sec= tion > only? >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Jeff Brasen > > Sent: Saturday, November 16, 2019 1:43 AM > > To: edk2-devel@lists.01.org; devel@edk2.groups.io > > Cc: Jeff Brasen ; Gao, Liming > > ; Kinney, Michael D > > ; Wu, Hao A ; Ni, Ray > > ; Gao, Zhichao > > Subject: [PATCH 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. > > > > Signed-off-by: Jeff Brasen > > --- > > MdeModulePkg/MdeModulePkg.dec | 18 ++++++++++++++++ > > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + > > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 > > +++++++++++++++++++++++++++++++- > > 3 files changed, 53 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/MdeModulePkg.dec > > b/MdeModulePkg/MdeModulePkg.dec index 41b9e70..a1767e4 100644 > > --- a/MdeModulePkg/MdeModulePkg.dec > > +++ b/MdeModulePkg/MdeModulePkg.dec > > @@ -2003,6 +2003,24 @@ > > # @Prompt Capsule On Disk relocation device path. > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdCodRelocationDevPath|{0xFF}|VOI > > D*|0x0000002f > > > > + ## 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. > > + > > + > > gEfiMdeModulePkgTokenSpaceGuid.PcdRuntimeServicesSupported|0x3FFF > > |UINT > > + 16|0x00000030 > > + > > [PcdsPatchableInModule] > > ## Specify memory size with page number for PEI code when > > # Loading Module at Fixed Address feature is enabled. > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > index 9310b4d..e4ba9be 100644 > > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > @@ -97,6 +97,7 @@ > > gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed = ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleOnDiskSupport = ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformRecoverySupport = ## > > CONSUMES > > + gEfiMdeModulePkgTokenSpaceGuid.PcdRuntimeServicesSupported > > ## CONSUMES > > > > [Depex] > > TRUE > > 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 (); > > } > > > > /** > > -- > > 2.7.4