From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602138533123.12868000758158; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BB5AD2007D1F6; Mon, 27 Mar 2017 01:08:54 -0700 (PDT) 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 D066621BC6A7F for ; Mon, 27 Mar 2017 01:08:53 -0700 (PDT) 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:53 -0700 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:51 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602133; x=1522138133; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=m41ijY/6IIXwba/baponEMPF3supTeYe7yj8EhU1iqU=; b=Jnrtg1civMjyPKee3HufuYF+25dr+cMt5PlRpnDCX4Yzo0tRBg0GetJR +5dlcLYRtfvMQDY4DD2CeMfh7mduwA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948324" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:33 -0700 Message-Id: <20170327080544.24748-2-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: [edk2] [PATCH 01/12] OvmfPkg/build.sh: Add support for --disable-flash switch 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is mainly useful to test the boot paths when flash hasn't been enabled. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh index 6821552025..7294198e2c 100755 --- a/OvmfPkg/build.sh +++ b/OvmfPkg/build.sh @@ -50,6 +50,7 @@ THREADNUMBER=3D1 LAST_ARG=3D RUN_QEMU=3Dno ENABLE_FLASH=3Dno +DISABLE_FLASH=3Dno =20 # # Pick a default tool type for a given OS @@ -127,6 +128,9 @@ do shift break ;; + --disable-flash) + DISABLE_FLASH=3Dyes + ;; --enable-flash) ENABLE_FLASH=3Dyes ;; @@ -228,7 +232,9 @@ if [[ "$RUN_QEMU" =3D=3D "yes" ]]; then awk '{print $2}') case $qemu_version in 1.[6-9].*|1.[1-9][0-9].*|2.*.*) - ENABLE_FLASH=3Dyes + if [[ "$DISABLE_FLASH" !=3D "yes" ]]; then + ENABLE_FLASH=3Dyes + fi ;; esac =20 @@ -283,7 +289,7 @@ if [[ "$RUN_QEMU" =3D=3D "yes" ]]; then if [[ "$ENABLE_FLASH" =3D=3D "yes" ]]; then QEMU_COMMAND=3D"$QEMU_COMMAND -pflash $QEMU_FIRMWARE_DIR/bios.bin" else - QEMU_COMMAND=3D"$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR" + QEMU_COMMAND=3D"$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR -bios $QEMU_FIRMWA= RE_DIR/bios.bin" fi if [[ "$ADD_QEMU_HDA" =3D=3D "yes" ]]; then QEMU_COMMAND=3D"$QEMU_COMMAND -hda fat:$BUILD_ROOT_ARCH" --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602140615846.2770392990125; Mon, 27 Mar 2017 01:09:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EB1F2203BEBF2; Mon, 27 Mar 2017 01:08:54 -0700 (PDT) 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 EB61821BC6ADB for ; Mon, 27 Mar 2017 01:08:53 -0700 (PDT) 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:53 -0700 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:52 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602133; x=1522138133; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TbOdHTwfHhvOtXC1ufX3h0zcdT56me10+5V3s070OPI=; b=JyGicK1LEtikNYGRcp5c/or3PvKECRJqWNvI7YQmDhk5mzRzS4uddg7A EyxLx8tPwFLOP0XM+5US82MzOVIOuQ==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948331" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:34 -0700 Message-Id: <20170327080544.24748-3-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: [edk2] [PATCH 02/12] OvmfPkg: resolve PcdLib for all PEIMs individually 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Laszlo Ersek Currently the default (module type independent) PcdLib resolution is to BasePcdLibNull.inf, which is inherited by all PEIMs. In the next patch, we'll flip the PEIM default resolution to PeiPcdLib.inf, but in order to keep that patch both correct and simple to review, we should spell out the Null resolution for those two PEIMs (ReportStatusCodeRouterPei and StatusCodeHandlerPei) that are now the only ones that don't specify an explicit resolution. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- OvmfPkg/OvmfPkgIa32.dsc | 10 ++++++++-- OvmfPkg/OvmfPkgIa32X64.dsc | 10 ++++++++-- OvmfPkg/OvmfPkgX64.dsc | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 0796b0db81..7c588a0499 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -533,8 +533,14 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 71ac62f023..6b540ae2ed 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -541,8 +541,14 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 2ceb31d7ff..5486ecb1e1 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -540,8 +540,14 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602143162947.5379528431187; Mon, 27 Mar 2017 01:09:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2DC1720084740; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) 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 B9AB420D2C3BA for ; Mon, 27 Mar 2017 01:08:54 -0700 (PDT) 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:54 -0700 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:53 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602134; x=1522138134; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=urusaVkAeqPz00D83h3plkjz+BE50yibhBEZOS1bJ9I=; b=rQFVf5DZkCjbuUGW380FQmMAQrYO+AkcRiBU3iENQndQD5XBbVwS45eS g58fQueiLBO29YhxJc0ips1ujmbM+A==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948339" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:35 -0700 Message-Id: <20170327080544.24748-4-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: [edk2] [PATCH 03/12] OvmfPkg: resolve PcdLib for PEIMs to PeiPcdLib by default 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Laszlo Ersek In the previous patch we had to add two explicit Null resolutions, but here we can remove five PeiPcdLib ones, after setting the default to it. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- OvmfPkg/OvmfPkgIa32.dsc | 22 +++++----------------- OvmfPkg/OvmfPkgIa32X64.dsc | 22 +++++----------------- OvmfPkg/OvmfPkgX64.dsc | 22 +++++----------------- 3 files changed, 15 insertions(+), 51 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 7c588a0499..56ff1557dc 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -237,6 +237,7 @@ CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -541,32 +542,19 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 6b540ae2ed..e16a7a5a04 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -242,6 +242,7 @@ CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -549,32 +550,19 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 [Components.X64] # diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 5486ecb1e1..2c798ea7f2 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -242,6 +242,7 @@ CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -548,32 +549,19 @@ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 # # DXE Phase modules --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 14906021452970.22350501342634743; Mon, 27 Mar 2017 01:09:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 604C820084745; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) 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 DB951203BEBED for ; Mon, 27 Mar 2017 01:08:54 -0700 (PDT) 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:54 -0700 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:54 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602134; x=1522138134; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=sYdc01kSWLAIa2ei6v7F/+sqKWe2aNd08l4Clcjye2A=; b=Jvn4xHXlzGHgvLZ/JPbAsdOxFLWKLZ6VyhOT9XWmeeHVo1cPUm3I9U2d zvhr9fg5m6OKSANuSaCj3xL73HkIFw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948345" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:36 -0700 Message-Id: <20170327080544.24748-5-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: [edk2] [PATCH 04/12] OvmfPkg QemuFlash: Make QemuFlash.* Base class safe 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will create a small 'NULL' base library to detect flash in PEI. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 30 +++++++++++-------= ---- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | 16 +++++------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.c index 5677b5ee11..68388048f3 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c @@ -1,7 +1,7 @@ /** @file OVMF support for QEMU system firmware flash device =20 - Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made availa= ble under the terms and conditions of the BSD License which accompanies this @@ -124,7 +124,7 @@ QemuFlashDetected ( @param[in] Buffer Pointer to the buffer to read into. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashRead ( IN EFI_LBA Lba, IN UINTN Offset, @@ -139,7 +139,7 @@ QemuFlashRead ( // block into the flash memory. // if (Lba >=3D mFdBlockCount) { - return EFI_INVALID_PARAMETER; + return RETURN_INVALID_PARAMETER; } =20 // @@ -149,7 +149,7 @@ QemuFlashRead ( =20 CopyMem (Buffer, Ptr, *NumBytes); =20 - return EFI_SUCCESS; + return RETURN_SUCCESS; } =20 =20 @@ -163,7 +163,7 @@ QemuFlashRead ( @param[in] Buffer Pointer to the data to write. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashWrite ( IN EFI_LBA Lba, IN UINTN Offset, @@ -179,7 +179,7 @@ QemuFlashWrite ( // block into the flash memory. // if (Lba >=3D mFdBlockCount) { - return EFI_INVALID_PARAMETER; + return RETURN_INVALID_PARAMETER; } =20 // @@ -199,7 +199,7 @@ QemuFlashWrite ( *(Ptr - 1) =3D READ_ARRAY_CMD; } =20 - return EFI_SUCCESS; + return RETURN_SUCCESS; } =20 =20 @@ -209,7 +209,7 @@ QemuFlashWrite ( @param Lba The logical block index to erase. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashEraseBlock ( IN EFI_LBA Lba ) @@ -217,24 +217,24 @@ QemuFlashEraseBlock ( volatile UINT8 *Ptr; =20 if (Lba >=3D mFdBlockCount) { - return EFI_INVALID_PARAMETER; + return RETURN_INVALID_PARAMETER; } =20 Ptr =3D QemuFlashPtr (Lba, 0); *Ptr =3D BLOCK_ERASE_CMD; *Ptr =3D BLOCK_ERASE_CONFIRM_CMD; - return EFI_SUCCESS; + return RETURN_SUCCESS; } =20 =20 /** Initializes QEMU flash memory support =20 - @retval EFI_WRITE_PROTECTED The QEMU flash device is not present. - @retval EFI_SUCCESS The QEMU flash device is supported. + @retval RETURN_WRITE_PROTECTED The QEMU flash device is not present. + @retval RETURN_SUCCESS The QEMU flash device is supported. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashInitialize ( VOID ) @@ -246,9 +246,9 @@ QemuFlashInitialize ( =20 if (!QemuFlashDetected ()) { ASSERT (!FeaturePcdGet (PcdSmmSmramRequire)); - return EFI_WRITE_PROTECTED; + return RETURN_WRITE_PROTECTED; } =20 - return EFI_SUCCESS; + return RETURN_SUCCESS; } =20 diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.h index 8d83dca7a5..4bd971b0d1 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h @@ -1,7 +1,7 @@ /** @file OVMF support for QEMU system firmware flash device =20 - Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made availa= ble under the terms and conditions of the BSD License which accompanies this @@ -16,8 +16,6 @@ #ifndef __QEMU_FLASH_H__ #define __QEMU_FLASH_H__ =20 -#include - extern UINT8 *mFlashBase; =20 /** @@ -30,7 +28,7 @@ extern UINT8 *mFlashBase; @param[in] Buffer Pointer to the buffer to read into. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashRead ( IN EFI_LBA Lba, IN UINTN Offset, @@ -49,7 +47,7 @@ QemuFlashRead ( @param[in] Buffer Pointer to the data to write. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashWrite ( IN EFI_LBA Lba, IN UINTN Offset, @@ -64,7 +62,7 @@ QemuFlashWrite ( @param Lba The logical block index to erase. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashEraseBlock ( IN EFI_LBA Lba ); @@ -73,11 +71,11 @@ QemuFlashEraseBlock ( /** Initializes QEMU flash memory support =20 - @retval EFI_WRITE_PROTECTED The QEMU flash device is not present. - @retval EFI_SUCCESS The QEMU flash device is supported. + @retval RETURN_WRITE_PROTECTED The QEMU flash device is not present. + @retval RETURN_SUCCESS The QEMU flash device is supported. =20 **/ -EFI_STATUS +RETURN_STATUS QemuFlashInitialize ( VOID ); --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602147806360.8889233347453; Mon, 27 Mar 2017 01:09:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8FA7920084749; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) 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 F3FD2203BEBF5 for ; Mon, 27 Mar 2017 01:08:54 -0700 (PDT) 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:54 -0700 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:54 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602134; x=1522138134; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Ie10hfnBul0g6TAkGa7VkphvgTkrKQDQjlzpXoaFmM4=; b=FM6MTTKXDDy0UJgMJxhHkY8yskWLeeCZFVpdbURs5fw/N4w7fXSglcuR taODvorYswYjijGncJnfCO/fIIy4Qg==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948350" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:37 -0700 Message-Id: <20170327080544.24748-6-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: [edk2] [PATCH 05/12] OvmfPkg QemuFlash: Make QemuFlashDetected external 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QemuFlashDetected is also changed to not use global variables. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 29 +++++++++++++++++-= ---- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | 14 +++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.c index 68388048f3..90e7810733 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include "QemuFlash.h" =20 @@ -37,12 +38,25 @@ STATIC UINTN mFdBlockCount =3D 0; =20 STATIC volatile UINT8* +QemuFlashPtrEx ( + UINT8 *FlashBase, + UINTN BlockSize, + IN EFI_LBA Lba, + IN UINTN Offset + ) +{ + return FlashBase + ((UINTN)Lba * BlockSize) + Offset; +} + + +STATIC +volatile UINT8* QemuFlashPtr ( IN EFI_LBA Lba, IN UINTN Offset ) { - return mFlashBase + ((UINTN)Lba * mFdBlockSize) + Offset; + return QemuFlashPtrEx (mFlashBase, mFdBlockSize, Lba, Offset); } =20 =20 @@ -53,7 +67,6 @@ QemuFlashPtr ( @retval TRUE The QEMU flash device is present. =20 **/ -STATIC BOOLEAN QemuFlashDetected ( VOID @@ -66,11 +79,15 @@ QemuFlashDetected ( UINT8 OriginalUint8; UINT8 ProbeUint8; =20 + UINT8 *FlashBase =3D (UINT8*)(UINTN) PcdGet32 (PcdOvmfFdBaseAddress); + UINTN BlockSize =3D PcdGet32 (PcdOvmfFirmwareBlockSize); + ASSERT(PcdGet32 (PcdOvmfFirmwareFdSize) % BlockSize =3D=3D 0); + FlashDetected =3D FALSE; - Ptr =3D QemuFlashPtr (0, 0); + Ptr =3D QemuFlashPtrEx (FlashBase, BlockSize, 0, 0); =20 - for (Offset =3D 0; Offset < mFdBlockSize; Offset++) { - Ptr =3D QemuFlashPtr (0, Offset); + for (Offset =3D 0; Offset < BlockSize; Offset++) { + Ptr =3D QemuFlashPtrEx (FlashBase, BlockSize, 0, Offset); ProbeUint8 =3D *Ptr; if (ProbeUint8 !=3D CLEAR_STATUS_CMD && ProbeUint8 !=3D READ_STATUS_CMD && @@ -79,7 +96,7 @@ QemuFlashDetected ( } } =20 - if (Offset >=3D mFdBlockSize) { + if (Offset >=3D BlockSize) { DEBUG ((EFI_D_INFO, "QEMU Flash: Failed to find probe location\n")); return FALSE; } diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.h index 4bd971b0d1..04f89364ab 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h @@ -19,6 +19,20 @@ extern UINT8 *mFlashBase; =20 /** + Detect if QEMU Flash is available and writable + + Note: This function does not use read or write global variables. + + @retval TRUE Flash is writable + +**/ +BOOLEAN +QemuFlashDetected ( + VOID + ); + + +/** Read from QEMU Flash =20 @param[in] Lba The starting logical block index to read from. --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602150217283.50986655627753; Mon, 27 Mar 2017 01:09:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BAF2D2008474D; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) 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 E4F0C203BEBE0 for ; Mon, 27 Mar 2017 01:08:55 -0700 (PDT) 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:55 -0700 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:55 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602135; x=1522138135; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uwKcrLbx3wiK/mdtQkhm+YZqs1Qdoi66e5Ki0RvT0X0=; b=xPuIgShsutIX++iv3PbY+CsN89O0PXqag1tuvcsKfJXjX0sBwrSjI1vr 53NH/ns8U2OXOKp70i9qqvMKCbJYFA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948358" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:38 -0700 Message-Id: <20170327080544.24748-7-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: [edk2] [PATCH 06/12] OvmfPkg QemuFlash: Add DetectFlashBaseLib.inf 'NULL' library 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This library attempts to detect QEMU flash. If writable flash is detected, then PcdOvmfFlashVariablesEnable is set to TRUE. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- .../DetectFlashNullLib.c | 41 +++++++++++++++ .../DetectFlashNullLib.inf | 60 ++++++++++++++++++= ++++ 2 files changed, 101 insertions(+) create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullL= ib.c create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullL= ib.inf diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c b/= OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c new file mode 100644 index 0000000000..cfa6026ff2 --- /dev/null +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c @@ -0,0 +1,41 @@ +/** @file + OVMF support for QEMU system firmware flash device + + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include + +#include "QemuFlash.h" + + +/** + Initializes QEMU flash memory support + + @retval !RETURN_SUCCESS Failed to set the PCD + @retval RETURN_SUCCESS The constructor was successful + +**/ +RETURN_STATUS +EFIAPI +DetectFlashConstructor ( + VOID + ) +{ + if (QemuFlashDetected ()) { + return PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); + } + + return RETURN_SUCCESS; +} diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf = b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf new file mode 100644 index 0000000000..1b7717af3e --- /dev/null +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf @@ -0,0 +1,60 @@ +## @file +# This is a small library with a constructor that will set a PCD if +# writable flash is detected. +# +# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials are licensed and made avail= able +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR +# IMPLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DetectFlashNullLib + FILE_GUID =3D 6ec93337-513a-4188-bf57-7bb746c6e8ac + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL|PEIM DXE_RUNTIME_DRIVER DXE_SMM_= DRIVER + CONSTRUCTOR =3D DetectFlashConstructor + +# +# The following information is for reference only and not required by the = build +# tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + DetectFlashNullLib.c + QemuFlash.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + PcdLib + +[FixedPcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable + +[FeaturePcd] + gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + +[Depex] + TRUE --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602152643379.7455174592834; Mon, 27 Mar 2017 01:09:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E89E320084751; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) 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 10028203BEBF5 for ; Mon, 27 Mar 2017 01:08:56 -0700 (PDT) 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:55 -0700 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:55 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602135; x=1522138135; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ZJcaopp7lBd7NOIqm852g4kSDeDU6Sw6DWcDHtBouNU=; b=eqT54TwxJG+nQVQRG0GBja042tgDwPilQQ0INongkFR0C//L+EUNz8Qm Jnm1gamlO9D0MMU5taozsktQW6WnAw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948363" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:39 -0700 Message-Id: <20170327080544.24748-8-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: [edk2] [PATCH 07/12] OvmfPkg PlatformPei: Detect and set PcdOvmfFlashVariablesEnable 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/OvmfPkgIa32.dsc | 5 ++++- OvmfPkg/OvmfPkgIa32X64.dsc | 5 ++++- OvmfPkg/OvmfPkgX64.dsc | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 56ff1557dc..ee1af50a14 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -544,7 +544,10 @@ } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf + OvmfPkg/PlatformPei/PlatformPei.inf { + + NULL|OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf + } UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { !if $(SMM_REQUIRE) =3D=3D TRUE diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index e16a7a5a04..a429ceff6b 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -552,7 +552,10 @@ } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf + OvmfPkg/PlatformPei/PlatformPei.inf { + + NULL|OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf + } UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { !if $(SMM_REQUIRE) =3D=3D TRUE diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 2c798ea7f2..21f52a0976 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -551,7 +551,10 @@ } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf + OvmfPkg/PlatformPei/PlatformPei.inf { + + NULL|OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf + } UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { !if $(SMM_REQUIRE) =3D=3D TRUE --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602154959562.1746023441891; Mon, 27 Mar 2017 01:09:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1C88520084755; Mon, 27 Mar 2017 01:08:59 -0700 (PDT) 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 71E5E203BEBE0 for ; Mon, 27 Mar 2017 01:08:56 -0700 (PDT) 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:56 -0700 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:56 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602136; x=1522138136; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=xb2BUGuRC8YGaWf7Eh9wyX7gcPmJJGsQUf64dweIKME=; b=UkyU2vCbZQbpCjtl0YIqY8Z3MvKS8pHhZzkdo2TcG2x6FtilIC4bcgP3 3vrxKS2UUrbRXDXDpXEx6q1oM9PPEw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948368" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:40 -0700 Message-Id: <20170327080544.24748-9-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: [edk2] [PATCH 08/12] OvmfPkg/EmuVariableFvbRuntimeDxe: Use PcdOvmfFlashVariablesEnable 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Previously we looked at PcdFlashNvStorageVariableBase64, which would not be set unless flash was in use, but soon we will set PcdFlashNvStorageVariableBase64 even for the memory based variable store. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c | 4 ++-- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c b/OvmfPkg/EmuVariableFv= bRuntimeDxe/Fvb.c index dec6d4af50..6abed7d5b6 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c @@ -2,7 +2,7 @@ Firmware Block Services to support emulating non-volatile variables by pretending that a memory buffer is storage for the NV variables. =20 - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -820,7 +820,7 @@ FvbInitialize ( return EFI_INVALID_PARAMETER; } =20 - if (PcdGet64 (PcdFlashNvStorageVariableBase64) !=3D 0) { + if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { DEBUG ((EFI_D_INFO, "Disabling EMU Variable FVB since " "flash variables appear to be supported.\n")); return EFI_ABORTED; diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf b/OvmfPkg/EmuVariable= FvbRuntimeDxe/Fvb.inf index 4d4827decb..05e9dd8915 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf @@ -2,7 +2,7 @@ # Firmware Block Services to support emulating non-volatile variables # by pretending that a memory buffer is storage for the NV variables. # -# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -67,6 +67,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602157258794.6391805577924; Mon, 27 Mar 2017 01:09:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 44A3820084759; Mon, 27 Mar 2017 01:08:59 -0700 (PDT) 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 AE3CE203BEBF5 for ; Mon, 27 Mar 2017 01:08:56 -0700 (PDT) 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:56 -0700 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:56 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602136; x=1522138136; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=zanHpqemdOOekzMge/GpSlUiPsoMETOjdPH9r5f6zKA=; b=nS/J/j619P2W6BgiiCJxvX3doyLPvNkF310c/6Q1a6E4A3p88vT1UtI5 Oz6ghA/KL3ANRx0zrvlO1R2KBWhUdA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948373" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:41 -0700 Message-Id: <20170327080544.24748-10-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: [edk2] [PATCH 09/12] OvmfPkg PlatformPei: Set flash variable PCDs 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This allows the PEI based variable drivers to run. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/PlatformPei/Platform.c | 34 +--------- OvmfPkg/PlatformPei/Platform.h | 7 ++- OvmfPkg/PlatformPei/PlatformPei.inf | 10 ++- OvmfPkg/PlatformPei/Vars.c | 122 ++++++++++++++++++++++++++++++++= ++++ 4 files changed, 140 insertions(+), 33 deletions(-) create mode 100644 OvmfPkg/PlatformPei/Vars.c diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 77a8a16c15..2e943d6e7b 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -1,7 +1,7 @@ /**@file Platform PEI driver =20 - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
Copyright (c) 2011, Andrei Warkentin =20 This program and the accompanying materials @@ -499,35 +499,6 @@ BootModeInitialization ( =20 =20 VOID -ReserveEmuVariableNvStore ( - ) -{ - EFI_PHYSICAL_ADDRESS VariableStore; - RETURN_STATUS PcdStatus; - - // - // Allocate storage for NV variables early on so it will be - // at a consistent address. Since VM memory is preserved - // across reboots, this allows the NV variable storage to survive - // a VM reboot. - // - VariableStore =3D - (EFI_PHYSICAL_ADDRESS)(UINTN) - AllocateAlignedRuntimePages ( - EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)), - PcdGet32 (PcdFlashNvStorageFtwSpareSize) - ); - DEBUG ((EFI_D_INFO, - "Reserved variable store memory: 0x%lX; size: %dkb\n", - VariableStore, - (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024 - )); - PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore); - ASSERT_RETURN_ERROR (PcdStatus); -} - - -VOID DebugDumpCmos ( VOID ) @@ -660,8 +631,9 @@ InitializePlatform ( // mHostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); =20 + SetupVariables (); + if (mBootMode !=3D BOOT_ON_S3_RESUME) { - ReserveEmuVariableNvStore (); PeiFvInitialization (); MemMapInitialization (); NoexecDxeInitialization (); diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index 18f42c3f0e..dfbdb8b75d 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -1,7 +1,7 @@ /** @file Platform PEI module include file. =20 - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -95,6 +95,11 @@ XenPublishRamRegions ( VOID ); =20 +VOID +SetupVariables ( + VOID + ); + extern EFI_BOOT_MODE mBootMode; =20 extern BOOLEAN mS3Supported; diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 53c6dd445a..0eaf27e553 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -2,7 +2,7 @@ # Platform PEI driver # # This module provides platform specific function to detect boot mode. -# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -34,6 +34,7 @@ Fv.c MemDetect.c Platform.c + Vars.c Xen.c =20 [Packages] @@ -83,9 +84,16 @@ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDecompressionScratchEnd gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/PlatformPei/Vars.c b/OvmfPkg/PlatformPei/Vars.c new file mode 100644 index 0000000000..563f847a55 --- /dev/null +++ b/OvmfPkg/PlatformPei/Vars.c @@ -0,0 +1,122 @@ +/**@file + Platform PEI Variable Store Initialization + + Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials are licensed and made + available under the terms and conditions of the BSD License which + accompanies this distribution. The full text of the license may be + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#define OVMF_FVB_BLOCK_SIZE (FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize)) +#define OVMF_FVB_SIZE (2 * FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize)) +#define OVMF_FV_HEADER_LENGTH OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, Var= Hdr) + + +VOID +ReserveEmuVariableNvStore ( + ) +{ + EFI_PHYSICAL_ADDRESS VariableStore; + UINT32 Offset; + RETURN_STATUS PcdStatus; + + // + // Allocate storage for NV variables early on so it will be + // at a consistent address. Since VM memory is preserved + // across reboots, this allows the NV variable storage to survive + // a VM reboot. + // + VariableStore =3D + (EFI_PHYSICAL_ADDRESS)(UINTN) + AllocateAlignedRuntimePages ( + EFI_SIZE_TO_PAGES (OVMF_FVB_SIZE), + PcdGet32 (PcdFlashNvStorageFtwSpareSize) + ); + ASSERT (VariableStore !=3D 0); + ASSERT ((VariableStore + OVMF_FVB_SIZE) <=3D MAX_ADDRESS); + DEBUG ((EFI_D_INFO, + "Reserved variable store memory: 0x%lX; size: %dkb\n", + VariableStore, + (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024 + )); + PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore); + ASSERT_RETURN_ERROR (PcdStatus); + + // + // Initialize the main FV header and variable store header + // + PcdStatus =3D PcdSet64S ( + PcdFlashNvStorageVariableBase64, + VariableStore); + ASSERT_RETURN_ERROR (PcdStatus); + + // + // Initialize the Fault Tolerant Write data area + // + Offset =3D PcdGet32 (PcdVariableStoreSize); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwWorkingBase, + VariableStore + Offset); + ASSERT_RETURN_ERROR (PcdStatus); + + // + // Initialize the Fault Tolerant Write spare block + // + Offset =3D FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwSpareBase, + VariableStore + Offset); + ASSERT_RETURN_ERROR (PcdStatus); +} + + +VOID +SetupVariables ( + VOID + ) +{ + RETURN_STATUS PcdStatus; + + if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { + // + // If flash is enabled, then set the variable PCD to point + // directly at flash. + // + PcdStatus =3D PcdSet64S ( + PcdFlashNvStorageVariableBase64, + (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwWorkingBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwSpareBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + } else { + // + // If flash is not enabled, then allocate a buffer and initialize + // it if necessary for variable operations. + // + ReserveEmuVariableNvStore (); + } +} --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 149060215958728.582697656096002; Mon, 27 Mar 2017 01:09:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 697BF2008475D; Mon, 27 Mar 2017 01:08:59 -0700 (PDT) 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 072D62007D1F8 for ; Mon, 27 Mar 2017 01:08:57 -0700 (PDT) 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:56 -0700 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:56 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490602136; x=1522138136; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=5n87uNo35MF/f57OTPdl4NE0a1XwSs8+58PuIel23Ik=; b=LLqrXgYEYczRmp13gQKE5XBi/pQAcsBanQlsVbsvmKiVl/VZFpT/mig1 xsqvjsz+20o1CaDPgVhJkeVKVjTyVg==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948378" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:42 -0700 Message-Id: <20170327080544.24748-11-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: [edk2] [PATCH 10/12] OvmfPkg PlatformPei: Initialize memory based variable store buffer 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is similar to the initialization in OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/PlatformPei/Vars.c | 161 ++++++++++++++++++++++++++++++++= ++++ 2 files changed, 162 insertions(+) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 0eaf27e553..7a7f5c23b0 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -50,6 +50,7 @@ =20 [LibraryClasses] BaseLib + BaseMemoryLib DebugLib HobLib IoLib diff --git a/OvmfPkg/PlatformPei/Vars.c b/OvmfPkg/PlatformPei/Vars.c index 563f847a55..452b06e399 100644 --- a/OvmfPkg/PlatformPei/Vars.c +++ b/OvmfPkg/PlatformPei/Vars.c @@ -15,18 +15,172 @@ **/ =20 #include +#include +#include #include +#include #include #include #include =20 #include "Platform.h" =20 +typedef struct { + + EFI_FIRMWARE_VOLUME_HEADER FvHdr; + EFI_FV_BLOCK_MAP_ENTRY EndBlockMap; + VARIABLE_STORE_HEADER VarHdr; + +} FVB_FV_HDR_AND_VARS_TEMPLATE; + #define OVMF_FVB_BLOCK_SIZE (FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize)) #define OVMF_FVB_SIZE (2 * FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize)) #define OVMF_FV_HEADER_LENGTH OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, Var= Hdr) =20 =20 +/** + Check the integrity of firmware volume header. + + @param[in] FwVolHeader - A pointer to a firmware volume header + + @retval EFI_SUCCESS - The firmware volume is consistent + @retval EFI_NOT_FOUND - The firmware volume has been corrupted. + +**/ +STATIC EFI_STATUS +ValidateFvHeader ( + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader + ) +{ + UINT16 Checksum; + + // + // Verify the header revision, header signature, length + // Length of FvBlock cannot be 2**64-1 + // HeaderLength cannot be an odd number + // + if ((FwVolHeader->Revision !=3D EFI_FVH_REVISION) || + (FwVolHeader->Signature !=3D EFI_FVH_SIGNATURE) || + (FwVolHeader->FvLength !=3D OVMF_FVB_SIZE) || + (FwVolHeader->HeaderLength !=3D OVMF_FV_HEADER_LENGTH) + ) { + DEBUG ((EFI_D_INFO, "EMU Variable FVB: Basic FV headers were invalid\n= ")); + return EFI_NOT_FOUND; + } + // + // Verify the header checksum + // + Checksum =3D CalculateSum16((VOID*) FwVolHeader, FwVolHeader->HeaderLeng= th); + + if (Checksum !=3D 0) { + DEBUG ((EFI_D_INFO, "EMU Variable FVB: FV checksum was invalid\n")); + return EFI_NOT_FOUND; + } + + return EFI_SUCCESS; +} + + +/** + Initializes the FV Header and Variable Store Header + to support variable operations. + + @param[in] Ptr - Location to initialize the headers + +**/ +STATIC VOID +InitializeFvAndVariableStoreHeaders ( + IN VOID *Ptr + ) +{ + // + // Templates for authenticated variable FV header + // + STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndAuthenticatedVarTemplate =3D { + { // EFI_FIRMWARE_VOLUME_HEADER FvHdr; + // UINT8 ZeroVector[16]; + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + + // EFI_GUID FileSystemGuid; + EFI_SYSTEM_NV_DATA_FV_GUID, + + // UINT64 FvLength; + OVMF_FVB_SIZE, + + // UINT32 Signature; + EFI_FVH_SIGNATURE, + + // EFI_FVB_ATTRIBUTES_2 Attributes; + 0x4feff, + + // UINT16 HeaderLength; + OVMF_FV_HEADER_LENGTH, + + // UINT16 Checksum; + 0, + + // UINT16 ExtHeaderOffset; + 0, + + // UINT8 Reserved[1]; + {0}, + + // UINT8 Revision; + EFI_FVH_REVISION, + + // EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; + { + { + 2, // UINT32 NumBlocks; + OVMF_FVB_BLOCK_SIZE // UINT32 Length; + } + } + }, + // EFI_FV_BLOCK_MAP_ENTRY EndBlockMap; + { 0, 0 }, // End of block map + { // VARIABLE_STORE_HEADER VarHdr; + // EFI_GUID Signature; // need authenticated variables for se= cure boot + EFI_AUTHENTICATED_VARIABLE_GUID, + + // UINT32 Size; + ( + FixedPcdGet32 (PcdVariableStoreSize) - + OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, VarHdr) + ), + + // UINT8 Format; + VARIABLE_STORE_FORMATTED, + + // UINT8 State; + VARIABLE_STORE_HEALTHY, + + // UINT16 Reserved; + 0, + + // UINT32 Reserved1; + 0 + } + }; + + EFI_FIRMWARE_VOLUME_HEADER *Fv; + + // + // Copy the template structure into the location + // + CopyMem ( + Ptr, + (VOID*) &FvAndAuthenticatedVarTemplate, + sizeof (FvAndAuthenticatedVarTemplate) + ); + + // + // Update the checksum for the FV header + // + Fv =3D (EFI_FIRMWARE_VOLUME_HEADER*) Ptr; + Fv->Checksum =3D CalculateCheckSum16 (Ptr, Fv->HeaderLength); +} + + VOID ReserveEmuVariableNvStore ( ) @@ -57,6 +211,13 @@ ReserveEmuVariableNvStore ( PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore); ASSERT_RETURN_ERROR (PcdStatus); =20 + VOID *Ptr =3D (VOID*)(UINTN) VariableStore; + + if (EFI_ERROR (ValidateFvHeader (Ptr))) { + SetMem (Ptr, OVMF_FVB_SIZE, 0xff); + InitializeFvAndVariableStoreHeaders (Ptr); + } + // // Initialize the main FV header and variable store header // --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 149060216258955.56720026949574; Mon, 27 Mar 2017 01:09:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 90A9B20084761; Mon, 27 Mar 2017 01:08:59 -0700 (PDT) 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 53D1B2007D1F8 for ; Mon, 27 Mar 2017 01:08:57 -0700 (PDT) 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 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:56 -0700 X-Original-To: edk2-devel@lists.01.org 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=wgriwaS/nBjWotdd4MwsO0/CjjEyfwgECLNHHhSikAA=; b=T/QIvcq5gToRKmExKKj5BWS6au72gXT9Dba8FztA6zjW9XEOzJMZu4oP yEMzXfZcFSti36swZII0reRwSZy7FA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948383" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:43 -0700 Message-Id: <20170327080544.24748-12-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: [edk2] [PATCH 11/12] OvmfPkg: Enable PEI variable access 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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We have to make sure PlatformPei runs early to set flash variable PCDs, so we add it to the APIORI list. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- OvmfPkg/OvmfPkgIa32.dsc | 2 ++ OvmfPkg/OvmfPkgIa32.fdf | 5 ++++- OvmfPkg/OvmfPkgIa32X64.dsc | 2 ++ OvmfPkg/OvmfPkgIa32X64.fdf | 5 ++++- OvmfPkg/OvmfPkgX64.dsc | 2 ++ OvmfPkg/OvmfPkgX64.fdf | 5 ++++- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index ee1af50a14..d3d0cb0af0 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -558,6 +558,8 @@ OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 09c165882c..45d303d57c 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -1,7 +1,7 @@ ## @file # Open Virtual Machine Firmware: FDF # -# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# # This program and the accompanying materials @@ -148,6 +148,7 @@ READ_LOCK_STATUS =3D TRUE =20 APRIORI PEI { INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF OvmfPkg/PlatformPei/PlatformPei.inf } =20 # @@ -164,6 +165,8 @@ INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pe= i.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 ##########################################################################= ###### =20 diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index a429ceff6b..011f97771f 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -566,6 +566,8 @@ OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 [Components.X64] # diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 5233314139..79928fb44b 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -1,7 +1,7 @@ ## @file # Open Virtual Machine Firmware: FDF # -# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# # This program and the accompanying materials @@ -148,6 +148,7 @@ READ_LOCK_STATUS =3D TRUE =20 APRIORI PEI { INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF OvmfPkg/PlatformPei/PlatformPei.inf } =20 # @@ -164,6 +165,8 @@ INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pe= i.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 ##########################################################################= ###### =20 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 21f52a0976..c1e02f65a4 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -565,6 +565,8 @@ OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 36150101e7..602f4bd710 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -1,7 +1,7 @@ ## @file # Open Virtual Machine Firmware: FDF # -# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# # This program and the accompanying materials @@ -148,6 +148,7 @@ READ_LOCK_STATUS =3D TRUE =20 APRIORI PEI { INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF OvmfPkg/PlatformPei/PlatformPei.inf } =20 # @@ -164,6 +165,8 @@ INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pe= i.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf =20 ##########################################################################= ###### =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 10:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490602168553588.4296799433387; Mon, 27 Mar 2017 01:09:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D914F21DFA7BB; Mon, 27 Mar 2017 01:09:05 -0700 (PDT) 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) 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 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 X-Original-To: edk2-devel@lists.01.org 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==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948389" From: Jordan Justen To: edk2-devel@lists.01.org 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: [edk2] [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: , Cc: Jordan Justen , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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.i= nf 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 =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable =20 [FeaturePcd] diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf b/Ov= mfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf index ba2d3679a4..c9cbc34901 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf @@ -77,11 +77,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable =20 [FeaturePcd] diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c b/Ovmf= Pkg/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; =20 - 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; } =20 + Status =3D 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 ( =20 MarkMemoryRangeForRuntimeAccess (BaseAddress, Length); =20 - // - // Set several PCD values to point to flash - // - PcdStatus =3D PcdSet64S ( - PcdFlashNvStorageVariableBase64, - (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet32S ( - PcdFlashNvStorageFtwWorkingBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet32S ( - PcdFlashNvStorageFtwSpareBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - FwhInstance =3D (EFI_FW_VOL_INSTANCE *) ( (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength + @@ -1123,7 +1107,5 @@ FvbInitialize ( // InstallVirtualAddressChangeHandler (); =20 - PcdStatus =3D PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); - ASSERT_RETURN_ERROR (PcdStatus); return EFI_SUCCESS; } --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel