From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.73]) by mx.groups.io with SMTP id smtpd.web10.21701.1681236214101218881 for ; Tue, 11 Apr 2023 11:03:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=LeLWf5UZ; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.96.73, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/RW2SDa7ILe0A3yJ8WcpmqGpvYPoxUy1pZs48LOJHlMtNoQ8Q03I8SrogyD/0OEsV5PnACAEevvhCPaWStl2SSECrGH/Fv6AoFkckinUU9SLV4rZpEzLpVkfGQkEmHThP6UUfpgTI8ji2a3+r+rpXsS2yCJkTZkOdcVG6Ts84GSV6HZAW/BofPD4J3pLuebuRVIKlZvGq9ptmI2xONVPJxD2k7GfZQ0xdaLXnT+Q+8Xvx6GUfWlL/KuwXQD/Y+BxRCNNy9ZocJs+ySj7OwgF00/g+XYOU8pX+yZ/nKIg07NlUbdzfCpBndnRCAilffduuKbs50PbdMHZIKttnQqmA== 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=zOmcGI8WgqZIa1ITY5R6N/TjQ8mRJLT8CYSdXSzetAU=; b=Ri3j+k5j3nI1dI9T9VunOsjY8SJsjTS3L6e273C6JsHeXfvNi5W5ekv5R8+y4jGSZi94v9RUBCgS/RFrlFNV3A7KvexpMwbZzW5D5loOf+4S9Nlo883fuOmrcIvo/KwhyS94IJ22uo7ELhHOGNEc3581vk46ruJqegpo8Zq36U/sSk50yk9Bzi5+vwtnO+EbPw/vbcBERJ8w7Oayp2N6euWz0b6MMNH/ijuzwzmNMeZOnCtKAXaq1zX9t89qPa2ZYCBldFpFTI8HGLFyyVrpEmF0hyd++eHTRNd/q2BpJyhbbkv7GSbjS19qnGTCYDmJCRd9fmzVSJuWskfl7ebagA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zOmcGI8WgqZIa1ITY5R6N/TjQ8mRJLT8CYSdXSzetAU=; b=LeLWf5UZ1d1Lohffcmukzr9KZty0eKBhFsUOdzvgxOT3lmHcTxQI+KMun/aDfFYx6CZpG6HOcqBq1PcZUhBBizOG3NoT3ggVTyFJgxVurctY0yNc6yAiIxmZd+G3iA5SITKr25EkeBjkdoamVjVHt4GFhzq0vT15ActfFh8o834= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by MN0PR12MB5739.namprd12.prod.outlook.com (2603:10b6:208:372::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.31; Tue, 11 Apr 2023 18:03:31 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::5b56:bf13:70be:ea60]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::5b56:bf13:70be:ea60%6]) with mapi id 15.20.6277.038; Tue, 11 Apr 2023 18:03:31 +0000 Message-ID: Date: Tue, 11 Apr 2023 13:03:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH V1 1/1] OvmfPkg/PlatformPei: Skip PlatformInitEmuVariableNvStore in SEV guest To: Gerd Hoffmann Cc: "Xu, Min M" , joeyli , "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Michael Roth 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> From: "Lendacky, Thomas" In-Reply-To: X-ClientProxiedBy: BL1P223CA0024.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::29) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|MN0PR12MB5739:EE_ X-MS-Office365-Filtering-Correlation-Id: 028bb3ba-7fcc-4510-eee9-08db3ab70f37 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8LpRYLbsvx3f1adf+GkLuGPWf0Q0CCGAH1Me4JLj7x/OcB26iOsokd3oibDkSOcZLgCMTYT1WPJBga8vcIhRfuGLSU/jZP1RK9GoktZquIBg7S53oWN7QxsRCUv+7ITDJpPjndI9Vpu85F56VD6NKuORU3w1B7LnAWkFmKYg9+7kSmiCqpqxMvr/mgTGkVyNHWFck+onvuGd0igc6khZ+DL9hEJJcIN4uz144klgpP9LqzIB/Znsj0VRk6F8WV39LT2RSkkIo6hqP6otBeDzDComYlvK6ztl9+dX5eQhJBKDgl5Yaj7wbreU1LnOdmR4SkUEmiFzyIIll9/4IvwKUXVarEevMZLRK3DLvVFT4on3zGQyKcETchRNyt+WsPw9g4D3Ky6mKJFZ6CyvTQDv3LjG3VEEsVmrLop5kKgVIIPFLVpEIpbcNXjJsfLRZRR1YvJ9LL5LOTFbNLHGKwJI6VtYS8V3Zt7MrabnzTzo89muQkfIbmbi7EoxlqSDAZ8Q7zSOGtGd31XG5h6jDG5Iy/3LDHTmDp/HIYxhvr1IJJezlPHlkCnyCXYVs9wheXOhtKqyFOiDlJRayDfEIiLXkiRBtGwVfAGwcEYfMU+HhmeWAmEYoQuTqb2t2J+VSKqLJCRqsKvyWBSf6hT6EQ+asw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(6029001)(4636009)(366004)(376002)(396003)(346002)(39860400002)(136003)(451199021)(2616005)(41300700001)(5660300002)(31686004)(83380400001)(2906002)(8936002)(38100700002)(26005)(6512007)(6506007)(186003)(66476007)(66556008)(66946007)(6916009)(6666004)(36756003)(6486002)(54906003)(316002)(4326008)(31696002)(86362001)(8676002)(53546011)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?azQxYkFQVXJBMEZ1ZFA1djgrdkxYOE5HN1RrOUxEZGFwSzZSQnArMWVTOWYw?= =?utf-8?B?QkV5WEM0L2dXYTZxdmhTTktmK3BTTUxsUSs0SUNWYUg0ekFQdHZFK3J2aGpV?= =?utf-8?B?OTVjcTZSRmVoTjdrMnl5YkRnNldMWm11Rk9GTEsxczZqZVNOaVBUc0s2UkVt?= =?utf-8?B?SWRhb1ZlTU1TZkpaZStVWDhyWVlrU3FMckFrb3R5aHNlRzA3QUM3cTlPNm1z?= =?utf-8?B?djdINEtiMXAySTlUSVRxdWJTK28rSTNoMHpmSnI4dG5qVm01UExtSFFzRldW?= =?utf-8?B?enZ3VEFPRi9vW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0aGVqNDB1SW5qZHFJ?= =?utf-8?Q?igKtnY5GJZDfjYpLNnGzsze+J?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 028bb3ba-7fcc-4510-eee9-08db3ab70f37 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 18:03:31.3606 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DFptV3gkAwYIkM+ddzQLlMx/F6AbXN5fYE1Or3OWD85QY7gGHHMSph/+v3XHOc0Qel5DXRDndr4QeKrpDEDW4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5739 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/11/23 05:04, Gerd Hoffmann wrote: > 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? That doesn't work either. Specifying both OVMF_CODE.fd and OVMF_VARS.fd generates an ASSERT. Specifying just OVMF_CODE.fd causes VMRUN failure (triple fault) Specifying just OVMF.fd boots successfully Thanks, Tom > > 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 {