public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jian J Wang <jian.j.wang@intel.com>
To: edk2-devel@lists.01.org
Cc: Eric Dong <eric.dong@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH v2 5/8] UefiCpuPkg/UefiCpuPkg.dec: Add two new PCDs for stack switch
Date: Wed, 22 Nov 2017 16:45:45 +0800	[thread overview]
Message-ID: <20171122084548.6564-6-jian.j.wang@intel.com> (raw)
In-Reply-To: <20171122084548.6564-1-jian.j.wang@intel.com>

> v2:
>    Add two new PCDs to configure exception stack switch.

Stack switch is required by Stack Guard feature. Following two PCDs are
introduced to simplify the resource allocation for initializing stack switch.

  gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList
  gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize

PcdCpuStackSwitchExceptionList is used to specify which exception will
have separate stack for its handler. For Stack Guard feature, #PF must
be specified at least.

PcdCpuKnownGoodStackSize is used to specify the size of good stack for an
exception handler. Cpu driver or other drivers should use this PCD to reserve
stack memory for exceptions specified above PCD.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/UefiCpuPkg.dec | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 3bd8740c98..b87e20fb38 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -144,6 +144,18 @@
   # @Prompt Lock SMM Feature Control MSR.
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmFeatureControlMsrLock|TRUE|BOOLEAN|0x3213210B
 
+[PcdsFixedAtBuild]
+  ## List of exception vectors which need switching stack.
+  #  This PCD will only take into effect if PcdCpuStackGuard is enabled.
+  #  By default exception #DD(8), #PF(14) are supported.
+  # @Prompt Specify exception vectors which need switching stack.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList|{0x08, 0x0E}|VOID*|0x30002000
+
+  ## Size of good stack for an exception.
+  #  This PCD will only take into effect if PcdCpuStackGuard is enabled.
+  # @Prompt Specify size of good stack of exception which need switching stack.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize|2048|UINT32|0x30002001
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## This value is the CPU Local APIC base address, which aligns the address on a 4-KByte boundary.
   # @Prompt Configure base address of CPU Local APIC
-- 
2.14.1.windows.1



  parent reply	other threads:[~2017-11-22  8:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  8:45 [PATCH v2 0/8] Implement stack guard feature Jian J Wang
2017-11-22  8:45 ` [PATCH v2 1/8] MdeModulePkg/metafile: Add PCD PcdCpuStackGuard Jian J Wang
2017-11-22  8:45 ` [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API Jian J Wang
2017-11-23  4:07   ` Yao, Jiewen
2017-11-23  5:06     ` Wang, Jian J
2017-11-25 13:17       ` 答复: " Fan Jeff
2017-11-27  2:20         ` Wang, Jian J
2017-11-22  8:45 ` [PATCH v2 3/8] MdePkg/BaseLib: Add stack switch related definitions for IA32 Jian J Wang
2017-11-22  8:45 ` [PATCH v2 4/8] MdeModulePkg/DxeIpl: Enable paging for Stack Guard Jian J Wang
2017-11-22  8:45 ` Jian J Wang [this message]
2017-11-22  8:45 ` [PATCH v2 6/8] UefiCpuPkg/MpLib: Add GDTR, IDTR and TR in saved AP data Jian J Wang
2017-11-22  8:45 ` [PATCH v2 7/8] UefiCpuPkg/CpuExceptionHandlerLib: Add stack switch support Jian J Wang
2017-11-23  5:50   ` Yao, Jiewen
2017-11-23  5:59     ` Yao, Jiewen
2017-11-23  6:09       ` Wang, Jian J
2017-11-23  6:25         ` Yao, Jiewen
2017-11-23  7:54           ` Wang, Jian J
2017-11-23  6:05     ` Wang, Jian J
2017-11-23  6:16       ` Yao, Jiewen
2017-11-23  6:43         ` Wang, Jian J
2017-11-25 13:27           ` 答复: " Fan Jeff
2017-11-27  2:21             ` Wang, Jian J
2017-11-28  1:38           ` Wang, Jian J
2017-11-28  2:06             ` Yao, Jiewen
2017-11-25 13:35   ` 答复: " Fan Jeff
2017-11-22  8:45 ` [PATCH v2 8/8] UefiCpuPkg/CpuDxe: Initialize stack switch for MP Jian J Wang
2017-11-23  4:13   ` Yao, Jiewen
2017-11-23  5:03     ` Wang, Jian J
2017-11-23  5:19       ` Wang, Jian J
2017-11-23  5:39         ` Yao, Jiewen
2017-11-23  3:47 ` [PATCH v2 0/8] Implement stack guard feature Yao, Jiewen
2017-11-23  5:09   ` Wang, Jian J
2017-11-23  5:40     ` Yao, Jiewen
2017-11-25 13:44       ` 答复: " Fan Jeff
2017-11-25 13:55         ` Yao, Jiewen

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=20171122084548.6564-6-jian.j.wang@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