Reviewed-by: Eric Dong <[email protected]>

> -----Original Message-----
> From: Wu, Hao A
> Sent: Friday, December 21, 2018 11:11 AM
> To: [email protected]
> Cc: Wu, Hao A <[email protected]>; Ard Biesheuvel
> <[email protected]>; Yao, Jiewen <[email protected]>; Gao,
> Liming <[email protected]>; Dong, Eric <[email protected]>; Ni, Ruiyu
> <[email protected]>; Laszlo Ersek <[email protected]>
> 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 <[email protected]>
> Cc: Jiewen Yao <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Eric Dong <[email protected]>
> Cc: Ruiyu Ni <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <[email protected]>
> ---
>  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

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to