From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.58]) by mx.groups.io with SMTP id smtpd.web10.7517.1676383214895887503 for ; Tue, 14 Feb 2023 06:00:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=ALTut4lW; 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.93.58, mailfrom: pankaj.gupta@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n33UdovUf1Kv/T7z6ptwrzMiAHexmPKYwHmRFA7/9IUp45sQ8YcsHsJD1jsxjS78HzfXSJ4MvpWywAoLEbErmmDReHZ++uVuGlsNJ6Wyl0u/+wW3hLYSr7T2US1ybOUOIS1jWOfeT5ACc+a62e9p6LJLdIg9Q6Q6OHN0INltcn7EsOY8qvvmsjpdGxyd+KLq9tcbCy28WSl44vbfhRIg/YTag8+YyT15qtFlR3s0o/xIvffaW9JXXKxXWIVXjKNm2E0S7ykU5E7BC2HCCNftSiAu8FTc7zNWuJpmrsJVoaBGmJgSH0RwL1X8dIIzXQqD74E4EbmgK/YwQLKw712KXA== 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=emHpyjf0lwrkl9JhYRstGeW7B0GawyB6eTt8SDHPLOU=; b=ZFJFkK6fP3byoCi1LNgCEK/2kbyz8laJ4rEdv448187CeKssatz5zP2NGd/j4L3sVo6WUxelpH96cJVQh2j0lhephQNu5u9UL7o1W5CiNyAt6NqQURaHoa30+ksyEnFnwxCmqP5fg7cbSMIECrPaO9dblv0/X2q+eD3VnDA2ITAu7PuS/3+kS+yOlhHU5mX+/JTVqgzfN9s0+dN8twD1kpyZgSomNpS3RtZZcdr0H3DgDkcBYyMuH9XZteQ5oel/kmXuPmoRCrCkO2vgs4DPDvNt7dqA9PklDVPZRM0Js+vpvGsNTt1TPHKkWW2196rrcxf9JeUmhGFwJVcioGh51A== 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=emHpyjf0lwrkl9JhYRstGeW7B0GawyB6eTt8SDHPLOU=; b=ALTut4lW1RCa3O+ahEVZif/lMJI6uCoDFVKWBAS/AcY/SYcGrigvDaIWpERVK1JMvZSy5hIQ46KBO9VDGPJXetO7OgCy2Ea5ZvDaXWmAFmKtBg6SKxjHzw2XiSlWp2WOrTx7VNrB+4QLKwVHzOgPRGbXDPm3kp/uTaE3ACkrhYc= 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 IA1PR12MB6580.namprd12.prod.outlook.com (2603:10b6:208:3a0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.22; Tue, 14 Feb 2023 14:00:12 +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; Tue, 14 Feb 2023 14:00:12 +0000 Message-ID: <6ffacb75-f890-c07c-937b-85069daae714@amd.com> Date: Tue, 14 Feb 2023 15:00:03 +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: devel@edk2.groups.io, Dionna Amalie Glaze Cc: 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> <39f4b07d-43ce-904c-991d-4789384c496c@amd.com> <9a8e1ab8-c430-0a54-11be-581a2d9b6221@amd.com> <1743B21FF9509E5F.2641@groups.io> From: "Gupta, Pankaj" In-Reply-To: <1743B21FF9509E5F.2641@groups.io> X-ClientProxiedBy: FR2P281CA0009.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::19) 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_|IA1PR12MB6580:EE_ X-MS-Office365-Filtering-Correlation-Id: b6e1840c-cf4b-42f5-5d81-08db0e93ca4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 29xy9FDJ6llg2ZvuGMkl+LazDq30M6Z8DRkVCYM4F4O3noCHkUn0rxYYeSOrUnjAQN0z4xmeNkHcAEj4C9V/5li+bOpyWzpZZXc/2b7sQK5AZnO7vh6Z6TjdoIAm/bE6vLea0FPZQm9VMRfn9dqJcqseIhTvfzKAtp3N4oKs3TWYe2DFmgLBIuGzX1prCfA92UTvQOJx5+WWSdk7sP80aL7L/Q02slHzJCBMU4fMrNG7LPrn2H7wjesUM3iaJtHuHc+IovrDV4bNCxMYcVxbbrzR4K8hD66T3c2gHV9W0qD1rT4LpKJ7grut4GY/mU9lz0muM5t8ogw2QqYPlAtj9K3ttse+c/aEOUCYyKH3VOsPdQthOJQyPH9RtqpAePhguxdBr3gpRK+z11132zXtr6hF3sfBmZf6sScMaB71LlUqnTEojzyOsPLUAcRmnjiOPM7f74Xwch8iblsC5v2MDgcVbMWkgjqmYbt3pcShn66k14IC443LnQpdKM4Xnz7AN81v4LQJ7mNlxk1jZ7+X9hX25Gogb/SU9Jf+y371UPmSR1mR0dPXpifh93r66mtexxTw5yQCXOie8NrgvOPYPGEOKj/cy5TheWhyg9iwhfmxHqhb0MJnM8bLSPMwyNqVuQNFdJyiWFKVW9OtYwzsU4/yrdk8+mCMBK9LeWtT3Sqs7sgSqHrklokZqFrTOOMuaJbsxXjoZ72IP9yj9gVtr0hDcrG5lfTEWNBnjBY7fxw= 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)(396003)(366004)(376002)(346002)(136003)(39860400002)(451199018)(41300700001)(54906003)(5660300002)(316002)(36756003)(38100700002)(31686004)(8936002)(66556008)(2616005)(66476007)(66946007)(86362001)(478600001)(26005)(8676002)(6916009)(186003)(4326008)(6512007)(2906002)(53546011)(31696002)(6506007)(6666004)(6486002)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?emNXOThveVc5UzRnTjFZMlQ5T0RsakN0UUtQbEE4MGtlemtEYllGWXlZdzJX?= =?utf-8?B?QWQ2azBEK2pEMTMvWDByd0FwYktqTnZJcTAzckJMS01pdlI0ZU1pQ0N6TkMy?= =?utf-8?B?ZjdTZjBjaVh2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vMVR3YUxkdlZidGtBYmN4RUFiTFBZRC9JdUM5TlU0M3Fx?= =?utf-8?B?blVrRW5JZ3RmNGRvaVJsUzZMQjluK3VRSy85eU85bXJqeG5POThYRHFNMDZS?= =?utf-8?B?ZDRTU3k0VDlLaDNmelRVZnBqMVE1WkhxVXFRWkhGN1pLNjNCNHNFUS9hTWtI?= =?utf-8?Q?TNklSVF7GW9avOfgoHwFQRI2Z?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6e1840c-cf4b-42f5-5d81-08db0e93ca4e X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2810.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 14:00:12.2359 (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: pNLpsFy3sUIQQsfYXzJ4zJFPpkHc1uZteqQdDaHXYSFejIpWVml5JBvhYGyqkRgsXnQDR8Rwe+Syq6EGQMWLaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6580 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/14/2023 1:55 PM, Gupta, Pankaj via groups.io wrote: > On 2/14/2023 1:51 PM, Gupta, Pankaj wrote: >> >>>> 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 >>> >>> 4 calls is telling me that "Accepting all memory" is somehow modifying >>> the memory map each call, but that shouldn't be happening. You've >>> confirmed that the body of the loop is getting skipped after the first >>> call? >> >> yes. This also changes the memory key every time. Below change solves >> the issue >> and don't even get even the second invocation of "Accepting all >> memory" message. It seems "gBS->FreePool" changes the memory map every >> time? See like there is a typo s/gBS/gDS :) Now also getting two printfs for "Accepting all memory", which seems right thing. Thank you, for the pointers! --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -123,7 +123,7 @@ AcceptAllMemory ( } } - gBS->FreePool (AllDescMap); + gDS->FreePool (AllDescMap);^M return Status; }