UefiCpuPkg/MpInitLib: put mReservedApLoopFunc in executable memory
authorJian J Wang <jian.j.wang@intel.com>
Fri, 2 Mar 2018 02:46:05 +0000 (10:46 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 8 Mar 2018 09:07:14 +0000 (17:07 +0800)
commitbc2288f59ba2d613643ba66a9638bcc8c7340ddb
tree5b47438275036a44d026fb209f0dcfdaa6b418dd
parent8b13bca9b81490fc0e42df25d5feb82bbb47833e
UefiCpuPkg/MpInitLib: put mReservedApLoopFunc in executable memory

if PcdDxeNxMemoryProtectionPolicy is enabled for EfiReservedMemoryType
of memory, #PF will be triggered for each APs after ExitBootServices
in SCRT test. The root cause is that AP wakeup code executed at that
time is stored in memory of type EfiReservedMemoryType (referenced by
global mReservedApLoopFunc), which is marked as non-executable.

This patch fixes this issue by setting memory of mReservedApLoopFunc to
be executable immediately after allocation.

Cc: Ruiyu Ni <ruiyu.ni@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: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c