From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.58]) by mx.groups.io with SMTP id smtpd.web11.25058.1678468114183655143 for ; Fri, 10 Mar 2023 09:08:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=SoJ72cA8; 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.102.58, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B23sSvLj9eSMY+9LmNYqQqX54FExevb0YekNDZACRfWVc+eLS35isjLu51jaRH9nl6qp6ReJX3NqMiptPs9IL3o14ff/BQiO8VxTXwV8d/mnwratrUQQFIBbtDLoZBJEyxwHf4vDN9+hzcQ0zPQTuO2zORxyuGx52tw6zyFr8mVtAD/JCRnIxVi5LTEs8ojhWoDlZhTAftPpl/NjtQMOedhqObw9ZI1a0/e1RR6it+TS07Gu/IYaEnEFu3ZUxFDf/p5EmXa0VyubrLzcSWnnRH46TXQaMwOmkDXShbKusUWatZDZtExLgsrx2rXQa/XFRBDcdQoo+wDJ7oxc6lQACg== 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=utD1jHQzDmbQDMG/NJHndZA6dFfm3ZDoHht5VTKEjLY=; b=oKtHeleP9/RP1GSFbESqKzO+i713rxgq/92PzIZPpORWIrqouPEnR27prEJNiL2tJUjs4jyCraqayljjBZW0VBK807ZalW0ppMMhnjDAdSXyGJd34wNIpJucnIYk6HbIGajp4ISk2eF9jtyZDSCc5symxd0Mx06d/M9XYyuhZFpGicYMw4oNuIXVKFUIBwsZyAwV6YDge+MOaoA67c4G23PAv0vkm7VQ/1HWckIGwhZYWCpCQQHK0XMVQFeTQLKKJ8rlaSpkvGmJ9sLOoCJp9cBzbyFtDi4O0Bb0pzrNlJJB55X424u2zsh+vOp2zbkugVqRphxv/sMm9Fu1YX/6YA== 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=utD1jHQzDmbQDMG/NJHndZA6dFfm3ZDoHht5VTKEjLY=; b=SoJ72cA8hlPhE3aUjSYIXFvhByIZr0WR4JYpUqTaliSd+O4r4udLjEXTsainzO+xj2xoHUrR2VZ36kqWWbK4ZW0hgm/k5ROS4AXioZTFNoaYtr+gnae17kjkpctqeaojqriysrW/U0ZKKGOiq1bt/Tj5MtGZdlh/YD2bLxWaUNI= 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 BL1PR12MB5221.namprd12.prod.outlook.com (2603:10b6:208:30b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20; Fri, 10 Mar 2023 17:08:28 +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.6178.019; Fri, 10 Mar 2023 17:08:28 +0000 Message-ID: Date: Fri, 10 Mar 2023 11:08:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 0/2] SEV-SNP guest support fixes From: "Lendacky, Thomas" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Michael Roth , Ashish Kalra References: In-Reply-To: X-ClientProxiedBy: DM6PR03CA0030.namprd03.prod.outlook.com (2603:10b6:5:40::43) 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_|BL1PR12MB5221:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a9b79f6-4bda-4357-8571-08db218a111c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ffJExXB2AOkQnLKeV8N0f91x+KIyEgPN+wGKBGYd/sYxt2KR3MEXd60z1AuX3fHDueBjmztkuAJ5VOF5Y5RvJYEhe4PMMNV2RuM5Gsvx4ZXRiCtA4xdds24Wc2oHBtduozralagH9arywt7e9j1XUb0IPWX6jwTRwNYgJMqCK+ZYicHzdB3ssU92TJOrsffNT51K1PTagWzC24hkVQ3jeCTN2Ku1NrNqK88FTvCQ31SrhnQ6jOclsfeG+2yfnsRd80j+OqulZ5zHVLTiby89RozDwZLv0Q33i9799jzbwFwx738REZfSETZAxDb9mkkLnY3ahnpS27tPBvht4ECbwpnaLvWBkWrFVMXotQuBawdiir+g0sjcZmY77aYGNSu4Wi4jhyFwBwTmDaZXNrRddIzqL6p6c0g2N45H5MYrrz3k8RwKT5jrt8/OQIokBK/TPEyyPzJBfqKri5jsSq5KbiH/iLO+n8rg8xPTKP0VZMF2w+br5AT2/x8A+lj02tX0JlbA5EHm0+D3m3w6BK4CoMawCpY2yyIXG/xoNqmILcZlTbGZjwl++9Qje0kToSTseWrG/ISnOUjzTm17UOXMCkj85MrbFcfll15UTPT2i201B2oJPDaFKjx1AgPzlYnS0Gx8mXr7E7RKZjVg9yiQQiAJ0ZWl6QHr/L22VIZHrHs0hYqj2AhqAnkVqmhAkqafwFrcdpiXapYhhy7IYi0Y5+DxeebTNrmPIlN4xpe3vQU= 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:(13230025)(4636009)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199018)(66556008)(8676002)(66476007)(4326008)(31686004)(6916009)(316002)(66946007)(54906003)(41300700001)(5660300002)(966005)(6486002)(2906002)(53546011)(6512007)(6506007)(26005)(19627235002)(2616005)(186003)(8936002)(478600001)(36756003)(86362001)(31696002)(83380400001)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QW5kTVZhQk01REFDNjQ2MXFtMkRxZytNVlJWdFhqOFVDVUNTSG5jRXhIblZh?= =?utf-8?B?Zzc1YjhlQ3hGQzR0V0ZoODFZbUhFanhxV1JsQWFRbkxHMGFldE04WkNEZ2RY?= =?utf-8?B?dHozS1dEenI2cllhaEhEOEVPYlJqQW5lcmdnUHlwUTVCTk9FbTZ4dnFTTjc4?= =?utf-8?B?eGhnL3liQ0Z1N05wcG5ZYVArVW01Z3FDeERSZ2tVQWp5OWhFY2JsV2JGZlVu?= =?utf-8?B?RUVOZGhWVHpLb05UejdGZ3dHU21mSEozbFlnUUtCU01xUDQvZXlkQW5KYStm?= =?utf-8?B?cVJVVnFCL2JFVDBsYzBqTkRzVThnR2ExaEV0NDhFVzFBc0psaUkvVXJhMHl6?= =?utf-8?B?MFpjTG5xa3VZbzU5bUVDRk1aajlxQmJWd3BZNVZvM3E2OWlDM2N1TEZNN0R0?= =?utf-8?B?N2VqL3dSRmdVeEh4RjZrWStsU3ZoOEJ1Q2d5THZKWll6Z0N4eD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RFRXQmxVTzNEdEtnb2pxQm9JRUJCUGF2elFUSVNh?= =?utf-8?B?TzFEYnlCdk05OXZjWXlaSWx3c1pEb2k5U2ZSSlpoeE1hY0V2djROS1VuNjZ0?= =?utf-8?B?SVZoQ3pCVU5nWVFWMUpjSzdhalB2VE5pWlZSSFdpQUFNblo3WEUwUkp0Zms4?= =?utf-8?B?aVVCUXVoQTQveFMxVzdQdzZvRWVCcHo3UngxdVAyZ1FzbWVOU08wUzdXcURq?= =?utf-8?B?OThUdTVNWHl6OWJLcUM0YVFGdVorc3RLUFptSFUzL1gybWVFOG0xVEpiZkJX?= =?utf-8?B?VTJnd24wZy9uczhPSWhyNmRRMDludEhGQWhRc0pzQzA0dE9IdnhSRVdIUGhi?= =?utf-8?B?RHJrbFJ1bTF2YjRGdkVKaUJIS3pja0FWU01VRWx4WVY0N1dBcmI1amtVZWJy?= =?utf-8?B?N2lWaFZyL0tPWGFwbVFjTmtjNUpaYVNxTmhwcmN5NGV2WFEyUGZjczNCM1pR?= =?utf-8?B?eG1WcEZVck5nRHBUUFZNaVhtbWJXUWlZellKOG5selVMOGFLOFo4c2xqWXlp?= =?utf-8?B?L3lmSHc2QkxGejlmeDRhaGNjQXJvcUNIemdtcXBnbythNUJWeWM2RVN3QjRm?= =?utf-8?B?SFNValBQNWF5UkN1UCtmUkdiTFpVanhYSnlUeHpKSE5XSWR5WTFPRTRoaWxv?= =?utf-8?B?NnFKMVdBUTFXQ3JNaUV1cHgxRHRFZGVKZ0crb2l0NkI0eXJkalNZS21ycWcw?= =?utf-8?B?QlV4ajA0THlCY0RlTVJmMlZEOVZXVmhKa0M3WjI3SkphUC9RWWtQSUlNWm0v?= =?utf-8?Q?pXdZYy+om12YfSZjBsqw/SPOa?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a9b79f6-4bda-4357-8571-08db218a111c X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 17:08:28.1060 (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: LSWnsCpbGe9iTUjuQBZUKbuWXdnUnbzrHdv6/o75SkmdHg0zNmPC4FBW1hXo2myCtiHWvlamu1Kw05s+jewbyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5221 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/10/23 11:03, Tom Lendacky wrote: > This patch series provides some fixes around AP creation: > > - An erratum on AMD hardware requires that a VMSA not be aligned on a > 2MB boundary. To work around this issue, allocate 2 pages of memory > and using the page that is not 2MB aligned and freeing the other. > > - When parking APs after exiting boot services, the current SNP support > will perform an allocation that will not be reflected in memory map > being supplied to the OS. Instead of allocating new VMSAs each time, > re-use the current VMSA. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4353 > > --- > > These patches are based on commit: > f80f052277c8 ("OvmfPkg/RiscVVirt: Add Stack HOB") Specified the wrong commit here... should be: 9b94ebb0c826 ("DynamicTablesPkg: Add SMBIOS String table helper library") Also, the first patch has a #define for IS_ALIGNED, which Gerd is trying to address with another patch series. Once his series is merged, I'll re-submit with the removal of the #define, but wanted to get this out for review now. Thanks, Tom > > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Michael Roth > Cc: Ashish Kalra > > Tom Lendacky (2): > UefiCpuPkg/MpInitLib: Ensure SEV-SNP VMSA allocations are not 2MB > aligned > UefiCpuPkg/MpInitLib: Reuse VMSA allocation to avoid unreserved > allocation > > UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 224 ++++++++++++++-------- > 1 file changed, 144 insertions(+), 80 deletions(-) >