]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c
MdeModulePkg BootScriptExecutorDxe: Reduce reserved memory consumption
authorStar Zeng <star.zeng@intel.com>
Mon, 27 Jul 2015 03:03:25 +0000 (03:03 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 27 Jul 2015 03:03:25 +0000 (03:03 +0000)
commitc6368abcf02628fba94c48f7f413f5cae50d1347
tree892d1de2d9c31bf2d6e3b6199ecab8eb6f89fa56
parent841349282b95a0f4ee17dec3ffdf747bb7268a95
MdeModulePkg BootScriptExecutorDxe: Reduce reserved memory consumption

We are going to reduce reserved memory consumption by page table buffer,
then OS can have more available memory to use.
Take PhysicalAddressBits = 48 and 2MB page granularity as example,
1:1 Virtual to Physical identity mapping page table buffer needs to be
((512 + 1) * 512 + 1) * 4096 = 1075843072 bytes = 0x40201000 bytes.

Current BootScriptExecutorDxe handles > 4G request by page fault because
S3ResumePeim only builds 4G page table when long mode waking vector is
not needed, but BootScriptExecutorDxe still assume the page table buffer for
page table is at 1:1 Virtual to Physical identity mapping.

To reduce reserved memory consumption, the code is updated to only use
8 extra pages to handles > 4G request by page fault.
Another, when both BIOS and OS wants long mode waking vector,
S3ResumePei should have established 1:1 Virtual to Physical identity mapping
page table for ACPI spec requirement, so no need to hook page fault handler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18067 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c