From nobody Mon Feb 9 07:04:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39805+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39805+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556587816; cv=none; d=zoho.com; s=zohoarc; b=gzw0dLdEciaQkcWoPVSj6MIs5UR6tM2/1grE5CRc+AkKIQh9kBA3g4FF828naWbh/MPCivKhAopBzMF8A1qi2294iId9wdeTiVrC0Ub/Z4SBdcsTTuU/WdjMdQWRx5Q4hPjEENlynomkXv+PIKDl7b7mryhpNP3W1N6dBxx/BmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556587816; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=BqmN7FS9KB5/o6SMnOmBounPh0Hzem2z7MxLnuFPAlM=; b=DK2BZH8QmjieRu46uX+S4UoFm0DVLVrjzAQt4f68kADyA7BJ5Jhkte6s4iKpe+D9yrVq1TiGK5PmA2f+lHszdjPdTCp5lVnUKGtVN3V/vFluL4lP7KXFSqeX30tS1L1I29Uq/gHSJ1K/0Imyx5YV82oH7V1IEljr6w6zjiKCDlw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39805+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 155658781646274.35422823370459; Mon, 29 Apr 2019 18:30:16 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Mon, 29 Apr 2019 18:30:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 18:30:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,411,1549958400"; d="scan'208";a="139954329" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.111.157]) by orsmga006.jf.intel.com with ESMTP; 29 Apr 2019 18:30:14 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao Subject: [edk2-devel] [Patch V2 1/6] MdePkg: Add PcdSpeculationBarrierType Date: Mon, 29 Apr 2019 18:30:07 -0700 Message-Id: <20190430013012.24008-2-michael.d.kinney@intel.com> In-Reply-To: <20190430013012.24008-1-michael.d.kinney@intel.com> References: <20190430013012.24008-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556587816; bh=d0Q8TqK/+q0owxr983pVQf9MnVwXagRQJnK5ayoIj84=; h=Cc:Date:From:Reply-To:Subject:To; b=Mrzg93YJC2QFrwe7cMVT2mjEr3Szchev3apZxV5eH8MCJD+5q4zdkHqIEPrH2VfhjT3 ja01/m2cq7m5yg5tpTg0koCNb4GC3zfYFatLLuPIO8K8u1OTrCpI+ZmJ7jMvYXXtoUmDb DUpUboRHlyRhCsISQ4YkW+xmNArrOtUl8x4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Michael D Kinney Reviewed-by: Laszlo Ersek --- 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|UINT3= 2|0x30001017 =20 + ## Indicates the type of instruction sequence to use for a speculation + # barrier. The default instruction sequence is LFENCE.

+ # 0x00 - No operation.
+ # 0x01 - LFENCE (IA32/X64).
+ # 0x02 - CPUID (IA32/X64).
+ # 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()

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.
\n" = " Other - reserved" =20 +#string STR_gEfiMdePkgTokenSpaceGuid_PcdSpeculationBarrierType_PROMPT #la= nguage en-US "Speculation Barrier Type." + +#string STR_gEfiMdePkgTokenSpaceGuid_PcdSpeculationBarrierType_HELP #lang= uage en-US "Indicates the type of instruction sequence to use for a specul= ation.barrier. The default instruction sequence is LFENCE.

\n" + = "0x00 - No operation.
\n" + = "0x01 - LFENCE (IA32/X64).
\n" + = "0x02 - CPUID (IA32/X64).
\n" + = "Other - reserved" + #string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_PROMPT #= language en-US "Maximum Length of Ascii String" =20 #string STR_gEfiMdePkgTokenSpaceGuid_PcdMaximumAsciiStringLength_HELP #la= nguage en-US "Sets the maximum number of ASCII characters used for string f= unctions. This affects the following BaseLib functions: AsciiStrLen(), Asc= iiStrSize(), AsciiStrCmp(), AsciiStrnCmp(), AsciiStrCpy(), AsciiStrnCpy(). =

\n" --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39805): https://edk2.groups.io/g/devel/message/39805 Mute This Topic: https://groups.io/mt/31415900/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-