[PATCH v1 1/2] UefiCpuPkg: Update SEC_IDT_TABLE struct


Kuo, Ted
 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3957
The reserved IDT table size in SecCore is too small for X64. Changed the ty=
pe
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 <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Ray Ni <ray.ni@...>
Cc: Ashraf Ali S <ashraf.ali.s@...>
Cc: Debkumar De <debkumar.de@...>
Cc: Harry Han <harry.han@...>
Cc: Catharine West <catharine.west@...>
Signed-off-by: Ted Kuo <ted.kuo@...>
---
UefiCpuPkg/SecCore/SecMain.c | 1 +
UefiCpuPkg/SecCore/SecMain.h | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c
index a7526be9dd..d7140c2db3 100644
--- a/UefiCpuPkg/SecCore/SecMain.c
+++ b/UefiCpuPkg/SecCore/SecMain.c
@@ -202,6 +202,7 @@ SecStartup (
=0D
IdtTableInStack.PeiService =3D 0;=0D
for (Index =3D 0; Index < SEC_IDT_ENTRY_COUNT; Index++) {=0D
+ ZeroMem ((VOID *)&IdtTableInStack.IdtTable[Index], sizeof (IA32_IDT_GA=
TE_DESCRIPTOR));=0D
CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&mIdtEntryT=
emplate, sizeof (UINT64));=0D
}=0D
=0D
diff --git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h
index 189fcf9326..1be57c2248 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=0D
// EFI_PEI_SERVICES**=0D
//=0D
- UINT64 PeiService;=0D
- UINT64 IdtTable[SEC_IDT_ENTRY_COUNT];=0D
+ UINT64 PeiService;=0D
+ IA32_IDT_GATE_DESCRIPTOR IdtTable[SEC_IDT_ENTRY_COUNT];=0D
} SEC_IDT_TABLE;=0D
=0D
/**=0D
--=20
2.26.2.windows.1