]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/CpuExceptionHandlerLib: Avoid calling PEI services from AP
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 31 Aug 2018 08:29:20 +0000 (16:29 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 3 Sep 2018 06:02:26 +0000 (14:02 +0800)
commit374168ae651fabcb77a0b9d2e55ca80b46630dbb
treeabf5ee13b178cf6b5bc7e065aa840acd222f2380
parent87a9dd0d15631fdbd8c1cce65fa1f3fc1a48beff
UefiCpuPkg/CpuExceptionHandlerLib: Avoid calling PEI services from AP

When an exception happens in AP, system hangs at
GetPeiServicesTablePointer(), complaining the PeiServices retrieved
from memory before IDT is NULL.

Due to the following commit:
c563077a380437c114aba4c95be65eb963ebc1f3
* UefiCpuPkg/MpInitLib: Avoid calling PEI services from AP
the IDT used by AP no longer preserve PeiServices pointer in the
very beginning.
But the implementation of PeiExceptionHandlerLib still assumes
the PeiServices pointer is there, so the assertion happens.

The patch fixes the exception handler library to not call
PEI services from AP.

The patch duplicates the #0 exception stub header in an allocated
pool but with extra 4-byte/8-byte to store the exception handler
data which was originally stored in HOB.
When AP exception happens, the code gets the exception handler data
from the exception handler for #0.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Fan Jeff <vanjeff_919@hotmail.com>
UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c