From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.22477.1574335607736794943 for ; Thu, 21 Nov 2019 03:26:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0228d47d92=sunnywang@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xALBQg1Z002221; Thu, 21 Nov 2019 11:26:46 GMT Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2wdqwn0x31-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2019 11:26:46 +0000 Received: from G1W8107.americas.hpqcorp.net (g1w8107.austin.hp.com [16.193.72.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id 5AE9589; Thu, 21 Nov 2019 11:26:44 +0000 (UTC) Received: from G4W9120.americas.hpqcorp.net (2002:10d2:150f::10d2:150f) by G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 21 Nov 2019 11:26:44 +0000 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (15.241.52.10) by G4W9120.americas.hpqcorp.net (16.210.21.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 21 Nov 2019 11:26:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XndRtMsIpFzePnKu0LFCBiNrPUdebNvwzpG1F6vHo5Di0VDQdpeuBEIhXJhmY4uV5M6xj4iG0KAgH7OSWSnJZPj/Fr+JgrhEddF4hDbEKj3294K9Bz2sRgYoKR6dmv3f0lRozE+FHWvQahUBRXuKlVJGgVKgcMKujKcBM6o/HLNXzdkuwSXhaZvyaF1C6Eta+Rb0fdwlYJl6FUiz8jOv5RnsdjDa30Mv2tcTdyGPHfcSXFBqTv0JC+ccDczMoSjP4vl6+ghaWPVvAWA6o8oG6bCLQQQKlcSiXNGR8+Z9IbI/vWfI0+kNc/5Y6GMn9tkfDkkNem1rOn/dMuU0LWNVXg== 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=zIyqNRm7PVOS99CAsKxHdj37fEIjEC1MtzZ53WmtScs=; b=N+KNarMKRiEENsdbVwWrkYZtmjsSvrOURViVhuChc6WYqLF9vPO7JYfcgJBoIwn9ETgjGx/ISY5FLLyYttFFJRUJD3eMCHXyhPiqvYJ5RE/709jXFu1M0rNelWgy4AqEQOG848CEu/q61ZhwLqGJ9xTohvFS3C6DrzEYR2ou0qRiDJGd0pcEsuMWMJiYFP43GoIB86/0cpYwI9b/p6Aw3Ja9UWQHHLqggdt60VfqYe+Qruuk7t51Cz8KYjLZ/RL4nbYWOgcm3+DaLSdI203kAxU9kjTPeFyAJ/kn2dFaBJvC5LeKTzLWMzPiRRTwfitZyL7Or6Vzx34tIp4sVpD1uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from DF4PR8401MB0969.NAMPRD84.PROD.OUTLOOK.COM (10.169.87.143) by DF4PR8401MB0954.NAMPRD84.PROD.OUTLOOK.COM (10.169.86.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 11:26:42 +0000 Received: from DF4PR8401MB0969.NAMPRD84.PROD.OUTLOOK.COM ([fe80::f8ff:e020:24ec:2d30]) by DF4PR8401MB0969.NAMPRD84.PROD.OUTLOOK.COM ([fe80::f8ff:e020:24ec:2d30%3]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 11:26:42 +0000 From: "Wang, Sunny (HPS SW)" To: "devel@edk2.groups.io" , "zhichao.gao@intel.com" , "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 RuntimeServicesSupported variable Thread-Topic: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable Thread-Index: AQHVm9wulPnxNDw3xUuw/GrxyMRwQaeVJUmAgAAITICAAEHTcA== Date: Thu, 21 Nov 2019 11:26:42 +0000 Message-ID: References: <7be9cf3d3ebaf8e367763ef72e1473c690cfdd5a.1573839532.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C367F0D@SHSMSX104.ccr.corp.intel.com> <3CE959C139B4C44DBEA1810E3AA6F9000B8793B4@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <3CE959C139B4C44DBEA1810E3AA6F9000B8793B4@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.133] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0d0093a3-ce01-4a06-5c12-08d76e75aeff x-ms-traffictypediagnostic: DF4PR8401MB0954: x-ms-exchange-purlcount: 3 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:586; x-forefront-prvs: 0228DDDDD7 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(13464003)(54906003)(26005)(966005)(478600001)(33656002)(3846002)(2906002)(446003)(66066001)(71200400001)(6116002)(71190400001)(11346002)(14454004)(25786009)(66476007)(66556008)(64756008)(66446008)(66946007)(8936002)(76116006)(81166006)(8676002)(81156014)(7736002)(2501003)(4326008)(305945005)(7696005)(76176011)(229853002)(110136005)(86362001)(6436002)(6306002)(55016002)(102836004)(9686003)(99286004)(5660300002)(6246003)(52536014)(14444005)(256004)(6506007)(53546011)(186003)(316002)(74316002);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR8401MB0954;H:DF4PR8401MB0969.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bdyg9u4NxdjX6hkch80X9evLwos5aZeM1SSP9WXfVVq5nr8ou0SgSoGYevHELbGKRfLEQOAX7/QpYLd+FaZ0x3GVRpN97b+FLWaVCN8pJDcpYJSrAE4WtzyeHdxlDHejWQbpfavjgz4MkE7HrJeJK+3pr3D72TccmHJSXGTJrEeNC9zZvbfAMkImDaUctTOPMiooaVOqUqq1Xr7xqOzoeFIfEAqmcV3+2qN0uqeiKAY71HRZiPN7J3JcBnvdfjf/e2pclk08W+XyPtBmEK11maGge7JMY0ppRWzA12Gz79k1C4SkR2GtVHeA0wA5e7aGGqPftzJVfLa5bnziKDWYGs3Bj7nW6vBThHp/aajR/3Dky+mUefnVbaegs2pnKJxk3j7lLlg3+OS64A46xrZCIaCtajLlUr2SzNwGn10PWsCB1X5FNTGHyCLnZHbwXzSnoR1CY2XcETHXQad7kRyrIgn/hNt1LeUZOKgDLd1E13M= X-MS-Exchange-CrossTenant-Network-Message-Id: 0d0093a3-ce01-4a06-5c12-08d76e75aeff X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2019 11:26:42.1004 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: t1KwWWPVCVjmTSlfL7JbpHdycODNhfHBDvaSP+BJmrWoe2U4oQIdp9FUomO3Lc7WPljcN8xxBcQI6I7QYTA/hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0954 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 3 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-21_02:2019-11-21,2019-11-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1011 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911210103 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray,=20 May I know why we need to put this PCD to [PcdsFixedAtBuild, PcdsPatchable= InModule] section only? If the reason is the security concern, Locking the = variable (value of PCD) at the EndOfDxe should be secure enough. For the pl= atforms that want to make it more secure (don't want the PCD to be modified= ), they can override the PCD type in their .dsc file.=20 I can imagine that there are still some use cases that need to modify the = PCD during boot. Can we put this PCD in [PcdsFixedAtBuild, PcdsPatchableInM= odule, PcdsDynamic, PcdsDynamicEx] to make it more flexible?=20 Regards, Sunny Wang -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Gao,= Zhichao Sent: Thursday, November 21, 2019 2:12 PM To: Ni, Ray ; Jeff Brasen ; edk2-dev= el@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 RuntimeServ= icesSupported variable Agree with Ray, and we should update the uni file at the same time when ad= d 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;=20 > devel@edk2.groups.io > Cc: Gao, Liming ; Kinney, Michael D=20 > ; Wu, Hao A ; Gao,=20 > Zhichao > Subject: RE: [PATCH 3/3] MdeModulePkg/BdsDxe: Set=20 > RuntimeServicesSupported variable >=20 > Jeff, > I suggest you add the PCD definition to MdePkg.dec because this PCD=20 > just maps to the spec defined variable RuntimeServicesSupported. >=20 > And can you put this PCD to [PcdsFixedAtBuild, PcdsPatchableInModule]=20 > section 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=20 > > ; Kinney, Michael D=20 > > ; Wu, Hao A ; Ni,=20 > > Ray ; Gao, Zhichao > > Subject: [PATCH 3/3] MdeModulePkg/BdsDxe: Set=20 > > RuntimeServicesSupported variable > > > > Add support for initializing and setting the UEFI 2.8 global=20 > > variable RuntimeServicesSupported based on the value of a PCD. > > > > Signed-off-by: Jeff Brasen > > --- > > MdeModulePkg/MdeModulePkg.dec | 18 ++++++++++++++++ > > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 +=20 > > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 > > +++++++++++++++++++++++++++++++- > > 3 files changed, 53 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/MdeModulePkg.dec=20 > > 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 -=20 > > + SetWakeupTime # > > + BIT4 - GetVariable # BIT5 - GetNextVariableName # BIT6 -=20 > > + SetVariable # BIT7 - SetVirtualAddressMap # BIT8 -=20 > > + ConvertPointer # BIT9 - GetNextHighMonotonicCount # BIT10 -=20 > > + ResetSystem # BIT11 - UpdateCapsule # BIT12 -=20 > > + QueryCapsuleCapabilites # BIT13 - QueryVariableInfo # @Prompt=20 > > + 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=20 > > + (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=20 > > + 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