public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Dandan Bi <dandan.bi@intel.com>
Subject: [Patch 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Clean up useless code.
Date: Thu, 25 Oct 2018 10:26:00 +0800	[thread overview]
Message-ID: <20181025022601.25136-6-eric.dong@intel.com> (raw)
In-Reply-To: <20181025022601.25136-1-eric.dong@intel.com>

Remove useless code after change 93324390.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c      | 10 +---------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 16 ----------------
 2 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index 42b040531e..abcc3eea05 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1272,7 +1272,6 @@ InitializeSmmCpuSemaphores (
   UINTN                      TotalSize;
   UINTN                      GlobalSemaphoresSize;
   UINTN                      CpuSemaphoresSize;
-  UINTN                      MsrSemahporeSize;
   UINTN                      SemaphoreSize;
   UINTN                      Pages;
   UINTN                      *SemaphoreBlock;
@@ -1282,8 +1281,7 @@ InitializeSmmCpuSemaphores (
   ProcessorCount = gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus;
   GlobalSemaphoresSize = (sizeof (SMM_CPU_SEMAPHORE_GLOBAL) / sizeof (VOID *)) * SemaphoreSize;
   CpuSemaphoresSize    = (sizeof (SMM_CPU_SEMAPHORE_CPU) / sizeof (VOID *)) * ProcessorCount * SemaphoreSize;
-  MsrSemahporeSize     = MSR_SPIN_LOCK_INIT_NUM * SemaphoreSize;
-  TotalSize = GlobalSemaphoresSize + CpuSemaphoresSize + MsrSemahporeSize;
+  TotalSize = GlobalSemaphoresSize + CpuSemaphoresSize;
   DEBUG((EFI_D_INFO, "One Semaphore Size    = 0x%x\n", SemaphoreSize));
   DEBUG((EFI_D_INFO, "Total Semaphores Size = 0x%x\n", TotalSize));
   Pages = EFI_SIZE_TO_PAGES (TotalSize);
@@ -1311,12 +1309,6 @@ InitializeSmmCpuSemaphores (
   SemaphoreAddr += ProcessorCount * SemaphoreSize;
   mSmmCpuSemaphores.SemaphoreCpu.Present = (BOOLEAN *)SemaphoreAddr;
 
-  SemaphoreAddr = (UINTN)SemaphoreBlock + GlobalSemaphoresSize + CpuSemaphoresSize;
-  mSmmCpuSemaphores.SemaphoreMsr.Msr              = (SPIN_LOCK *)SemaphoreAddr;
-  mSmmCpuSemaphores.SemaphoreMsr.AvailableCounter =
-        ((UINTN)SemaphoreBlock + Pages * SIZE_4KB - SemaphoreAddr) / SemaphoreSize;
-  ASSERT (mSmmCpuSemaphores.SemaphoreMsr.AvailableCounter >= MSR_SPIN_LOCK_INIT_NUM);
-
   mPFLock                       = mSmmCpuSemaphores.SemaphoreGlobal.PFLock;
   mConfigSmmCodeAccessCheckLock = mSmmCpuSemaphores.SemaphoreGlobal.CodeAccessCheckLock;
 
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
index e2970308fe..61d4bd3085 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
@@ -347,13 +347,6 @@ typedef struct {
   volatile BOOLEAN              *CandidateBsp;
 } SMM_DISPATCHER_MP_SYNC_DATA;
 
-#define MSR_SPIN_LOCK_INIT_NUM 15
-
-typedef struct {
-  SPIN_LOCK    *SpinLock;
-  UINT32       MsrIndex;
-} MP_MSR_LOCK;
-
 #define SMM_PSD_OFFSET              0xfb00
 
 ///
@@ -376,21 +369,12 @@ typedef struct {
   volatile BOOLEAN                  *Present;
 } SMM_CPU_SEMAPHORE_CPU;
 
-///
-/// All MSRs semaphores' pointer and counter
-///
-typedef struct {
-  SPIN_LOCK            *Msr;
-  UINTN                AvailableCounter;
-} SMM_CPU_SEMAPHORE_MSR;
-
 ///
 /// All semaphores' information
 ///
 typedef struct {
   SMM_CPU_SEMAPHORE_GLOBAL          SemaphoreGlobal;
   SMM_CPU_SEMAPHORE_CPU             SemaphoreCpu;
-  SMM_CPU_SEMAPHORE_MSR             SemaphoreMsr;
 } SMM_CPU_SEMAPHORES;
 
 extern IA32_DESCRIPTOR                     gcSmiGdtr;
-- 
2.15.0.windows.1



  parent reply	other threads:[~2018-10-25  2:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  2:25 [Patch 0/6] Fix coding style issues Eric Dong
2018-10-25  2:25 ` [Patch 1/6] UefiCpuPkg/RegisterCpuFeaturesLib: Fix build failure for VS2012 and GCC49 Eric Dong
2018-10-25  2:25 ` [Patch 2/6] UefiCpuPkg/CpuCommonFeaturesLib: Remove white space at line end Eric Dong
2018-10-25  2:25 ` [Patch 3/6] UefiCpuPkg/RegisterCpuFeaturesLib: Fix ECC issues Eric Dong
2018-10-25  2:25 ` [Patch 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: Remove white space at line end Eric Dong
2018-10-25  2:26 ` Eric Dong [this message]
2018-10-25  5:50   ` [Patch 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Clean up useless code Ni, Ruiyu
2018-10-25  2:26 ` [Patch 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Fix build failure for VS2012 and GCC49 Eric Dong
2018-10-25  5:50 ` [Patch 0/6] Fix coding style issues Ni, Ruiyu

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=20181025022601.25136-6-eric.dong@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