From: Hao Wu Date: Fri, 21 Dec 2018 02:22:10 +0000 (+0800) Subject: MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier X-Git-Tag: edk2-stable201903~430 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=0e8c5d8b3b8dcc58491b6274b8841ff495da9da7 MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1417 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(). Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Jian J Wang --- 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/content - // 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 before + // calling into FtwWrite(). // - AsmLfence (); + SpeculationBarrier (); Status = FtwWrite( &mFtwDevice->FtwInstance, SmmFtwWriteHeader->Lba,