From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.88]) by mx.groups.io with SMTP id smtpd.web11.24918.1678467854375845768 for ; Fri, 10 Mar 2023 09:04:14 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=E41TIBPd; 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.100.88, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0U/mgIHjTQve9IvvPWk7fcHcpQXGNvqEswou7LHvumE7PJryIDe9XOygjLIOSVd2LkKn3yifXDDzIp2g3oot74WEDBFy0ZYALA5Po7Foro4btC5jYRqbZNhHIDOLd1Uk5NqF1dQymB4PTNq7xAPtD5+c1BtukCu18TDI7vXMlBdbntU56l0+OE/STJaX89a8TQ5eyaSVxY0j/CO5YlGRBCnkaAqFFeuc0DqyD5yKNdxglgFewsT8oJKDGWGyitfiLjdm2bYV/TSyuVXaW49Bn3UJ45EzAnpHf9B+VClMLGF6aduKHL4SRmDyQTnFKjCJ9lCN19RL0N9Y8L/c5+sFA== 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=PVX+sO7mxXg1wZf614EV4peevF6wRm0/1AaCvvMfhFU=; b=lb9ywYwYaCHjBPoVrDck0tINUjh7R611572UCre72a5EUDdphJ0t1nuYZTWuogcODJwRVeJxXt2UjPdkcRYXHK6f6qdz4YNtZvPYdZDabpVsY3vtA37hxD1VY7AP3//S67Df1BnfzfGVJBjSg0XeM4/Cl4TDzyhHgT9eGLwzTvgm99FXELyygXC3XrB2uzZzlZoiljcLTZyrxxejmsN/N3pHTgts/33++FiMIql6ibuBIVRI+Gos9aqNXNS3xmxCwGv1OP2JlcuI7wSr173nKsYO88KTGajMoW7a/dOnlepl0vkD+O2mg7SBABkf54YqcCmVeHz0TfQqgg3zNNXe+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=PVX+sO7mxXg1wZf614EV4peevF6wRm0/1AaCvvMfhFU=; b=E41TIBPdJzjS3fRoMU1MEzpWE6rbMzE8ga147PbHxChT3tqIN9cL1mh/Pl4bH2hwEWeAgTY3+I+HMvyOw8JIpuB270sXZVrMyHmm5D3gngvtfdvgh8Z6Fcsg3qrUl3sSWJDNwRhzXEGY+30P/9YyZKm3LuN5LhvrCw3FerF6rcw= Received: from BN9PR03CA0554.namprd03.prod.outlook.com (2603:10b6:408:138::19) by PH8PR12MB6748.namprd12.prod.outlook.com (2603:10b6:510:1c4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 17:04:11 +0000 Received: from BL02EPF00010209.namprd05.prod.outlook.com (2603:10b6:408:138:cafe::3) by BN9PR03CA0554.outlook.office365.com (2603:10b6:408:138::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 17:04:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF00010209.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.13 via Frontend Transport; Fri, 10 Mar 2023 17:04:10 +0000 Received: from tlendack-t1.amdoffice.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 10 Mar 2023 11:04:09 -0600 From: "Lendacky, Thomas" To: CC: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Michael Roth , Ashish Kalra Subject: [PATCH 0/2] SEV-SNP guest support fixes Date: Fri, 10 Mar 2023 11:03:58 -0600 Message-ID: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Return-Path: Thomas.Lendacky@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00010209:EE_|PH8PR12MB6748:EE_ X-MS-Office365-Filtering-Correlation-Id: 382be2a6-892c-4df1-0d98-08db218977d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V2lmC+6Nx0UgWXa2KZDo44H4KNl7PHoiZXrF8FGVMjBArb8nCJ4c5r61nTLPfxjUejzIEiR24KvGbSBf5/vOzANrMMalp7Bki/wmhnwjnrK21CmR0cZIFQ1QkVsoLpLocF82ewuntt/SM3tv85zEMFkHkW0zwQQytbJcQ8TPz/Js3WoncAxM9RIsxnAjaKIvl5xC3QnxuKzy9dsA4YJzEhLENH+siulUHLH1p7DUmbN9qfkTeuVCJHnlRJ6g5yAWc11wnMEhSy1sTldtKi+zVhwEzSlyVLYEAwevG/PNE/CrYHFugo+vDz3TvmdStjMSdcYdscsMAv6f0lYmcgg5wg4cVnAyGcXUDSijl3axEnEZiqkYZViB87zut0Vk6qd1mGKGGcs8hW3CTiHXNdl9BchUiGw0moS16bJjj8Bm5c+tnmRfAmE36yfmM40fWg8v2fb0zGeZg6NV/G6ZtV3R8td0pjnCAfU4hGK4Se3OVE2lv2fkzg6cHxqmWf7kkOrKjuJlHbbVzRzf4vNMzUXNg71ZQIZYpz4j+wlwT5Fucmc5yVWKWr6aKcc1kEHHI7SRPzqCk7qQp8I9ZrFHtp94hSHTNZKbd9phDueP/7D7NvSp3WvylKoey32DSfNdLl8vRECfmhXQiA6cTSFu+xzeR8srStOOSXJ5OzyTeZsZmzLAJ7XKdRTzkeTuHJjcKyNLSyKkh1d9eMWS3EMdhH4r6q7unMyzy+icCbv4mRMtKAc= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(47076005)(336012)(426003)(356005)(36756003)(54906003)(40460700003)(40480700001)(86362001)(16526019)(82740400003)(36860700001)(82310400005)(83380400001)(6666004)(2616005)(186003)(26005)(81166007)(316002)(966005)(478600001)(6916009)(5660300002)(70586007)(4326008)(41300700001)(19627235002)(8936002)(2906002)(70206006)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 17:04:10.7471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 382be2a6-892c-4df1-0d98-08db218977d8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00010209.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6748 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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=3D4353 --- These patches are based on commit: f80f052277c8 ("OvmfPkg/RiscVVirt: Add Stack HOB") 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(-) --=20 2.39.1