From nobody Mon Feb 9 18:19:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111683+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111683+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1700751766; cv=none; d=zohomail.com; s=zohoarc; b=WB/e0exfzzztCRECniN4GqpS4ufaPdb0n839OoZ6zHUXa7jeew/IysavcxHcB4HcMLCawnzZJV5XjP98c0gvamFeOx1rHw9+RvrRfd2lgsNHOECrJCsnx6pNvb7OFs2Gz83x5XvsfKfNugutTO2JMG31x0IrKBWEcxKeOc3wADE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700751766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=6gmM952ukHp0rhFWBQL4AEjhlD3hVl95YcnLU8aBq2s=; b=a08o8TCnKhMV9nMZS5+rFKYtBkt585Q1WjiPdM8OfAeWMlHTERH23FOGipj15obcIsgzIJnhcbbtdYaF51iwLG4ONE+OLb/8bvnhsqGWhUaJOl9QuF7WqBwFW7Hllteel8dYowm6ppauIngq3pbTvw9iwaKD2wp/cekLoNDCbnE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111683+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700751766457688.165698369116; Thu, 23 Nov 2023 07:02:46 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=vQzEs7QGlhndHmKg+HMXLOMQ8PehFZAt6WWI4k8mZlg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700751766; v=1; b=QTnh2WKDetOamBHs3hns3nAtlzVbrnSADR+pK+fNJlhHloAmLzDXge0EkfEVUAWek8T3JWU4 BbbuLaZSb5bVLgMB2eqlFPPcpCJdOE5b6U6xryYPVHofg1vdOL/Y9EQcvK98yyTWnlET2MnJGIy uEASBX5vaSD6h+ZvAx+vi7ZI= X-Received: by 127.0.0.2 with SMTP id b53RYY1788612x87o4mySITl; Thu, 23 Nov 2023 07:02:46 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.93013.1700751765365869104 for ; Thu, 23 Nov 2023 07:02:45 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-208-81ztUjC1OmqucAmjp-ZvNw-1; Thu, 23 Nov 2023 10:02:40 -0500 X-MC-Unique: 81ztUjC1OmqucAmjp-ZvNw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1353B3800BCF for ; Thu, 23 Nov 2023 15:02:39 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF92C2166B26; Thu, 23 Nov 2023 15:02:38 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DDEAC1800DDC; Thu, 23 Nov 2023 16:02:34 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , =?UTF-8?q?L=C3=A1szl=C3=B3=20=C3=89rsek?= , Gerd Hoffmann Subject: [edk2-devel] [PATCH 4/7] OvmfPkg: add PcdQemuVarsRequire Date: Thu, 23 Nov 2023 16:02:31 +0100 Message-ID: <20231123150234.117835-5-kraxel@redhat.com> In-Reply-To: <20231123150234.117835-1-kraxel@redhat.com> References: <20231123150234.117835-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Xu9CcczLnPgCVkG9Kmmu1PyBx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700751767363100027 Content-Type: text/plain; charset="utf-8"; x-default="true" Add PcdQemuVarsRequire FeaturePcd, so firmware code can figure whenever the given build is supposed to use the qemu uefi variable service. Skip the emulated variable store setup in case PcdQemuVarsRequire is true. This is needed to make secure boot work. Signed-off-by: Gerd Hoffmann --- OvmfPkg/OvmfPkg.dec | 3 +++ OvmfPkg/OvmfPkgX64.dsc | 1 + OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/PlatformPei/Platform.c | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index e3861e5c1b39..7fa7ee5e99e3 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -502,3 +502,6 @@ [PcdsFeatureFlag] # firmware contains a CSM (Compatibility Support Module). # gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|FALSE|BOOLEAN|0x35 + + ## This feature flag indicates the firmware build needs the qemu variabl= e service. + gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire|FALSE|BOOLEAN|0x6e diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 4b044321e31b..a27ea95dedc5 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -505,6 +505,7 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE !endif !if $(QEMU_VARS) =3D=3D TRUE + gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE !endif !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 3934aeed9514..0794e605ef4c 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -135,6 +135,7 @@ [FixedPcd] [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + gUefiOvmfPkgTokenSpaceGuid.PcdQemuVarsRequire =20 [Ppis] gEfiPeiMasterBootModePpiGuid diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index f5dc41c3a8c4..31922a91fbfd 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -219,6 +219,10 @@ ReserveEmuVariableNvStore ( EFI_PHYSICAL_ADDRESS VariableStore; RETURN_STATUS PcdStatus; =20 + if (FeaturePcdGet (PcdQemuVarsRequire)) { + return; + } + VariableStore =3D (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariabl= eNvStore (); PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStor= e); =20 --=20 2.42.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111683): https://edk2.groups.io/g/devel/message/111683 Mute This Topic: https://groups.io/mt/102767941/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-