From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.90112.1679618341198890106 for ; Thu, 23 Mar 2023 17:39:02 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=bLGvMUjt; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679618341; x=1711154341; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Km1DTjgdi7JAkYMIO42ZSO9XQkmqFjgyBGH6sx/TjF0=; b=bLGvMUjtPaC1q7TK08mESp49A+XtRySiIi86u+2OUdzbTN5E4ke/4mzs NLKk7SaUxjpZ1JnkzWjcddW6RBDg3WvpH2/pIc4CiIjmmyV9MSqa0K+a/ ZvFkVr/CaLofLiBciPNlBLhqsOjKKp0LBfNOoP2/GweU7f/HVanhR0xJ4 2683MwiDxojDck+6G0RGa6uKNZuSGXwC90FZ8cGN01CdcSryM5e2UQPah jgCOTB0O1r0W4zojR6qy7e0O4Imsvk3idA2+kOGTAekeMaFld5S0tHwY4 kghqdrSQ98d7vlcUNQc8If1IAhqe8s1S1qtE+n/IbAJ52rocw86ggF2T+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="367404025" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="367404025" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 17:38:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="712887508" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="712887508" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP; 23 Mar 2023 17:38:52 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 23 Mar 2023 17:38:52 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 23 Mar 2023 17:38:52 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Thu, 23 Mar 2023 17:38:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKxIihNp5d/cBZGoM7GF0zfV2uqaFlpvnnk8D962rInEqD9okZiNRuC05Huluc4YcG+cGXhfdPDauGG94BYIwEp2odOWAnyMLOfa7JH9devykOnV1/YKyOQEB/SGeI3gIC1bbZx2aTe2Ij7nbV0U6ytwnWM8//LIibf5+K+0gIho9HxciNd9vOhzhSoMyfAg/uhHtfukEwhpBoOc05nQvEq20HyKS2Y9C1vYCwC9FDpz3IQPOwVCEVnCy0SBQnB4R7EoH2OqUY2L8rm7aDcGNxWlHO3aNyUrH0Nbg+3SXS+nTJoBlkvSL5e/7LUVbYk2AtVljJrLOk7XNOCpFm0mNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gF5CrKlw8NTC5KDxNZnfAAKcj7rRo769QLt4OaM9Gv0=; b=AC8eoUfJqmPvVRkGPWBf2DxmPxbm8k7is0dmvZpWJOPyqXFupbYB3TG5zwiRXn2NteUUJZoAnXYaqQXhBqwuO3VNvQigeTpDz5SHA7wXgcIiAXJFN7zwHraKHQPZXJjYYVTvJEvaUllIndtMVorpHpDGyEAKahkkhcQjbLbHJVAWoGePMun4TOtCyX+zwjk1HGURSYI7RUTFrSvhfipRjYeRJum3yV+W3vHGnpAt4JQJiE8Hb+tQ7xZN6MMPS56X0wrgYAqI5t2envd8SGWO80PycfeHx20Jf1eMbYUSCj3blEGlc9IWf0nf2wA3pQplPCbreZRt8kQcCYPvUsvaUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by DM4PR11MB5503.namprd11.prod.outlook.com (2603:10b6:5:39f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 00:38:43 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::6364:feb3:108:a5ee]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::6364:feb3:108:a5ee%5]) with mapi id 15.20.6178.038; Fri, 24 Mar 2023 00:38:43 +0000 From: "Min Xu" To: joeyli , "devel@edk2.groups.io" CC: "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Gerd Hoffmann , "Xu, Min M" Subject: Re: [edk2-devel] [PATCH V5 4/8] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore Thread-Topic: [edk2-devel] [PATCH V5 4/8] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore Thread-Index: AQHYwao99yKXqKh2sEWuHqinl0PjGa8GLJsAgAQhpGA= Date: Fri, 24 Mar 2023 00:38:43 +0000 Message-ID: References: <20230321093152.GF8116@linux-l9pv.suse> In-Reply-To: <20230321093152.GF8116@linux-l9pv.suse> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR11MB5064:EE_|DM4PR11MB5503:EE_ x-ms-office365-filtering-correlation-id: 72cf8960-cfd8-46a4-d78c-08db2c001ed5 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: p4val37IxWX6iICkCrc+tsQ5iGBRExf4BudlZmExdhPxcAfZb/FtUf/fKF3OFm8YoiVBLLaB5vidYwBZHs/2RWe5BZdbHULsOcFQ5+JfUzKuSi2hFrm9QFYCBI6R2YZ5sOX6390kcyxb/wTYWTdyAoAegEJhrbLSI9nDSfSHPK7K7Wck/qjS7qI9iMlDhOV8ZeROfng3S4zsS+r/Aq16cdxoq9zVm+epSztr2vKevQSjgxVoPNkjGy31gMFqJdLj4MKmMG7bcZTm4dkWhXO8msT4EFnNTDtms+K7N+7/jYuSU1Sg0wkEH9cLHJq8qvHqG9cQWKzcH7GuChesCnkU7YGU4HUHUEYRn32ZkpQwtQbnREYMmdsXmUBSOkOYCEap4xXsMEwUVXk7merK9CFVGPwOSTXBUwJI4I3/zI8ZM051QRySxPtWJiNjFq1hscluncTSW5+mNL5agP9p9nkOmIJWSzb8ey74yUK58/o8PVAw3+HWePNixtvokLQVgNdCiCGBuA0K2xO//6QWI3Jxj9ZeT51Gd60qumITbybrA2VwWDaXGFAFQspHohrUJ0QHmPqm0mSDd6r/mWjZ7DyyAIdwzpVdL+rl/6xVNw2KpdrMz5U04fblkMpjyS6/fDUSqm/Qsvcr09rwczqom3k2N/hWs/4ODnvbFRX8/F6DX/RQ5KYx1bsXtqm4irQqE/3XNt1TS0T1p6muWbHO2YABpNhlDjr/S2i++5IYt4ZqC3Q= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(6029001)(136003)(396003)(39860400002)(366004)(346002)(376002)(84040400005)(451199018)(38100700002)(2906002)(55016003)(38070700005)(66899018)(478600001)(83380400001)(7696005)(966005)(9686003)(316002)(186003)(86362001)(33656002)(71200400001)(54906003)(110136005)(52536014)(66476007)(64756008)(66556008)(66446008)(8676002)(4326008)(66946007)(76116006)(107886003)(26005)(8936002)(6506007)(53546011)(15650500001)(122000001)(41300700001)(5660300002)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ZbwiJNAfFtRpbNIXOpiJVoTwTA7nVgoqmklIL7aBr7mPbE7GltdGnbeMpFAy?= =?us-ascii?Q?uSYygtKtpUPLUuv2vqdPbKSsbJub5821O5/th0nic5sJQUNfdNuG6l/tj5fE?= =?us-ascii?Q?5o/TFMZ+pC7TC/yZ65ptvjiq/eiGNZRMFW/FCb+a50enbv48x+gz81FSygXb?= =?us-ascii?Q?PW4cDFO2b3TcudnfMtKkm5Qcx9idIpbOnhiZbIf3NXSD5JdoxWA1PwbW+/6J?= =?us-ascii?Q?hVVhhjwe0OeVh1QG8MrjagLKkGrONtBUYBjAst2GOdYbJ1Pcsk2FGXIvxIPj?= =?us-ascii?Q?tXqTfI0LPp9a0sgeep89uiwPIYiXbZjvcx5EMSQ5GsqizuYZZhHTqaVZYdYD?= =?us-ascii?Q?Jls3JwojXQQ1xclQ5Qt1RAqbyIGyhBlmDLhrvz3829UYzLSQOhdUhs/wnwpz?= =?us-ascii?Q?Z+lfj5GIiqHa2HJhdt0jBFz2Sm9ePhO0n7pgXZ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Q?VryQCd6X/PlQLvAd63sXIL5/czYN+ynLCyhD/Q0o1y1Guhwpi4EiTQ4OItGR?= =?us-ascii?Q?nvu/D787zyyt5m58xabwxVy2SDzDMU0gUAnfWAda6R3cBfW7Iddrdjpgr4wD?= =?us-ascii?Q?zQMs/++T9lz6e3MoUqahCSeF5xsc0pvbaEBmJClz59OHp0WzdLSuUQXGIuJV?= =?us-ascii?Q?6rat/Vd6GOFzK54Mzeq6u8JPgW2EkBU0XGj6yn7AJUnsVLnU5tdEhYgBn9/P?= =?us-ascii?Q?wmFyBoR01HEC5Bt7SppcSrXhp12g37uNPcAoRmaN?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72cf8960-cfd8-46a4-d78c-08db2c001ed5 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2023 00:38:43.1385 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fB9NrDIU/fs88kWkSc9JozoXcjUj/3sFHPPiPe2pSdRwu6m2bEYobHTGcydwlPaTO6lGlORuN9bobH6JaFrYOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5503 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, joeyli Please see my comments in https://bugzilla.tianocore.org/show_bug.cgi?id=3D= 4379 I need your help to catch some logs in AMD SEV environment for this problem= . Thanks Min > -----Original Message----- > From: joeyli > Sent: Tuesday, March 21, 2023 5:32 PM > To: devel@edk2.groups.io; Xu, Min M > Cc: Aktas, Erdem ; James Bottomley > ; Yao, Jiewen ; Tom Lendacky > ; Gerd Hoffmann > Subject: Re: [edk2-devel] [PATCH V5 4/8] OvmfPkg/PlatformPei: Update > ReserveEmuVariableNvStore >=20 > Hi Min M Xu, >=20 > I have filed a EDK2 bug relates to this patch: >=20 > Bug 4379 - Got NvVarStore FV headers were invalid when using OVMF with > AMD SEV > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4379 >=20 > I got a "NvVarStore FV headers were invalid." assert when using OVMF with > AMD SEV. After reverted this patch, the assert is gone. >=20 > Thanks! > Joey Lee >=20 > On Tue, Sep 06, 2022 at 12:35:56PM +0800, Min Xu via groups.io wrote: > > From: Min M Xu > > > > ReserveEmuVariableNvStore is updated with below 2 functions defined in > > PlatformInitLib: > > - PlatformReserveEmuVariableNvStore > > - PlatformInitEmuVariableNvStore > > > > PlatformInitEmuVariableNvStore works when secure boot feature is enable= d. > > 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/PlatformPei/Platform.c | 25 +++++++------------------ > > 1 file changed, 7 insertions(+), 18 deletions(-) > > > > diff --git a/OvmfPkg/PlatformPei/Platform.c > > b/OvmfPkg/PlatformPei/Platform.c index 009db67ee60a..b1f8140d6041 > > 100644 > > --- a/OvmfPkg/PlatformPei/Platform.c > > +++ b/OvmfPkg/PlatformPei/Platform.c > > @@ -220,24 +220,13 @@ 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) > > - AllocateRuntimePages ( > > - EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) > > - ); > > - DEBUG (( > > - DEBUG_INFO, > > - "Reserved variable store memory: 0x%lX; size: %dkb\n", > > - VariableStore, > > - (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024 > > - )); > > - PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, > > VariableStore); > > + VariableStore =3D > (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariableNvStore (); > > + PcdStatus =3D PcdSet64S (PcdEmuVariableNvStoreReserved, Variable= Store); > > + > > + #ifdef SECURE_BOOT_FEATURE_ENABLED > > + PlatformInitEmuVariableNvStore ((VOID *)(UINTN)VariableStore); > > + #endif > > + > > ASSERT_RETURN_ERROR (PcdStatus); > > } > > > > -- > > 2.29.2.windows.2 > > > > > > > >=20 > >