From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0DB222194D387 for ; Mon, 24 Dec 2018 21:04:17 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Dec 2018 21:04:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,395,1539673200"; d="scan'208";a="113097362" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 24 Dec 2018 21:04:16 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 24 Dec 2018 21:04:16 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 24 Dec 2018 21:04:16 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.210]) with mapi id 14.03.0415.000; Tue, 25 Dec 2018 13:04:13 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Kubacki, Michael A" Thread-Topic: [PATCH v1] MinPlatformPkg/Test: Update to consume SpeculationBarrier Thread-Index: AQHUm/CAZ0/6j16TA0S61XaqCFm/LqWO5qAQ Date: Tue, 25 Dec 2018 05:04:12 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F46AE80@shsmsx102.ccr.corp.intel.com> References: <20181225012349.7496-1-hao.a.wu@intel.com> In-Reply-To: <20181225012349.7496-1-hao.a.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDBhOGVkMjktODkzOC00MmNkLWE4MTUtZDMyODAxNzcyMmRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidUdxakg5WTNMTFV4N2xFVEtpMStiYk9SUTBGXC9FWldCWldrSWI0N21abVRnaENHNDFBZVF1SHZUeHFyUmJ2S28ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v1] MinPlatformPkg/Test: Update to consume SpeculationBarrier X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2018 05:04:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Wu, Hao A > Sent: Tuesday, December 25, 2018 9:24 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Kubacki, Michael A > ; Yao, Jiewen > Subject: [PATCH v1] MinPlatformPkg/Test: Update to consume > SpeculationBarrier >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1417 >=20 > Since BaseLib API AsmLfence() is a x86 arch specific API and should be > avoided using in generic codes, this commit replaces the usage of > AsmLfence() with arch-generic API SpeculationBarrier(). >=20 > Cc: Michael A Kubacki > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hao Wu > --- >=20 > Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPo > intCheckLib.c | 6 +++--- >=20 > Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointCo > mmunication.c | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest > PointCheckLib.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest > PointCheckLib.c > index dc40dae6d5..2d051bb6bb 100644 > --- > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest > PointCheckLib.c > +++ > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest > PointCheckLib.c > @@ -376,11 +376,11 @@ > TestPointSmmReadyToBootSmmPageProtectionHandler ( >=20 > if (CommData->UefiMemoryMapSize !=3D 0) { > // > - // The AsmLfence() call here is to ensure the previous range/content > checks > - // for the CommBuffer (copied in to CommData) have been completed > before > + // The SpeculationBarrier() call here is to ensure the previous > range/content > + // checks for the CommBuffer (copied in to CommData) have been > completed before > // calling into TestPointCheckSmmCommunicationBuffer(). > // > - AsmLfence (); > + SpeculationBarrier (); > Result =3D TRUE; >=20 > Status =3D TestPointCheckSmmCommunicationBuffer ( > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointC > ommunication.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointC > ommunication.c > index b4757da046..d2387f6244 100644 > --- > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointC > ommunication.c > +++ > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointC > ommunication.c > @@ -253,11 +253,11 @@ SmmTestPointSmiHandlerGetDataByOffset ( > } >=20 > // > - // The AsmLfence() call here is to ensure the previous range/content > checks > - // for the CommBuffer have been completed before calling into > + // The SpeculationBarrier() call here is to ensure the previous > range/content > + // checks for the CommBuffer have been completed before calling into > // SmiHandlerTestPointCopyData(). > // > - AsmLfence (); > + SpeculationBarrier (); > SmiHandlerTestPointCopyData ( > Data, > DataSize, > -- > 2.12.0.windows.1