From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.22625.1574337069865628102 for ; Thu, 21 Nov 2019 03:51:10 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: ray.ni@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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 03:51:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,224,1571727600"; d="scan'208";a="259348787" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 21 Nov 2019 03:51:09 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 03:51:09 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 03:51:08 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by shsmsx102.ccr.corp.intel.com ([169.254.2.108]) with mapi id 14.03.0439.000; Thu, 21 Nov 2019 19:51:07 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "sunnywang@hpe.com" , "Gao, Zhichao" , Jeff Brasen , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Kinney, Michael D" , "Wu, Hao A" , "Spottswood, Jason" Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Topic: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Index: AQHVm9wetSi4710/CUulr4wj2XD1bqeVJGjQ//+DEYCAAFfLAIAAjCBw Date: Thu, 21 Nov 2019 11:51:06 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C368A01@SHSMSX104.ccr.corp.intel.com> References: <7be9cf3d3ebaf8e367763ef72e1473c690cfdd5a.1573839532.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C367F0D@SHSMSX104.ccr.corp.intel.com> <3CE959C139B4C44DBEA1810E3AA6F9000B8793B4@SHSMSX101.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGIzZmUyMjItN2FkMC00MTQzLTk4MTQtYmFhYmZkNWMxMTJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVnhpbFNBZUYyRTRSaWRERThcL0NxRnlDR1ZxUXA0UWFpUUNLZHZrYm9cL0xvUjBhbjhvQ3dBRzVRMk13VzUwTmY0In0= 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: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sunny, I am fine to put it to dynamic section if there are real requirements. I thought if the platform doesn't support runtime services, it always does= n't support. Thanks, Ray > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wang, Sun= ny (HPS SW) > Sent: Thursday, November 21, 2019 7:27 PM > To: devel@edk2.groups.io; Gao, Zhichao ; Ni, Ray = ; Jeff Brasen > ; edk2-devel@lists.01.org > Cc: Gao, Liming ; Kinney, Michael D ; Wu, Hao A > ; Spottswood, Jason ; Wang= , Sunny (HPS SW) > Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeSe= rvicesSupported variable >=20 > Hi Ray, >=20 > May I know why we need to put this PCD to [PcdsFixedAtBuild, PcdsPatchab= leInModule] section only? If the reason is the > security concern, Locking the variable (value of PCD) at the EndOfDxe sh= ould be secure enough. For the platforms that > want to make it more secure (don't want the PCD to be modified), they ca= n override the PCD type in their .dsc file. > I can imagine that there are still some use cases that need to modify th= e PCD during boot. Can we put this PCD in > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] to= make it more flexible? >=20 > Regards, > Sunny Wang >=20 > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Ga= o, Zhichao > Sent: Thursday, November 21, 2019 2:12 PM > To: Ni, Ray ; Jeff Brasen ; edk2-d= evel@lists.01.org; devel@edk2.groups.io > Cc: Gao, Liming ; Kinney, Michael D ; Wu, Hao A > > Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeSe= rvicesSupported variable >=20 > Agree with Ray, and we should update the uni file at the same time when = add the new pcd. >=20 > Thanks, > Zhichao >=20 > > -----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 > > > > Jeff, > > I suggest you add the PCD definition to MdePkg.dec because this PCD > > just maps to the spec defined variable RuntimeServicesSupported. > > > > And can you put this PCD to [PcdsFixedAtBuild, PcdsPatchableInModule] > > section only? > > > > Thanks, > > Ray > > > > > -----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 >=20 >=20 >=20 >=20 >=20 >=20