From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.3981.1665637089255310053 for ; Wed, 12 Oct 2022 21:58:10 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=flwBZCZY; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665637089; x=1697173089; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qSwrrkfxql2wzL0jXRJZB36LFJEklYN0Tq7W+dlAgVE=; b=flwBZCZYGkaTYgt9KuKnV100NFqGQNttyJISEGbW9ASBzIGjL5mV/LPN C2S1l56tpZInqhA2hqxwSXzYzw3pNmeVFGJxkH+pXtrJkJnA7APdSJFXq I2B90LwDJQU9aDa/cXIAF7ijDNEPL5WXV4ltXGzFG560vlQZBnxB+fE0i 2wdnRIla2IjOT+47kwQ8jWV2JY+QRssq714FnaIpRnjKDHnTlrvRbKyO5 pPg6DWICU2PI13+N83t3vll++TIv1eO+JoJ2aGGrrU5dax49xnStcuPEG dz0nXZheCg+is6wuWqvTcpew71ozqfRvhlG6sqqa7SUaOzyNJArlYGif+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="366978750" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="366978750" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 21:57:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="658032719" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="658032719" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 12 Oct 2022 21:57:50 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 12 Oct 2022 21:57:49 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 12 Oct 2022 21:57:49 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 12 Oct 2022 21:57:49 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 12 Oct 2022 21:57:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cN5T8BLgylufnXfnSIgIMiEzjjk7Mz1rgq/LFaPLiJj0eFYP5rfFKuC9AVNEpoTveVog3FWY3BNrXNuMLTsMAqLbLZPJ99eTV4swC4SuEIh0Ok9b+RSkOtTbBDH2A2+zM++KrmrZ6H5S8dkjg++jds0HLt/rF4nul8GFvu28x1TKMC+Jt5irjWrfMzBVqxebkYBhEE6WVW96RT2wu8Ex+zzgNDvNbUFUWYMdN7DZ6bnIxHqALC2xUj6+AFrQ8zBSOPZVFGZTRNpA066wvULOCHga3slCdQVB9qouLnbd9WT6fj2cRGkdnEzEh/q6EA3aFMqRO4SDnw7W6uQWxLUeIA== 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=cXFfRXX+weXdi33AkJzJrJ3zohYo4cVJgYOYG2sRhg0=; b=H6iRX0QkMhNI2E2JGK1rFq6/SfEdIi6oewvOVaYQzrR4U4HVbeDnKVcgb1+lzxPZRqr52gsSU0MTcBfLZzX/8P9zFwO36yKbxhtZICCooqwJoNLh2I8VyoZfdSeCr/a39YL76Z0Qv/s/oM5qtXq9Mtl4xt9LfjbSsMuzXsf9R6xehK0bEw61Yn54IMSo41th3LTGqOM+kawDCjjKsLzzTjuykeQAZLhv3T+/LNQCKYa+4+qbuvIvTu9XT/ZDdiOzt48XcZ32XWsSTT5tUmshFpKrmb6uABGv4Dm7jXPo+udElgJ27qhda2APGy4E7SEb8BX0EkGqZymULYRUTGrtrg== 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 MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by SJ0PR11MB5200.namprd11.prod.outlook.com (2603:10b6:a03:2df::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Thu, 13 Oct 2022 04:57:48 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::483f:4bb5:a15f:f571]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::483f:4bb5:a15f:f571%11]) with mapi id 15.20.5709.021; Thu, 13 Oct 2022 04:57:48 +0000 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" Subject: Re: [PATCH V2] UefiCpuPkg:Add RegisterExceptionHandler in PeiCpuExceptionHandlerLib Thread-Topic: [PATCH V2] UefiCpuPkg:Add RegisterExceptionHandler in PeiCpuExceptionHandlerLib Thread-Index: AQHY3gwpPbTJM1wYKkiM4c5Y4SaKwa4LxLIw Date: Thu, 13 Oct 2022 04:57:48 +0000 Message-ID: References: <20221012072745.549-1-zhiguang.liu@intel.com> In-Reply-To: <20221012072745.549-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MWHPR11MB1631:EE_|SJ0PR11MB5200:EE_ x-ms-office365-filtering-correlation-id: 5b441bd5-e009-4da0-25cd-08daacd77961 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jQpSKtlZpRxG9NiQ+Zqm0x2sDD0+Z3/S4/CMcNYS0BLpxhNljsvlhaNvRdLtmMTW1moA1pdqLCRxjRQCdMppD7pVHUtn9Guif0PCDIwGMw7AdkpDGN+FSbti7TPaO85i426j800oKaTn4mXBP7rjYKZgpZ2njSwIX7Gu3f+y8GHkw3LVrkNE3BvyZAVeVDvkD3tg+2Lg4c9mr94WVyAv27BEy/CL3i+4ZjFQgLBSefdsrinv93yrjOTfwaAKJkYo0wPDHz6TDUFcut2vuTDaduBKl6b7KDqm2fy1o0sqUQAxJ7udDllO2uUexNvPme+590GcjJNWCC4Q30FAsw2qfxOcilXsC0hSA6aksxMfR5ud80kCjtucPH45xkuLSFZMpuoxmiVhNJ3daq2I1ntKXqkv84yX2L79p7sExoxHrkNncW6QvXutbv4kIwKgzbZ5k7itXIKSgkBNAQH/htUUi8ByqLq18DUr0Ox+ojbYZn6mWqHmze3W1/9HNXqSyszzzYECfzMsQDCLbd2aDl4nCYPS/SjvShfwdDtnBhDmQkniPUENTsIfqig/zwHLbUCrCFDHmBUNOkxmj1EsnVwxAVQmDHnJRKCQ0m48+9nJePoRbGAwIEKObPqvFoCSpPaItFFsQ12vGSDCdPwJT8zA9p4SXPHJNX+m2LZUvLRmLU6310GtcwX5j82l8hpk0Z5yuAU753j4GZ8/tPhLXZyGHAN9ilEOX3TTw0r52pVGbzyf7M7y01RrS9bV3xZMhVFcweHNWjjhZBHJzXtvdkw8DPD1xqpTabtWOWH2GrZe89g= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(136003)(376002)(39860400002)(366004)(396003)(451199015)(316002)(38100700002)(6506007)(122000001)(5660300002)(54906003)(110136005)(82960400001)(64756008)(66946007)(2906002)(38070700005)(66556008)(66446008)(66476007)(52536014)(76116006)(4326008)(186003)(41300700001)(8676002)(53546011)(8936002)(7696005)(9686003)(478600001)(83380400001)(26005)(71200400001)(107886003)(55016003)(33656002)(86362001)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nDYqSf1qN4px2ln/65uRinJm+Yom51UZiZr1XDVZ4xvh1NOx7xvEweZ/Xgx4?= =?us-ascii?Q?MPidd1BO6RY9+1Kx/65MK041+D+dNR0CERsBZ4sPtnUWFmYhAKXvlisjklap?= =?us-ascii?Q?EzFTNDKCr3iD8WlX8UHg93witXAs2nYhSwmlPFvqXUWoRbAVEJZbetNgPuhl?= =?us-ascii?Q?qRDnJK6KmR1jLK0qzWdw3sJI2RCJtI0mCtxxL1m7b2ZB00/YCLDUa4mlHMCw?= =?us-ascii?Q?Jtbze9B32rUunupxhy0UfGfwRLOH1C/1XtN3jriRlAMyXVMY+R0zc0KdcpSv?= =?us-ascii?Q?5Dh3BQcK71sdvZLB/r4HCEk3WUh5j6FdKvDEj9n3rkxhM18Uap5cvq+62ZTh?= =?us-ascii?Q?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AHUE/I07?= =?us-ascii?Q?2uAgFOcgARH4pSR+geidCSpOwFMfGtWgpMfOHbAIu2NtGLCpGI75MCwZFfC4?= =?us-ascii?Q?XGHTy8LWYTW4e/6YehB+f+rVKYOGvl+1GFaGZFvbd11Kar9lB9J9GXkjeA8i?= =?us-ascii?Q?eMk91L1g0UCXy957BDZsnXrZu6GH/gXot8LjJsUjCT8n1De02gl3WC39OtGR?= =?us-ascii?Q?kjgRBroDOBVXN5TtEDxZ1ELEofQccgB0CMRDiV5pBH0OZKKmGsA8WLrs8SAM?= =?us-ascii?Q?RUUH/jX2TBtxIaciUvZPJIcKCriyyP1y0u8NnRjyGSW9LGanaSFRUy6mjk2Y?= =?us-ascii?Q?lxr29QAQf3fnJfpUMk8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b441bd5-e009-4da0-25cd-08daacd77961 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2022 04:57:48.0546 (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: chAphGIaGNSafGIyC1P3WUZUHDUpmGaTo/wzsQBAHXXLduoyE7TeMW3EoFzpZiIKqEoytqJsMDmth4GCmZvIow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5200 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Liu, Zhiguang > Sent: Wednesday, October 12, 2022 3:28 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Dong, Eric > ; Ni, Ray ; Kumar, Rahul R > > Subject: [PATCH V2] UefiCpuPkg:Add RegisterExceptionHandler in > PeiCpuExceptionHandlerLib >=20 > The PEI instance of the CpuExceptionHandlerLib didn't implement the > RegisterCpuInterruptHandler() API. This patch adds the missing API. >=20 > Signed-off-by: Zhiguang Liu > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > --- > UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c | 38 > +++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) >=20 > diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > index 940d83a92f..1c3012b770 100644 > --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c > @@ -100,6 +100,42 @@ CommonExceptionHandler ( > CommonExceptionHandlerWorker (ExceptionType, SystemContext, > ExceptionHandlerData); > } >=20 > +/** > + Registers a function to be called from the processor interrupt handler= . > + > + This function registers and enables the handler specified by > InterruptHandler for a processor > + interrupt or exception type specified by InterruptType. If InterruptHa= ndler > 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 > InitializeCpuExceptionHandlers() is invoked, > + otherwise EFI_UNSUPPORTED returned. > + > + @param[in] InterruptType Defines which interrupt or exception to = hook. > + @param[in] InterruptHandler A pointer to a function of type > EFI_CPU_INTERRUPT_HANDLER that is called > + when a processor interrupt occurs. If th= is parameter is NULL, > then the handler > + will be uninstalled. > + > + @retval EFI_SUCCESS The handler for the processor interrupt = 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 handler > for InterruptType was not > + previously installed. > + @retval EFI_UNSUPPORTED The interrupt specified by InterruptType= is > not supported, > + or this function is not supported. > +**/ > +EFI_STATUS > +EFIAPI > +RegisterCpuInterruptHandler ( > + IN EFI_EXCEPTION_TYPE InterruptType, > + IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler > + ) > +{ > + EXCEPTION_HANDLER_DATA *ExceptionHandlerData; > + > + ExceptionHandlerData =3D GetExceptionHandlerData (); > + return RegisterCpuInterruptHandlerWorker (InterruptType, > InterruptHandler, ExceptionHandlerData); > +} > + > /** > Initializes all CPU exceptions entries and provides the default except= ion > handlers. >=20 > @@ -135,7 +171,7 @@ InitializeCpuExceptionHandlers ( > ASSERT (ExceptionHandlerData !=3D NULL); > ExceptionHandlerData->IdtEntryCount =3D CPU_EXCEPTION_NUM; > ExceptionHandlerData->ReservedVectors =3D ReservedVectors; > - ExceptionHandlerData->ExternalInterruptHandler =3D NULL; > + ExceptionHandlerData->ExternalInterruptHandler =3D AllocateZeroPool > (sizeof (EFI_CPU_INTERRUPT_HANDLER) * ExceptionHandlerData- > >IdtEntryCount); > InitializeSpinLock (&ExceptionHandlerData->DisplayMessageSpinLock); >=20 > Status =3D InitializeCpuExceptionHandlersWorker (VectorInfo, > ExceptionHandlerData); > -- > 2.31.1.windows.1