From: Kuo, Ted Date: Tue, 12 Jul 2022 09:30:57 +0000 (-0700) Subject: UefiCpuPkg: Update SEC_IDT_TABLE struct X-Git-Tag: edk2-stable202208~116 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9ab389c01b875869c6173557aa053d397aaf14f1 UefiCpuPkg: Update SEC_IDT_TABLE struct REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3957 The reserved IDT table size in SecCore is too small for X64. Changed the type of IdtTable in SEC_IDT_TABLE from UINT64 to IA32_IDT_GATE_DESCRIPTOR to have sufficient size reserved in IdtTable for X64. dff Cc: Chasel Chiu Cc: Nate DeSimone Cc: Ray Ni Cc: Ashraf Ali S Cc: Debkumar De Cc: Harry Han Cc: Catharine West Signed-off-by: Ted Kuo Reviewed-by: Ray Ni --- diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c index 4edf0ce972..fe03d8019a 100644 --- a/UefiCpuPkg/SecCore/SecMain.c +++ b/UefiCpuPkg/SecCore/SecMain.c @@ -211,6 +211,7 @@ SecStartup ( IdtTableInStack.PeiService = 0; for (Index = 0; Index < SEC_IDT_ENTRY_COUNT; Index++) { + ZeroMem ((VOID *)&IdtTableInStack.IdtTable[Index], sizeof (IA32_IDT_GATE_DESCRIPTOR)); CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&mIdtEntryTemplate, sizeof (UINT64)); } diff --git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h index 189fcf9326..26c54bd926 100644 --- a/UefiCpuPkg/SecCore/SecMain.h +++ b/UefiCpuPkg/SecCore/SecMain.h @@ -43,8 +43,8 @@ typedef struct _SEC_IDT_TABLE { // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store // EFI_PEI_SERVICES** // - UINT64 PeiService; - UINT64 IdtTable[SEC_IDT_ENTRY_COUNT]; + UINT64 PeiService; + IA32_IDT_GATE_DESCRIPTOR IdtTable[SEC_IDT_ENTRY_COUNT]; } SEC_IDT_TABLE; /**