public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Fan, Jeff" <jeff.fan@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entry
Date: Wed, 30 Nov 2016 02:48:04 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E8E908@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20161129071715.29508-1-jeff.fan@intel.com>

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Thanks/Ray

> -----Original Message-----
> From: Fan, Jeff
> Sent: Tuesday, November 29, 2016 3:17 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH] SourceLevelDebugPkg: Avoid to re-init IDT table again at
> SMI entry
> 
> Current SmmDebugAgentLib will initialize IDT table to support source
> debugging at each time SMI entry on SMM BSP. Actually, we only need to
> initialize IDT table at first time SMI entry.
> 
> Add one flag to avoid re-initializing IDT table.
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Fan <jeff.fan@intel.com>
> ---
>  .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c        | 10
> +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebug
> AgentLib.c
> b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebu
> gAgentLib.c
> index 701c4be..6216142 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebug
> AgentLib.c
> +++
> b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebu
> gAgent
> +++ Lib.c
> @@ -19,6 +19,7 @@ DEBUG_AGENT_MAILBOX         mLocalMailbox;
>  UINTN                       mSavedDebugRegisters[6];
>  IA32_IDT_GATE_DESCRIPTOR    mIdtEntryTable[33];
>  BOOLEAN                     mSkipBreakpoint = FALSE;
> +BOOLEAN                     mSmmDebugIdtInitFlag = FALSE;
> 
>  CHAR8 mWarningMsgIgnoreSmmEntryBreak[] = "Ignore smmentrybreak
> setting for SMI issued during DXE debugging!\r\n";
> 
> @@ -276,7 +277,14 @@ InitializeDebugAgent (
> 
>    case DEBUG_AGENT_INIT_ENTER_SMI:
>      SaveDebugRegister ();
> -    InitializeDebugIdt ();
> +    if (!mSmmDebugIdtInitFlag) {
> +      //
> +      // We only need to initialize Debug IDT table at first SMI entry
> +      // after SMM relocation.
> +      //
> +      InitializeDebugIdt ();
> +      mSmmDebugIdtInitFlag = TRUE;
> +    }
>      //
>      // Check if CPU APIC Timer is working, otherwise initialize it.
>      //
> --
> 2.9.3.windows.2



      reply	other threads:[~2016-11-30  2:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29  7:17 [PATCH] SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entry Jeff Fan
2016-11-30  2:48 ` Ni, Ruiyu [this message]

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=734D49CCEBEEF84792F5B80ED585239D58E8E908@SHSMSX104.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