[edk2] [PATCH v1 5/5] UefiCpuPkg/PiSmmCpuDxeSmm: Update to consume SpeculationBarrier

Hao Wu hao.a.wu at intel.com
Thu Dec 20 19:11:06 PST 2018


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 at linaro.org>
Cc: Jiewen Yao <jiewen.yao at intel.com>
Cc: Liming Gao <liming.gao at intel.com>
Cc: Eric Dong <eric.dong at intel.com>
Cc: Ruiyu Ni <ruiyu.ni at intel.com>
Cc: Laszlo Ersek <lersek at redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu at intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
index 19979d5418..8c9fa14b5b 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
@@ -238,10 +238,10 @@ SmmReadSaveState (
     return EFI_INVALID_PARAMETER;
   }
   //
-  // The AsmLfence() call here is to ensure the above check for the CpuIndex
-  // has been completed before the execution of subsequent codes.
+  // The SpeculationBarrier() call here is to ensure the above check for the
+  // CpuIndex has been completed before the execution of subsequent codes.
   //
-  AsmLfence ();
+  SpeculationBarrier ();
 
   //
   // Check for special EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID
-- 
2.12.0.windows.1



More information about the edk2-devel mailing list