From a8ab14d355072241915d87de86770c0fde92cba9 Mon Sep 17 00:00:00 2001 From: Jian J Wang Date: Thu, 7 Dec 2017 20:17:32 +0800 Subject: [PATCH 1/1] MdeModulePkg/Core/Dxe: Call new API InitializeCpuExceptionHandlersEx instead Original API InitializeCpuExceptionHandlers is used in DxeMain to initialize exception handlers but it does not support setting up stack switch required by Stack Guard feature. Using the new API instead to make sure Stack Guard feature is applicable to most part of code. Since this API is called before memory service initialization, there's no way to call AllocateXxx API to reserve memory. Global variables are used for this special case. GDT table is reserved at least 2KB which should be big enough for all current use cases. Cc: Star Zeng Cc: Eric Dong Cc: Jiewen Yao Suggested-by: Ayellet Wolman Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang Reviewed-by: Jeff Fan Reviewed-by: Jiewen.yao@intel.com --- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 433cca3a80..62a597edaf 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -258,7 +258,7 @@ DxeMain ( if (GuidHob != NULL) { VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob)); } - Status = InitializeCpuExceptionHandlers (VectorInfoList); + Status = InitializeCpuExceptionHandlersEx (VectorInfoList, NULL); ASSERT_EFI_ERROR (Status); // -- 2.39.2