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

Dong, Eric eric.dong at intel.com
Sun Dec 23 16:54:09 PST 2018


Reviewed-by: Eric Dong <eric.dong at intel.com>

> -----Original Message-----
> From: Wu, Hao A
> Sent: Friday, December 21, 2018 11:11 AM
> To: edk2-devel at lists.01.org
> Cc: Wu, Hao A <hao.a.wu at intel.com>; Ard Biesheuvel
> <ard.biesheuvel at linaro.org>; Yao, Jiewen <jiewen.yao at intel.com>; Gao,
> Liming <liming.gao at intel.com>; Dong, Eric <eric.dong at intel.com>; Ni, Ruiyu
> <ruiyu.ni at intel.com>; Laszlo Ersek <lersek at redhat.com>
> Subject: [PATCH v1 5/5] 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 <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