From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.67.109; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067109.outbound.protection.outlook.com [40.92.67.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 88A8E20D7B251 for ; Sun, 27 May 2018 09:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e1jQY3TpJElEjAYXgfFIsCnxtfFv54A7AxwsSCJqps0=; b=OLHQzJs5lKxm5Dx0KVDIjBO0CBSuUsr9Z2NI10hFX2155/zTWDkV0PDkbH9v2BtLvMBNHWPepvnJTDRwqLaEqCA30VGIcR9rrSShwORzFh9Of5DkvJ9sk5+fwOFtF2qvmE2ntFWOddK+g/6uMEv5t1WoVkHmOlyb/CBhbJ44tqfqh9rO0WoSoxR3GRvN8z6Bx7JuhGwPkSfH58OxGP89AA3+XYCMkJmFXlg3Qdv9BCldDuHtmWieSETat/xTLSpTBjrC2LC1koNsFS7dQKLLk/dZiLIPag9/Ip1nux9UTflbH+FPgrP95ipwwBMebjAgG9g0YnU+540H6LmUHYgvuw== Received: from HE1EUR02FT037.eop-EUR02.prod.protection.outlook.com (10.152.10.52) by HE1EUR02HT036.eop-EUR02.prod.protection.outlook.com (10.152.11.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.820.8; Sun, 27 May 2018 16:47:58 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com (10.152.10.52) by HE1EUR02FT037.mail.protection.outlook.com (10.152.10.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.797.11 via Frontend Transport; Sun, 27 May 2018 16:47:58 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7010:5d5e:8dcf:d92e]) by VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7010:5d5e:8dcf:d92e%17]) with mapi id 15.20.0797.017; Sun, 27 May 2018 16:47:58 +0000 From: Marvin H?user To: "edk2-devel@lists.01.org" , Abhishek Singh CC: "star.zeng@intel.com" , "eric.dong@intel.com" , "ruiyu.ni@intel.com" , "Laszlo Ersek" Thread-Topic: [edk2] smm lock query Thread-Index: AQHT9QLeWaJtLWq0BUWJb0CKtcRg8aRDrfwg Date: Sun, 27 May 2018 16:47:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:5BD5C12E53DB49BF63E61E5AEB10DAD1C1D894F2C181CC58EEF70EDE10E17C97; UpperCasedChecksum:4A8DA1B1ED0D2CC4074694B31BBD9CEA90236D994A76F83B9F1448DFD58C26E5; SizeAsReceived:7242; Count:46 x-tmn: [HYOaYXDlWazQdN+KzuW0DZnDpnYrY+o7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1EUR02HT036; 7:S3VMBukaVzFJM+vmhu4TrVtZPTmkRWdGiMIiAb+nI+OiKBOPQg+RCHeZYek8e+l1LgijK8HVNmh92QnHLuPDSPVhx0Ew9R3mcLdGfn/6mjTLVa1DiLG80zDze43MWU5xJXQ/JlxocJiYwZPAddcNymZT1eDBoffaWn4gSbJOrul9oKloz7I3Th57S6d1asU3WJW9cqI3GzAETTSRF9mlWZ4W/j/dLU+Y5s3zYkBve6t7bSra5PLe7UUDtg9K25/0 x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125466)(1701031045); SRVR:HE1EUR02HT036; x-ms-traffictypediagnostic: HE1EUR02HT036: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:HE1EUR02HT036; BCL:0; PCL:0; RULEID:; SRVR:HE1EUR02HT036; x-forefront-prvs: 0685122203 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(199004)(189003)(13464003)(68736007)(8936002)(8676002)(81156014)(5660300001)(3280700002)(3660700001)(87572001)(6346003)(110136005)(102836004)(86362001)(486006)(476003)(305945005)(54906003)(11346002)(446003)(426003)(26005)(8666007)(76176011)(33656002)(59450400001)(97736004)(7696005)(53546011)(229853002)(2501003)(14454004)(5250100002)(6436002)(20460500001)(104016004)(2900100001)(2171002)(6246003)(966005)(82202002)(72206003)(74316002)(6306002)(25786009)(55016002)(99286004)(4326008)(105586002)(106356001); DIR:OUT; SFP:1901; SCL:1; SRVR:HE1EUR02HT036; H:VI1PR0801MB1790.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; received-spf: None (protection.outlook.com: outlook.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Marvin.Haeuser@outlook.com; x-microsoft-antispam-message-info: gCjY9nsWgE84mFpdjV6RTdzWUTyCYKVqw0YMJc3Yt2Sx7A5Yo8lyoxKf2CK1nGe+0U8MZcVr+YqhbV0J/09jOtPoTa2gGy+TNUxDGrV1EJuRfrWv1aaHaQrsF/pAQnRxTYZFeXBGWQpnt10O9ZAVVhNKiyhLY+Eh2Sq/YQRg8iykeuHQiWMt3KbD8pQ2o35A MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c8ee3920-0878-4993-d5e5-08d5c3f19a0c X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: c8ee3920-0878-4993-d5e5-08d5c3f19a0c X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 27 May 2018 16:47:58.0454 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT036 Subject: Re: smm lock query X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2018 16:48:02 -0000 Content-Language: de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Good day Abhishek, I CC'd the MdeModulePkg maintainers, Ruiyu for the Platform BDS aspect (exp= oses the ReadyToLock protocol) and Laszlo for his high-quality answers. Strictly speaking you are, right, because of the description for the MM pro= tocol: "Indicates that MM resources and services that should not be used by the th= ird party code are about[Marvin: (!)] to be locked." Practically however, I don't see any issue with the current implementation.= Code inside MMRAM is not affected directly by the lock, it is just notifie= d. However, either the code or the specification should be slightly updated to= be in sync. A code update might require review of the caller assumptions, = just to be sure. I have a different concern though and hope I'm actually overlooking somethi= ng. If I understand the code correctly, it is the Platform BDS that exposes the= (S)MmReadyToLock protocol. PiSmmIpl seems to consume that event and lock S= MM resources based on the event. Because of latter being an event however, I don't think it is, or can be, g= uaranteed to be the last event group member executing. When it is not the last, the "about to be locked" part is not true for any = subsequent callbacks, that could actually be a risky break of the specifica= tion - if it is. If it is a break of the specification, I can only think of letting Platform= BDS expose an "internal" event group, which is only caught by PiSmmIpl, wh= ich then drives the actual SmmReadyToLock flow. This would require updates to all platform trees and hence I would propose = a temporary backwards-compatibility. Any comments? Did I overlook something (I hope)? Thanks and regards, Marvin > -----Original Message----- > From: edk2-devel On Behalf Of > Abhishek Singh > Sent: Saturday, May 26, 2018 5:05 PM > To: edk2-devel@lists.01.org > Subject: [edk2] smm lock query >=20 > Hi, >=20 > This is the first time I am mailing to this list. If this is not the righ= t place for the > kind of questions I am asking please let me know where to direct my queri= es. >=20 > I have been looking at the SMM IPL code and a portion of the code is a li= ttle > confusing to me. In the function SmmIplReadyToLockEventNotify, smram is > locked (mSmmAccess->Lock) before the ready to lock notifications are sent > through SmmIplGuidedEventNotify. Shouldn't the lock be placed after the > ready to lock notifications? >=20 > Best regards, > Abhishek > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel