From b70ec0de46d052d2debf0c8e2159addf9628604f Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Fri, 21 Dec 2018 10:34:20 +0800 Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: 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 Cc: Ruiyu Ni Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Eric Dong --- 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