]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
UefiCpuPkg/CpuExceptionHandlerLib: always clear descriptor data in advance
[mirror_edk2.git] / UefiCpuPkg / Library / CpuExceptionHandlerLib / X64 / ArchExceptionHandler.c
index 93ecf5ae5a5b9d6deb480b0dfa664a7661519365..5dc628149e76df923cd5102c04d5ea4ffccf569e 100644 (file)
@@ -219,6 +219,8 @@ ArchSetupExcpetionStack (
   //\r
   TssBase = (UINTN)Tss;\r
 \r
+  TssDesc->Uint128.Uint64  = 0;\r
+  TssDesc->Uint128.Uint64_1= 0;\r
   TssDesc->Bits.LimitLow   = sizeof(IA32_TASK_STATE_SEGMENT) - 1;\r
   TssDesc->Bits.BaseLow    = (UINT16)TssBase;\r
   TssDesc->Bits.BaseMidl   = (UINT8)(TssBase >> 16);\r
@@ -231,6 +233,7 @@ ArchSetupExcpetionStack (
   //\r
   // Fixup exception task descriptor and task-state segment\r
   //\r
+  ZeroMem (Tss, sizeof (*Tss));\r
   StackTop = StackSwitchData->X64.KnownGoodStackTop - CPU_STACK_ALIGNMENT;\r
   StackTop = (UINTN)ALIGN_POINTER (StackTop, CPU_STACK_ALIGNMENT);\r
   IdtTable = StackSwitchData->X64.IdtTable;\r