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: Jiewen Yao <jiewen.yao@intel.com>,
	Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>
Subject: [PATCH v2 1/4] MdeModulePkg/MdeModulePkg.dec: Add new PCDs and Guid
Date: Mon,  4 Dec 2017 16:35:53 +0800	[thread overview]
Message-ID: <20171204083556.19416-2-jian.j.wang@intel.com> (raw)
In-Reply-To: <20171204083556.19416-1-jian.j.wang@intel.com>

> v2:
>   newly added

PcdPageTablePoolUnitSize is used to specify the smallest size of memory pool
reserved for page table.

PcdPageTablePoolAlignment is used to specify the alignment of the memory pool
reserved for page table.

gPageTablePoolGuid is used to identify the memory pool used for page table.

These definitions are used to simplify the page table creation and protection.
They are also used to make sure that DxeIpl and CpuDxe driver are using the
same way to allocate page table memory.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 856d67aceb..075d51f807 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -392,6 +392,9 @@
   ## Include/Guid/PlatformHasAcpi.h
   gEdkiiPlatformHasAcpiGuid = { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04, 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } }
 
+  ## Include/Guid/PageTablePool.h
+  gPageTablePoolGuid = { 0x18347A49, 0xF48B, 0x4012, {0x67, 0x1D, 0x70, 0x23, 0x76, 0x5C, 0x92, 0xAD} }
+
 [Ppis]
   ## Include/Ppi/AtaController.h
   gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
@@ -949,6 +952,31 @@
   # @Prompt The Heap Guard feature mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask|0x0|UINT8|0x30001054
 
+  ## Specifiy the size in byte of memory unit allocated for page table.
+  #
+  #  This PCD is used for reserving certain amount of pages for page table
+  #  initialization. If pages reserved at last time are used up, another amount
+  #  of memory specified by this PCD will be allocated again, until all page
+  #  tables are initialized.
+  #
+  #  It's designed to reduce the recursive "split" action from larger
+  #  granularity to smaller one, and simplify the page table protection. Its
+  #  value must be the same as one of page sizes supported by the processor and
+  #  should be larger than the size of one page table.
+  #
+  # @Prompt Size of memory unit allocated for page table.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPageTablePoolUnitSize|0x200000|UINT32|0x30001060
+
+  ## Specifiy the alignment of page table pool.
+  #
+  #  This PCD is used for reserving page table pool at desired alignment boundary.
+  #  It's designed to reduce the recursive "split" action from larger granularity
+  #  to smaller one, and simplify the page table protection. Its value should
+  #  not be less than PcdPageTablePoolUnitSize for IA32 processor.
+  #
+  # @Prompt Alignment of page pool memory unit.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPageTablePoolAlignment|0x200000|UINT32|0x30001061
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting action.
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
-- 
2.14.1.windows.1



  reply	other threads:[~2017-12-04  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04  8:35 [PATCH v2 0/4] Enable page table write protection Jian J Wang
2017-12-04  8:35 ` Jian J Wang [this message]
2017-12-04  8:35 ` [PATCH v2 2/4] MdeModulePkg/PageTablePool.h: Page table pool GUID definition file Jian J Wang
2017-12-04  8:35 ` [PATCH v2 3/4] MdeModulePkg/DxeIpl: Mark page table as read-only Jian J Wang
2017-12-04  8:35 ` [PATCH v2 4/4] UefiCpuPkg/CpuDxe: Enable protection for newly added page table Jian J Wang
2017-12-04  9:11 ` [PATCH v2 0/4] Enable page table write protection Zeng, Star
2017-12-04  9:26   ` Wang, Jian J
2017-12-05  2:26     ` Yao, Jiewen
2017-12-05  6:26       ` Wang, Jian J
2017-12-05  2:31 ` Yao, Jiewen
2017-12-05  6:41   ` 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=20171204083556.19416-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