From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 9B2DF21198CD0 for ; Sun, 23 Dec 2018 18:56:06 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2018 18:56:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,390,1539673200"; d="scan'208";a="304598907" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 23 Dec 2018 18:56:05 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 23 Dec 2018 18:56:05 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 23 Dec 2018 18:56:05 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.59]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.210]) with mapi id 14.03.0415.000; Mon, 24 Dec 2018 10:56:03 +0800 From: "Wang, Jian J" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: Ard Biesheuvel , "Yao, Jiewen" , "Gao, Liming" Thread-Topic: [PATCH v1 2/5] MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier Thread-Index: AQHUmNrjnU9ihJ2HkU6eREpdLV6sOqWNNoqA Date: Mon, 24 Dec 2018 02:56:02 +0000 Message-ID: References: <20181221031106.12960-1-hao.a.wu@intel.com> <20181221031106.12960-3-hao.a.wu@intel.com> In-Reply-To: <20181221031106.12960-3-hao.a.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmUzZDk4YzktYzk1OS00NmNjLWFiYjEtYTVmM2FmZGE2ZWY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidWErMXV5aFcrcGhpbnFPcEN1VHpualJtc1F1VDJMdkJtTUdpRE9LWmlyUm9nRWlnOTVYZ3FGMlpmZkozS1pTTSJ9 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 2/5] MdeModulePkg/FaultTolerantWrite: 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: Mon, 24 Dec 2018 02:56:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang > -----Original Message----- > From: Wu, Hao A > Sent: Friday, December 21, 2018 11:11 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Ard Biesheuvel > ; Yao, Jiewen ; Gao, > Liming ; Wang, Jian J > Subject: [PATCH v1 2/5] MdeModulePkg/FaultTolerantWrite: 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: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Liming Gao > Cc: Jian J Wang > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hao Wu > --- > MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c | 8 > ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c > b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c > index 27fcab19b6..481fea3f1f 100644 > --- > a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c > +++ > b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c > @@ -419,11 +419,11 @@ SmmFaultTolerantWriteHandler ( > ); > if (!EFI_ERROR (Status)) { > // > - // The AsmLfence() call here is to ensure the previous range/con= tent > - // checks for the CommBuffer have been completed before calling = into > - // FtwWrite(). > + // The SpeculationBarrier() call here is to ensure the previous > + // range/content checks for the CommBuffer have been completed b= efore > + // calling into FtwWrite(). > // > - AsmLfence (); > + SpeculationBarrier (); > Status =3D FtwWrite( > &mFtwDevice->FtwInstance, > SmmFtwWriteHeader->Lba, > -- > 2.12.0.windows.1