From 28b020b5de1e1bee4a44e2536f71fc96c781863c Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Sun, 23 Oct 2016 23:21:20 +0800 Subject: [PATCH] UefiCpuPkg/dec: Add PcdCpuSmmStaticPageTable. If enabled, SMM will not use on-demand paging. SMM will build static page table for all memory. The page table size depend on 2 things: 1) The 1G paging capability. 2) The whole system memory/MMIO addressing capability. A) If the system only supports 2M paging, When the whole memory/MMIO is 32bit, we only need 1+1+4=6 pages for 4G. When the whole memory/MMIO is 39bit, we need 1+1+256 pages (~ 1M) When the whole memory/MMIO is 48bit, we need 1+256+256*256 pages (~ 257M) B) If the system supports 1G paging. When the whole memory/MMIO is 32bit, we only need 1+1+4=6 pages for 4G. (We still generate 2M page for maintenance consideration.) When the whole memory/MMIO is 39bit, we still need 6 pages. (We setup 1G paging for >1G.) When the whole memory/MMIO is 48bit, we need 1+256 pages (~ 1M). Cc: Jeff Fan Cc: Feng Tian Cc: Star Zeng Cc: Michael D Kinney Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Tested-by: Laszlo Ersek Reviewed-by: Jeff Fan Reviewed-by: Michael D Kinney --- UefiCpuPkg/UefiCpuPkg.dec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 542704be70..89779c447d 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -206,6 +206,14 @@ # @Prompt The specified AP target C-state for Mwait. gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0|UINT8|0x00000007 + ## Indicates if SMM uses static page table. + # If enabled, SMM will not use on-demand paging. SMM will build static page table for all memory.

+ # This flag only impacts X64 build, because SMM alway builds static page table for IA32. + # TRUE - SMM uses static page table for all memory.
+ # FALSE - SMM uses static page table for below 4G memory and use on-demand paging for above 4G memory.
+ # @Prompt Use static page table for all memory in SMM. + gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStaticPageTable|TRUE|BOOLEAN|0x3213210D + [PcdsDynamic, PcdsDynamicEx] ## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA. # @Prompt The pointer to a CPU S3 data buffer. -- 2.39.2