]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
UefiCpuPkg PiSmmCpuDxeSmm: Fixed #double fault on #page fault for IA32
authorStar Zeng <star.zeng@intel.com>
Thu, 11 Jan 2018 10:27:12 +0000 (18:27 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 15 Jan 2018 02:41:15 +0000 (10:41 +0800)
commit6e601a4109d4a998596986718653048ae23de0a6
tree817616f9324708f324e7d5d8f87f51cd44ddfa60
parent018432f0ce1b42541977f61f9c7607257a4bf43a
UefiCpuPkg PiSmmCpuDxeSmm: Fixed #double fault on #page fault for IA32

When StackGuard is enabled on IA32, the #double fault exception
is reported instead of #page fault.

This issue does not exist on X64, or IA32 without StackGuard.

The fix at e4435f710cea2d2f10cd7343d545920867780086 was incomplete.

It is because AllocateCodePages() is used to allocate buffer for
GDT and TSS, the code pages will be set to RO in SetMemMapAttributes().
But IA32 Stack Guard need use task switch to switch stack that need
write GDT and TSS, so AllocateCodePages() could not be used.

This patch uses AllocatePages() instead of AllocateCodePages() to
allocate buffer for GDT and TSS if StackGuard is enabled on IA32.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c