audk/ArmPkg/Library
Oliver Smith-Denny ef05145136 ArmPkg: DefaultExceptionHandlerLib: Do Not Allocate Memory
If gST->ConOut is available when Arm's DefaultExceptionHandler is
running, AsciiPrint will get called to attempt to print to ConOut, in
addition to the serial output.

AsciiPrint calls AsciiInternalPrint in UefiLibPrint.c which in turn
calls AllocatePool to allocate a buffer to convert the Ascii input
string to a Unicode string to pass to ConOut->OutputString.

Per the comment on DefaultExceptionHandler, we should not be allocating
memory in the exception handler, as this can cause the exception handler
to fail if we had a memory exception or the system state is such that we
cannot allocate memory.

It has been observed on ArmVirtQemu that exceptions generated in the
memory handling code will fail to output the stack dump and CPU state
that is critical to debugging because the AllocatePool will fail.

This patch fixes the Arm and AARCH64 DefaultExceptionHandlers to not
allocate memory when ConOut is available and instead use stack memory to
convert the Ascii string needed for SerialPortWrite to the Unicode
string needed for ConOut->OutputString. Correspondingly, ArmVirtQemu can
now output the stack dump and CPU state when hitting an exception in
memory code.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2023-08-03 14:43:08 +00:00
..
ArmArchTimerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmCacheMaintenanceLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmDisassemblerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmExceptionLib ArmPkg: Emit BTI opcodes when BTI codegen is enabled 2023-03-30 11:05:22 +00:00
ArmGenericTimerPhyCounterLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGenericTimerVirtCounterLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGicArchLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGicArchSecLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmHvcLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
ArmHvcLibNull ArmPkg/ArmHvcLibNull: Add NULL instance of ArmHvcLib 2022-11-06 16:32:28 +00:00
ArmLib ArmLib: add functions to read system registers 2023-04-21 18:50:05 +00:00
ArmMmuLib ArmPkg: Drop individual memory permission helpers 2023-06-27 16:40:07 +00:00
ArmMonitorLib ArmPkg/ArmMonitorLib: Add ArmMonitorLib 2022-11-06 16:32:28 +00:00
ArmMtlNullLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmPsciResetSystemLib ArmPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmSmcLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
ArmSmcLibNull ArmPkg: Add SMC helper functions 2021-12-14 11:30:26 +00:00
ArmSmcPsciResetSystemLib ArmPkg: Handle warm reboot request correctly 2022-09-05 13:52:51 +00:00
ArmSoftFloatLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmSvcLib ArmPkg: Emit BTI opcodes when BTI codegen is enabled 2023-03-30 11:05:22 +00:00
ArmTrngLib ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor() 2022-11-26 14:42:41 +00:00
CompilerIntrinsicsLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
DebugAgentSymbolsBaseLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DebugPeCoffExtraActionLib ArmPkg: Remove RealView Debugger support 2023-01-30 16:50:14 +00:00
DefaultExceptionHandlerLib ArmPkg: DefaultExceptionHandlerLib: Do Not Allocate Memory 2023-08-03 14:43:08 +00:00
GccLto ArmPkg/GccLto AARCH64: Add BTI note to LTO helper library 2023-03-30 11:05:22 +00:00
LinuxBootBootManagerLib ArmPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
OpteeLib ArmPkg/OpteeLib: Map shared communication buffer non-executable 2023-06-27 16:40:07 +00:00
PeiServicesTablePointerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformBootManagerLib ArmPkg: Configure PcdEmuVariableNvModeEnable as a dynamic PCD 2023-05-29 15:14:00 +00:00
SemiHostingDebugLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SemiHostingSerialPortLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SemihostLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
StandaloneMmMmuLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GnuNoteBti.bin ArmPkg, BaseTools AARCH64: Add BTI ELF note to .hii objects 2023-03-30 11:05:22 +00:00