From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.24978.1676316848318402210 for ; Mon, 13 Feb 2023 11:34:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=tOoPFMuR; 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.236.41, mailfrom: pankaj.gupta@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZteEJeMEDG828kGUAifhkOezNXVfO13vG/ekwBAgDgcuCOnqGvk0qcxR7uSWU91tZrd8P6fLgay7q3ec8DEQOxkCWDUF7COby5Deqircn61hwfuFLcdgwYJSs5epKPMS5kqk6IId9GQwD44u655wNvAQFrapTKZ6LpWhEE+Ltm5QyYMdYZSfgvhIAX0s/RzXrjlmc2c55GNrN+HK5NBqlxXzv8NpiIEO5jHmxWCQ10RScIaqYe5ulK32+vPXodLnWCUXa/3VC5wnGwN/4sPskFivHKddvd9t/cmMaMVi8XeP0Q2FKKpx7Hm1ihVmzcUdt6gxU4GVfXLohhSEFr/flQ== 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=BgCTZJ706lxoSOg9TEDW7tjyR3bIOL0Ud4EJWxAmT54=; b=JogIxKQH7Z54mfVvfTyDjLu8OCSOjwyr3IvNAKTlfqzCmkCD2/wsr9LhwZUK76wFa5M0B8TDN1q96o+9ESWOYLBuA0nGG0k6u5Nn7SbigfvSZVofsVsJVmK5pQWEKon++yyFEbQUDzbOBJNv+ecieIed7+oEMr04yorpHfP4XJgpk8IEPdyDCjZT1n0hfmYvuosgTIzcVxm1yotrA8ntbr5t2vP03tNBGEo6hRHCtI1B6CS2dkN+w7iEQjWGr65oRaYUAsNgScFj9viknVC/HAb0kAsuX+uvI5NhByChJqyT/wSiGx97hU6BvYIOftVJCw150MXUAUq+xJnTQUEgYQ== 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=BgCTZJ706lxoSOg9TEDW7tjyR3bIOL0Ud4EJWxAmT54=; b=tOoPFMuROgujrw0FCXdIu0bUZ4FDYP81KQ7CFqJaBrz5SrrSdeN5Rk6ROzO4AKvhCqK/E4pcLDjkJdNsyHQO4ErmU1DhQ/K1Dc92WjU63udXbCdlTBIuje0OZiy88aXaQeKkw+nDbiljt8vdkRXA+36nsHcqXgqvGRZglr/Q3JM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB2810.namprd12.prod.outlook.com (2603:10b6:5:41::21) by BL0PR12MB4898.namprd12.prod.outlook.com (2603:10b6:208:1c7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Mon, 13 Feb 2023 19:34:04 +0000 Received: from DM6PR12MB2810.namprd12.prod.outlook.com ([fe80::b84e:f638:fa40:27ef]) by DM6PR12MB2810.namprd12.prod.outlook.com ([fe80::b84e:f638:fa40:27ef%6]) with mapi id 15.20.6086.024; Mon, 13 Feb 2023 19:34:04 +0000 Message-ID: <39f4b07d-43ce-904c-991d-4789384c496c@amd.com> Date: Mon, 13 Feb 2023 20:33:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [edk2-devel] [PATCH v10 1/4] OvmfPkg: Add memory acceptance event in AmdSevDxe To: Dionna Amalie Glaze Cc: devel@edk2.groups.io, Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Ard Biesheuvel , "Min M. Xu" , Andrew Fish , "Michael D. Kinney" References: <20230126005647.3019225-1-dionnaglaze@google.com> <20230126005647.3019225-2-dionnaglaze@google.com> <0d8f2b0b-1d62-3db6-34c9-e9ce39838bce@amd.com> <9ea61013-e2c1-30a4-3be7-feed537c035a@amd.com> <52c7d139-3763-b4f2-ab5c-a0a925a1a3ff@amd.com> From: "Gupta, Pankaj" In-Reply-To: X-ClientProxiedBy: FR0P281CA0103.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::16) To DM6PR12MB2810.namprd12.prod.outlook.com (2603:10b6:5:41::21) Return-Path: Pankaj.Gupta@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB2810:EE_|BL0PR12MB4898:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f98c9f2-ba53-41d8-df59-08db0df943ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FBbyuCuwYpf5OD+RQB0mzQFmkP9QnE1IyQ6xEm2iQzMmbPkKQItzZxFnfYew2B7yUlgGbOmrIbiqQPibLtiomoLUyUIDz7gLDmRFT4B8y82xAfnXyNHdpBTc8i+f8Bbyb7F7g6llunbCzNxtK+OMQeaN4Qbdi2/d7RIuElvKMB/EMjrbhy9HRW+T0c17gH4U//rWYU9zgTpMLRpok41trwLoOuteyRmWNkUgS83wKlxKF7LfqUMcXBtE2MH3aeDUbbEb8lX0Sw2U7FFsYQTdjyQhY6U7ws/YNwH4XlHT03YeBPZPUjuekmVgv8iZrCdbaOMF4OpIu/sGFSr4kO/bcblnP2/bbJUn26u/nGgSJ3haPQgXPoN7pUiark1pmTm10VDED0R4GPp0g13MPC2nDJqbGcLwwwvbDhv619SZDq8aJ8S7k+6fnHFzafhz50ryesttEuVT38JoiwC08o7AwpWunjf8Q5HOPiYg8ikgk0zzt2bnF4DJWJoanCDD+kvHPaEJkik0KNqQ9wnCYXxI/4YaZ/hDvEmlRi02d9Z4mAahn5EAtyNP5NMZuVHQg/JevcjSGNR44ZjRvho9ldSEbZ+L4V/4LhMvQQPOMXLJKsMd+h6mevIxWStOs92LJ+5hpe+6BOLdar9MFx9mohhZz7CPnrhZ0MaylskUQzZu+YSOoRqhIjdluxMG4lgrWqLyqaHCmej4jt1w0rKV4qjpny+Gn3k43Ep2BJyVswINDc0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB2810.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(451199018)(38100700002)(2906002)(31696002)(86362001)(36756003)(41300700001)(8936002)(5660300002)(4326008)(6916009)(26005)(186003)(6512007)(53546011)(6666004)(2616005)(6506007)(66946007)(316002)(66556008)(66476007)(54906003)(478600001)(6486002)(8676002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Zy9PSkVxWmtRbFd4OERFMmo4RFlRc1ZhOFZya0dZQ3dVUGw2NEpuSnZjckln?= =?utf-8?B?WGpKd0VnYnYyRjBnZjVoQmNvSXpCUzc0elpzUjBFeVVEOVE1YWdaY3g1Z2gr?= =?utf-8?B?eEcrdlpvWEZ2bWtEeCticVRHYUloZTF5bkhpb3k1K1d0Wm12ZVZWMnB1L0Zm?= =?utf-8?B?emxIY3BaTGkwYlNLRHNTbklLOU51WFdZVTl0SGV3a2lTZlJBTHA3emNpU2p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V21XaFNDcDM4VHdvSm1s?= =?utf-8?B?eVpMaTdDYVd4TC91M0ZvZkpZYktVQ0hKdG95QXFJWTBsbFhxRW94MzYzR2Y0?= =?utf-8?Q?PouV1+C3mwUbxQ1oijeRNg2Ix?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f98c9f2-ba53-41d8-df59-08db0df943ff X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2810.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2023 19:34:04.4573 (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: 6WZvkYNyZDmg08PipDkPArbQYN+dHsp5OFs4Lyklk6vR2uBaMYy6zTJSVoH/HBsRt5aBRRihOAj9HuKMpaZedg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4898 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/13/2023 7:31 PM, Dionna Amalie Glaze wrote: > I'm rather confused at the moment how our internal testing succeeds > given the premise of the protocol is to use the specified behavior > that the OS must call get_memory_map again if ebs fails with > efi_invalid_parameter, but upstream does not appear to do this. > If you're able to make progress by applying this patch to your linux > build, then we might be back at square one, since the protocol's whole > purpose is to work with older SEV-SNP kernels. > > diff --git a/drivers/firmware/efi/libstub/x86-stub.c > b/drivers/firmware/efi/libstub/x86-stub.c > index a0bfd31358ba..795db2315f35 100644 > --- a/drivers/firmware/efi/libstub/x86-stub.c > +++ b/drivers/firmware/efi/libstub/x86-stub.c > @@ -747,6 +747,18 @@ static efi_status_t exit_boot(struct boot_params > *boot_params, void *handle) > > /* Might as well exit boot services now */ > status = efi_exit_boot_services(handle, &priv, exit_boot_func); > + /* > + * EBS may fail once with INVALID_PARAMETER, which means the > OS must call > + * get_memory_map again and try EBS one more time. > + */ > + if (status == EFI_INVALID_PARAMETER) { > + status = allocate_e820(boot_params, &e820ext, &e820ext_size); > + if (status != EFI_SUCCESS) > + return status; > + > + status = efi_exit_boot_services(handle, &priv, exit_boot_func); > + } > + > if (status != EFI_SUCCESS) > return status; Not solving the issue. Now, getting 4 calls. See below: ConvertPages: range 1000000 - 41AEFFF covers multiple entries ConvertPages: range 1000000 - 41AEFFF covers multiple entries Accepting all memory Accepting all memory Accepting all memory Accepting all memory EFI stub: ERROR: exit_boot() failed! EFI stub: ERROR: efi_main() failed! StartImage failed: Invalid Parameter Thanks, Pankaj