From nobody Mon Feb 9 12:11:54 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+93176+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+93176+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1662438986; cv=none; d=zohomail.com; s=zohoarc; b=WK/H2qRvOG5590QCaHrYjSbQ9exPQE+K9iYhYIYCJpIRHNWjSxbHM3+vz2r2K+CHFHGJtYARDupgVsH5haYAOOepXw9O9sloXa9em4mX3qNcm8K5Ra9aEsf0GBs3cuobWoayM96K+MD9QlLvvdM4pvwClSsDp5zXrag3E44ObL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662438986; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qTq2H9uD1ZddbdCZgt2runGaHym+P0ae6UYlxyrw9Nc=; b=cMMQ6xv4AR6/pwjSxrqwgIsH7WJ7hLYTHv9J1q98SKDmpYw/Cy08w6w9NmN801kHTt/vOsc2d1kqGkh3JG500nzBN7NL59E6Ru1TKQEtdUKLw0D/7ysXE/cu+v0EOkjYM+tQ4k5XWmjMFurRTxOU1wpF53+U6QK3pjZuRdENrBQ= 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+93176+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 1662438986146135.15675442822248; Mon, 5 Sep 2022 21:36:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BP27YY1788612xPpf5zg2q3X; Mon, 05 Sep 2022 21:36:25 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.303.1662438976985344787 for ; Mon, 05 Sep 2022 21:36:25 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10461"; a="296502090" X-IronPort-AV: E=Sophos;i="5.93,293,1654585200"; d="scan'208";a="296502090" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 21:36:25 -0700 X-IronPort-AV: E=Sophos;i="5.93,293,1654585200"; d="scan'208";a="675517321" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.4.118]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 21:36:23 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V5 5/8] OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup Date: Tue, 6 Sep 2022 12:35:57 +0800 Message-Id: <5ea1dbaa18b8358d05c3498dc5a049a9d7ad8d82.1662423715.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: Oq7mbbE4iLDb8HzDRDQnIQlHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1662438985; bh=OuohwWgiL5UJNqtjmN46nJ9Bt29rhupf05wnm5b2Wpo=; h=Cc:Date:From:Reply-To:Subject:To; b=Pu5seblixGnjZZgMrKAG6tvGlyI/GB1nBycObYxrpWkIRrF+mBjUALW2fkyKJlMvOpK Ea6bZzmb96T1LcnbC9rjRRpBoQudW78eu/JyGSYPqGEcpsbuaKgHI8bJPhMwgGFdrDCDU T5I/8Cl9X4BVWaSn7ke99ncE67d46rgxzQk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1662438987859100023 Content-Type: text/plain; charset="utf-8" From: Min M Xu EmuVariableNvStore is reserved and init with below 2 functions defined in PlatformInitLib: - PlatformReserveEmuVariableNvStore - PlatformInitEmuVariableNvStore PlatformInitEmuVariableNvStore works when secure boot feature is enabled. This is because secure boot needs the EFI variables (PK/KEK/DB/DBX, etc) and EmuVariableNvStore is cleared when OVMF is launched with -bios parameter. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c b/OvmfPkg/L= ibrary/PeilessStartupLib/PeilessStartup.c index 7502ec44669e..380e71597206 100644 --- a/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c +++ b/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c @@ -42,6 +42,7 @@ InitializePlatform ( ) { UINT32 LowerMemorySize; + VOID *VariableStore; =20 DEBUG ((DEBUG_INFO, "InitializePlatform in Pei-less boot\n")); PlatformDebugDumpCmos (); @@ -79,6 +80,12 @@ InitializePlatform ( LowerMemorySize )); =20 + VariableStore =3D PlatformReserveEmuVar= iableNvStore (); + PlatformInfoHob->PcdEmuVariableNvStoreReserved =3D (UINT64)(UINTN)Variab= leStore; + #ifdef SECURE_BOOT_FEATURE_ENABLED + PlatformInitEmuVariableNvStore (VariableStore); + #endif + if (TdIsEnabled ()) { PlatformTdxPublishRamRegions (); } else { --=20 2.29.2.windows.2 -=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 (#93176): https://edk2.groups.io/g/devel/message/93176 Mute This Topic: https://groups.io/mt/93494908/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-