mirror_edk2/MdeModulePkg/Core/Dxe
Ray Ni e7abb94d1f CpuException: Add InitializeSeparateExceptionStacks
Today InitializeCpuExceptionHandlersEx is called from three modules:
1. DxeCore (links to DxeCpuExceptionHandlerLib)
    DxeCore expects it initializes the IDT entries as well as
    assigning separate stacks for #DF and #PF.
2. CpuMpPei (links to PeiCpuExceptionHandlerLib)
   and CpuDxe (links to DxeCpuExceptionHandlerLib)
    It's called for each thread for only assigning separate stacks for
    #DF and #PF. The IDT entries initialization is skipped because
    caller sets InitData->X64.InitDefaultHandlers to FALSE.

Additionally, SecPeiCpuExceptionHandlerLib, SmmCpuExceptionHandlerLib
also implement such API and the behavior of the API is simply to initialize
IDT entries only.

Because it mixes the IDT entries initialization and separate stacks
assignment for certain exception handlers together, in order to know
whether the function call only initializes IDT entries, or assigns stacks,
we need to check:
1. value of InitData->X64.InitDefaultHandlers
2. library instance

This patch cleans up the code to separate the stack assignment to a new API:
InitializeSeparateExceptionStacks().

Only when caller calls the new API, the separate stacks are assigned.
With this change, the SecPei and Smm instance can return unsupported which
gives caller a very clear status.

The old API InitializeCpuExceptionHandlersEx() is removed in this patch.
Because no platform module is consuming the old API, the impact is none.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
2022-06-10 07:54:48 +00:00
..
Dispatcher MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeMain CpuException: Add InitializeSeparateExceptionStacks 2022-06-10 07:54:48 +00:00
Event MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FwVol MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FwVolBlock MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Gcd MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Hand MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Image MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Library MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Mem MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Misc MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SectionExtraction MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeCore.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
DxeCoreExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
DxeMain.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeMain.inf MdeModulePkg/Core/Dxe: limit FwVol encapsulation section recursion 2020-11-21 01:40:53 +00:00