From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.3775.1574410229059618734 for ; Fri, 22 Nov 2019 00:10:29 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0229c7ba67=sunnywang@hpe.com) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAM87A5v010393; Fri, 22 Nov 2019 08:10:28 GMT Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2we517tbca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Nov 2019 08:10:27 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5009.houston.hpe.com (Postfix) with ESMTPS id 084335C; Fri, 22 Nov 2019 08:10:26 +0000 (UTC) Received: from G9W8672.americas.hpqcorp.net (16.220.49.31) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 22 Nov 2019 08:10:26 +0000 Received: from G9W9209.americas.hpqcorp.net (2002:10dc:429c::10dc:429c) by G9W8672.americas.hpqcorp.net (2002:10dc:311f::10dc:311f) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 22 Nov 2019 08:10:25 +0000 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (15.241.52.11) by G9W9209.americas.hpqcorp.net (16.220.66.156) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 22 Nov 2019 08:10:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kXqo31je1L91v8uZl3oWMMg3XCwjr+JYzI+vF2otHXhSiFS38oEFi/YYZsrebHdHz196m0ls2dOhevJxcmSHM8xfPTvb6K7vgUasqDas3WUDeJwl1gtkV1Uti0C0xYt0dTkbrkdYyQEQ/3G9sFXnZZAv5Z10QcjCz3V8qzS6m5tN+0GPX9j5DdPrSP2SpXGCqk9pQCVgbfJuEE7xCp0AUF32WUfhhzFtXha7mqozea9PhlEtPz+e8nfBK6az1t7tywJdheLATp9Wp/W9CCK+py5ygl9IsdvM1LM6YouAUgYWqB0BqTn6TgMJr06jwfdrqr0CI14H8NKthuiZ75gDCw== 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=mGwMLxw1CPWUEjDba/gKNF426uavN1WOYtkg+6NRXl0=; b=LL0yInh66yJjbjXXdI096EqfinL1oGL5UNiz5+7Ddsqbjdkk+RfwkdPIXjetstaunQpavNsmtOJtioTCq+mVXSTRahW8COKBLTNajb608eJCqUpRKUNBce/1B+5QjbpiJD7Z0AJC+zhKxUmTHkEQcCWpRoyYvs4qhQlMnujNmbmcMNtP5fw88Tbl85CsNOiCu96/iUJyMf2/nzsn2G8f/HrzkNQjPX3i1xrl5W2NBoAK8am+QYbtVBauyCv56ceW3YdBAvoL6mtvKWJ7vHvqqNR6mDI3g/Yky3mzTkbk9w5q1wEwNxBG1xkAbMFTMZEnbVIkiB3iV6zVmCcU8h1a2Q== 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 DF4PR8401MB0572.NAMPRD84.PROD.OUTLOOK.COM (10.169.92.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Fri, 22 Nov 2019 08:10:24 +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; Fri, 22 Nov 2019 08:10:24 +0000 From: "Wang, Sunny (HPS SW)" To: "Ni, Ray" , "devel@edk2.groups.io" , "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: AQHVm9wulPnxNDw3xUuw/GrxyMRwQaeVJUmAgAAITICAAEHTcIAAHMkAgAFThQA= Date: Fri, 22 Nov 2019 08:10:24 +0000 Message-ID: References: <7be9cf3d3ebaf8e367763ef72e1473c690cfdd5a.1573839532.git.jbrasen@nvidia.com> <734D49CCEBEEF84792F5B80ED585239D5C367F0D@SHSMSX104.ccr.corp.intel.com> <3CE959C139B4C44DBEA1810E3AA6F9000B8793B4@SHSMSX101.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C368A01@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C368A01@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [61.231.193.128] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 21115c6f-19ac-4588-73f3-08d76f236d3a x-ms-traffictypediagnostic: DF4PR8401MB0572: x-ms-exchange-purlcount: 3 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:751; x-forefront-prvs: 02296943FF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(136003)(39860400002)(346002)(396003)(13464003)(51914003)(199004)(189003)(26005)(54906003)(186003)(256004)(52536014)(76176011)(5660300002)(305945005)(6116002)(19627235002)(6506007)(53546011)(74316002)(76116006)(86362001)(3846002)(478600001)(7736002)(4326008)(7696005)(966005)(110136005)(6246003)(9686003)(8676002)(229853002)(81156014)(6306002)(66066001)(66946007)(446003)(14444005)(8936002)(66476007)(66556008)(64756008)(33656002)(2906002)(99286004)(25786009)(71190400001)(11346002)(316002)(71200400001)(102836004)(81166006)(55016002)(14454004)(6436002)(2501003)(66446008);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR8401MB0572;H:DF4PR8401MB0969.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: r7CR1chlChGafKUbgnCYoF90gTiN5Zk4cw2S4Jy8/0BZanjjz6Mvs0Ockk4zcAw19n5WiFv7JxqZ/b2cOMHOqPxfdzw/7kDFmO0BXdTOk1EySJOjharrABEAMqVG88RtoGfJqKB+xtGTttr3qnraPQ2EA7x6TQbDiwlYj0bGl3kkvYs+gzamOJSF0eFGrlqvMGSo5r3kxCzyY2tD3umMS3acCyJngPW2gqtpZ7b34aiEGR0+d6dElJ35tWXGgZkKoCZL8vEbYdTX5/XTyfDdKxtRH2Iffb2+iFWZ99/lDmStmsLYCtPAQKhwhARnkJHnEe9BSnC25SHEiWDTj84rCgKjXb/svB9LMoy/xvO+ggJ/x1/7pJn3NfDR2og7v5KJrj0eXIhVmFm79XdbCQkvHZYsTNJbtYKLGjQ61P5vwc+JT46qCC6D1RZbt/cu/hxwBFd9Vst766cXjNtFAQwJiYPRT7lFpfJf0Q7jW7i3prE= X-MS-Exchange-CrossTenant-Network-Message-Id: 21115c6f-19ac-4588-73f3-08d76f236d3a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2019 08:10:24.2780 (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: DYt5jf+RntUvZQxIR//XGWmSOF0lYoGYrvNopPKvw/dQZ2nY6/HzWNDXY+T7kZmQ4W6zhXBAHpjmjSA9DKC+/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0572 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 1 URL was 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_07:2019-11-21,2019-11-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 malwarescore=0 suspectscore=0 phishscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911220071 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the clarification, Ray. Regards, Sunny Wang -----Original Message----- From: Ni, Ray [mailto:ray.ni@intel.com]=20 Sent: Thursday, November 21, 2019 7:51 PM To: devel@edk2.groups.io; Wang, Sunny (HPS SW) ; Gao, Z= hichao ; Jeff Brasen ; edk2-deve= l@lists.01.org Cc: Gao, Liming ; Kinney, Michael D ; Wu, Hao A ; Spottswood, Jason Subject: RE: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set RuntimeServ= icesSupported variable Importance: High 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,=20 > Sunny (HPS SW) > Sent: Thursday, November 21, 2019 7:27 PM > To: devel@edk2.groups.io; Gao, Zhichao ; Ni,=20 > Ray ; Jeff Brasen ;=20 > edk2-devel@lists.01.org > Cc: Gao, Liming ; Kinney, Michael D=20 > ; Wu, Hao A ;=20 > Spottswood, Jason ; Wang, Sunny (HPS SW)=20 > > Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set=20 > RuntimeServicesSupported variable >=20 > Hi Ray, >=20 > May I know why we need to put this PCD to [PcdsFixedAtBuild,=20 > PcdsPatchableInModule] section only? If the reason is the security=20 > concern, Locking the variable (value of PCD) at the EndOfDxe should be s= ecure enough. For the platforms that want to make it more secure (don't wan= t the PCD to be modified), they can override the PCD type in their .dsc fil= e. > I can imagine that there are still some use cases that need to modify=20 > the PCD during boot. Can we put this PCD in [PcdsFixedAtBuild, PcdsPatch= ableInModule, 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=20 > Gao, Zhichao > Sent: Thursday, November 21, 2019 2:12 PM > To: Ni, Ray ; Jeff Brasen ;=20 > edk2-devel@lists.01.org; devel@edk2.groups.io > Cc: Gao, Liming ; Kinney, Michael D=20 > ; Wu, Hao A > Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/BdsDxe: Set=20 > RuntimeServicesSupported 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;=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 > > > > Jeff, > > I suggest you add the PCD definition to MdePkg.dec because this PCD=20 > > just maps to the spec defined variable RuntimeServicesSupported. > > > > And can you put this PCD to [PcdsFixedAtBuild,=20 > > 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=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 -=20 > > > + 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 >=20 >=20 >=20 >=20 >=20 >=20