From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.70]) by mx.groups.io with SMTP id smtpd.web12.4609.1655119585997288047 for ; Mon, 13 Jun 2022 04:26:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=wzWtqg7i; spf=pass (domain: arm.com, ip: 40.107.2.70, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BORPMahPCSaOPSdCGhkt3hE6ezXBtldCg8+sq058PYc1asqgQWjULfbWJe+nfq47F0pg6i9Z1qYkcOHHCNYeHF9J59MD76kb8s2ixDwa6bBhDh+aZ7nyI7XEWpGEKGA7uPTCz6/DPssj3C92veIDQYDKX3ufG8PJcqaHv0z0GIDg/7g2gDs6nziImZ3IODcBQtbr988oaGlmMO9W2fW3E1ZEauxiF0muURWSkOr8oEoUHP3s6RN7BMQTq2+oR/1anEB4GEqBmHGWT+mtmEWVZ/VfAxG8GlbY9Qmd9F7i9iJ4yJQaVsQ6DOAA6dKWPa865F6NAIcmVa2HK7o9Qb1Ajg== ARC-Message-Signature: i=2; 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=v39ClX2zeidVMwG3qKRfSIHU3QxxmQvhHnKF7wylu8s=; b=j8lYlNKnu+mHc5h5PR1xaOQ62D9SWoxzoig5cWMwBKfyDEoiiocdKhhIIGfOGktdO7VvwxdJVk/FLz3a9NXX9+hVTNT3evhHvHyO60rh70p95OwGk+9gXCOe2dhBXaNufIODtdW9gNEujleQ3mVz8vxc4IkEJ70Pnf1CWPHJZUhrMUkgA955uVqA3JmE62sKbV/WiTBfApC/UJjFzlPb8vNtedkPLcA07aVtrQTBE020+ofuDkU2p50ZgfZaMIaZbkpcXS2MUMaHE6bjLgpWZzPEpAsrA426FM0dwZond69vDqw1aeQOmvisIu3JjjDcfNDmVoTaHmTCPqkMG0WUUg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v39ClX2zeidVMwG3qKRfSIHU3QxxmQvhHnKF7wylu8s=; b=wzWtqg7iOO+wuB/aWw0nXii2+G+jxdSwJ5HtI+bpJjHIuphTk4TOGwKYvS01K/34ZNDvOb66+BIf/s8rwqvxS0/52NNdUfVscSsxUSqXr910e1oUcuctZzkDo9LaWD3sj6MgYG/lVXeGd5uOD6MJK4ocEHiKNwbeRdIe6tpoSpU= Received: from DB6PR0301CA0021.eurprd03.prod.outlook.com (2603:10a6:4:3e::31) by DBBPR08MB4919.eurprd08.prod.outlook.com (2603:10a6:10:f0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15; Mon, 13 Jun 2022 11:26:21 +0000 Received: from DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3e:cafe::7e) by DB6PR0301CA0021.outlook.office365.com (2603:10a6:4:3e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.20 via Frontend Transport; Mon, 13 Jun 2022 11:26:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT005.mail.protection.outlook.com (100.127.142.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Mon, 13 Jun 2022 11:26:21 +0000 Received: ("Tessian outbound 5b5a41c043d3:v120"); Mon, 13 Jun 2022 11:26:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0e9ef1ebad1d253f X-CR-MTA-TID: 64aa7808 Received: from 40bd72a54c77.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7F0A89B9-85BC-453E-8DE6-9DD7283EC0C4.1; Mon, 13 Jun 2022 11:26:13 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40bd72a54c77.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 13 Jun 2022 11:26:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IMoBzr73itU78WkZcbNvK4ZyDBQjQd6vUf4+/huRYhliuyTA0hXyeu8S6LETA1E61sVx7yrtrNfO47AAGFiZhs8+p/gfuELbpBhoApfLIenc1uPc1NVM0rgAIUsCXHzyiynYCkyel8n2y3i0g8uO55HmjJlXS6D8DoYSORerfdRF7osOg/7DI8dF5Ri8dDTQBCeubxHVAT0ALjb/3NbWPHEhvgIAns5d9D/ed/Z0U0o/Vc2c7yQhCB7FmDw+cDCDIigF+GPJmj4U7WfuTPS4k63ya8S1DupQlUL9YavQP25dLvrP7msX+LfWXLv4wUv9PqlkvGK+IU+0glxWMkDDVg== 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=v39ClX2zeidVMwG3qKRfSIHU3QxxmQvhHnKF7wylu8s=; b=edxZyU8PMcEz2rscJF9iwXNReNvrcDJJGzux43w7rzhWJof26a1Ffg9ZpVZKuuYJsiJIevhv8EPFQ1LmTN0pc5i7yqzl8XtHcA5v9IAjsVlCwOps8r7KznZD2NH8oEngQuMwJ1a4Z01H7V2kUF6D6tNCS7nVhuw8e16zXnOyunDCOPsxPKui5ww6FjBY79qsST+fcdOttYpXn6icqUOgr2mYA5e016o2gPyHpW9TWOrRcALD8QlwKzXSlGXhnmxqDcnbqUsqmDqG/oHVE8S6sbnKjX/t5Ax6djDn4SKD2CcgNK8bPv/hv/OJ1I6QFlX/zs+qCD+8bB8Ejxr81OBwwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v39ClX2zeidVMwG3qKRfSIHU3QxxmQvhHnKF7wylu8s=; b=wzWtqg7iOO+wuB/aWw0nXii2+G+jxdSwJ5HtI+bpJjHIuphTk4TOGwKYvS01K/34ZNDvOb66+BIf/s8rwqvxS0/52NNdUfVscSsxUSqXr910e1oUcuctZzkDo9LaWD3sj6MgYG/lVXeGd5uOD6MJK4ocEHiKNwbeRdIe6tpoSpU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB3127.eurprd08.prod.outlook.com (2603:10a6:209:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14; Mon, 13 Jun 2022 11:26:10 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::fc42:db38:98b1:3729]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::fc42:db38:98b1:3729%3]) with mapi id 15.20.5332.020; Mon, 13 Jun 2022 11:26:10 +0000 Message-ID: <17869a6a-6a16-6326-db6c-d18442d1c26c@arm.com> Date: Mon, 13 Jun 2022 12:26:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 1/2] ArmPkg/ArmExceptionLib: Follow new CpuExceptionHandlerLib APIs To: Ray Ni , devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , nd@arm.com References: <20220613033903.1395-1-ray.ni@intel.com> <20220613033903.1395-2-ray.ni@intel.com> From: "Sami Mujawar" In-Reply-To: <20220613033903.1395-2-ray.ni@intel.com> X-ClientProxiedBy: LO4P123CA0510.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:272::14) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b1a4bcd2-912f-421f-6c0c-08da4d2f8ae9 X-MS-TrafficTypeDiagnostic: AM6PR08MB3127:EE_|DBAEUR03FT005:EE_|DBBPR08MB4919:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cqMOwESIWyT0I7rtp8E+4vcKF861naYbhdHAak7mxXBciKF2exRRgZEVVn1fiLuaEtLofp2rmVy0ejtEu+FmJlcALanGWLoaQ1CYPuN6CVUx/RpZhSaJBmwFyEEHV3NNv6QuS4NyYyYarh8oq8ckMW/IUPplLN2S8maUfI1sIS6loeSSfcHvxNwuxCEozqhnOUnY4JQzmp0hU/r7YryS5CJOfSo3zhm7vWAFoDDpYjnMx5rAUz3uxO94lHT59/vCfFkIk7xFquXsQfnoI0HWeFrXbP871Qumo2oNThF6YtgSpdcWWgwUqAKZNcl1TIWU0pWEN3D7nZdq2nz5/nR2JZS33r1FyTWE+0gcFHvrdhp8DTK1RSmjVnXe64fBk3NPr/aIfUq8I0dVgQ/MAcKq7L4SKVaWI6RN2Ax+6J3ZZusxQhPdPZpUDmdRK2R+qkqsI+qZveZytOj8RrCLtckxTK7XU8xR3thHvWD0atMLxAFnKm5GsaXO+H4omOjX1augLCS2SWblBEhlnwlk+gHFzZUHwgNk+rNUvc7N+0dp+wPpfq/QIw4cO0yI1Db2S5DCKa4CjeRyPd7zCu+pkK+m7oVWiiLZIy+3vzdh9W2sH34Qy9/ZL8BHFGRDVQrRix3nV8lvSeUIMh5QfqHPYl4KvinketF5hsfgo4c5MN2L3yOvTInyg+iIUGTRzIaOig8BKBoymMlTrzJXhgGY1mBJySN4IWm1rZClOq6I4Hb3ji+8/5xswafTwC4qPUD/Viv+Q2f2thCaj0WiUfR1Jrn5CZQELW+ju3XqVhgPzlsEZNrAzt/YChaNiaCCoAsxSjrn X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(30864003)(53546011)(38100700002)(26005)(6512007)(33964004)(31686004)(86362001)(44832011)(5660300002)(2906002)(36756003)(2616005)(8936002)(6506007)(66946007)(166002)(31696002)(66556008)(508600001)(83380400001)(6486002)(54906003)(316002)(186003)(66476007)(8676002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3127 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1f46fc0e-ec92-4724-9772-08da4d2f845a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3BEQQuZwyA0cNOn9zRfXJjDDjYR0ctOJtm72F3ZkDk99NMh6sf+nNU6W8aMHSG+RJpeaSvcFbtRuI7crkunujEdzPnjw6oFXjmZfOm1zITM3SCrd57aFqPJHMO3k8A75SJ4w72n+ntHeeS9OyeKtFL0VP0aTw16NPZZvnxd/FyJpfvl7ZMrhdgP8NcgKZshEhV80yoajnBggpr4xho4eP2lJDqLwhvpABaztxXzlluSlF1Rdik94hs+r3IBt/LNw9wAM9UCAzfPOaByEKYx7mPACFDwiKgZ2u9s/y22cKUjUg7OODddTkhtRvQSYeyjC5Khsz39RfkcgeR9sfrOUqoVH4muXxYeaKwIRP7SaA9uVDHIMhQX5exOFvkylXlKv8TqaMvft+UT8kq7Wwztr+oHoieQzJTDwXlm60Y6AJQYdP6FIxZeDsO5HpYQSSdO9q/ViUe4onXCYLge+jq7SME3vsMBGZISghfbuZpumcrPYksilF0hYaFOvbe3lfY+zj1JqvfkUNI24pz+r2lFMMWKjva7440saCgqVp4lYiaChxGBrKXt8rfoJqHTMGcsjJlxB9eJp9MRiFSvW54+HTZN1pStkW6S8tFC9CFUMJfYSsUfrY7V+e/2O86kacGk+8bdy08AKemkomm7Q24wXX4cTag5q+2dyjTKsoximzp93DY/a+wFfU9kTF4x6INq1SsstBPicehB+QCxIjrBNsvd5eiQy9FPG6J92Rjl+67y0hU6kqHk/bWQLizF8yHm9l6T1pRpswtTF/7HAD8scc2KihEgd7XKdd5VRjOekYPo= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(36840700001)(46966006)(40470700004)(316002)(26005)(54906003)(33964004)(508600001)(31696002)(6506007)(53546011)(86362001)(6486002)(30864003)(356005)(36860700001)(166002)(47076005)(186003)(336012)(6512007)(82310400005)(40460700003)(83380400001)(2616005)(70206006)(8676002)(4326008)(70586007)(36756003)(2906002)(81166007)(8936002)(31686004)(5660300002)(44832011)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2022 11:26:21.5545 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1a4bcd2-912f-421f-6c0c-08da4d2f8ae9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4919 Content-Type: multipart/alternative; boundary="------------Rf1rYg8SEKl26NCMHxXSRcSj" --------------Rf1rYg8SEKl26NCMHxXSRcSj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Ray, Thank you for this patch. I have one minor suggestion marked inline as [SAMI], otherwise this patch looks good to me. With that updated. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 13/06/2022 04:39 am, Ray Ni wrote: > CpuExceptionHandlerLib has been refactored with following changes: > 1. Removed InitializeCpuInterruptHandlers in 2a09527ebcb459b40 > 2. Removed InitializeCpuExceptionHandlersEx and > added InitializeSeparateExceptionStacks in e7abb94d1fb8a0e7 > > The patch updates ARM version of CpuExceptionHandlerLib to follow > the API changes. > > The functionality to ARM platforms should be none. > > Signed-off-by: Ray Ni > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Sami Mujawar > --- > .../Library/ArmExceptionLib/ArmExceptionLib.c | 58 ++++--------------- > 1 file changed, 11 insertions(+), 47 deletions(-) > > diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c > index 1904816c16..2c7bc66aa7 100644 > --- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c > +++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c > @@ -4,6 +4,7 @@ > * Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
> > * Copyright (c) 2011-2021, Arm Limited. All rights reserved.
> > * Copyright (c) 2016 HP Development Company, L.P. > > +* Copyright (c) 2022, Intel Corporation. All rights reserved.
> > * > > * SPDX-License-Identifier: BSD-2-Clause-Patent > > * > > @@ -194,32 +195,6 @@ CopyExceptionHandlers ( > return RETURN_SUCCESS; > > } > > > > -/** > > -Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. > > - > > -Caller should try to get an array of interrupt and/or exception vectors 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 have been successfully initialized > > -with default interrupt/exception handlers. > > -@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. > > -@retval EFI_UNSUPPORTED This function is not supported. > > - > > -**/ > > -EFI_STATUS > > -EFIAPI > > -InitializeCpuInterruptHandlers ( > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL > > - ) > > -{ > > - // not needed, this is what the CPU driver is for > > - return EFI_UNSUPPORTED; > > -} > > - > > /** > > Registers a function to be called from the processor exception handler. (On ARM/AArch64 this only > > provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt > > @@ -229,8 +204,8 @@ This function registers and enables the handler specified by ExceptionHandler fo > interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the > > handler for the processor interrupt or exception type specified by ExceptionType is uninstalled. > > The installed handler is called once for each processor interrupt or exception. > > -NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or > > -InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned. > > +NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked, > > +otherwise EFI_UNSUPPORTED returned. > > > > @param[in] ExceptionType Defines which interrupt or exception to hook. > > @param[in] ExceptionHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called > > @@ -312,33 +287,22 @@ CommonCExceptionHandler ( > } > > > > /** > > - Initializes all CPU exceptions entries with optional extra initializations. > > - > > - By default, this method should include all functionalities implemented by > > - InitializeCpuExceptionHandlers(), plus extra initialization works, if any. > > - This could be done by calling InitializeCpuExceptionHandlers() directly > > - in this method besides the extra works. > > + Setup separate stacks for certain exception handlers. > > > > - InitData is optional and its use and content are processor arch dependent. > > - The typical usage of it is to convey resources which have to be reserved > > - elsewhere and are necessary for the extra initializations of exception. > > + InitData is optional and processor arch dependent. > > > > - @param[in] VectorInfo Pointer to reserved vector list. > > - @param[in] InitData Pointer to data optional for extra initializations > > - of exception. > > + @param[in] InitData Pointer to data optional for information about how > > + to assign stacks for certain exception handlers. > > > > - @retval EFI_SUCCESS The exceptions have been successfully > > - initialized. > > - @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid > > - content. > > + @retval EFI_SUCCESS The stacks are assigned successfully. > > + @retval EFI_UNSUPPORTED This function is not supported. > > > > **/ > > EFI_STATUS > > EFIAPI > > -InitializeCpuExceptionHandlersEx ( > > - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, > > +InitializeSeparateExceptionStacks ( > > IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL > > ) > > { > > - return InitializeCpuExceptionHandlers (VectorInfo); > > + return EFI_SUCCESS; [SAMI] I think this function should return EFI_UNSUPPORTED. Doing this should not impact the functionality as PcdCpuStackGuard is not enabled on Arm. So, your patch [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled () does take care of this. [/SAMI] > > } > --------------Rf1rYg8SEKl26NCMHxXSRcSj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi Ray,

Thank you for this patch.

I have one minor suggestion marked inline as [SAMI], otherwise this patch looks good to me.

With that updated.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 13/06/2022 04:39 am, Ray Ni wrote:
CpuExceptionHandlerLib has been refactored with following changes:
1. Removed InitializeCpuInterruptHandlers in 2a09527ebcb459b40
2. Removed InitializeCpuExceptionHandlersEx and
   added InitializeSeparateExceptionStacks in e7abb94d1fb8a0e7

The patch updates ARM version of CpuExceptionHandlerLib to follow
the API changes.

The functionality to ARM platforms should be none.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
---
 .../Library/ArmExceptionLib/ArmExceptionLib.c | 58 ++++---------------
 1 file changed, 11 insertions(+), 47 deletions(-)

diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
index 1904816c16..2c7bc66aa7 100644
--- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
+++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
@@ -4,6 +4,7 @@
 *  Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>

 *  Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>

 *  Copyright (c) 2016 HP Development Company, L.P.

+*  Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>

 *

 *  SPDX-License-Identifier: BSD-2-Clause-Patent

 *

@@ -194,32 +195,6 @@ CopyExceptionHandlers (
   return RETURN_SUCCESS;

 }

 

-/**

-Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.

-

-Caller should try to get an array of interrupt and/or exception vectors 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 have been successfully initialized

-with default interrupt/exception handlers.

-@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.

-@retval EFI_UNSUPPORTED       This function is not supported.

-

-**/

-EFI_STATUS

-EFIAPI

-InitializeCpuInterruptHandlers (

-  IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL

-  )

-{

-  // not needed, this is what the CPU driver is for

-  return EFI_UNSUPPORTED;

-}

-

 /**

 Registers a function to be called from the processor exception handler. (On ARM/AArch64 this only

 provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt

@@ -229,8 +204,8 @@ This function registers and enables the handler specified by ExceptionHandler fo
 interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the

 handler for the processor interrupt or exception type specified by ExceptionType is uninstalled.

 The installed handler is called once for each processor interrupt or exception.

-NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or

-InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.

+NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,

+otherwise EFI_UNSUPPORTED returned.

 

 @param[in]  ExceptionType     Defines which interrupt or exception to hook.

 @param[in]  ExceptionHandler  A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called

@@ -312,33 +287,22 @@ CommonCExceptionHandler (
 }

 

 /**

-  Initializes all CPU exceptions entries with optional extra initializations.

-

-  By default, this method should include all functionalities implemented by

-  InitializeCpuExceptionHandlers(), plus extra initialization works, if any.

-  This could be done by calling InitializeCpuExceptionHandlers() directly

-  in this method besides the extra works.

+  Setup separate stacks for certain exception handlers.

 

-  InitData is optional and its use and content are processor arch dependent.

-  The typical usage of it is to convey resources which have to be reserved

-  elsewhere and are necessary for the extra initializations of exception.

+  InitData is optional and processor arch dependent.

 

-  @param[in]  VectorInfo    Pointer to reserved vector list.

-  @param[in]  InitData      Pointer to data optional for extra initializations

-                            of exception.

+  @param[in]  InitData      Pointer to data optional for information about how

+                            to assign stacks for certain exception handlers.

 

-  @retval EFI_SUCCESS             The exceptions have been successfully

-                                  initialized.

-  @retval EFI_INVALID_PARAMETER   VectorInfo or InitData contains invalid

-                                  content.

+  @retval EFI_SUCCESS             The stacks are assigned successfully.

+  @retval EFI_UNSUPPORTED         This function is not supported.

 

 **/

 EFI_STATUS

 EFIAPI

-InitializeCpuExceptionHandlersEx (

-  IN EFI_VECTOR_HANDOFF_INFO  *VectorInfo OPTIONAL,

+InitializeSeparateExceptionStacks (

   IN CPU_EXCEPTION_INIT_DATA  *InitData OPTIONAL

   )

 {

-  return InitializeCpuExceptionHandlers (VectorInfo);

+  return EFI_SUCCESS;

[SAMI] I think this function should return EFI_UNSUPPORTED. Doing this should not impact the functionality as PcdCpuStackGuard is not enabled on Arm.

So, your patch [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled () does take care of this.

[/SAMI]


 }

--------------Rf1rYg8SEKl26NCMHxXSRcSj--