]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add PcdSpeculationBarrierType
authorMichael D Kinney <michael.d.kinney@intel.com>
Mon, 29 Apr 2019 23:17:20 +0000 (16:17 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Tue, 30 Apr 2019 23:39:09 +0000 (16:39 -0700)
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>
Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
MdePkg/MdePkg.dec
MdePkg/MdePkg.uni

index e2ea8fff669953aa399fc4cdbd5ccf256c66ed13..28d4a966c27ce51719c99385eafd7ce7f144afef 100644 (file)
   # @Prompt Enable control flow enforcement.\r
   gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask|0x0|UINT32|0x30001017\r
 \r
+  ## Indicates the type of instruction sequence to use for a speculation\r
+  #  barrier.  The default instruction sequence is LFENCE.<BR><BR>\r
+  #   0x00 - No operation.<BR>\r
+  #   0x01 - LFENCE (IA32/X64).<BR>\r
+  #   0x02 - CPUID  (IA32/X64).<BR>\r
+  #   Other - reserved\r
+  # @Prompt Speculation Barrier Type.\r
+  gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType|0x01|UINT8|0x30001018\r
+\r
 [PcdsFixedAtBuild,PcdsPatchableInModule]\r
   ## Indicates the maximum length of unicode string used in the following\r
   #  BaseLib functions: StrLen(), StrSize(), StrCmp(), StrnCmp(), StrCpy(), StrnCpy()<BR><BR>\r
index c359bb4b5b8dcc3b36e929ff232ef9d20883f3fc..5c1fa24065c763eafb34fcb2ddcc357110f91029 100644 (file)
                                                                                                   " BIT0 - SMM CET Shadow Stack is enabled.<BR>\n"\r
                                                                                                   " Other - reserved"\r
 \r
+#string STR_gEfiMdePkgTokenSpaceGuid_PcdSpeculationBarrierType_PROMPT  #language en-US "Speculation Barrier Type."\r
+\r
+#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"\r
+                                                                                      "0x00 - No operation.<BR>\n"\r
+                                                                                      "0x01 - LFENCE (IA32/X64).<BR>\n"\r
+                                                                                      "0x02 - CPUID  (IA32/X64).<BR>\n"\r
+                                                                                      "Other - reserved"\r
+\r
 #string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_PROMPT  #language en-US "Maximum Length of Ascii String"\r
 \r
 #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"\r