From patchwork Thu Mar 24 10:36:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 64303 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp549631lbc; Thu, 24 Mar 2016 03:37:54 -0700 (PDT) X-Received: by 10.66.55.39 with SMTP id o7mr11369625pap.13.1458815868566; Thu, 24 Mar 2016 03:37:48 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id yx1si11414799pab.52.2016.03.24.03.37.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 03:37:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8703E1A1F08; Thu, 24 Mar 2016 03:38:08 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CF2441A1EF7 for ; Thu, 24 Mar 2016 03:38:07 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 34CF1804EC; Thu, 24 Mar 2016 10:37:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-47.phx2.redhat.com [10.3.113.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2OAbRfT032425; Thu, 24 Mar 2016 06:37:41 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 24 Mar 2016 11:36:55 +0100 Message-Id: <1458815844-24793-7-git-send-email-lersek@redhat.com> In-Reply-To: <1458815844-24793-1-git-send-email-lersek@redhat.com> References: <1458815844-24793-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Subject: [edk2] [PATCH 06/35] EdkCompatibilityPkg: SmmBaseHelper: remove set but unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This patch also eliminates an AsmReadCr3() call in PageFaultHandler(), but that should not be a problem. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c index 16566d2b2948..5f220dd47695 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c @@ -228,7 +228,6 @@ WriteCpuSaveState ( IN EFI_SMM_CPU_SAVE_STATE *ToWrite ) { - EFI_STATUS Status; UINTN Index; EFI_SMM_CPU_STATE *State; EFI_SMI_CPU_SAVE_STATE *SaveState; @@ -250,14 +249,14 @@ WriteCpuSaveState ( State->x86.AutoHALTRestart = SaveState->AutoHALTRestart; for (Index = 0; Index < sizeof (mCpuSaveStateConvTable) / sizeof (CPU_SAVE_STATE_CONVERSION); Index++) { - Status = mSmmCpu->WriteSaveState ( - mSmmCpu, - (UINTN)sizeof (UINT32), - mCpuSaveStateConvTable[Index].Register, - CpuIndex, - ((UINT8 *)SaveState) + - mCpuSaveStateConvTable[Index].Offset - ); + mSmmCpu->WriteSaveState ( + mSmmCpu, + (UINTN)sizeof (UINT32), + mCpuSaveStateConvTable[Index].Register, + CpuIndex, + ((UINT8 *)SaveState) + + mCpuSaveStateConvTable[Index].Offset + ); } } @@ -345,14 +344,12 @@ PageFaultHandler ( ) { BOOLEAN IsHandled; - UINT64 *PageTable; UINT64 PFAddress; UINTN NumCpuStatePages; ASSERT (mPageTableHookEnabled); AcquireSpinLock (&mPFLock); - PageTable = (UINT64*)(UINTN)(AsmReadCr3 () & mPhyMask); PFAddress = AsmReadCr2 (); NumCpuStatePages = EFI_SIZE_TO_PAGES (mNumberOfProcessors * sizeof (EFI_SMM_CPU_SAVE_STATE)); IsHandled = FALSE;