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.web08.1988.1655091554100657261 for ; Sun, 12 Jun 2022 20:39:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NULGRffs; 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=1655091555; x=1686627555; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dDTCXZq9Lf9X8we3fY46s5WgrGnwOYFhxsr5M3I3px4=; b=NULGRffsyo/ibzRCYhvqJKsdEt21LQpRwDzafycAp5FEXiTLQeDVMdgT WAtRFsvzGHCMjqSt5dezBGoMQMbaxhDZRKsWK9iqE0aClAgT7gF9yKmZ+ vRTS74agKVe0NDpH9jzKEl9oYVUREbagV/ylMTi+qMZTQj26LRrP4LD8D OTlqp2xNh0iyp1ALz7ROfaSfJQeizazNiCzR9nbM7JQuecl0BGZqb9G8a HL2gv09YxqtNyBgyIchRnlDUl9vUcQhnVmmMKBSuLP+NsIWZXwtC+7CyS 9xtAl5L48VPhxit4r+X+GR22nGgxyaVXjppDXaj12dqI5JUQ5CXrfMcOI A==; X-IronPort-AV: E=McAfee;i="6400,9594,10376"; a="339826055" X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="339826055" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2022 20:39:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="639470377" Received: from shwdeopenlab706.ccr.corp.intel.com ([10.239.183.102]) by fmsmga008.fm.intel.com with ESMTP; 12 Jun 2022 20:39:08 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [PATCH 1/2] ArmPkg/ArmExceptionLib: Follow new CpuExceptionHandlerLib APIs Date: Mon, 13 Jun 2022 11:39:02 +0800 Message-Id: <20220613033903.1395-2-ray.ni@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220613033903.1395-1-ray.ni@intel.com> References: <20220613033903.1395-1-ray.ni@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/Libr= ary/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.
=0D * Copyright (c) 2011-2021, Arm Limited. All rights reserved.
=0D * Copyright (c) 2016 HP Development Company, L.P.=0D +* Copyright (c) 2022, Intel Corporation. All rights reserved.
=0D *=0D * SPDX-License-Identifier: BSD-2-Clause-Patent=0D *=0D @@ -194,32 +195,6 @@ CopyExceptionHandlers ( return RETURN_SUCCESS;=0D }=0D =0D -/**=0D -Initializes all CPU interrupt/exceptions entries and provides the default = interrupt/exception handlers.=0D -=0D -Caller should try to get an array of interrupt and/or exception vectors th= at are in use and need to=0D -persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.=0D -If caller cannot get reserved vector list or it does not exists, set Vecto= rInfo to NULL.=0D -If VectorInfo is not NULL, the exception vectors will be initialized per v= ector attribute accordingly.=0D -=0D -@param[in] VectorInfo Pointer to reserved vector list.=0D -=0D -@retval EFI_SUCCESS All CPU interrupt/exception entries have bee= n successfully initialized=0D -with default interrupt/exception handlers.=0D -@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if V= ectorInfo is not NULL.=0D -@retval EFI_UNSUPPORTED This function is not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeCpuInterruptHandlers (=0D - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL=0D - )=0D -{=0D - // not needed, this is what the CPU driver is for=0D - return EFI_UNSUPPORTED;=0D -}=0D -=0D /**=0D Registers a function to be called from the processor exception handler. (O= n ARM/AArch64 this only=0D provides exception handlers, not interrupt handling which is provided thro= ugh the Hardware Interrupt=0D @@ -229,8 +204,8 @@ This function registers and enables the handler specifi= ed by ExceptionHandler fo interrupt or exception type specified by ExceptionType. If ExceptionHandle= r is NULL, then the=0D handler for the processor interrupt or exception type specified by Excepti= onType is uninstalled.=0D The installed handler is called once for each processor interrupt or excep= tion.=0D -NOTE: This function should be invoked after InitializeCpuExceptionHandlers= () or=0D -InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED return= ed.=0D +NOTE: This function should be invoked after InitializeCpuExceptionHandlers= () is invoked,=0D +otherwise EFI_UNSUPPORTED returned.=0D =0D @param[in] ExceptionType Defines which interrupt or exception to hook= .=0D @param[in] ExceptionHandler A pointer to a function of type EFI_CPU_INTE= RRUPT_HANDLER that is called=0D @@ -312,33 +287,22 @@ CommonCExceptionHandler ( }=0D =0D /**=0D - Initializes all CPU exceptions entries with optional extra initializatio= ns.=0D -=0D - By default, this method should include all functionalities implemented b= y=0D - InitializeCpuExceptionHandlers(), plus extra initialization works, if an= y.=0D - This could be done by calling InitializeCpuExceptionHandlers() directly= =0D - in this method besides the extra works.=0D + Setup separate stacks for certain exception handlers.=0D =0D - InitData is optional and its use and content are processor arch dependen= t.=0D - The typical usage of it is to convey resources which have to be reserved= =0D - elsewhere and are necessary for the extra initializations of exception.= =0D + InitData is optional and processor arch dependent.=0D =0D - @param[in] VectorInfo Pointer to reserved vector list.=0D - @param[in] InitData Pointer to data optional for extra initializat= ions=0D - of exception.=0D + @param[in] InitData Pointer to data optional for information about= how=0D + to assign stacks for certain exception handler= s.=0D =0D - @retval EFI_SUCCESS The exceptions have been successfully=0D - initialized.=0D - @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid= =0D - content.=0D + @retval EFI_SUCCESS The stacks are assigned successfully.=0D + @retval EFI_UNSUPPORTED This function is not supported.=0D =0D **/=0D EFI_STATUS=0D EFIAPI=0D -InitializeCpuExceptionHandlersEx (=0D - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,=0D +InitializeSeparateExceptionStacks (=0D IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL=0D )=0D {=0D - return InitializeCpuExceptionHandlers (VectorInfo);=0D + return EFI_SUCCESS;=0D }=0D --=20 2.35.1.windows.2