[edk2] [PATCH v1 3/5] MdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier

Wang, Jian J jian.j.wang at intel.com
Sun Dec 23 18:56:39 PST 2018



Reviewed-by: Jian J Wang <jian.j.wang 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>; Wang, Jian J <jian.j.wang at intel.com>
> Subject: [PATCH v1 3/5] MdeModulePkg/SmmLockBox: 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: Jian J Wang <jian.j.wang at intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu at intel.com>
> ---
>  MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c | 12 ++++++-
> -----
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
> b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
> index c1c9aa5663..a743129539 100644
> --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
> +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
> @@ -77,10 +77,10 @@ SmmLockBoxSave (
>      return ;
>    }
>    //
> -  // The AsmLfence() call here is to ensure the above range check for the
> -  // CommBuffer have been completed before calling into SaveLockBox().
> +  // The SpeculationBarrier() call here is to ensure the above range check for
> +  // the CommBuffer have been completed before calling into SaveLockBox().
>    //
> -  AsmLfence ();
> +  SpeculationBarrier ();
> 
>    //
>    // Save data
> @@ -166,10 +166,10 @@ SmmLockBoxUpdate (
>      return ;
>    }
>    //
> -  // The AsmLfence() call here is to ensure the above range check for the
> -  // CommBuffer have been completed before calling into UpdateLockBox().
> +  // The SpeculationBarrier() call here is to ensure the above range check for
> +  // the CommBuffer have been completed before calling into UpdateLockBox().
>    //
> -  AsmLfence ();
> +  SpeculationBarrier ();
> 
>    //
>    // Update data
> --
> 2.12.0.windows.1



More information about the edk2-devel mailing list