From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.7072.1657618285263341164 for ; Tue, 12 Jul 2022 02:31:26 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dWTlrDhu; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ted.kuo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657618286; x=1689154286; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=amsA3vdNcrm2wfgdb2h5ee1Y4DL5EXKHjjZVqqlKPB0=; b=dWTlrDhuD99HxyRWZBmjPIGOoLpGDOUZwFwwSmL0xK2Zl38+8gR+paqI pEKrJEfMnXrfw2jscruaz69P+JPpPTNvX66bsMFQqLhTuP3vNfY/XxvnF 9EpDn/Bai20STCLYa0Umb3nCXSHvf1IMQH4zCcVVxap4+DSEwdnBB3+b5 X6MI2np07FEV60pfwgp8Tm4QtyPr2j/YMFke+HEWkjNY+IIr62+UZiw8B q888oM1nnzqFprY5hpwYt2APIn6lAF21jMbfKz/YOplsbMUSRiHsm+B89 Ier8BJnGgoZw3NeO+TqSuHhcPSxVo7lYjssIdI326/6lxUaD1C6fTr0S6 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10405"; a="265298760" X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="265298760" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2022 02:31:25 -0700 X-IronPort-AV: E=Sophos;i="5.92,265,1650956400"; d="scan'208";a="545360974" Received: from tedkuo1-win10.gar.corp.intel.com ([10.5.215.13]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2022 02:31:24 -0700 From: "Kuo, Ted" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Ray Ni , Ashraf Ali S , Debkumar De , Harry Han , Catharine West Subject: [edk2-devel][PATCH v2 1/2] UefiCpuPkg: Update SEC_IDT_TABLE struct Date: Tue, 12 Jul 2022 17:30:57 +0800 Message-Id: X-Mailer: git-send-email 2.35.3.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Nate DeSimone Cc: Ray Ni Cc: Ashraf Ali S Cc: Debkumar De Cc: Harry Han Cc: Catharine West Signed-off-by: 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 4edf0ce972..fe03d8019a 100644 --- a/UefiCpuPkg/SecCore/SecMain.c +++ b/UefiCpuPkg/SecCore/SecMain.c @@ -211,6 +211,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.35.3.windows.1