From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.17916.1653236856713963257 for ; Sun, 22 May 2022 09:27:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dbZVv2MZ; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: jian.j.wang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653236856; x=1684772856; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1azJl7D3l6ZLPHVT2b+Zm8LCEX5e5jQnIyIuJLayoeg=; b=dbZVv2MZ8ZU69sNifZDOe1xOv+6oOsrDATCyeVD45PGyKHcYqAOeBtfT f9pLmXn0at3PWHsUqX24IkC+51AdMXPlccdcjKVUXqVS7ZdAFwXlxJZBw NOZe+XfFvhtdAekWItyGm/HCbn+CYAeu/18CFoWYeVYkWP4KIf5ykD+1r e4m5SFAk4qB5xk0D38ZrEznbvSUyRHtqwAZPchA9INqqaEauSZTPBePYB KoblSGI0EDQhEKP4slDROWYQSMMTaJo6HSJNajOsAXausW2a3KoJNC60I 7iw7oPkR1iMHIQGx7YejxLC0JnbXaJXTRdApXM870fTDNyz4aAuCGeKIk w==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="273000789" X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="273000789" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 09:27:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,244,1647327600"; d="scan'208";a="641107377" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 22 May 2022 09:27:35 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 22 May 2022 09:27:34 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 22 May 2022 09:27:34 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 via Frontend Transport; Sun, 22 May 2022 09:27:34 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) 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; Sun, 22 May 2022 09:27:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXeJcZoYHVa5Qc9tAq2kFowAWXY4tFUQaKwjhh/w8eCe5yemMz+GGR7ZYPKBCZ29ctbRYKa5gzWXyI9lq0eTS4JzX8zkUJgSzqpLJaovMyBc91bWyUW1Eb1QFD8u8unjAlFldIrUSfpBPGojxXka4LSi56teOuNHsolAHfTa24lcIwft/nHeDvqdzYbyWOEBJ1EdzkHLVHHNwkJgECqE1amgvRK6XRz4kmwMTFA8nL1pnS2YJ/xP2qF92GASQhYap2Sujmfe7k+I8GjJNQ7XDJecvoDstt1V2KXSpxSqKEMQwxnC1QR7awziNe1H5uEgpglRkszps4UPrix0rbBu3Q== 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=GVHLiqpn+jX2bVe6qEhf3YNQWExdUPiKqltInMcqDRw=; b=kXQIrFNSEzXU7eyzFY2W2X79rd1SkwWup5DvIHU0Xs8UkpcQfPjZZ86VSn1n3eOAKF7xj1OodSLbbyp5deVINDk34dn1k7whrb6kWffAnL0LukaMObfQol50oqlMoNWVUKbeKsn7yOKGL0p5/xRyr+efbo11ulwNz8y0vC3neN9YOaiBiMZN+wjg3XFs1mFR13XWk5D8jGCE3uhHpjKCoa22OHyhaAHXf0aVA3brBZ7a4zhokHlRL3feGhuO7BkbWyI4wL3tpU0C3b0fFl1YifCTzq2gFGE3NQrLx31+kGy/G2/XNWKXTRA5fLcrfUESJFc7aGvrPAdnhhwlgPX76A== 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 CO1PR11MB4945.namprd11.prod.outlook.com (2603:10b6:303:9c::8) by SN6PR11MB3501.namprd11.prod.outlook.com (2603:10b6:805:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22; Sun, 22 May 2022 16:27:26 +0000 Received: from CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::a420:db2c:31db:7906]) by CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::a420:db2c:31db:7906%9]) with mapi id 15.20.5273.022; Sun, 22 May 2022 16:27:26 +0000 From: "Wang, Jian J" To: "devel@edk2.groups.io" , "Ni, Ray" CC: "Dong, Eric" Subject: Re: [edk2-devel] [PATCH 4/5] CpuException: Remove InitializeCpuInterruptHandlers Thread-Topic: [edk2-devel] [PATCH 4/5] CpuException: Remove InitializeCpuInterruptHandlers Thread-Index: AQHYbFQvQxNFzWJppUWVXwAS9HRJhK0rFa/g Date: Sun, 22 May 2022 16:27:26 +0000 Message-ID: References: <20220520141549.108-1-ray.ni@intel.com> <20220520141549.108-5-ray.ni@intel.com> In-Reply-To: <20220520141549.108-5-ray.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows 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: 83bb24f3-132c-4087-6f2c-08da3c0ff56b x-ms-traffictypediagnostic: SN6PR11MB3501:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PNW4GgOngeE6hjnbXeOinzcw9H0u5tLHmQZQsMo+mj3aC6Tg7SUrBeKRl8oWZq5NNaTa3njpqxHH5G7bfn5saoUKIy+DqA5hqbWF3nA73shhEyIHZ68zpwJ7opHrmDxl2wgntc2IkjMqOgsrMLmegvRIpe3EbXBnXzLPyav7/pjARPtckPrX/TTWI21MC3gsuFZMJmXuAw0sEKnBNuGYSn2ehdVa8JuLQSgWYkSIi+gBS784yu7JPiUIRN7K5yivV73uEBWN6wi71+dJOdSrRsiqsmIMeKx2wMVbXynumwhbzvAZKdKo50PoxooNHsWkMmaXJvSrvWZCrYz6x7esPFJ9SwSAAnskgYkTrZTprFhMJstk7wlTgdHMdDRb05s0rxH651BSyb2RodjsN1I+5vYQepL5+j4LnHAJHNcJy/hKDAkVVJmqwkznzkvUUh8F3CH9cZy3p3VSG53ro5Xzdut3fe/vhE4iYECMbbCTqOCoLxs7aX2EpVKTqDHt1MeJ5X8y/+6lZ5i//AFIq7xfG5IZHeia8r8XZW0sjp+56qW/SW4ii8gScKaZD9pqHUHyr6ekkFCsGEuAhLQgZMG+8uvPhrG6V4LdkgQ2cC/4BSrfB+3uZ6eBSo1hbya3l3p8hRSOfAup2xV1XbNxn+orcLDmIhDeSUmztPTHvZfx9lCFAz2d6p8wLVWr/h8Qci/FK0yaxEeQG8iScUNNZsszlYuxbqOGvMOjeep8GOjFFpxtjq3geGPZtUHhMPGeS1dDm6eLZ0e0dWMqa4zT4VHO4qx71otYMtLIczeDObD6LEPaWc1lws/HEf3/yA6GJIXRgCxYFv0Kf8AHZd4vCQ4yKw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4945.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(71200400001)(38100700002)(66946007)(66556008)(86362001)(8676002)(55016003)(33656002)(4326008)(64756008)(66446008)(66476007)(76116006)(2906002)(107886003)(186003)(110136005)(122000001)(508600001)(6636002)(53546011)(82960400001)(966005)(30864003)(5660300002)(316002)(83380400001)(6506007)(8936002)(26005)(9686003)(7696005)(52536014)(38070700005)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9lGZcursrBqdmFnHYVxkqm7HE6V18SdKbI/AU1eBzgBAgAYbgBTuMftXaz8f?= =?us-ascii?Q?ymyLmlU2SWatbsL0wlndHtuQzV/6fqekPNJ+JcIPQAYZe0qQS7rL8VJ7qc17?= =?us-ascii?Q?EOIFi+fQ75DwIzaHIkVFGjcqwscGIokhSVMDfVggUJ5QO8RPKC3FWwruIqAK?= =?us-ascii?Q?C/Cow6dn3MRN1/oXhAndq3pG7/9Mzk/mvj0Ki9lcJyeS+rAPoK2hoAGG6Obj?= =?us-ascii?Q?cxtiU6Y7HzKGjzaM+3peHiMS3cW5m7lskkh0MWbm9H48gMvIwIk//k8x7GTG?= =?us-ascii?Q?AButa2SOywJJ/s+uteT7aE3LVkE8wuyXO6ee+CAb8RnneKw+P9P6RYmODopq?= =?us-ascii?Q?HjsmFdmtPIpMmSNiedKaSzowkw3q9LThIcp+YhTTwlpFs0RpjhRjelAJPKMj?= =?us-ascii?Q?z2EXoJdCr4f7k0wGE1NOOAfKTHs2A4nXQNkpsDwQx5ABRUWmViFUnAyK37aJ?= =?us-ascii?Q?VtqtEdOAgnCA+70+1A4q0M0mTMLfdkTsaZrmX4tk6quEHdBsTB1NqXbDOg1s?= =?us-ascii?Q?L/zNf1hbxQljD7MyRbo6Sbofdm4htMQ3aAZoBWW2kikItbSixnZT8O7nFgYo?= =?us-ascii?Q?JHabhBb1envw0xr09wNtNnAwVKy+Qwc0BD6gRBvO9wTGXIntoM5XWR6eZKwu?= =?us-ascii?Q?eSDeQwtwZ9dDiUma4mUFL4Dz6cgehKxRDFdzArtXl+ifQZSBwFx3v1zW3fNd?= =?us-ascii?Q?ITEi2n3Tm34Q8ktE16RIe0uYbGrHLFzqHb6Z/YsUQH2tOHOeDzOyw1njqmjW?= =?us-ascii?Q?k7TbsV73eOCBh3aWu7mugx9EQCm4guoa37ZsEwy0hLGWcxziawSWDGt5LjBz?= =?us-ascii?Q?9RKkzcUJF23wvpCZtzRzvAqK5g+qZGRCIN4SJVZoxrkDt6EAyMy/5Kt4gCdu?= =?us-ascii?Q?RV+lw+KNZOMHS/0qXyJp/hv4LvGosHjNj7ECEqnTWF0fcwzQlfrsRVROHYiV?= =?us-ascii?Q?mDAMjqn7JtYODne6aCDBSQfoYATATytGzil6nH/TuKqTVeOMqhHXgjv7tv7G?= =?us-ascii?Q?7hPynzVkeO0JYlhOxJIefTsu6g3BbFznL4wkMSaDvEztBhpK1h1OH9HFki99?= =?us-ascii?Q?8DauvWkWN3Xb0GvfRJffLQZ6UyluqEuaLvfdvuw0QWnd533O9ycMp+xg+Oih?= =?us-ascii?Q?pj0wBCeCLS3NMcRoHFljxq6WUCUsLPOMs4pDwPjff3OBiNZBA45jQWwaSCbF?= =?us-ascii?Q?xecugCLHG1+rYYRCyMr93feKa0CeL/OmEUz21qXcZsx6mKHglFpyflLZHf0Z?= =?us-ascii?Q?+a8drCZ5MLHtGPeUhIoRZi5myOIXlwqQ2eHQdU1IYzIUmT7FwfjyMJ2JwRxo?= =?us-ascii?Q?CbmMY8wqRW91rDMqH/6hX1+V+x4d89TPUUw0TQfNDPRIHFOrovkULDO7jL5p?= =?us-ascii?Q?pgagXnDxSU2du0Rt2QTU2Ec5/NcEu4LixE2COSlCU7sypslONy9ZYu11XTh/?= =?us-ascii?Q?jCOfSJWYRyakWMOgn4Cqdh3qogvEAp5mK7CCWyPEBqOduFUMZQAIWbgM1Y7m?= =?us-ascii?Q?kRTKqQm+/gnIqpbZZEm0Sgz1ytmn0LLI9n9kikmggvdJdO8jPnteAX8llHaN?= =?us-ascii?Q?z7chb+4VrMADVnf8xsOu9+8Da6hpkJ3vFW0z7UWIFnky8ZOs4IAzsm0u+8aH?= =?us-ascii?Q?ekKv0cb2WYN5K2CVSG+qqR8XLz91JAPg6H5YChueC64WQ1HSNG0fyOxazwKW?= =?us-ascii?Q?/iNqXvB4mWXQmguBbvc+DobFAtHZt3AICsjQh6pdcF2zeL6wtzPOWXGIlXsJ?= =?us-ascii?Q?7gGvJcSMLw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4945.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83bb24f3-132c-4087-6f2c-08da3c0ff56b X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2022 16:27:26.5668 (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: ifHM6gdIfD6i/LB1RLb/V/oT2FkqrtV+tZBYqQmlrE5uwEsIILoa1u6gr0OoXYnlCdqAdWx1cXUt5LOLfKcTGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3501 Return-Path: jian.j.wang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray, Both CpuDxe.c and CpuExceptionCommon.h have CPU_INTERRUPT_NUM defined. I'd suggest to move it to a common place, such as BaseLib.h. I don't see an= y issue if they are defined to different value. It just gives me a feeling that it = might cause potential problems sometimes in the future. Regards, Jian > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Friday, May 20, 2022 10:16 PM > To: devel@edk2.groups.io > Cc: Dong, Eric > Subject: [edk2-devel] [PATCH 4/5] CpuException: Remove > InitializeCpuInterruptHandlers >=20 > InitializeCpuExceptionHandlers() expects caller allocates IDT while > InitializeCpuInterruptHandlers() allocates 256 IDT entries itself. >=20 > InitializeCpuExceptionHandlers() fills max 32 IDT entries allocated > by caller. If caller allocates 10 entries, the API just fills 10 IDT > entries. >=20 > The inconsistency between the two APIs makes code hard to > unerstand and hard to share. >=20 > Because there is only one caller (CpuDxe) for > InitializeCpuInterruptHandler(), this patch updates CpuDxe driver > to allocates 256 IDT entries then call > InitializeCpuExceptionHandlers(). >=20 > With this change, InitializeCpuInterruptHandlers() is removed > completely. >=20 > And InitializeCpuExceptionHandlers() fills max 32 entries for PEI > and SMM instance, max 256 entries for DXE instance. > Such behavior matches to the original one. >=20 > Signed-off-by: Ray Ni > Cc: Eric Dong > --- > .../Include/Library/CpuExceptionHandlerLib.h | 28 +------ > .../CpuExceptionHandlerLibNull.c | 31 +------ > UefiCpuPkg/CpuDxe/CpuDxe.c | 33 ++++++-- > .../CpuExceptionHandlerLib/DxeException.c | 80 ++----------------- > .../CpuExceptionHandlerLib/PeiCpuException.c | 61 +------------- > .../PeiDxeSmmCpuException.c | 19 ++--- > .../SecPeiCpuException.c | 31 +------ > .../CpuExceptionHandlerLib/SmmException.c | 35 ++------ > 8 files changed, 56 insertions(+), 262 deletions(-) >=20 > diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h > b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h > index 22a4408f9f..d4649bebe1 100644 > --- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h > +++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h > @@ -2,7 +2,7 @@ > CPU Exception library provides the default CPU interrupt/exception han= dler. >=20 > It also provides capability to register user interrupt/exception handl= er. >=20 >=20 >=20 > - Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -132,28 +132,6 @@ InitializeCpuExceptionHandlersEx ( > IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL >=20 > ); >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ); >=20 > - >=20 > /** >=20 > Registers a function to be called from the processor interrupt handler= . >=20 >=20 >=20 > @@ -161,8 +139,8 @@ InitializeCpuInterruptHandlers ( > interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > + NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > is invoked, >=20 > + otherwise EFI_UNSUPPORTED returned. >=20 >=20 >=20 > @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > diff --git > a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLib > Null.c > b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLib > Null.c > index 35ab5a8db5..54f38788fe 100644 > --- > a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLib > Null.c > +++ > b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLib > Null.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU Exception Handler library implementition with empty functions. >=20 >=20 >=20 > - Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -33,31 +33,6 @@ InitializeCpuExceptionHandlers ( > return EFI_SUCCESS; >=20 > } >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ) >=20 > -{ >=20 > - return EFI_SUCCESS; >=20 > -} >=20 > - >=20 > /** >=20 > Registers a function to be called from the processor interrupt handler= . >=20 >=20 >=20 > @@ -65,8 +40,8 @@ InitializeCpuInterruptHandlers ( > interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > + NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > is invoked, >=20 > + otherwise EFI_UNSUPPORTED returned. >=20 >=20 >=20 > @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c > index 00f3cb0957..a6a91507f6 100644 > --- a/UefiCpuPkg/CpuDxe/CpuDxe.c > +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU DXE Module to produce CPU ARCH Protocol. >=20 >=20 >=20 > - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -10,6 +10,8 @@ > #include "CpuMp.h" >=20 > #include "CpuPageTable.h" >=20 >=20 >=20 > +#define CPU_INTERRUPT_NUM 256 >=20 > + >=20 > // >=20 > // Global Variables >=20 > // >=20 > @@ -924,9 +926,12 @@ InitInterruptDescriptorTable ( > VOID >=20 > ) >=20 > { >=20 > - EFI_STATUS Status; >=20 > - EFI_VECTOR_HANDOFF_INFO *VectorInfoList; >=20 > - EFI_VECTOR_HANDOFF_INFO *VectorInfo; >=20 > + EFI_STATUS Status; >=20 > + EFI_VECTOR_HANDOFF_INFO *VectorInfoList; >=20 > + EFI_VECTOR_HANDOFF_INFO *VectorInfo; >=20 > + IA32_IDT_GATE_DESCRIPTOR *IdtTable; >=20 > + IA32_DESCRIPTOR IdtDescriptor; >=20 > + UINTN IdtEntryCount; >=20 >=20 >=20 > VectorInfo =3D NULL; >=20 > Status =3D EfiGetSystemConfigurationTable (&gEfiVectorHandoffTable= Guid, > (VOID **)&VectorInfoList); >=20 > @@ -934,7 +939,25 @@ InitInterruptDescriptorTable ( > VectorInfo =3D VectorInfoList; >=20 > } >=20 >=20 >=20 > - Status =3D InitializeCpuInterruptHandlers (VectorInfo); >=20 > + AsmReadIdtr (&IdtDescriptor); >=20 > + IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > (IA32_IDT_GATE_DESCRIPTOR); >=20 > + if (IdtEntryCount < CPU_INTERRUPT_NUM) { >=20 > + // >=20 > + // Increase Interrupt Descriptor Table and Copy the old IDT table in >=20 > + // >=20 > + IdtTable =3D AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * > CPU_INTERRUPT_NUM); >=20 > + ASSERT (IdtTable !=3D NULL); >=20 > + CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof > (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); >=20 > + >=20 > + // >=20 > + // Load Interrupt Descriptor Table >=20 > + // >=20 > + IdtDescriptor.Base =3D (UINTN)IdtTable; >=20 > + IdtDescriptor.Limit =3D (UINT16)(sizeof (IA32_IDT_GATE_DESCRIPTOR) * > CPU_INTERRUPT_NUM - 1); >=20 > + AsmWriteIdtr (&IdtDescriptor); >=20 > + } >=20 > + >=20 > + Status =3D InitializeCpuExceptionHandlers (VectorInfo); >=20 > ASSERT_EFI_ERROR (Status); >=20 > } >=20 >=20 >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c > index f139131a7c..c7c1fe31d2 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU exception handler library implemenation for DXE modules. >=20 >=20 >=20 > - Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -17,8 +17,8 @@ CONST UINTN mDoFarReturnFlag =3D 0; > RESERVED_VECTORS_DATA mReservedVectorsData[CPU_INTERRUPT_NUM]; >=20 > EFI_CPU_INTERRUPT_HANDLER > mExternalInterruptHandlerTable[CPU_INTERRUPT_NUM]; >=20 > EXCEPTION_HANDLER_DATA mExceptionHandlerData =3D { >=20 > - 0, // To be fixed >=20 > - 0, // To be fixed >=20 > + CPU_INTERRUPT_NUM, >=20 > + 0, // To be fixed >=20 > mReservedVectorsData, >=20 > mExternalInterruptHandlerTable >=20 > }; >=20 > @@ -69,76 +69,6 @@ InitializeCpuExceptionHandlers ( > return InitializeCpuExceptionHandlersWorker (VectorInfo, > &mExceptionHandlerData); >=20 > } >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ) >=20 > -{ >=20 > - EFI_STATUS Status; >=20 > - IA32_IDT_GATE_DESCRIPTOR *IdtTable; >=20 > - IA32_DESCRIPTOR IdtDescriptor; >=20 > - UINTN IdtEntryCount; >=20 > - EXCEPTION_HANDLER_TEMPLATE_MAP TemplateMap; >=20 > - >=20 > - SetMem ((VOID *)mReservedVectorsData, sizeof (RESERVED_VECTORS_DATA) > * CPU_INTERRUPT_NUM, 0xff); >=20 > - if (VectorInfo !=3D NULL) { >=20 > - Status =3D ReadAndVerifyVectorInfo (VectorInfo, mReservedVectorsData= , > CPU_INTERRUPT_NUM); >=20 > - if (EFI_ERROR (Status)) { >=20 > - return EFI_INVALID_PARAMETER; >=20 > - } >=20 > - } >=20 > - >=20 > - // >=20 > - // Read IDT descriptor and calculate IDT size >=20 > - // >=20 > - AsmReadIdtr (&IdtDescriptor); >=20 > - IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > (IA32_IDT_GATE_DESCRIPTOR); >=20 > - if (IdtEntryCount > CPU_INTERRUPT_NUM) { >=20 > - IdtEntryCount =3D CPU_INTERRUPT_NUM; >=20 > - } >=20 > - >=20 > - // >=20 > - // Create Interrupt Descriptor Table and Copy the old IDT table in >=20 > - // >=20 > - IdtTable =3D AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * > CPU_INTERRUPT_NUM); >=20 > - ASSERT (IdtTable !=3D NULL); >=20 > - CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof > (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); >=20 > - >=20 > - AsmGetTemplateAddressMap (&TemplateMap); >=20 > - ASSERT (TemplateMap.ExceptionStubHeaderSize <=3D HOOKAFTER_STUB_SIZE); >=20 > - >=20 > - mExceptionHandlerData.IdtEntryCount =3D CPU_INTERRUPT_NUM; >=20 > - InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock); >=20 > - >=20 > - UpdateIdtTable (IdtTable, &TemplateMap, &mExceptionHandlerData); >=20 > - >=20 > - // >=20 > - // Load Interrupt Descriptor Table >=20 > - // >=20 > - IdtDescriptor.Base =3D (UINTN)IdtTable; >=20 > - IdtDescriptor.Limit =3D (UINT16)(sizeof (IA32_IDT_GATE_DESCRIPTOR) * > CPU_INTERRUPT_NUM - 1); >=20 > - AsmWriteIdtr ((IA32_DESCRIPTOR *)&IdtDescriptor); >=20 > - >=20 > - return EFI_SUCCESS; >=20 > -} >=20 > - >=20 > /** >=20 > Registers a function to be called from the processor interrupt handler= . >=20 >=20 >=20 > @@ -146,8 +76,8 @@ InitializeCpuInterruptHandlers ( > interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > + NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > is invoked, >=20 > + otherwise EFI_UNSUPPORTED returned. >=20 >=20 >=20 > @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > index 687fc4177f..1ae611c75e 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU exception handler library implementation for PEIM module. >=20 >=20 >=20 > -Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -133,6 +133,7 @@ InitializeCpuExceptionHandlers ( >=20 >=20 > ExceptionHandlerData =3D AllocatePool (sizeof (EXCEPTION_HANDLER_DATA)= ); >=20 > ASSERT (ExceptionHandlerData !=3D NULL); >=20 > + ExceptionHandlerData->IdtEntryCount =3D CPU_EXCEPTION_NUM; >=20 > ExceptionHandlerData->ReservedVectors =3D ReservedVectors; >=20 > ExceptionHandlerData->ExternalInterruptHandler =3D NULL; >=20 > InitializeSpinLock (&ExceptionHandlerData->DisplayMessageSpinLock); >=20 > @@ -148,64 +149,6 @@ InitializeCpuExceptionHandlers ( > return EFI_SUCCESS; >=20 > } >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ) >=20 > -{ >=20 > - return EFI_UNSUPPORTED; >=20 > -} >=20 > - >=20 > -/** >=20 > - Registers a function to be called from the processor interrupt handler= . >=20 > - >=20 > - This function registers and enables the handler specified by Interrupt= Handler > for a processor >=20 > - interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > - handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > - The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > - >=20 > - @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > - @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > - when a processor interrupt occurs. If th= is parameter is NULL, > then the handler >=20 > - will be uninstalled. >=20 > - >=20 > - @retval EFI_SUCCESS The handler for the processor interrupt = was > successfully installed or uninstalled. >=20 > - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a hand= ler > for InterruptType was >=20 > - previously installed. >=20 > - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler = for > InterruptType was not >=20 > - previously installed. >=20 > - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType= is not > supported, >=20 > - or this function is not supported. >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -RegisterCpuInterruptHandler ( >=20 > - IN EFI_EXCEPTION_TYPE InterruptType, >=20 > - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler >=20 > - ) >=20 > -{ >=20 > - return EFI_UNSUPPORTED; >=20 > -} >=20 > - >=20 > /** >=20 > Initializes all CPU exceptions entries with optional extra initializat= ions. >=20 >=20 >=20 > diff --git > a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > index f47a80dcab..a7d0897ef1 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU Exception Library provides PEI/DXE/SMM CPU common exception handle= r. >=20 >=20 >=20 > -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -261,31 +261,26 @@ InitializeCpuExceptionHandlersWorker ( > RESERVED_VECTORS_DATA *ReservedVectors; >=20 >=20 >=20 > ReservedVectors =3D ExceptionHandlerData->ReservedVectors; >=20 > - SetMem ((VOID *)ReservedVectors, sizeof (RESERVED_VECTORS_DATA) * > CPU_EXCEPTION_NUM, 0xff); >=20 > + SetMem ((VOID *)ReservedVectors, sizeof (RESERVED_VECTORS_DATA) * > ExceptionHandlerData->IdtEntryCount, 0xff); >=20 > if (VectorInfo !=3D NULL) { >=20 > - Status =3D ReadAndVerifyVectorInfo (VectorInfo, ReservedVectors, > CPU_EXCEPTION_NUM); >=20 > + Status =3D ReadAndVerifyVectorInfo (VectorInfo, ReservedVectors, > ExceptionHandlerData->IdtEntryCount); >=20 > if (EFI_ERROR (Status)) { >=20 > return EFI_INVALID_PARAMETER; >=20 > } >=20 > } >=20 >=20 >=20 > // >=20 > - // Read IDT descriptor and calculate IDT size >=20 > + // Setup the exception handlers according to IDT size, but no more tha= n >=20 > + // ExceptionHandlerData->IdtEntryCount (32 in PEI and SMM, 256 in DX= E) > handlers. >=20 > // >=20 > AsmReadIdtr (&IdtDescriptor); >=20 > - IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > (IA32_IDT_GATE_DESCRIPTOR); >=20 > - if (IdtEntryCount > CPU_EXCEPTION_NUM) { >=20 > - // >=20 > - // CPU exception library only setup CPU_EXCEPTION_NUM exception hand= ler > at most >=20 > - // >=20 > - IdtEntryCount =3D CPU_EXCEPTION_NUM; >=20 > - } >=20 > + IdtEntryCount =3D (IdtDescriptor.Limit + 1) / si= zeof > (IA32_IDT_GATE_DESCRIPTOR); >=20 > + ExceptionHandlerData->IdtEntryCount =3D MIN (IdtEntryCount, > ExceptionHandlerData->IdtEntryCount); >=20 >=20 >=20 > IdtTable =3D (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor.Base; >=20 > AsmGetTemplateAddressMap (&TemplateMap); >=20 > ASSERT (TemplateMap.ExceptionStubHeaderSize <=3D HOOKAFTER_STUB_SIZE); >=20 >=20 >=20 > - ExceptionHandlerData->IdtEntryCount =3D IdtEntryCount; >=20 > UpdateIdtTable (IdtTable, &TemplateMap, ExceptionHandlerData); >=20 >=20 >=20 > return EFI_SUCCESS; >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException= .c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > index 6e5216380d..e894ead612 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU exception handler library implemenation for SEC/PEIM modules. >=20 >=20 >=20 > -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -166,31 +166,6 @@ InitializeCpuExceptionHandlers ( > return EFI_SUCCESS; >=20 > } >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ) >=20 > -{ >=20 > - return EFI_UNSUPPORTED; >=20 > -} >=20 > - >=20 > /** >=20 > Registers a function to be called from the processor interrupt handler= . >=20 >=20 >=20 > @@ -198,8 +173,8 @@ InitializeCpuInterruptHandlers ( > interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > + NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > is invoked, >=20 > + otherwise EFI_UNSUPPORTED returned. >=20 >=20 >=20 > @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c > index 9f0af4120a..ec643556c7 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c > @@ -1,7 +1,7 @@ > /** @file >=20 > CPU exception handler library implementation for SMM modules. >=20 >=20 >=20 > - Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -14,8 +14,8 @@ CONST UINTN mDoFarReturnFlag =3D 1; > RESERVED_VECTORS_DATA mReservedVectorsData[CPU_EXCEPTION_NUM]; >=20 > EFI_CPU_INTERRUPT_HANDLER > mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; >=20 > EXCEPTION_HANDLER_DATA mExceptionHandlerData =3D { >=20 > - 0, // To be fixed >=20 > - 0, // To be fixed >=20 > + CPU_EXCEPTION_NUM, >=20 > + 0, // To be fixed >=20 > mReservedVectorsData, >=20 > mExternalInterruptHandlerTable >=20 > }; >=20 > @@ -62,31 +62,6 @@ InitializeCpuExceptionHandlers ( > return InitializeCpuExceptionHandlersWorker (VectorInfo, > &mExceptionHandlerData); >=20 > } >=20 >=20 >=20 > -/** >=20 > - Initializes all CPU interrupt/exceptions entries and provides the defa= ult > interrupt/exception handlers. >=20 > - >=20 > - Caller should try to get an array of interrupt and/or exception vector= s that are > in use and need to >=20 > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. >=20 > - If caller cannot get reserved vector list or it does not exists, set V= ectorInfo to > NULL. >=20 > - If VectorInfo is not NULL, the exception vectors will be initialized p= er vector > attribute accordingly. >=20 > - >=20 > - @param[in] VectorInfo Pointer to reserved vector list. >=20 > - >=20 > - @retval EFI_SUCCESS All CPU interrupt/exception entries have= been > successfully initialized >=20 > - with default interrupt/exception handler= s. >=20 > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content = if > VectorInfo is not NULL. >=20 > - @retval EFI_UNSUPPORTED This function is not supported. >=20 > - >=20 > -**/ >=20 > -EFI_STATUS >=20 > -EFIAPI >=20 > -InitializeCpuInterruptHandlers ( >=20 > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL >=20 > - ) >=20 > -{ >=20 > - return EFI_UNSUPPORTED; >=20 > -} >=20 > - >=20 > /** >=20 > Registers a function to be called from the processor interrupt handler= . >=20 >=20 >=20 > @@ -94,8 +69,8 @@ InitializeCpuInterruptHandlers ( > interrupt or exception type specified by InterruptType. If InterruptHa= ndler is > NULL, then the >=20 > handler for the processor interrupt or exception type specified by > InterruptType is uninstalled. >=20 > The installed handler is called once for each processor interrupt or e= xception. >=20 > - NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > or >=20 > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > returned. >=20 > + NOTE: This function should be invoked after InitializeCpuExceptionHand= lers() > is invoked, >=20 > + otherwise EFI_UNSUPPORTED returned. >=20 >=20 >=20 > @param[in] InterruptType Defines which interrupt or exception to = hook. >=20 > @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called >=20 > -- > 2.35.1.windows.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#89919): https://edk2.groups.io/g/devel/message/89919 > Mute This Topic: https://groups.io/mt/91231770/1768734 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [jian.j.wang@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20