From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.89]) by mx.groups.io with SMTP id smtpd.web10.3714.1680026979988676293 for ; Tue, 28 Mar 2023 11:09:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=h+YWWpVU; 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.94.89, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhcktlqwauIkCgEuBpZrMvv5fCnnE368x1ZVEvJ7KGoxzW7th7qX66NW1tO2vJSBEQBt+bJiBqddthnldwmWGNk7P1I8pPJHB5RJ5+Kw+tmqzXxTQvuEDI8PqFswGPYAdYy34DoqlC+4mF0uYtr+tOHtLPvcLJlCVanz26CByyVGPILShndMVMfWWPBOP+rHIosCOKS2lXiOD/r+C3vMUjABaJ1kiLbpt1mJyiDi2IqQBQHWTv/ds7MWsWMeCs4ObAjpefztnTiwJM6A0TfVy8JEKS2QsjtUgKItFDEdZxpMvgGgMoLAsoOKtVcXqvYhLzvEki+DhgPFxVed7YpUiw== 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=78HbzpKGuc41IpJnK+aa8eKflZoN15wZjjjcFiqhN1M=; b=D3H5hOFtB89UQoj73NEYRF1cYb1bG2LWcxeWdt54V4JQTrKYXMweN4ia3zcm75Xqh+zANFeU8RZUmJgajWsQkfxNAO2EobZPHpgGnGd67j6qU9hCtkDB9zfFN4KRcrv+i9MsAlQ2Vq3MOhymcR6LBwC9HDe8FC8JR1mst8QK9GKih+6KbFSJW0gaATi/He1NESupGzqP5UKOXuUZeUj47+4KsI0JLyedl34iODKvYhaMPVC9lNwBggMbKISiA6NmNgPMEJGzHtVEQmSNvaism0kwqRgb6CgVZSPeDh6MWJatiHf6mXXwajaCsSq4HxzS6Me+0bYHX1wFqluN73993w== 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=78HbzpKGuc41IpJnK+aa8eKflZoN15wZjjjcFiqhN1M=; b=h+YWWpVUsMEixnmOJbrM9IkO/yGRzESWMfDRkSPL38C14olHETogBkGHge5/Y0AVQ7UF8fCKYEo7dmeO2hswMKOQuv+gZk8MvYeosVRiSHyvFD6yMuFMtIhyWXb04ipX0WEW+hap4TTtA6IO/GBstpf04RLIQrdikB/sWhWIEdg= Received: from BL1PR13CA0222.namprd13.prod.outlook.com (2603:10b6:208:2bf::17) by PH0PR12MB7960.namprd12.prod.outlook.com (2603:10b6:510:287::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Tue, 28 Mar 2023 18:09:38 +0000 Received: from BL02EPF0000C403.namprd05.prod.outlook.com (2603:10b6:208:2bf:cafe::7c) by BL1PR13CA0222.outlook.office365.com (2603:10b6:208:2bf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.18 via Frontend Transport; Tue, 28 Mar 2023 18:09:37 +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 BL02EPF0000C403.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.30 via Frontend Transport; Tue, 28 Mar 2023 18:09:37 +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; Tue, 28 Mar 2023 13:09:36 -0500 From: "Lendacky, Thomas" To: CC: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Michael Roth , Ashish Kalra Subject: [PATCH v2 0/2] SEV-SNP guest support fixes Date: Tue, 28 Mar 2023 13:09:22 -0500 Message-ID: X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Return-Path: Thomas.Lendacky@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C403:EE_|PH0PR12MB7960:EE_ X-MS-Office365-Filtering-Correlation-Id: 73665e3f-7b18-4daf-a313-08db2fb797c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nji86pwFF0FPb/grAPc3J45k3H99xqWdxhIIATnnlecr6NlvYjVVl5i0MXbXFzFv4igZqi0L8jpTBfd19YnFra3Enkjf2PPpO2uDg973YpalTKPEbY2ozvLcJlXlpQErTpufGaOrOgRzqbOJ+N7xDm1aVvYvXp80cOA+Y9LcRoKjtxfu3BKC3sFLBI7+yFANJHsTT+Y+QaijAKtT8qWOHjbNO12kLpdUrolQ1Pa0JSx/RBUv/9zpMI+wPhd/9+/6L6I6Ra1der9sQqPSFEx6TK8LLzWVRtxKkryLXP4WBIsIZQjvN32ZCSI/IUdd4y6L5j3LLmKcZI6Dc/3hDIWZFbM+1TRMmZ6AkCEObRXArERt+tZUpTDhA9rITOhPGS4FIuvXckTz5fxDwuGt1rTq/M+AMX7s9sPV6KaauxjfncMqLw+fYBxQRMQDEzQwugPggSm/R0r2KFmdwAsz8QmSQb4QbZ9j09JRmcbjaP6DVK9GdCuL0KXNMGTN46CtOdU2Qz8My1800mGH5GY76VCrNkwg8wBTjRxEY+TdZy1YoETrNT+q0aNYe5+W+VPNSp/G83NHxbN60J6gbCk6HAjT4kT5qlPQo0gLviqCS2Qbbf6VCNU6pge5JoM48n0bHIfNjlZFzXTxlF3YEEywOY+8bQ0Xa/BWCk1mj8KwSSLvPeqk6hn4aOT+xUflseAQOvNZ87W2swofyENyNWgG9Mt8qv/TAie3lsSLvmhCMmYscZw= 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:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199021)(40470700004)(36840700001)(46966006)(86362001)(47076005)(426003)(336012)(82740400003)(36756003)(16526019)(83380400001)(82310400005)(186003)(2616005)(5660300002)(26005)(8936002)(356005)(81166007)(6666004)(966005)(2906002)(70206006)(36860700001)(40460700003)(70586007)(41300700001)(19627235002)(40480700001)(6916009)(4326008)(54906003)(316002)(478600001)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2023 18:09:37.4093 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73665e3f-7b18-4daf-a313-08db2fb797c0 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: BL02EPF0000C403.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7960 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 --- Changes since v1: - Change the order of the patches to make the patch diffs easier to review - Add erratum number to the patch description and code comment - Use existing ALIGN_POINTER macro These patches are based on commit: 5eb3d1bcc16f ("ArmVirtPkg: can't find gUefiOvmfPkgTokenSpaceGuid") Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Michael Roth Cc: Ashish Kalra Tom Lendacky (2): UefiCpuPkg/MpInitLib: Reuse VMSA allocation to avoid unreserved allocation UefiCpuPkg/MpInitLib: Ensure SEV-SNP VMSA allocations are not 2MB aligned UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 224 ++++++++++++++-------- 1 file changed, 144 insertions(+), 80 deletions(-) --=20 2.40.0