public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Wang, Jian J" <jian.j.wang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>, "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API
Date: Thu, 23 Nov 2017 04:07:54 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA29099@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171122084548.6564-3-jian.j.wang@intel.com>

Hi
I am a little worried about the way to use VOID * to pass arch dependent data.

Can we define it clearly in each ARCH in the header file, and use a UNION to include all arch?

I think both the caller and the callee need parse it. As such, VOID * is not a good way.

Thank you
Yao Jiewen

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian J
> Wang
> Sent: Wednesday, November 22, 2017 4:46 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric <eric.dong@intel.com>;
> Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add
> a new API
> 
> > v2:
> >    Add prototype definition of InitializeCpuExceptionStackSwitchHandlers()
> 
> A new API InitializeCpuExceptionStackSwitchHandlers() is introduced to support
> initializing exception handlers being able to switch stack. StackSwitchData is
> arch dependent and required by IA32 processor to convey resources reserved in
> advance. This is necessary because the CpuExceptionHandlerLib will be linked
> in different phases, in which there's no common way to reserve resources.
> 
> EFI_STATUS
> EFIAPI
> InitializeCpuExceptionStackSwitchHandlers (
>   IN VOID       *StackSwitchData  OPTIONAL
>   );
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h | 18
> ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
> b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
> index 6cd8230127..68de4850e1 100644
> --- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
> +++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
> @@ -41,6 +41,24 @@ InitializeCpuExceptionHandlers (
>    IN EFI_VECTOR_HANDOFF_INFO       *VectorInfo OPTIONAL
>    );
> 
> +/**
> +  Setup separate stack for given exceptions. StackSwitchData is optional and its
> +  content depends one the specific arch of CPU.
> +
> +  @param[in] StackSwitchData      Pointer to data required for setuping up
> +                                  stack switch.
> +
> +  @retval EFI_SUCCESS             The exceptions have been successfully
> +                                  initialized.
> +  @retval EFI_INVALID_PARAMETER   StackSwitchData contains invalid
> content.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +InitializeCpuExceptionStackSwitchHandlers (
> +  IN VOID       *StackSwitchData  OPTIONAL
> +  );
> +
>  /**
>    Initializes all CPU interrupt/exceptions entries and provides the default
> interrupt/exception handlers.
> 
> --
> 2.14.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-11-23  4:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  8:45 [PATCH v2 0/8] Implement stack guard feature Jian J Wang
2017-11-22  8:45 ` [PATCH v2 1/8] MdeModulePkg/metafile: Add PCD PcdCpuStackGuard Jian J Wang
2017-11-22  8:45 ` [PATCH v2 2/8] MdeModulePkg/CpuExceptionHandlerLib.h: Add a new API Jian J Wang
2017-11-23  4:07   ` Yao, Jiewen [this message]
2017-11-23  5:06     ` Wang, Jian J
2017-11-25 13:17       ` 答复: " Fan Jeff
2017-11-27  2:20         ` Wang, Jian J
2017-11-22  8:45 ` [PATCH v2 3/8] MdePkg/BaseLib: Add stack switch related definitions for IA32 Jian J Wang
2017-11-22  8:45 ` [PATCH v2 4/8] MdeModulePkg/DxeIpl: Enable paging for Stack Guard Jian J Wang
2017-11-22  8:45 ` [PATCH v2 5/8] UefiCpuPkg/UefiCpuPkg.dec: Add two new PCDs for stack switch Jian J Wang
2017-11-22  8:45 ` [PATCH v2 6/8] UefiCpuPkg/MpLib: Add GDTR, IDTR and TR in saved AP data Jian J Wang
2017-11-22  8:45 ` [PATCH v2 7/8] UefiCpuPkg/CpuExceptionHandlerLib: Add stack switch support Jian J Wang
2017-11-23  5:50   ` Yao, Jiewen
2017-11-23  5:59     ` Yao, Jiewen
2017-11-23  6:09       ` Wang, Jian J
2017-11-23  6:25         ` Yao, Jiewen
2017-11-23  7:54           ` Wang, Jian J
2017-11-23  6:05     ` Wang, Jian J
2017-11-23  6:16       ` Yao, Jiewen
2017-11-23  6:43         ` Wang, Jian J
2017-11-25 13:27           ` 答复: " Fan Jeff
2017-11-27  2:21             ` Wang, Jian J
2017-11-28  1:38           ` Wang, Jian J
2017-11-28  2:06             ` Yao, Jiewen
2017-11-25 13:35   ` 答复: " Fan Jeff
2017-11-22  8:45 ` [PATCH v2 8/8] UefiCpuPkg/CpuDxe: Initialize stack switch for MP Jian J Wang
2017-11-23  4:13   ` Yao, Jiewen
2017-11-23  5:03     ` Wang, Jian J
2017-11-23  5:19       ` Wang, Jian J
2017-11-23  5:39         ` Yao, Jiewen
2017-11-23  3:47 ` [PATCH v2 0/8] Implement stack guard feature Yao, Jiewen
2017-11-23  5:09   ` Wang, Jian J
2017-11-23  5:40     ` Yao, Jiewen
2017-11-25 13:44       ` 答复: " Fan Jeff
2017-11-25 13:55         ` Yao, Jiewen

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=74D8A39837DF1E4DA445A8C0B3885C503AA29099@shsmsx102.ccr.corp.intel.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