audk/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32
Jiewen Yao 717fb60443 UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection.
PiSmmCpuDxeSmm consumes SmmAttributesTable and setup page table:
1) Code region is marked as read-only and Data region is non-executable,
if the PE image is 4K aligned.
2) Important data structure is set to RO, such as GDT/IDT.
3) SmmSaveState is set to non-executable,
and SmmEntrypoint is set to read-only.
4) If static page is supported, page table is read-only.

We use page table to protect other components, and itself.

If we use dynamic paging, we can still provide *partial* protection.
And hope page table is not modified by other components.

The XD enabling code is moved to SmiEntry to let NX take effect.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@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>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2016-11-17 16:30:07 +08:00
..
MpFuncs.S UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00
MpFuncs.asm UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00
MpFuncs.nasm UefiCpuPkg PiSmmCpuDxeSmm: Update Ia32/MpFuncs.nasm 2016-06-28 09:52:13 +08:00
PageTbl.c UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
Semaphore.c UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00
SmiEntry.S UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmiEntry.asm UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmiEntry.nasm UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmiException.S UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmiException.asm UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmiException.nasm UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmmFuncsArch.c UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmmInit.S UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00
SmmInit.asm UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00
SmmInit.nasm UefiCpuPkg/PiSmmCpuDxeSmm: remove superfluous ENDs from NASM source 2016-07-18 19:23:01 +02:00
SmmProfileArch.c UefiCpuPkg/PiSmmCpuDxeSmm: Add paging protection. 2016-11-17 16:30:07 +08:00
SmmProfileArch.h UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files 2015-10-19 19:13:13 +00:00