From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Hao Wu <hao.a.wu@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
Leif Lindholm <leif.lindholm@linaro.org>,
Liming Gao <liming.gao@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
Jian J Wang <jian.j.wang@intel.com>,
Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>,
Ruiyu Ni <ruiyu.ni@intel.com>
Subject: Re: [PATCH v1 0/5] Ues arch-generic API SpeculationBarrier() to replace AsmLfence()
Date: Fri, 21 Dec 2018 12:22:08 +0100 [thread overview]
Message-ID: <CAKv+Gu_9StCnh4QvJ2+3pZ80GJWyANq0gR4fxTA5_ePCWbnGiw@mail.gmail.com> (raw)
In-Reply-To: <20181221031106.12960-1-hao.a.wu@intel.com>
On Fri, 21 Dec 2018 at 04:11, Hao Wu <hao.a.wu@intel.com> 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 <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>
> 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
>
prev parent reply other threads:[~2018-12-21 11:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-21 3:11 [PATCH v1 0/5] Ues arch-generic API SpeculationBarrier() to replace AsmLfence() Hao Wu
2018-12-21 3:11 ` [PATCH v1 1/5] MdePkg/BaseLib: Introduce new SpeculationBarrier API Hao Wu
2018-12-24 3:15 ` Gao, Liming
2018-12-21 3:11 ` [PATCH v1 2/5] MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier Hao Wu
2018-12-24 2:56 ` Wang, Jian J
2018-12-21 3:11 ` [PATCH v1 3/5] MdeModulePkg/SmmLockBox: " Hao Wu
2018-12-24 2:56 ` Wang, Jian J
2018-12-21 3:11 ` [PATCH v1 4/5] MdeModulePkg/Variable: " Hao Wu
2018-12-24 2:59 ` Wang, Jian J
2018-12-21 3:11 ` [PATCH v1 5/5] UefiCpuPkg/PiSmmCpuDxeSmm: " Hao Wu
2018-12-24 0:54 ` Dong, Eric
2018-12-21 11:22 ` Ard Biesheuvel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKv+Gu_9StCnh4QvJ2+3pZ80GJWyANq0gR4fxTA5_ePCWbnGiw@mail.gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox