From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 A1DA321BC6A23 for ; Mon, 27 Mar 2017 01:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602137; x=1522138137; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=qRIxfNlejJuTKAmVUnW51AoHhfUXWSqE4C30dOP/kNY=; b=NkKC6stL+66d+W2mhEP/vNqPoi2COu3XogW0vI3w2AuRcu8eKsrxqRMK dJIepOZk1/iP69A8G8yTk/NydEkVvw==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 01:08:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948389" Received: from junghyun-mobl.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.252.131.12]) by fmsmga005.fm.intel.com with ESMTP; 27 Mar 2017 01:08:57 -0700 From: Jordan Justen To: edk2-devel@lists.01.org Cc: Jordan Justen , Laszlo Ersek Date: Mon, 27 Mar 2017 01:05:44 -0700 Message-Id: <20170327080544.24748-13-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170327080544.24748-1-jordan.l.justen@intel.com> References: <20170327080544.24748-1-jordan.l.justen@intel.com> Subject: [PATCH 12/12] OvmfPkg QemuFlashFvbServicesRuntimeDxe: Cleanup init now done in PEI 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, 27 Mar 2017 08:08:57 -0000 This is now done in PEI since commit "OvmfPkg PlatformPei: Set flash variable PCDs". Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- .../FvbServicesRuntimeDxe.inf | 4 ---- .../FvbServicesSmm.inf | 4 ---- .../FwBlockService.c | 28 ++++------------------ 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf index c0dda75bf7..8656d185f6 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf @@ -78,11 +78,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable [FeaturePcd] diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf index ba2d3679a4..c9cbc34901 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf @@ -77,11 +77,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable [FeaturePcd] diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c index ff27c1100c..857b1e3878 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c @@ -965,9 +965,9 @@ FvbInitialize ( EFI_PHYSICAL_ADDRESS BaseAddress; UINTN Length; UINTN NumOfBlocks; - RETURN_STATUS PcdStatus; - if (EFI_ERROR (QemuFlashInitialize ())) { + if (!PcdGetBool (PcdOvmfFlashVariablesEnable)) { + ASSERT (!FeaturePcdGet (PcdSmmSmramRequire)); // // Return an error so image will be unloaded // @@ -976,6 +976,9 @@ FvbInitialize ( return EFI_WRITE_PROTECTED; } + Status = QemuFlashInitialize (); + ASSERT_RETURN_ERROR (Status); + // // Allocate runtime services data for global variable, which contains // the private data of all firmware volume block instances @@ -1093,25 +1096,6 @@ FvbInitialize ( MarkMemoryRangeForRuntimeAccess (BaseAddress, Length); - // - // Set several PCD values to point to flash - // - PcdStatus = PcdSet64S ( - PcdFlashNvStorageVariableBase64, - (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus = PcdSet32S ( - PcdFlashNvStorageFtwWorkingBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus = PcdSet32S ( - PcdFlashNvStorageFtwSpareBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - FwhInstance = (EFI_FW_VOL_INSTANCE *) ( (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength + @@ -1123,7 +1107,5 @@ FvbInitialize ( // InstallVirtualAddressChangeHandler (); - PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); - ASSERT_RETURN_ERROR (PcdStatus); return EFI_SUCCESS; } -- 2.11.0