audk/UefiCpuPkg/Library/CpuExceptionHandlerLib
Ruiyu Ni 374168ae65 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:
c563077a38
* 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>
2018-09-03 14:02:26 +08:00
..
Ia32 CpuExceptionHandlerLib: Add comments to make code more readable 2018-09-03 14:02:24 +08:00
X64 CpuExceptionHandlerLib: Add comments to make code more readable 2018-09-03 14:02:24 +08:00
CpuExceptionCommon.c UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuExceptionCommon.h UefiCpuPkg/CpuExceptionHandlerLib: Avoid calling PEI services from AP 2018-09-03 14:02:26 +08:00
DxeCpuExceptionHandlerLib.inf UefiCpuPkg: Remove X86 ASM and S files 2018-06-07 15:27:36 +08:00
DxeCpuExceptionHandlerLib.uni UefiCpuPkg/CpuExceptionHandlerLib: Trim white space at end of line 2017-04-07 10:06:37 +08:00
DxeException.c UefiCpuPkg/CpuExceptionHandlerLib: fix incorrect init of exception stack 2018-02-28 15:30:26 +08:00
PeiCpuException.c UefiCpuPkg/CpuExceptionHandlerLib: Avoid calling PEI services from AP 2018-09-03 14:02:26 +08:00
PeiCpuExceptionHandlerLib.inf UefiCpuPkg: Remove X86 ASM and S files 2018-06-07 15:27:36 +08:00
PeiCpuExceptionHandlerLib.uni UefiCpuPkg/CpuExceptionHandlerLib: Trim white space at end of line 2017-04-07 10:06:37 +08:00
PeiDxeSmmCpuException.c CpuExceptionHandlerLib: Add comments to make code more readable 2018-09-03 14:02:24 +08:00
SecPeiCpuException.c UefiCpuPkg/CpuExceptionHandler: Init serial port before context dump 2018-01-26 18:56:26 +08:00
SecPeiCpuExceptionHandlerLib.inf UefiCpuPkg: Remove X86 ASM and S files 2018-06-07 15:27:36 +08:00
SecPeiCpuExceptionHandlerLib.uni UefiCpuPkg/CpuExceptionHandlerLib: Trim white space at end of line 2017-04-07 10:06:37 +08:00
SmmCpuExceptionHandlerLib.inf UefiCpuPkg: Remove X86 ASM and S files 2018-06-07 15:27:36 +08:00
SmmCpuExceptionHandlerLib.uni UefiCpuPkg/CpuExceptionHandlerLib: Trim white space at end of line 2017-04-07 10:06:37 +08:00
SmmException.c UefiCpuPkg/CpuExceptionHandlerLib: Add stack switch support 2017-12-08 14:38:48 +08:00