public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Ray Ni <ray.ni@intel.com>, devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	nd@arm.com
Subject: Re: [PATCH 1/2] ArmPkg/ArmExceptionLib: Follow new CpuExceptionHandlerLib APIs
Date: Mon, 13 Jun 2022 12:26:08 +0100	[thread overview]
Message-ID: <17869a6a-6a16-6326-db6c-d18442d1c26c@arm.com> (raw)
In-Reply-To: <20220613033903.1395-2-ray.ni@intel.com>

[-- Attachment #1: Type: text/plain, Size: 6432 bytes --]

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 
<https://edk2.groups.io/g/devel/topic/patch_2_2_dxemain_fix_the/91719888?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,91719888,previd%3D1655113540627857877,nextid%3D1655040814392344888&previd=1655113540627857877&nextid=1655040814392344888> 
() does take care of this.

[/SAMI]

>
>   }
>

[-- Attachment #2: Type: text/html, Size: 7179 bytes --]

  reply	other threads:[~2022-06-13 11:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13  3:39 [PATCH 0/2] DxeMain: Fix the bug that StackGuard is not enabled Ni, Ray
2022-06-13  3:39 ` [PATCH 1/2] ArmPkg/ArmExceptionLib: Follow new CpuExceptionHandlerLib APIs Ni, Ray
2022-06-13 11:26   ` Sami Mujawar [this message]
2022-06-13  3:39 ` [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled Ni, Ray
2022-06-13 11:28   ` [edk2-devel] " Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17869a6a-6a16-6326-db6c-d18442d1c26c@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox