From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.9944.1681207479333557069 for ; Tue, 11 Apr 2023 03:04:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ClkqgpGW; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681207478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TPy9mOyGqVzKz6G0mpUfmaT7gUQiPJxu8Q7DGf86k7k=; b=ClkqgpGWFUwRrIaNU0B+TLKUdI1/1gDiGmC61zduExPSND3YRX0vvUXD3/kAfcFHSxNS8v PEZCrLyRpTHYOBEZEOZWMLnXt7MW7Md5M+FPP6oJry7KJVr9Mh/ccBx+CIFApKtCBQnHDM vzVrtCUkUEKR2as7bdR8KSS7rQPSLug= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-77-wMnpKrKbPRab2qCTN8ANTA-1; Tue, 11 Apr 2023 06:04:34 -0400 X-MC-Unique: wMnpKrKbPRab2qCTN8ANTA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE125885627; Tue, 11 Apr 2023 10:04:33 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A88D492C13; Tue, 11 Apr 2023 10:04:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 68DD21802393; Tue, 11 Apr 2023 12:04:26 +0200 (CEST) Date: Tue, 11 Apr 2023 12:04:26 +0200 From: "Gerd Hoffmann" To: Tom Lendacky Cc: "Xu, Min M" , joeyli , "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Michael Roth Subject: Re: [PATCH V1 1/1] OvmfPkg/PlatformPei: Skip PlatformInitEmuVariableNvStore in SEV guest Message-ID: References: <4tmi32c3kevecoc3y7mb6jlv7d7ygmctt6bgwflvjybqwphjqk@gnnertcj5kz2> <20230331075956.GJ8569@linux-l9pv.suse> <20230331144834.GK8569@linux-l9pv.suse> <5d170680-0a9e-2d5f-ecc1-e9f587548e3c@amd.com> <7a06aa46-4c10-fc85-48a6-826a4d82991e@amd.com> MIME-Version: 1.0 In-Reply-To: <7a06aa46-4c10-fc85-48a6-826a4d82991e@amd.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 07, 2023 at 12:00:46PM -0500, Tom Lendacky wrote: > > Thanks for the quick turn-around, but that patch didn't work for me. I've > update the bugzilla. Can you try the patch below? thanks, Gerd >>From a9179864523d12c3dcc137f36f6ed1a2832ed22c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 11 Apr 2023 11:12:37 +0200 Subject: [PATCH 1/1] OvmfPkg: call ReserveEmuVariableNvStore after AmdSevInitialize Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/Platform.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index c56247e294f2..1e70c1920830 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -378,10 +378,6 @@ InitializePlatform ( InitializeRamRegions (PlatformInfoHob); if (PlatformInfoHob->BootMode != BOOT_ON_S3_RESUME) { - if (!PlatformInfoHob->SmmSmramRequire) { - ReserveEmuVariableNvStore (); - } - PeiFvInitialization (PlatformInfoHob); MemTypeInfoInitialization (PlatformInfoHob); MemMapInitialization (PlatformInfoHob); @@ -390,6 +386,12 @@ InitializePlatform ( InstallClearCacheCallback (); AmdSevInitialize (PlatformInfoHob); + + if ((PlatformInfoHob->BootMode != BOOT_ON_S3_RESUME) && + (!PlatformInfoHob->SmmSmramRequire)) { + ReserveEmuVariableNvStore (); + } + if (PlatformInfoHob->HostBridgeDevId == 0xffff) { MiscInitializationForMicrovm (PlatformInfoHob); } else { -- 2.39.2