]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier
authorHao Wu <hao.a.wu@intel.com>
Fri, 21 Dec 2018 02:29:29 +0000 (10:29 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 25 Dec 2018 01:16:04 +0000 (09:16 +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/LockBox/SmmLockBox/SmmLockBox.c

index c1c9aa5663b3e65a6f9a1fb8146bb23b90625df3..a743129539b1affed3b959f6371b505579c4dce8 100644 (file)
@@ -77,10 +77,10 @@ SmmLockBoxSave (
     return ;\r
   }\r
   //\r
-  // The AsmLfence() call here is to ensure the above range check for the\r
-  // CommBuffer have been completed before calling into SaveLockBox().\r
+  // The SpeculationBarrier() call here is to ensure the above range check for\r
+  // the CommBuffer have been completed before calling into SaveLockBox().\r
   //\r
-  AsmLfence ();\r
+  SpeculationBarrier ();\r
 \r
   //\r
   // Save data\r
@@ -166,10 +166,10 @@ SmmLockBoxUpdate (
     return ;\r
   }\r
   //\r
-  // The AsmLfence() call here is to ensure the above range check for the\r
-  // CommBuffer have been completed before calling into UpdateLockBox().\r
+  // The SpeculationBarrier() call here is to ensure the above range check for\r
+  // the CommBuffer have been completed before calling into UpdateLockBox().\r
   //\r
-  AsmLfence ();\r
+  SpeculationBarrier ();\r
 \r
   //\r
   // Update data\r