]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier
authorHao Wu <hao.a.wu@intel.com>
Fri, 21 Dec 2018 02:22:10 +0000 (10:22 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 25 Dec 2018 01:15:57 +0000 (09:15 +0800)
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 <ard.biesheuvel@linaro.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c

index 27fcab19b62bce0304012772aaa1c69f8b30598d..481fea3f1fdfc953c4d4ae478e848744e1dd682a 100644 (file)
@@ -419,11 +419,11 @@ SmmFaultTolerantWriteHandler (
                  );\r
       if (!EFI_ERROR (Status)) {\r
         //\r
-        // The AsmLfence() call here is to ensure the previous range/content\r
-        // checks for the CommBuffer have been completed before calling into\r
-        // FtwWrite().\r
+        // The SpeculationBarrier() call here is to ensure the previous\r
+        // range/content checks for the CommBuffer have been completed before\r
+        // calling into FtwWrite().\r
         //\r
-        AsmLfence ();\r
+        SpeculationBarrier ();\r
         Status = FtwWrite(\r
                    &mFtwDevice->FtwInstance,\r
                    SmmFtwWriteHeader->Lba,\r