public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Dong, Eric" <eric.dong@intel.com>
Cc: "Zeng, Star" <star.zeng@intel.com>, Laszlo Ersek <lersek@redhat.com>
Subject: Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens.
Date: Fri, 10 Apr 2020 07:08:32 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C4E476B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20200410065401.966-3-eric.dong@intel.com>

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Dong, Eric
> Sent: Friday, April 10, 2020 2:54 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Zeng, Star <star.zeng@intel.com>; Laszlo Ersek <lersek@redhat.com>
> Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388
> 
> 
> After remove Used parameter, below code in ResetTokens can also be
> removed:
> 1. The RunningApCount parameter will be reset in GetFreeToken.
> 2. The ReleaseSpinLock should be called in ReleaseToken function,
>    Code in this function seems like a later fix if ReleaseToken not
>    Release it. We should remove code here and fix the real issue if
>    existed.
> 
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 20 --------------------
>  1 file changed, 20 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index 305bffa9bc..57e788c01b 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -433,26 +433,6 @@ ResetTokens (
>    VOID
> 
>    )
> 
>  {
> 
> -  LIST_ENTRY            *Link;
> 
> -  PROCEDURE_TOKEN       *ProcToken;
> 
> -
> 
> -  Link = GetFirstNode (&gSmmCpuPrivate->TokenList);
> 
> -  while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {
> 
> -    ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
> 
> -
> 
> -    ProcToken->RunningApCount = 0;
> 
> -
> 
> -    //
> 
> -    // Check the spinlock status and release it if not released yet.
> 
> -    //
> 
> -    if (!AcquireSpinLockOrFail(ProcToken->SpinLock)) {
> 
> -      DEBUG((DEBUG_ERROR, "Risk::SpinLock still not released!"));
> 
> -    }
> 
> -    ReleaseSpinLock (ProcToken->SpinLock);
> 
> -
> 
> -    Link = GetNextNode (&gSmmCpuPrivate->TokenList, Link);
> 
> -  }
> 
> -
> 
>    //
> 
>    // Reset the FirstFreeToken to the beginning of token list upon exiting SMI.
> 
>    //
> 
> --
> 2.23.0.windows.1
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#57184): https://edk2.groups.io/g/devel/message/57184
> Mute This Topic: https://groups.io/mt/72915832/1712937
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub  [ray.ni@intel.com]
> -=-=-=-=-=-=


      reply	other threads:[~2020-04-10  7:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  6:53 [PATCH 0/2] Remove useless code Dong, Eric
2020-04-10  6:54 ` [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove Used parameter Dong, Eric
2020-04-10  7:07   ` [edk2-devel] " Ni, Ray
2020-04-10  6:54 ` [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens Dong, Eric
2020-04-10  7:08   ` Ni, Ray [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=734D49CCEBEEF84792F5B80ED585239D5C4E476B@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