From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Liming Gao <liming.gao@intel.com>, Laszlo Ersek <lersek@redhat.com>
Subject: [Patch V3 1/8] MdePkg: Add PcdSpeculationBarrierType
Date: Tue, 30 Apr 2019 12:31:01 -0700 [thread overview]
Message-ID: <20190430193108.8544-2-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20190430193108.8544-1-michael.d.kinney@intel.com>
Add gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType that
uses the PCD type FixedAtBuild. This performs a build time
selection for the type of speculation barrier to use in the
BaseLib function SpeculationBarrier(). The recommended
speculation barrier for x86 is LFENCE and this is the default
value for this PCD. x86 CPUs that do not support LFENCE must
select one of the other supported values which includes CPUID
and nothing.
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---
MdePkg/MdePkg.dec | 9 +++++++++
MdePkg/MdePkg.uni | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index e2ea8fff66..28d4a966c2 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2062,6 +2062,15 @@ [PcdsFixedAtBuild]
# @Prompt Enable control flow enforcement.
gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask|0x0|UINT32|0x30001017
+ ## Indicates the type of instruction sequence to use for a speculation
+ # barrier. The default instruction sequence is LFENCE.<BR><BR>
+ # 0x00 - No operation.<BR>
+ # 0x01 - LFENCE (IA32/X64).<BR>
+ # 0x02 - CPUID (IA32/X64).<BR>
+ # Other - reserved
+ # @Prompt Speculation Barrier Type.
+ gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType|0x01|UINT8|0x30001018
+
[PcdsFixedAtBuild,PcdsPatchableInModule]
## Indicates the maximum length of unicode string used in the following
# BaseLib functions: StrLen(), StrSize(), StrCmp(), StrnCmp(), StrCpy(), StrnCpy()<BR><BR>
diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni
index c359bb4b5b..5c1fa24065 100644
--- a/MdePkg/MdePkg.uni
+++ b/MdePkg/MdePkg.uni
@@ -149,6 +149,14 @@
" BIT0 - SMM CET Shadow Stack is enabled.<BR>\n"
" Other - reserved"
+#string STR_gEfiMdePkgTokenSpaceGuid_PcdSpeculationBarrierType_PROMPT #language en-US "Speculation Barrier Type."
+
+#string STR_gEfiMdePkgTokenSpaceGuid_PcdSpeculationBarrierType_HELP #language en-US "Indicates the type of instruction sequence to use for a speculation.barrier. The default instruction sequence is LFENCE.<BR><BR>\n"
+ "0x00 - No operation.<BR>\n"
+ "0x01 - LFENCE (IA32/X64).<BR>\n"
+ "0x02 - CPUID (IA32/X64).<BR>\n"
+ "Other - reserved"
+
#string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_PROMPT #language en-US "Maximum Length of Ascii String"
#string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_HELP #language en-US "Sets the maximum number of ASCII characters used for string functions. This affects the following BaseLib functions: AsciiStrLen(), AsciiStrSize(), AsciiStrCmp(), AsciiStrnCmp(), AsciiStrCpy(), AsciiStrnCpy(). <BR><BR>\n"
--
2.21.0.windows.1
next prev parent reply other threads:[~2019-04-30 19:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 19:31 [Patch V3 0/8] Resolve Quark build and boot issues Michael D Kinney
2019-04-30 19:31 ` Michael D Kinney [this message]
2019-04-30 19:31 ` [Patch V3 2/8] MdePkg/BaseLib: Use PcdSpeculationBarrierType Michael D Kinney
2019-04-30 19:31 ` [Patch V3 3/8] QuarkPlatformPkg: Set PcdSpeculationBarrierType to CPUID Michael D Kinney
2019-04-30 21:25 ` [edk2-devel] " Kubacki, Michael A
2019-04-30 19:31 ` [Patch V3 4/8] UefiCpuPkg/MpInitLibUp: Add uniprocessor MpInitLib Michael D Kinney
2019-04-30 20:25 ` [edk2-devel] " Laszlo Ersek
2019-05-05 2:36 ` Ni, Ray
2019-04-30 19:31 ` [Patch V3 5/8] UefiCPuPkg/CpuMpPei: Add missing CpuLib class Michael D Kinney
2019-04-30 20:31 ` [edk2-devel] " Laszlo Ersek
2019-04-30 19:31 ` [Patch V3 6/8] QuarkPlatformPkg: Use uniprocessor MpInitLibUp Michael D Kinney
2019-04-30 21:31 ` [edk2-devel] " Kubacki, Michael A
2019-04-30 19:31 ` [Patch V3 7/8] QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close Michael D Kinney
2019-04-30 19:31 ` [Patch V3 8/8] QuarkPlatformPkg/PlatformInit: Resolve ResetSystemLib name collision Michael D Kinney
2019-05-05 5:23 ` [Patch V3 0/8] Resolve Quark build and boot issues Liming Gao
2019-05-08 14:49 ` Steele, Kelly
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=20190430193108.8544-2-michael.d.kinney@intel.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