From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 C15EF2195407C for ; Mon, 24 Apr 2017 01:57:44 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2017 01:57:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,243,1488873600"; d="scan'208";a="91417640" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by orsmga005.jf.intel.com with ESMTP; 24 Apr 2017 01:57:42 -0700 From: Liming Gao To: edk2-devel@lists.01.org Cc: Star Zeng Date: Mon, 24 Apr 2017 16:57:35 +0800 Message-Id: <1493024255-16560-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg PiSmmIpl: Fix the issue in LMFA feature X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2017 08:57:44 -0000 SmramBase should be got from mLMFAConfigurationTable. Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c index feb846e..2601275 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -263,6 +263,7 @@ EFI_PHYSICAL_ADDRESS mSmramCacheBase; UINT64 mSmramCacheSize; EFI_SMM_COMMUNICATE_HEADER mCommunicateHeader; +EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *mLMFAConfigurationTable = NULL; // // Table of Protocol notification and GUIDed Event notifications that the SMM IPL requires @@ -841,7 +842,7 @@ GetPeCoffImageFixLoadingAssignedAddress( FixLoadingAddress = 0; Status = EFI_NOT_FOUND; - SmramBase = mCurrentSmramRange->CpuStart; + SmramBase = mLMFAConfigurationTable->SmramBase; // // Get PeHeader pointer // @@ -1519,7 +1520,6 @@ SmmIplEntry ( UINT64 MaxSize; VOID *Registration; UINT64 SmmCodeSize; - EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *LMFAConfigurationTable; EFI_CPU_ARCH_PROTOCOL *CpuArch; EFI_STATUS SetAttrStatus; EFI_SMRAM_DESCRIPTOR *SmramRangeSmmDriver; @@ -1623,14 +1623,14 @@ SmmIplEntry ( // Status = EfiGetSystemConfigurationTable ( &gLoadFixedAddressConfigurationTableGuid, - (VOID **) &LMFAConfigurationTable + (VOID **) &mLMFAConfigurationTable ); - if (!EFI_ERROR (Status) && LMFAConfigurationTable != NULL) { - LMFAConfigurationTable->SmramBase = mCurrentSmramRange->CpuStart; + if (!EFI_ERROR (Status) && mLMFAConfigurationTable != NULL) { + mLMFAConfigurationTable->SmramBase = mCurrentSmramRange->CpuStart; // // Print the SMRAM base // - DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: TSEG BASE is %x. \n", LMFAConfigurationTable->SmramBase)); + DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: TSEG BASE is %x. \n", mLMFAConfigurationTable->SmramBase)); } // -- 2.8.0.windows.1