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+90944+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+90944+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1656631791; cv=none; d=zohomail.com; s=zohoarc; b=dhTL1JXa9SiiFDvoGDEz7BxTfegB61poE5YCIf5fdAVagw/4VVBxWqOYcEZLoNJnrE7IK8aZJtZez50MGUZvBnun1KzNc+HO/PU1k4B1XVX/emu7n2Efm1Tc00gog+ai/fvDAH43TcByl6x56Iycru1+NEcVf8uf36tyO+t+RIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656631791; 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=WXegy1yA0YgDofUflhRepQfmwrWIrRHd4tlKDyF4kSA=; b=QTkJmFfz9VE0STWJxrWaMTSiVRcL2zBCCvZ5YvNG24eRb/kXpppOcktjF4Hdfe6bXVYAaK9XWQDn0wGlUcJJrjwrSeAt7W97dueT4gJ3yHoJaow6dxsmztUrBS6g8qcr/SkQ9lvRY1J7E2F4ZIlwWPuIk+PEr5lF+aCqtUEVHyU= 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+90944+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 1656631791009761.7541341392935; Thu, 30 Jun 2022 16:29:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6ks2YY1788612xM7A6RYaTNG; Thu, 30 Jun 2022 16:29:50 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.32335.1656631779038420889 for ; Thu, 30 Jun 2022 16:29:49 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="265528341" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="265528341" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 16:29:48 -0700 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="648098695" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.210]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 16:29:46 -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 V4 5/8] OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup Date: Fri, 1 Jul 2022 07:29:14 +0800 Message-Id: <0586936abdc27ab58302ae0a8630d4e598e8067c.1656630360.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: TiNirgoWz1CCsq7mXOUQJPwqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1656631790; bh=e+R5IW5CMYT5VD9FPqOalnU9Zvdg2/NNCtZv0Y6MvX8=; h=Cc:Date:From:Reply-To:Subject:To; b=pzklalbyGAaXs0/uLXBSGte7rk7wGP+WkNhfXB/0SuO0oci95FpUoWtjgPopTEKtZ0b gMNUIorh/iJZMopZFVaRi4cB9OTH4xxctCqxyLfgM+SVr5DlBv820iooOygHVmc/6r3TO jB4fP5L2abX1Tokcui39hVHG92ilbVUfcpU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1656631792439100005 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 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 (#90944): https://edk2.groups.io/g/devel/message/90944 Mute This Topic: https://groups.io/mt/92098440/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-