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.web09.10630.1653405534863764678 for ; Tue, 24 May 2022 08:18:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=mEQ58K8q; 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=1653405535; x=1684941535; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=dWguo/MYAQpHpPY/k59S+GBgvE+zfkv+b/18Fw0sSQ4=; b=mEQ58K8qCI1jtYiZkMw8PJmlVb5wlwjvsSAjZ8zKeccNHcQzgv33v2Bn gXZ75iazDS79Mr3BV9ZDyxAyS3IsdEZtxnfWwK8xTD16vzfbvcvWdZvbR tmmv1xTkhHylXawtVyD/0bBYxSQpvfJ9bpYc5F1YBqq92SEJRN/R7qnUb lZbtct6BEfxJgcGqo+aOt6CTavqc2aS/e+Nlv+5+0wOlOqhym6+7K0WNG RpJga+LdL3+LCINRJA8BLsz0hpAbJ+/NPeqldmhhq29/8a0d6pYlyOFm8 wn2FLrUdSCJXjCefYhefym6DMAjNnhuVimlJI8g7qSg8O7GAnShP8mwQU A==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273554863" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="273554863" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 08:17:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="641977891" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 24 May 2022 08:17:29 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 08:17:28 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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; Tue, 24 May 2022 08:17:28 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 24 May 2022 08:17:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IK4Bk2edGEkKBVn0oVEjesZbtvHXjzFZLAsIyPr9siQ0DBJ/yoL+UrZBBJzsLjvhX5Kqx8I8WxRtqTODyaYcoJNa3mDRxbRllvu5psUh4kQc4g/oUz+gf7N2OKmyPt57TXOyuTwNpg75MaQp1NNX3ZlDq97iQ8r2srzAzfaQf3mIdE98SQ9Mm7XEH7mAueZTNdxR1yiQe/I9/Rqd4C6bm5HlC6fgl+ojalOYjfTqgfx+rUmj5YGgi4Fciz+hiLRLe7UAIcDY8ruErklC6jPZ5uKEz91fM+go5TRo7nFpnkZQOQlrjF3TYA16jZFFTMbNepeDWVk/ASTw2BCtYIudpw== 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=Fn4+jZkSJSFkRR4Q36NenFaQ4f8iPmDio4Q2+HxoqBM=; b=lB2RY7dqNUzEWZOZyI3c56JOK8djuaJPaxVyywRBu4/N5YpHysCUDhjCnMvJ6zABVl5YVyv1CyE6QjzbLnKRSHNG9NOQw4Oq2rwgGAbrVFd/2EDDgciWx+jeYc9qvjMVx+dubUdkzVu0ZYzPweG1/STA9Y0+PO9j+a/q9yzAFPtH6GNVaKqLD3wc4QdjyLKU8u/f02Ewe+xHKE9Hk3EAnLumz9OArQWkGGcyV7OPDDtvKn6e58AaI6wx5pyUWbWnq4cvePzP5eKOeQjN8W3+WM1ObWiF4dqGpA6JUW3nsL/xNkJ5CQA/v9W+OXVNPBxETt30SVYAq0Aj+wFR67g29Q== 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 DM6PR11MB3162.namprd11.prod.outlook.com (2603:10b6:5:55::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Tue, 24 May 2022 15:17:21 +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.5293.013; Tue, 24 May 2022 15:17:21 +0000 From: "Wang, Jian J" To: "Ni, Ray" , "devel@edk2.groups.io" 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/ggAKbawCAAHjWkA== Date: Tue, 24 May 2022 15:17:20 +0000 Message-ID: References: <20220520141549.108-1-ray.ni@intel.com> <20220520141549.108-5-ray.ni@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 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: 6e7e568e-35c4-4fda-4584-08da3d987f83 x-ms-traffictypediagnostic: DM6PR11MB3162: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: vHTC+sscNMP15y9u022XcfjPAaw2gsDbRuOx+DsyRd6kHGKoNdC6S9ZxjNKJId6Hu08rjOqI7buh7HnMFv5XNlQ/UcvBWkQjEX0CcLAS4hmOlJLFRGA+rIzKgdzScOR7QPLm5dLlxnoLdTr9SjtG2ChHde11udBbD+wlL4vSLU0EpsC+PFnUH3xjeJbCcIyI6VKs8I+hPitT2WAv1cf+ZZT59UvNeGJDyd0EO6v7og8e7eJ57qJKXvKI3ooeNRER7UDv6r25iWEHIAjUrbkYsQPVxuS8UIjTRHgt9RuG/MMecVHH7izf8oRdUBmJQoF82uWKwo66fvO3yDuI+pnXVyLOU81diy80WSTIDUm1Qm1WIVLVu4mj9UZP01pe3bST9vEXL/WIS1ao6Gz92SoHQHRfNWb9tI/oS0W04xBCfalW9hP5WYb/Uls6ferx6wljbe+5f1Z9x7fqQ5uw4kuNE/d1MKfqmNJFrZLk1uTbNAREDCO6NxOClJQZ+Kr0KgtmjBXU7XVuqK0ZL7vhVww52apim45DomGgVZ5f6zN119VuzI1d1zDPAqx7VzpMqPXObAjLVZifd8/DmJwYeAps0VKCSafplzMLqXESaRMm//itvbhPY8AX00oRfRhlZwjINZa4JK2ouF81urVtUSpbGUmMqVSo22Qiv/ILyIxspZFVcE1xmmh7sqkliLrV4PP4YKYHTqSf1Yf5UIgerujKO4U1YI7LPYxE8CYPT/eZoA13nh8mMPyzVW5cVSJ+aTjoSR1klphzXxzIA7g0DUxgvF/8oWL/0nJwYQ48qGMtZyTApYwvXdh0ukiq9BiQqMUrl+lqGqvCROLvCpAD/t/LDQ== 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)(316002)(53546011)(55016003)(38100700002)(66556008)(82960400001)(26005)(30864003)(9686003)(71200400001)(83380400001)(966005)(7696005)(6506007)(508600001)(110136005)(33656002)(64756008)(66446008)(122000001)(76116006)(4326008)(86362001)(66476007)(8936002)(5660300002)(38070700005)(52536014)(8676002)(66946007)(2906002)(186003)(107886003)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1cm/vAH1UqFclFvfpNrjNQplsLL0xLthEnDbw9PaUltAmduh7hDOQJBdenJl?= =?us-ascii?Q?68sFvOCWNN8xv+XhLL1bHrIN01QnMgeH3/Tx/+Qz/A6W0mrF2ma53NwbLqUX?= =?us-ascii?Q?15gi1V4gglQ1fKf4/l90aQq++FInW+HdYOCDHpMWVy5X+qf6/teybEo5PVh9?= =?us-ascii?Q?qtbtGAd406iKiNBrUQj+uOp1ByvyOkeYwcJ0hdSwaZ/2BjJOrdd3FwfN3d4Y?= =?us-ascii?Q?eatNLao/YRj4i4JruOh3ct3TTE7OLGcy/eeDfdzitmy63q47pwZeLAWk7k1N?= =?us-ascii?Q?/pDz8rX0dH/MUuFvxRU313WWwNFCR+UOO51vE3wON32+oMs6cDRgSDHQ9jcg?= =?us-ascii?Q?RrLaBO2VbnufSgotytr7SMoz1MCcxzox+svuGj2DoL6cXiVobeY9HdqRjGCA?= =?us-ascii?Q?QeyGFW6CdwMfJwHu/8J4ja7rq+3DBw/CudBrV9+7ZWoWiWTiPNCH/+w4bXc2?= =?us-ascii?Q?AR5cueqZvFhjyTs2ICjZXIntLEZrs9Dp/uHkksgQqOIHGDBXeI8Ad1wpQLWT?= =?us-ascii?Q?4EQiJWnBG0GPnqkmr4Vru5laRo5nqKAzUMp50IQXoCFD1Pfhvz/CSeFVNUsv?= =?us-ascii?Q?vVkUiykNrzNCqhJVmIez7Wv3430x/gwQdj0owjIBStfpgPoXEnxuzUz6pPQa?= =?us-ascii?Q?hZnF3P8Z8bBMPJFI6PNAXMQvip6fgVDhhiWc6mqElCxzTAqRIt+XtZWBEi5d?= =?us-ascii?Q?dUeHpKKzXSKQ7kPLjgwUH+iW2r+QTMJHcQzb62CR7NzHcOy2BQhH9AzO08FX?= =?us-ascii?Q?47gRLQYaWV/2R9/tKaZgTqp2gosatVfng1czdff+e7ChGFaQ/JjY2VKl0Ze5?= =?us-ascii?Q?OV+f6qX4ix42UOXHUuZS3U8zJJdgSQzK85kBuTVgtB+eJa+on2b3tHhgZYC4?= =?us-ascii?Q?7Y6OZd1YnLDGdyETNuwWsgOLt8oXIYRe69bIBWCumkb2+h5Yw/fm5YtHYIIV?= =?us-ascii?Q?6sVG+t/EGxtQEDMdC9j8l/p00OFytWawkF8O5uK2kwLYaCLTPpvnPszSuZTx?= =?us-ascii?Q?rUFGrIsQSh6WQrbqS+cSnLZGtWwWMLAK2k5QGrWMLIvQGLHGQlMQNnQK31bi?= =?us-ascii?Q?75Wa8EU1ReRbcwXDyNZcmAFwEAHM2/TkVOCjz/oS00gpswcnpaqcTHzwVqXw?= =?us-ascii?Q?bF/a5keTNcMoes9DcvrrRANJZuN3eXnWde9xXdIpPiWRjeRP2pdVUzJftllJ?= =?us-ascii?Q?6IKpKXNhvOi30RgoDJvrUeFgxsvVL5kGR9tjeHjWDSe2s8Pzzk3X9z0CnH9u?= =?us-ascii?Q?ow9RL8x7ngonK+/T6bvhceNlQvWS6PKt4uy0abwguSD2ijMbuR70PXHhrT/J?= =?us-ascii?Q?7O+ExeCLXiShHR09HuZqYqWtXZFnrg6P5KAiC947oxNuf7IrtJiPmV4TRAfC?= =?us-ascii?Q?bV6TyDGIsl5ShUFAWMi1U73HPXgPRfwzGJ6IpbdDlnXD2Dwf/ZKeWFpEATmN?= =?us-ascii?Q?CD+qEJ1walSieH2NLMV3FTOcuReBX0nsp30cNz7J8j5g2V3LQ9YmoaL5oSMl?= =?us-ascii?Q?c9wBiJ0ZlK824Rf4r8nLr6cnpb1c4I9j4oVyNbt6DUiWBLEMhnnjgFtsyor0?= =?us-ascii?Q?gyqb2HGbdi7pUMBJhubLtS8Z9TALVSBiKPjdZEP6XPDGoXWdFPiMLecwBg+3?= =?us-ascii?Q?U3tiY+q3XO/Xf0rVELsp9UnJRvCW2PR08xowKF+gbnPYlCQMJEIPB6bBICSv?= =?us-ascii?Q?v+nAgjVX5VVe9YIHNG5zUNL9HJHM/rFrkZhiKHJLlRplMt+zDxrQ+qnvoVk0?= =?us-ascii?Q?VHp//agn+A=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: 6e7e568e-35c4-4fda-4584-08da3d987f83 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 15:17:20.9510 (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: +0wA63mn7zNjlAjKP7efAKSO4UIxxmbV/TN6tibCgqz2IjH757/gt06nD+vtSNIhnXzwjfrPWk+rGMTAMN+OIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3162 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 Another patch works for me. Reviewed-by: Jian J Wang Regards, Jian > -----Original Message----- > From: Ni, Ray > Sent: Tuesday, May 24, 2022 4:04 PM > To: Wang, Jian J ; devel@edk2.groups.io > Cc: Dong, Eric > Subject: Re: [edk2-devel] [PATCH 4/5] CpuException: Remove > InitializeCpuInterruptHandlers >=20 > Jian, > I think we need discussion on where to put the common CPU_INTERRUPT_NUM > definition. >=20 > Do you agree that we can leave that to another patch? >=20 > ________________________________________ > From: Wang, Jian J > Sent: Monday, May 23, 2022 0:27 > To: devel@edk2.groups.io; Ni, Ray > Cc: Dong, Eric > Subject: RE: [edk2-devel] [PATCH 4/5] CpuException: Remove > InitializeCpuInterruptHandlers >=20 > Hi Ray, >=20 > 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 = any > issue > if they are defined to different value. It just gives me a feeling that i= t might > cause > potential problems sometimes in the future. >=20 >=20 > Regards, > Jian >=20 > > -----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 > > > > InitializeCpuExceptionHandlers() expects caller allocates IDT while > > InitializeCpuInterruptHandlers() allocates 256 IDT entries itself. > > > > InitializeCpuExceptionHandlers() fills max 32 IDT entries allocated > > by caller. If caller allocates 10 entries, the API just fills 10 IDT > > entries. > > > > The inconsistency between the two APIs makes code hard to > > unerstand and hard to share. > > > > Because there is only one caller (CpuDxe) for > > InitializeCpuInterruptHandler(), this patch updates CpuDxe driver > > to allocates 256 IDT entries then call > > InitializeCpuExceptionHandlers(). > > > > With this change, InitializeCpuInterruptHandlers() is removed > > completely. > > > > And InitializeCpuExceptionHandlers() fills max 32 entries for PEI > > and SMM instance, max 256 entries for DXE instance. > > Such behavior matches to the original one. > > > > 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(-) > > > > 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 h= andler. > > > > It also provides capability to register user interrupt/exception han= dler. > > > > > > > > - Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved. > > > > + Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -132,28 +132,6 @@ InitializeCpuExceptionHandlersEx ( > > IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL > > > > ); > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ); > > > > - > > > > /** > > > > Registers a function to be called from the processor interrupt handl= er. > > > > > > > > @@ -161,8 +139,8 @@ InitializeCpuInterruptHandlers ( > > interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > + NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > is invoked, > > > > + otherwise EFI_UNSUPPORTED returned. > > > > > > > > @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > 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 > > > > CPU Exception Handler library implementition with empty functions. > > > > > > > > - Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved. > > > > + Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -33,31 +33,6 @@ InitializeCpuExceptionHandlers ( > > return EFI_SUCCESS; > > > > } > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ) > > > > -{ > > > > - return EFI_SUCCESS; > > > > -} > > > > - > > > > /** > > > > Registers a function to be called from the processor interrupt handl= er. > > > > > > > > @@ -65,8 +40,8 @@ InitializeCpuInterruptHandlers ( > > interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > + NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > is invoked, > > > > + otherwise EFI_UNSUPPORTED returned. > > > > > > > > @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > 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 > > > > CPU DXE Module to produce CPU ARCH Protocol. > > > > > > > > - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved. > > > > + Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -10,6 +10,8 @@ > > #include "CpuMp.h" > > > > #include "CpuPageTable.h" > > > > > > > > +#define CPU_INTERRUPT_NUM 256 > > > > + > > > > // > > > > // Global Variables > > > > // > > > > @@ -924,9 +926,12 @@ InitInterruptDescriptorTable ( > > VOID > > > > ) > > > > { > > > > - EFI_STATUS Status; > > > > - EFI_VECTOR_HANDOFF_INFO *VectorInfoList; > > > > - EFI_VECTOR_HANDOFF_INFO *VectorInfo; > > > > + EFI_STATUS Status; > > > > + EFI_VECTOR_HANDOFF_INFO *VectorInfoList; > > > > + EFI_VECTOR_HANDOFF_INFO *VectorInfo; > > > > + IA32_IDT_GATE_DESCRIPTOR *IdtTable; > > > > + IA32_DESCRIPTOR IdtDescriptor; > > > > + UINTN IdtEntryCount; > > > > > > > > VectorInfo =3D NULL; > > > > Status =3D EfiGetSystemConfigurationTable (&gEfiVectorHandoffTab= leGuid, > > (VOID **)&VectorInfoList); > > > > @@ -934,7 +939,25 @@ InitInterruptDescriptorTable ( > > VectorInfo =3D VectorInfoList; > > > > } > > > > > > > > - Status =3D InitializeCpuInterruptHandlers (VectorInfo); > > > > + AsmReadIdtr (&IdtDescriptor); > > > > + IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > > (IA32_IDT_GATE_DESCRIPTOR); > > > > + if (IdtEntryCount < CPU_INTERRUPT_NUM) { > > > > + // > > > > + // Increase Interrupt Descriptor Table and Copy the old IDT table = in > > > > + // > > > > + IdtTable =3D AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * > > CPU_INTERRUPT_NUM); > > > > + ASSERT (IdtTable !=3D NULL); > > > > + CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof > > (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); > > > > + > > > > + // > > > > + // Load Interrupt Descriptor Table > > > > + // > > > > + IdtDescriptor.Base =3D (UINTN)IdtTable; > > > > + IdtDescriptor.Limit =3D (UINT16)(sizeof (IA32_IDT_GATE_DESCRIPTOR)= * > > CPU_INTERRUPT_NUM - 1); > > > > + AsmWriteIdtr (&IdtDescriptor); > > > > + } > > > > + > > > > + Status =3D InitializeCpuExceptionHandlers (VectorInfo); > > > > ASSERT_EFI_ERROR (Status); > > > > } > > > > > > > > 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 > > > > CPU exception handler library implemenation for DXE modules. > > > > > > > > - Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved. > > > > + Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -17,8 +17,8 @@ CONST UINTN mDoFarReturnFlag =3D 0; > > RESERVED_VECTORS_DATA > mReservedVectorsData[CPU_INTERRUPT_NUM]; > > > > EFI_CPU_INTERRUPT_HANDLER > > mExternalInterruptHandlerTable[CPU_INTERRUPT_NUM]; > > > > EXCEPTION_HANDLER_DATA mExceptionHandlerData =3D { > > > > - 0, // To be fixed > > > > - 0, // To be fixed > > > > + CPU_INTERRUPT_NUM, > > > > + 0, // To be fixed > > > > mReservedVectorsData, > > > > mExternalInterruptHandlerTable > > > > }; > > > > @@ -69,76 +69,6 @@ InitializeCpuExceptionHandlers ( > > return InitializeCpuExceptionHandlersWorker (VectorInfo, > > &mExceptionHandlerData); > > > > } > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ) > > > > -{ > > > > - EFI_STATUS Status; > > > > - IA32_IDT_GATE_DESCRIPTOR *IdtTable; > > > > - IA32_DESCRIPTOR IdtDescriptor; > > > > - UINTN IdtEntryCount; > > > > - EXCEPTION_HANDLER_TEMPLATE_MAP TemplateMap; > > > > - > > > > - SetMem ((VOID *)mReservedVectorsData, sizeof > (RESERVED_VECTORS_DATA) > > * CPU_INTERRUPT_NUM, 0xff); > > > > - if (VectorInfo !=3D NULL) { > > > > - Status =3D ReadAndVerifyVectorInfo (VectorInfo, mReservedVectorsDa= ta, > > CPU_INTERRUPT_NUM); > > > > - if (EFI_ERROR (Status)) { > > > > - return EFI_INVALID_PARAMETER; > > > > - } > > > > - } > > > > - > > > > - // > > > > - // Read IDT descriptor and calculate IDT size > > > > - // > > > > - AsmReadIdtr (&IdtDescriptor); > > > > - IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > > (IA32_IDT_GATE_DESCRIPTOR); > > > > - if (IdtEntryCount > CPU_INTERRUPT_NUM) { > > > > - IdtEntryCount =3D CPU_INTERRUPT_NUM; > > > > - } > > > > - > > > > - // > > > > - // Create Interrupt Descriptor Table and Copy the old IDT table in > > > > - // > > > > - IdtTable =3D AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * > > CPU_INTERRUPT_NUM); > > > > - ASSERT (IdtTable !=3D NULL); > > > > - CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof > > (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); > > > > - > > > > - AsmGetTemplateAddressMap (&TemplateMap); > > > > - ASSERT (TemplateMap.ExceptionStubHeaderSize <=3D > HOOKAFTER_STUB_SIZE); > > > > - > > > > - mExceptionHandlerData.IdtEntryCount =3D CPU_INTERRUPT_NUM= ; > > > > - InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock); > > > > - > > > > - UpdateIdtTable (IdtTable, &TemplateMap, &mExceptionHandlerData); > > > > - > > > > - // > > > > - // Load Interrupt Descriptor Table > > > > - // > > > > - IdtDescriptor.Base =3D (UINTN)IdtTable; > > > > - IdtDescriptor.Limit =3D (UINT16)(sizeof (IA32_IDT_GATE_DESCRIPTOR) * > > CPU_INTERRUPT_NUM - 1); > > > > - AsmWriteIdtr ((IA32_DESCRIPTOR *)&IdtDescriptor); > > > > - > > > > - return EFI_SUCCESS; > > > > -} > > > > - > > > > /** > > > > Registers a function to be called from the processor interrupt handl= er. > > > > > > > > @@ -146,8 +76,8 @@ InitializeCpuInterruptHandlers ( > > interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > + NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > is invoked, > > > > + otherwise EFI_UNSUPPORTED returned. > > > > > > > > @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > 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 > > > > CPU exception handler library implementation for PEIM module. > > > > > > > > -Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> > > > +Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -133,6 +133,7 @@ InitializeCpuExceptionHandlers ( > > > > > > ExceptionHandlerData =3D AllocatePool (sizeof (EXCEPTION_HANDLER_DAT= A)); > > > > ASSERT (ExceptionHandlerData !=3D NULL); > > > > + ExceptionHandlerData->IdtEntryCount =3D CPU_EXCEPTION_NUM= ; > > > > ExceptionHandlerData->ReservedVectors =3D ReservedVectors; > > > > ExceptionHandlerData->ExternalInterruptHandler =3D NULL; > > > > InitializeSpinLock (&ExceptionHandlerData->DisplayMessageSpinLock); > > > > @@ -148,64 +149,6 @@ InitializeCpuExceptionHandlers ( > > return EFI_SUCCESS; > > > > } > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ) > > > > -{ > > > > - return EFI_UNSUPPORTED; > > > > -} > > > > - > > > > -/** > > > > - Registers a function to be called from the processor interrupt handl= er. > > > > - > > > > - This function registers and enables the handler specified by Interru= ptHandler > > for a processor > > > > - interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > - handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > - The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > - > > > > - @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > - @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > - when a processor interrupt occurs. If = this parameter is NULL, > > then the handler > > > > - will be uninstalled. > > > > - > > > > - @retval EFI_SUCCESS The handler for the processor interrup= t was > > successfully installed or uninstalled. > > > > - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a > handler > > for InterruptType was > > > > - previously installed. > > > > - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handle= r > for > > InterruptType was not > > > > - previously installed. > > > > - @retval EFI_UNSUPPORTED The interrupt specified by InterruptTy= pe is > not > > supported, > > > > - or this function is not supported. > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -RegisterCpuInterruptHandler ( > > > > - IN EFI_EXCEPTION_TYPE InterruptType, > > > > - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler > > > > - ) > > > > -{ > > > > - return EFI_UNSUPPORTED; > > > > -} > > > > - > > > > /** > > > > Initializes all CPU exceptions entries with optional extra initializ= ations. > > > > > > > > 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 > > > > CPU Exception Library provides PEI/DXE/SMM CPU common exception > handler. > > > > > > > > -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
> > > > +Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -261,31 +261,26 @@ InitializeCpuExceptionHandlersWorker ( > > RESERVED_VECTORS_DATA *ReservedVectors; > > > > > > > > ReservedVectors =3D ExceptionHandlerData->ReservedVectors; > > > > - SetMem ((VOID *)ReservedVectors, sizeof (RESERVED_VECTORS_DATA) * > > CPU_EXCEPTION_NUM, 0xff); > > > > + SetMem ((VOID *)ReservedVectors, sizeof (RESERVED_VECTORS_DATA) * > > ExceptionHandlerData->IdtEntryCount, 0xff); > > > > if (VectorInfo !=3D NULL) { > > > > - Status =3D ReadAndVerifyVectorInfo (VectorInfo, ReservedVectors, > > CPU_EXCEPTION_NUM); > > > > + Status =3D ReadAndVerifyVectorInfo (VectorInfo, ReservedVectors, > > ExceptionHandlerData->IdtEntryCount); > > > > if (EFI_ERROR (Status)) { > > > > return EFI_INVALID_PARAMETER; > > > > } > > > > } > > > > > > > > // > > > > - // Read IDT descriptor and calculate IDT size > > > > + // Setup the exception handlers according to IDT size, but no more t= han > > > > + // ExceptionHandlerData->IdtEntryCount (32 in PEI and SMM, 256 in = DXE) > > handlers. > > > > // > > > > AsmReadIdtr (&IdtDescriptor); > > > > - IdtEntryCount =3D (IdtDescriptor.Limit + 1) / sizeof > > (IA32_IDT_GATE_DESCRIPTOR); > > > > - if (IdtEntryCount > CPU_EXCEPTION_NUM) { > > > > - // > > > > - // CPU exception library only setup CPU_EXCEPTION_NUM exception > handler > > at most > > > > - // > > > > - IdtEntryCount =3D CPU_EXCEPTION_NUM; > > > > - } > > > > + IdtEntryCount =3D (IdtDescriptor.Limit + 1) / = sizeof > > (IA32_IDT_GATE_DESCRIPTOR); > > > > + ExceptionHandlerData->IdtEntryCount =3D MIN (IdtEntryCount, > > ExceptionHandlerData->IdtEntryCount); > > > > > > > > IdtTable =3D (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor.Base; > > > > AsmGetTemplateAddressMap (&TemplateMap); > > > > ASSERT (TemplateMap.ExceptionStubHeaderSize <=3D HOOKAFTER_STUB_SIZE= ); > > > > > > > > - ExceptionHandlerData->IdtEntryCount =3D IdtEntryCount; > > > > UpdateIdtTable (IdtTable, &TemplateMap, ExceptionHandlerData); > > > > > > > > return EFI_SUCCESS; > > > > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExcepti= on.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 > > > > CPU exception handler library implemenation for SEC/PEIM modules. > > > > > > > > -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
> > > > +Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -166,31 +166,6 @@ InitializeCpuExceptionHandlers ( > > return EFI_SUCCESS; > > > > } > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ) > > > > -{ > > > > - return EFI_UNSUPPORTED; > > > > -} > > > > - > > > > /** > > > > Registers a function to be called from the processor interrupt handl= er. > > > > > > > > @@ -198,8 +173,8 @@ InitializeCpuInterruptHandlers ( > > interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > + NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > is invoked, > > > > + otherwise EFI_UNSUPPORTED returned. > > > > > > > > @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > 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 > > > > CPU exception handler library implementation for SMM modules. > > > > > > > > - Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved. > > > > + Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -14,8 +14,8 @@ CONST UINTN mDoFarReturnFlag =3D 1; > > RESERVED_VECTORS_DATA > mReservedVectorsData[CPU_EXCEPTION_NUM]; > > > > EFI_CPU_INTERRUPT_HANDLER > > mExternalInterruptHandlerTable[CPU_EXCEPTION_NUM]; > > > > EXCEPTION_HANDLER_DATA mExceptionHandlerData =3D { > > > > - 0, // To be fixed > > > > - 0, // To be fixed > > > > + CPU_EXCEPTION_NUM, > > > > + 0, // To be fixed > > > > mReservedVectorsData, > > > > mExternalInterruptHandlerTable > > > > }; > > > > @@ -62,31 +62,6 @@ InitializeCpuExceptionHandlers ( > > return InitializeCpuExceptionHandlersWorker (VectorInfo, > > &mExceptionHandlerData); > > > > } > > > > > > > > -/** > > > > - Initializes all CPU interrupt/exceptions entries and provides the de= fault > > interrupt/exception handlers. > > > > - > > > > - Caller should try to get an array of interrupt and/or exception vect= ors that > are > > in use and need to > > > > - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. > > > > - If caller cannot get reserved vector list or it does not exists, set= VectorInfo > to > > NULL. > > > > - If VectorInfo is not NULL, the exception vectors will be initialized= per vector > > attribute accordingly. > > > > - > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > > > - > > > > - @retval EFI_SUCCESS All CPU interrupt/exception entries ha= ve been > > successfully initialized > > > > - with default interrupt/exception handl= ers. > > > > - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid conten= t if > > VectorInfo is not NULL. > > > > - @retval EFI_UNSUPPORTED This function is not supported. > > > > - > > > > -**/ > > > > -EFI_STATUS > > > > -EFIAPI > > > > -InitializeCpuInterruptHandlers ( > > > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > > > - ) > > > > -{ > > > > - return EFI_UNSUPPORTED; > > > > -} > > > > - > > > > /** > > > > Registers a function to be called from the processor interrupt handl= er. > > > > > > > > @@ -94,8 +69,8 @@ InitializeCpuInterruptHandlers ( > > interrupt or exception type specified by InterruptType. If Interrupt= Handler is > > NULL, then the > > > > handler for the processor interrupt or exception type specified by > > InterruptType is uninstalled. > > > > The installed handler is called once for each processor interrupt or= exception. > > > > - NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > or > > > > - InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED > > returned. > > > > + NOTE: This function should be invoked after InitializeCpuExceptionHa= ndlers() > > is invoked, > > > > + otherwise EFI_UNSUPPORTED returned. > > > > > > > > @param[in] InterruptType Defines which interrupt or exception t= o hook. > > > > @param[in] InterruptHandler A pointer to a function of type > > EFI_CPU_INTERRUPT_HANDLER that is called > > > > -- > > 2.35.1.windows.2 > > > > > > > > -=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/8991= 9 > > 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.co= m] > > -=3D-=3D-=3D-=3D-=3D-=3D > >