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: Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH v4 1/7] MdeModulePkg/MdeModulePkg.dec, .uni: Add Protocol, PCDs and string tokens
Date: Fri, 27 Oct 2017 14:11:34 +0800	[thread overview]
Message-ID: <20171027061140.17160-2-jian.j.wang@intel.com> (raw)
In-Reply-To: <20171027061140.17160-1-jian.j.wang@intel.com>

>v4:
> No content change but move this patch to be the first one

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.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>
---
 MdeModulePkg/MdeModulePkg.dec | 60 +++++++++++++++++++++++++++++++++++++++++++
 MdeModulePkg/MdeModulePkg.uni | 58 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 20a07be96e..90db14d2d9 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -559,6 +559,9 @@
   ## Include/Protocol/SmmEndofS3Resume.h
   gEdkiiSmmEndOfS3ResumeProtocolGuid = { 0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } }
 
+  ## Include/Protocol/SmmMemoryAttribute.h
+  gEdkiiSmmMemoryAttributeProtocolGuid = { 0x69b792ea, 0x39ce, 0x402d, { 0xa2, 0xa6, 0xf7, 0x21, 0xde, 0x35, 0x1d, 0xfe } }
+
 #
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]
 #   0x80000001 | Invalid value provided.
@@ -883,6 +886,63 @@
   # @Prompt Enable NULL address detection.
   gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|0x0|UINT8|0x30001050
 
