public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: fix incorrect init of exception stack
@ 2018-02-27  5:19 Jian J Wang
  2018-02-27 10:26 ` Laszlo Ersek
  0 siblings, 1 reply; 2+ messages in thread
From: Jian J Wang @ 2018-02-27  5:19 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Eric Dong, Laszlo Ersek

The field KnownGoodStackTop in CPU_EXCEPTION_INIT_DATA is initialized to
the start address of array mNewStack. This is wrong. It must be the end
of mNewStack. This patch fixes this mistake.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
index 6d1b54d31d..2a090782fc 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
@@ -270,7 +270,7 @@ InitializeCpuExceptionHandlersEx (
         AsmReadGdtr (&Gdtr);
 
         EssData.X64.Revision = CPU_EXCEPTION_INIT_DATA_REV;
-        EssData.X64.KnownGoodStackTop = (UINTN)mNewStack;
+        EssData.X64.KnownGoodStackTop = (UINTN)mNewStack + sizeof (mNewStack);
         EssData.X64.KnownGoodStackSize = CPU_KNOWN_GOOD_STACK_SIZE;
         EssData.X64.StackSwitchExceptions = CPU_STACK_SWITCH_EXCEPTION_LIST;
         EssData.X64.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;
-- 
2.15.1.windows.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-27 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27  5:19 [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: fix incorrect init of exception stack Jian J Wang
2018-02-27 10:26 ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox