On Fri, 21 Dec 2018 at 04:11, Hao Wu <[email protected]> wrote:
>
> X86 specific BaseLib API AsmLfence() was introduced to address the Spectre
> Variant 1 (CVE-2017-5753) issue. The purpose of this API is to insert
> barriers to stop speculative execution. However, the API is highly
> architecture (X86) specific, and thus should be avoided using across
> generic code.
>
> To address this issue, this series will add a new BaseLib API called
> SpeculationBarrier(). Different architectures will have different
> implementations for this API. And the series will replace the usage of
> AsmLfence() in generic codes with this newly added SpeculationBarrier().
>
> For the implementations of API SpeculationBarrier() among different
> architectures, this series will:
>
> * For IA32 and x64, SpeculationBarrier() will directly call AsmLfence().
> * For ARM and EBC architectures, an empty implementation is temporarily
> added as a placeholder. We hope experts in those domains can help to
> contribute the actual implementation.
>
> Cc: Ard Biesheuvel <[email protected]>
> Cc: Leif Lindholm <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Michael D Kinney <[email protected]>
> Cc: Jiewen Yao <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> Cc: Jian J Wang <[email protected]>
> Cc: Star Zeng <[email protected]>
> Cc: Eric Dong <[email protected]>
> Cc: Ruiyu Ni <[email protected]>
>
> Hao Wu (5):
> MdePkg/BaseLib: Introduce new SpeculationBarrier API
> MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier
> MdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier
> MdeModulePkg/Variable: Update to consume SpeculationBarrier
> UefiCpuPkg/PiSmmCpuDxeSmm: Update to consume SpeculationBarrier
>
Thanks Hao, this looks fine to me.
We've raised this with people in ARM, so we'll try and contribute the
missing pieces as soon as we can. In the mean time, please go ahead
and merge this as is.
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> | 2 +-
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> | 2 +-
> MdePkg/Library/BaseLib/BaseLib.inf
> | 5 +++
> MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
> | 10 +++---
> MdePkg/Include/Library/BaseLib.h
> | 15 +++++++++
> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
> | 8 ++---
> MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c
> | 12 ++++----
> MdeModulePkg/Universal/Variable/RuntimeDxe/{LoadFenceDxe.c =>
> SpeculationBarrierDxe.c} | 12 +++++---
> MdeModulePkg/Universal/Variable/RuntimeDxe/{LoadFenceSmm.c =>
> SpeculationBarrierSmm.c} | 14 +++++----
> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> | 6 ++--
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
> | 24 +++++++--------
> MdePkg/Library/BaseLib/Arm/SpeculationBarrier.c
> | 30 ++++++++++++++++++
> MdePkg/Library/BaseLib/Ebc/SpeculationBarrier.c
> | 30 ++++++++++++++++++
> MdePkg/Library/BaseLib/X86SpeculationBarrier.c
> | 32 ++++++++++++++++++++
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> | 6 ++--
> 15 files changed, 163 insertions(+), 45 deletions(-)
> rename MdeModulePkg/Universal/Variable/RuntimeDxe/{LoadFenceDxe.c =>
> SpeculationBarrierDxe.c} (62%)
> rename MdeModulePkg/Universal/Variable/RuntimeDxe/{LoadFenceSmm.c =>
> SpeculationBarrierSmm.c} (61%)
> create mode 100644 MdePkg/Library/BaseLib/Arm/SpeculationBarrier.c
> create mode 100644 MdePkg/Library/BaseLib/Ebc/SpeculationBarrier.c
> create mode 100644 MdePkg/Library/BaseLib/X86SpeculationBarrier.c
>
> --
> 2.12.0.windows.1
>
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel