Reviewed-by: Ray Ni <ray...@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Kuo, Ted
> Sent: Monday, June 27, 2022 3:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.c...@intel.com>; Desimone, Nathaniel L 
> <nathaniel.l.desim...@intel.com>; Ni, Ray
> <ray...@intel.com>; S, Ashraf Ali <ashraf.al...@intel.com>; De, Debkumar 
> <debkumar...@intel.com>; Han, Harry
> <harry....@intel.com>; West, Catharine <catharine.w...@intel.com>
> Subject: [edk2-devel][PATCH v1 1/2] 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 <chasel.c...@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
> Cc: Ray Ni <ray...@intel.com>
> Cc: Ashraf Ali S <ashraf.al...@intel.com>
> Cc: Debkumar De <debkumar...@intel.com>
> Cc: Harry Han <harry....@intel.com>
> Cc: Catharine West <catharine.w...@intel.com>
> Signed-off-by: Ted Kuo <ted....@intel.com>
> ---
>  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 (
> 
> 
>    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..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
> 
>    // 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;
> 
> 
> 
>  /**
> 
> --
> 2.26.2.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#90785): https://edk2.groups.io/g/devel/message/90785
> Mute This Topic: https://groups.io/mt/92015981/1862468
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ted....@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91215): https://edk2.groups.io/g/devel/message/91215
Mute This Topic: https://groups.io/mt/92306052/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to