From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.12887.1657650849423155052 for ; Tue, 12 Jul 2022 11:34:10 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=SLGXw0qq; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657650849; x=1689186849; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=V68q2Tbj1z+d8vvKW9CVIAfiHkdx5EkZBBE7nqGXkx4=; b=SLGXw0qqWtS6ZsVguxAksgfKGzHp1FMSRtgEaKTLb8iUycduYDmFUM8O sjCJc5PMQx7R7R3+n3PDE9/Sq2xCc64dtqD/GlHsLrki3RSjbdpeJWLBm r9OuglvJqbbxhbYsYNyxI4rN0aYJV66sfNFBvXn+xp2650G5ZgeupuTiH qERlc5HWBy1i7aXGbIMPpay2Tsho8vw7HqaautvvizTUw9rXPpaWn4ru/ NCvan90CnkiUPyfXv6MiwrjVP+2P75oecEvphmXUzu47sanimpK2ynTgv RCgPsXxd/iITWmkWqOrX9jV+96wlYTSzxfoil2td86CFnrsn2+aTkgu5q w==; X-IronPort-AV: E=McAfee;i="6400,9594,10406"; a="264802838" X-IronPort-AV: E=Sophos;i="5.92,266,1650956400"; d="scan'208";a="264802838" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2022 11:34:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,266,1650956400"; d="scan'208";a="922315531" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga005.fm.intel.com with ESMTP; 12 Jul 2022 11:34:08 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 12 Jul 2022 11:34:07 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 12 Jul 2022 11:34:07 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 12 Jul 2022 11:34:07 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 12 Jul 2022 11:34:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QPTKo5XhSwfE2mcbrVcUwTRQydz2glYvVb1phRpIHflRt3h1ww60hFfXTizChvgcfufmtkz6qoOFuraMdGSJzC4FnpUJGFWL2x8lNc1EoIwSMuGHosZ5zrtdhXInEljnuHzmVPtVPQ82ymgeTcNAOpEqPi/0g5n2YutFO+a20m6BjOCzZ/KL60BZyvCUidP2BY5OInBaqTwLMGYAUUe58in82+GPXXXz7yBBjTT9kQmOaSfXifpXhR0+AW5KonLEL+rCjZyQdpTig8YYhy5JanTcSEnCBNcBbqsxDSy7IHMLxgWi0aXx1DJZxCrM+PCWR15Y79H2pGJ7I86U5/5L/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NFPfoLdun1jACE7SAdZBkf4ejc7v3JlTc8RWol8enG0=; b=i0OueiHtdVaJ03e95O45H80W1VIJ/0wfO3saznjQdmMvwGzVw+AWtwAmMSuyRGlwE6jzq9II7GYZr1j5WJOQ67dMzmNQBxwsx1EqU/NB20eAwzDHhvIdwLWtpXcFiRtTDFH3I5ZhaN0uFmTsqp0Npn3yoARDeb1aGcc4Ebatq2ewCoM7jLVo67G6XKYB6SPpCDe0rJhEmTe76Uv5RyCzcrEggYbKoMlsS9pt/6rGnNUlcHM0anjY/8AB/+TZqvvizTaaNpbos53755wrvtVBcOG8O9DsYwQqPcmzlE8Jgh/3ZW83hSUHpZibyFVtngOiwARmcBs1RBzg3S+OgWWuWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by SN6PR11MB2670.namprd11.prod.outlook.com (2603:10b6:805:61::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Tue, 12 Jul 2022 18:34:02 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::a113:c892:d94:dd10]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::a113:c892:d94:dd10%7]) with mapi id 15.20.5417.026; Tue, 12 Jul 2022 18:34:02 +0000 From: "Chiu, Chasel" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" Subject: Re: [edk2-devel][PATCH v2 2/2] IntelFsp2Pkg: Update SEC_IDT_TABLE struct Thread-Topic: [edk2-devel][PATCH v2 2/2] IntelFsp2Pkg: Update SEC_IDT_TABLE struct Thread-Index: AQHYldIsmgbcthjELk+Zz64X0W5ctq17EAsg Date: Tue, 12 Jul 2022 18:34:02 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d42360b-cd17-4f02-2091-08da64351835 x-ms-traffictypediagnostic: SN6PR11MB2670:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bFhACiJE1Iknjr/XDn3HpXzEXx7F+2ZXAzR34QYfNmoE8jLZgaI3JAeofv+uQHfnMaOGP60GyEPpzYDN0qn3CYbYU6NaR1UxdBNVK5D1Wt/mUMUJzEi2GnpIvfsrVzaryqYG+gq2Gxbf1zbJiWk10z+a346iqTJkGv2KLEF5jdqZdauEy0+XDk8uv3hAKpdJ506esgCG1kdflVg6ik92XDVPvMyyhe52iJGZcJOCwMl4O6vImprGhZsnpNgiW4+PgP4TmXH04r8zs8a/bZte6DymoIN6ZZGmYCTTMMZNgXqpIM3a/nd5jdFdQ3TYB6YgPDrz0y/rJq8IoYSJZELeP930ffAr2bozTIlxVDXGMexJ3zsX6DzXuf1TFmrZleX7XW2+8hBXlLxYygvt1HNBRZRIKN0NZFcdYPpXhCmwqIjMl5hUS5wXitqAam6SSaLOMf3X2KlR4PQ6/sNwIUUYkNZogWZ9a0JD7Z5r3FhAHK6AdMTu0NA3MYd0DliddoYmKkUyW4lbIhEJcnm0e0UGq7MEojYKSHcOkxdPiVK85SVm9CyR6onbSqMioCMlSc0S2xE8HCrSEvUP08EoAd38eruc39CUQ5FA1S44Q44F0puDSYau2WGaTfcMdZXuYlIsLDbw1veP4UPLjT5Z6FGEaiyFhU5AhAMCmyQNkSlyE75qygDn21ZhWae1Mty8mcThVVYPcXwpevsERw4r41LFqHLryfH/RdcQURDlZfN24BSqN3mFR/3fCs6Sf4ee4fU5IMrpHFJaXgkbEoBgeq+NfW8qmAEA/dQkjey/EgcOWAoescF+ZvQ2ajgeBmH2WGhA0YQtEwIhOkbbiGCpynh/E17DwM/cXUuNhrVq4TdCW00= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(136003)(376002)(346002)(366004)(396003)(2906002)(122000001)(15650500001)(478600001)(186003)(110136005)(33656002)(38070700005)(83380400001)(55016003)(26005)(52536014)(66446008)(19627235002)(38100700002)(54906003)(107886003)(5660300002)(86362001)(8676002)(66476007)(8936002)(64756008)(4326008)(41300700001)(9686003)(71200400001)(82960400001)(76116006)(66556008)(7696005)(53546011)(6506007)(66946007)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nKYBlSkgt66uCsfw6z+f8LRKCpAfYrPCqyFrZIeg1OFOVAIQ6kDgjKXEOp4V?= =?us-ascii?Q?lc0kEDThrpVLvCcNozRGEpJnNPRVoYjSXMNQW4toqLMsFt5krMMyzj6uAk+t?= =?us-ascii?Q?0RcOv0O/zpBNgos33liBfQYaEjy0Hw7oxHz4TG1WN+u4EdHKrJaGU1FJFKl+?= =?us-ascii?Q?hPc8XNteoCwoPWY4EhyaTx2aSU996wF2AasRfukwxJ+dGBSJbHn6JIQ/4rH1?= =?us-ascii?Q?3FfQLdnELY9fSxiN4BClDkwhYwzjdvxhQIUMHlRgV7x8gKy8GhNfSw0AFW9f?= =?us-ascii?Q?AMjp/AbK+CL6zDUMbiR+GrVzCOMxwPmsLYCSYBC5d3S15/Vn33sM4/FuMUVC?= =?us-ascii?Q?W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XhjZ9UCL9d4lLXbVx7v24bD?= =?us-ascii?Q?XXB/D+XgkIARQrvmgqX4mOob7yCFlfTW495YWMreln6iHPqrOOCig4TYu02d?= =?us-ascii?Q?8vQsxhj5d9eBdwg3bhZKPhG+xDZSp/vDSDzdqFuwdX5cguJ0fn3amtIgiXtF?= =?us-ascii?Q?dy42lEC43cAdz0gLVrTUQK9cb3ONpJDo5RUjcjriMEolebEgFLihQ/ITWYIZ?= =?us-ascii?Q?bSwXek0KXRBZ4Wb2y07wKonVr+cMO0RXhby/sIujGIcRH0QQNeUzQyhTMCFx?= =?us-ascii?Q?XOoUmZ2tBnrWo6mhF4GhV+XHtuLEyz4OcFY5vJfc/KJ83Nq7qj9YZzw0/uuW?= =?us-ascii?Q?4t84aIE7D6nxhzez+WrVXxFAZzukQgwhyp9j6yr/?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d42360b-cd17-4f02-2091-08da64351835 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2022 18:34:02.8369 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CQBSC17rgMVxCEoFL7r7A9/76HZm4m3AdqggILGPuf6riNXapOzwRls21LZrIAB7kB62HlJ6TR2nej8ztc+3wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2670 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for updating! Reviewed-by: Chasel Chiu > -----Original Message----- > From: Kuo, Ted > Sent: Tuesday, July 12, 2022 2:31 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; S, As= hraf > Ali > Subject: [edk2-devel][PATCH v2 2/2] IntelFsp2Pkg: Update SEC_IDT_TABLE > struct >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3957 > 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. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Signed-off-by: Ted Kuo > --- > IntelFsp2Pkg/FspSecCore/SecFsp.c | 9 +++++---- > IntelFsp2Pkg/FspSecCore/SecFsp.h | 2 +- IntelFsp2Pkg/FspSecCore/SecMai= n.c > | 16 ++++++++-------- IntelFsp2Pkg/FspSecCore/SecMain.h | 4 ++-- > 4 files changed, 16 insertions(+), 15 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.c > b/IntelFsp2Pkg/FspSecCore/SecFsp.c > index 7fde6e7f41..e9b4091b20 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.c > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.c > @@ -16,19 +16,20 @@ > @return FSP specific IDT gate descriptor. **/- > UINT64+IA32_IDT_GATE_DESCRIPTOR FspGetExceptionHandler ( IN UINT64 > IdtEntryTemplate ) { UINT32 Entry;- UINT64 > ExceptionHandler;+ IA32_IDT_GATE_DESCRIPTOR ExceptionHandler; > IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor; FSP_INFO_HEADER > *FspInfoHeader; + ZeroMem ((VOID *)&ExceptionHandler, sizeof > (IA32_IDT_GATE_DESCRIPTOR)); FspInfoHeader =3D > (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader ();- ExceptionHandler > =3D IdtEntryTemplate;- IdtGateDescriptor =3D > (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;+ *(UINT64 > *)&ExceptionHandler =3D IdtEntryTemplate;+ IdtGateDescriptor = =3D > &ExceptionHandler; Entry =3D (IdtGateDescr= iptor- > >Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow; Entry > =3D FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1); > IdtGateDescriptor->Bits.OffsetHigh =3D (UINT16)(Entry >> 16);diff --git > a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/SecFsp.h > index 41931a33dd..e84528b378 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecFsp.h > +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h > @@ -30,7 +30,7 @@ > @return FSP specific IDT gate descriptor. **/- > UINT64+IA32_IDT_GATE_DESCRIPTOR FspGetExceptionHandler ( IN UINT64 > IdtEntryTemplate );diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.c > b/IntelFsp2Pkg/FspSecCore/SecMain.c > index 8effe2225c..94ea3865b4 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecMain.c > +++ b/IntelFsp2Pkg/FspSecCore/SecMain.c > @@ -58,13 +58,13 @@ SecStartup ( > IN UINT32 ApiIdx ) {- EFI_SEC_PEI_HAND_OFF SecCoreData;- > IA32_DESCRIPTOR IdtDescriptor;- SEC_IDT_TABLE IdtTableInSt= ack;- > UINT32 Index;- FSP_GLOBAL_DATA PeiFspData;- UINT64 > ExceptionHandler;- UINTN IdtSize;+ EFI_SEC_PEI_HAND_OFF > SecCoreData;+ IA32_DESCRIPTOR IdtDescriptor;+ SEC_IDT_TABLE > IdtTableInStack;+ UINT32 Index;+ FSP_GLOBAL_DATA > PeiFspData;+ IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;+ UINTN > IdtSize; // // Process all libraries constructor function linked to = SecCore.@@ - > 119,7 +119,7 @@ SecStartup ( > if (IdtDescriptor.Base =3D=3D 0) { ExceptionHandler =3D FspGetExce= ptionHandler > (mIdtEntryTemplate); for (Index =3D 0; Index < FixedPcdGet8 > (PcdFspMaxInterruptSupported); Index++) {- CopyMem ((VOID > *)&IdtTableInStack.IdtTable[Index], (VOID *)&ExceptionHandler, sizeof > (UINT64));+ CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID > *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR)); } IdtSi= ze =3D > sizeof (IdtTableInStack.IdtTable);diff --git a/IntelFsp2Pkg/FspSecCore/Se= cMain.h > b/IntelFsp2Pkg/FspSecCore/SecMain.h > index 7c2642ad48..1fe7c15aeb 100644 > --- a/IntelFsp2Pkg/FspSecCore/SecMain.h > +++ b/IntelFsp2Pkg/FspSecCore/SecMain.h > @@ -38,8 +38,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[FixedPcdGet8 (PcdFspMaxInterruptSupported)];+ UINT64 > PeiService;+ IA32_IDT_GATE_DESCRIPTOR IdtTable[FixedPcdGet8 > (PcdFspMaxInterruptSupported)]; } SEC_IDT_TABLE; /**-- > 2.35.3.windows.1