+  ## Indicates which type allocation need guard page.
+  # Below is bit mask for this PCD: (Order is same as UEFI spec)<BR>
+  #  EfiReservedMemoryType             0x0000000000000001<BR>
+  #  EfiLoaderCode                     0x0000000000000002<BR>
+  #  EfiLoaderData                     0x0000000000000004<BR>
+  #  EfiBootServicesCode               0x0000000000000008<BR>
+  #  EfiBootServicesData               0x0000000000000010<BR>
+  #  EfiRuntimeServicesCode            0x0000000000000020<BR>
+  #  EfiRuntimeServicesData            0x0000000000000040<BR>
+  #  EfiConventionalMemory             0x0000000000000080<BR>
+  #  EfiUnusableMemory                 0x0000000000000100<BR>
+  #  EfiACPIReclaimMemory              0x0000000000000200<BR>
+  #  EfiACPIMemoryNVS                  0x0000000000000400<BR>
+  #  EfiMemoryMappedIO                 0x0000000000000800<BR>
+  #  EfiMemoryMappedIOPortSpace        0x0000000000001000<BR>
+  #  EfiPalCode                        0x0000000000002000<BR>
+  #  EfiPersistentMemory               0x0000000000004000<BR>
+  #  OEM Reserved                      0x4000000000000000<BR>
+  #  OS Reserved                       0x8000000000000000<BR>
+  # e.g. LoaderCode+LoaderData+BootServicesCode+BootServicesData are needed, 0x1E should be used.<BR>
+  # @Prompt The memory type mask for Page Guard.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPageType|0x0|UINT64|0x30001051
+
+  ## Indicates which type allocation need guard page.
+  # Below is bit mask for this PCD: (Order is same as UEFI spec)<BR>
+  #  EfiReservedMemoryType             0x0000000000000001<BR>
+  #  EfiLoaderCode                     0x0000000000000002<BR>
+  #  EfiLoaderData                     0x0000000000000004<BR>
+  #  EfiBootServicesCode               0x0000000000000008<BR>
+  #  EfiBootServicesData               0x0000000000000010<BR>
+  #  EfiRuntimeServicesCode            0x0000000000000020<BR>
+  #  EfiRuntimeServicesData            0x0000000000000040<BR>
+  #  EfiConventionalMemory             0x0000000000000080<BR>
+  #  EfiUnusableMemory                 0x0000000000000100<BR>
+  #  EfiACPIReclaimMemory              0x0000000000000200<BR>
+  #  EfiACPIMemoryNVS                  0x0000000000000400<BR>
+  #  EfiMemoryMappedIO                 0x0000000000000800<BR>
+  #  EfiMemoryMappedIOPortSpace        0x0000000000001000<BR>
+  #  EfiPalCode                        0x0000000000002000<BR>
+  #  EfiPersistentMemory               0x0000000000004000<BR>
+  #  OEM Reserved                      0x4000000000000000<BR>
+  #  OS Reserved                       0x8000000000000000<BR>
+  # e.g. LoaderCode+LoaderData+BootServicesCode+BootServicesData are needed, 0x1E should be used.<BR>
+  # @Prompt The memory type mask for Pool Guard.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPoolType|0x0|UINT64|0x30001052
+
+  ## This mask is to control Heap Guard behavior.
+  #   BIT0 - Enable UEFI page guard.<BR>
+  #   BIT1 - Enable UEFI pool guard.<BR>
+  #   BIT2 - Enable SMM page guard.<BR>
+  #   BIT3 - Enable SMM pool guard.<BR>
+  #   BIT7 - The direction of Guard Page for Pool Guard.
+  #          0 - The returned pool is adjacent to the bottom guard page.<BR>
+  #          1 - The returned pool is adjacent to the top guard page.<BR>
+  # @Prompt The Heap Guard feature mask
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask|0x0|UINT8|0x30001053
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting action.
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index f8b31694ba..376c5e9c74 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1140,3 +1140,61 @@
                                                                                                        " exception caused by legacy memory (0-4095) access after EndOfDxe,"
                                                                                                        " such as Windows 7 boot on Qemu.\n"
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPageType_PROMPT  #language en-US "The memory type mask for Page Guard"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPageType_HELP    #language en-US "Indicates which type allocation need guard page.\n"
+                                                                                        " Below is bit mask for this PCD: (Order is same as UEFI spec)<BR>\n"
+                                                                                        "  EfiReservedMemoryType             0x0000000000000001\n"
+                                                                                        "  EfiLoaderCode                     0x0000000000000002\n"
+                                                                                        "  EfiLoaderData                     0x0000000000000004\n"
+                                                                                        "  EfiBootServicesCode               0x0000000000000008\n"
+                                                                                        "  EfiBootServicesData               0x0000000000000010\n"
+                                                                                        "  EfiRuntimeServicesCode            0x0000000000000020\n"
+                                                                                        "  EfiRuntimeServicesData            0x0000000000000040\n"
+                                                                                        "  EfiConventionalMemory             0x0000000000000080\n"
+                                                                                        "  EfiUnusableMemory                 0x0000000000000100\n"
+                                                                                        "  EfiACPIReclaimMemory              0x0000000000000200\n"
+                                                                                        "  EfiACPIMemoryNVS                  0x0000000000000400\n"
+                                                                                        "  EfiMemoryMappedIO                 0x0000000000000800\n"
+                                                                                        "  EfiMemoryMappedIOPortSpace        0x0000000000001000\n"
+                                                                                        "  EfiPalCode                        0x0000000000002000\n"
+                                                                                        "  EfiPersistentMemory               0x0000000000004000\n"
+                                                                                        "  OEM Reserved                      0x4000000000000000\n"
+                                                                                        "  OS Reserved                       0x8000000000000000\n"
+                                                                                        " e.g. LoaderCode+LoaderData+BootServicesCode+BootServicesData are needed, 0x1E should be used.<BR>"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPoolType_PROMPT  #language en-US "The memory type mask for Pool Guard"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPoolType_HELP    #language en-US "Indicates which type allocation need guard page.\n"
+                                                                                        " Below is bit mask for this PCD: (Order is same as UEFI spec)<BR>\n"
+                                                                                        "  EfiReservedMemoryType             0x0000000000000001\n"
+                                                                                        "  EfiLoaderCode                     0x0000000000000002\n"
+                                                                                        "  EfiLoaderData                     0x0000000000000004\n"
+                                                                                        "  EfiBootServicesCode               0x0000000000000008\n"
+                                                                                        "  EfiBootServicesData               0x0000000000000010\n"
+                                                                                        "  EfiRuntimeServicesCode            0x0000000000000020\n"
+                                                                                        "  EfiRuntimeServicesData            0x0000000000000040\n"
+                                                                                        "  EfiConventionalMemory             0x0000000000000080\n"
+                                                                                        "  EfiUnusableMemory                 0x0000000000000100\n"
+                                                                                        "  EfiACPIReclaimMemory              0x0000000000000200\n"
+                                                                                        "  EfiACPIMemoryNVS                  0x0000000000000400\n"
+                                                                                        "  EfiMemoryMappedIO                 0x0000000000000800\n"
+                                                                                        "  EfiMemoryMappedIOPortSpace        0x0000000000001000\n"
+                                                                                        "  EfiPalCode                        0x0000000000002000\n"
+                                                                                        "  EfiPersistentMemory               0x0000000000004000\n"
+                                                                                        "  OEM Reserved                      0x4000000000000000\n"
+                                                                                        "  OS Reserved                       0x8000000000000000\n"
+                                                                                        " e.g. LoaderCode+LoaderData+BootServicesCode+BootServicesData are needed, 0x1E should be used.<BR>"
+
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPropertyMask_PROMPT  #language en-US "The Heap Guard feature mask"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHeapGuardPropertyMask_HELP    #language en-US "This mask is to control Heap Guard behavior.\n"
+                                                                                            "   BIT0 - Enable UEFI page guard.<BR>\n"
+                                                                                            "   BIT1 - Enable UEFI pool guard.<BR>\n"
+                                                                                            "   BIT2 - Enable SMM page guard.<BR>\n"
+                                                                                            "   BIT3 - Enable SMM pool guard.<BR>\n"
+                                                                                            "   BIT7 - The direction of Guard Page for Pool Guard.\n"
+                                                                                            "          0 - The returned pool is adjacent to the bottom guard page.<BR>\n"
+                                                                                            "          1 - The returned pool is adjacent to the top guard page.<BR>"
+
-- 
2.14.1.windows.1



  reply	other threads:[~2017-10-27  6:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  6:11 [PATCH v4 0/7] Implement heap guard feature Jian J Wang
2017-10-27  6:11 ` Jian J Wang [this message]
2017-10-27  6:11 ` [PATCH v4 2/7] MdeModulePkg/SmmMemoryAttribute.h: Add new protocol definitions Jian J Wang
2017-11-09  5:12   ` Zeng, Star
2017-11-09  5:54     ` Wang, Jian J
2017-10-27  6:11 ` [PATCH v4 3/7] UefiCpuPkg/CpuDxe: Reduce debug message Jian J Wang
2017-10-27  6:11 ` [PATCH v4 4/7] MdeModulePkg/DxeIpl: Enable paging for heap guard Jian J Wang
2017-10-27  6:11 ` [PATCH v4 5/7] MdeModulePkg/DxeCore: Implement heap guard feature for UEFI Jian J Wang
2017-10-27  6:11 ` [PATCH v4 6/7] UefiCpuPkg/PiSmmCpuDxeSmm: Add SmmMemoryAttribute protocol Jian J Wang
2017-10-27  6:11 ` [PATCH v4 7/7] MdeModulePkg/PiSmmCore: Implement heap guard feature for SMM mode Jian J Wang
2017-10-27 17:22 ` [PATCH v4 0/7] Implement heap guard feature Laszlo Ersek
2017-11-09  1:59 ` Wang, Jian J
2017-11-09  2:53   ` Yao, Jiewen
2017-11-09  3:14     ` Wang, Jian J

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=20171027061140.17160-2-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