]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
MdeModulePkg/PiSmmCore: MemoryAttributeTable need keep non-PE record.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 30 Nov 2016 15:17:53 +0000 (23:17 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Wed, 7 Dec 2016 05:13:51 +0000 (13:13 +0800)
commit026e2ca2c315ea0d19be5f72b89009bdcf5f10c8
tree18ce85790ad3d5307a38fc8b2f64b3b261371db0
parent5f4d3e179435f539395748bcd5187e3c395b0bf9
MdeModulePkg/PiSmmCore: MemoryAttributeTable need keep non-PE record.

Current memory attribute table implementation will only mark PE code
to be EfiRuntimeServicesCode, and mark rest to be EfiRuntimeServicesData.

However, there might be a case that a SMM code wants to allocate
EfiRuntimeServicesCode explicitly to let page table protect this region
to be read only. It is unsupported.

This patch enhances the current solution so that MemoryAttributeTable
does not touch non PE image record.
Only the PE image region is forced to be EfiRuntimeServicesCode for
code and EfiRuntimeServicesData for data.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c