public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH v2 2/6] MdeModulePkg/DebugAgentLibNull: Indicate SMM Debug Agent support or not
Date: Tue, 26 Dec 2023 02:18:15 +0000	[thread overview]
Message-ID: <MN6PR11MB82446C6C5DDF117137B6164E8C98A@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231225162034.2052-3-jiaxin.wu@intel.com>

Similar comments as #1.
Context could be NULL. Please add check before the assignment.
With that, Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Wu, Jiaxin <jiaxin.wu@intel.com>
> Sent: Tuesday, December 26, 2023 12:21 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: [PATCH v2 2/6] MdeModulePkg/DebugAgentLibNull: Indicate SMM
> Debug Agent support or not
> 
> This patch is to use the Context to indicate SMM Debug Agent support or
> not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a
> BOOLEAN if it's not NULL.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c | 9
> +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c
> b/MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c
> index 8e70705eb6..5596ee3bf9 100644
> --- a/MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c
> +++ b/MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c
> @@ -22,10 +22,13 @@
>    passing in the Context to be its parameter.
> 
>    If Function() is NULL, Debug Agent Library instance will return after setup
> debug
>    environment.
> 
> +  If InitFlag is DEBUG_AGENT_INIT_SMM, Context must point to a BOOLEAN
> if it's not
> +  NULL, which indicates SMM Debug Agent supported or not.
> +
>    @param[in] InitFlag     Init flag is used to decide the initialize process.
>    @param[in] Context      Context needed according to InitFlag; it was optional.
>    @param[in] Function     Continue function called by debug agent library; it
> was
>                            optional.
> 
> @@ -36,10 +39,16 @@ InitializeDebugAgent (
>    IN UINT32                InitFlag,
>    IN VOID                  *Context  OPTIONAL,
>    IN DEBUG_AGENT_CONTINUE  Function  OPTIONAL
>    )
>  {
> +  switch (InitFlag) {
> +    case DEBUG_AGENT_INIT_SMM:
> +      *(BOOLEAN *)Context = FALSE;
> +      return;
> +  }
> +
>    if (Function != NULL) {
>      Function (Context);
>    }
>  }
> 
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112900): https://edk2.groups.io/g/devel/message/112900
Mute This Topic: https://groups.io/mt/103360803/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-26  2:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 16:20 [edk2-devel] [PATCH v2 0/6] Reduce one round BSP & AP sync Wu, Jiaxin
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 1/6] SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not Wu, Jiaxin
2023-12-26  2:17   ` Ni, Ray
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 2/6] MdeModulePkg/DebugAgentLibNull: " Wu, Jiaxin
2023-12-26  2:18   ` Ni, Ray [this message]
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Check " Wu, Jiaxin
2023-12-26  2:18   ` Ni, Ray
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: Align BSP and AP sync logic for SMI exit Wu, Jiaxin
2023-12-26  2:19   ` Ni, Ray
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent Wu, Jiaxin
2023-12-26  2:21   ` Ni, Ray
2023-12-25 16:20 ` [edk2-devel] [PATCH v2 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Reduce one round BSP & AP sync Wu, Jiaxin
2023-12-26  5:02   ` Ni, Ray

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=MN6PR11MB82446C6C5DDF117137B6164E8C98A@MN6PR11MB8244.namprd11.prod.outlook.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