From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 37965941E88 for ; Mon, 6 Nov 2023 22:45:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=mFFw+OkSD4mIhFNEYl1PVdds157N/524e1OVpeeeHYs=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1699310745; v=1; b=O8zpJi4haDfH4KmCQD7ev8iSeyQl195VIIYrutbjAiJ/tvAvmaOeRd2fs5O/MLcaI+8BB4Bh uTJC1hl/cCyvp8NmB3pPEo8F7Kvn+1jbJkoYO278nDAzFoS8Wdf1+yB8imDz+YrhRL3KASRcIMx qUVNZ9RaDuOSwrB+ujOo5Eww= X-Received: by 127.0.0.2 with SMTP id U6jwYY7687511xjTvSQEZJMt; Mon, 06 Nov 2023 14:45:45 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.48]) by mx.groups.io with SMTP id smtpd.web10.71569.1699310745098799636 for ; Mon, 06 Nov 2023 14:45:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJMVBPtwuKJ4WjpI50wJR93doizILbIN8G5jb6dser9mjf1yeVr5Kz6f3Y1SCXg8uQZUkOlWS4kYmB7k90/ptSav2ie66onH8/hcsjDvZSk43Bz5tbXc3e7QTEdmnR9cAl6NuBGHIDwbX5qBIip+kUUFFVQ9gxFs6RltWviuBmdnbaHDfmD2lC1kZsyQUtiLmSUNVhHVWasJnch/NIRTyhsE9Jkesb13cUemo/t1FzhAWcvPMFrvk9EmizJ+cZuElquy5lojLvHiLzbl72VdakvYaMZ/cy4nljtChkkvNwE4EAvYzhMjCLFacJMZhTvvWyIZvpGRx46vXrai0iyfqA== 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=elx5mcf8UI0frgE90zfFHYTTkB1qGEIoHWRjVKjxT/A=; b=FtABJubwtiVB+k8qZs6PKdYiMa77wefooEL05V007RuAa6hTAyIo1QMbpacNvUHduhy1bE7ZDyeZ5UvAWLfdhjSaXX0fAA7+vZf7TOtVY9sSFgzNHXykmdigRFt47pmJntLBF3rNQ7O79sOjWll0SUVVOKZ7UuMsuFoZFoDVIJk90xPDopuldyDwlbgmQfFbCPiLbVUz73djmBamt+c5wQjzg/c1fFai3p3dffVZ33z3GH300pqfi5HBH4DvXb3hLyeL72DzuY/9fod9fPDSjuvRTKpyzjZsuNHB2c2dBNgCFmJmlZlWl2KoJZQCVWGS3zuomcQixyfnDj28YdNVLA== 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 (0) X-Received: from CY8PR02CA0008.namprd02.prod.outlook.com (2603:10b6:930:4d::14) by PH8PR12MB8429.namprd12.prod.outlook.com (2603:10b6:510:258::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 22:45:43 +0000 X-Received: from CY4PEPF0000E9CF.namprd03.prod.outlook.com (2603:10b6:930:4d:cafe::53) by CY8PR02CA0008.outlook.office365.com (2603:10b6:930:4d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 22:45:43 +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 X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9CF.mail.protection.outlook.com (10.167.241.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 22:45:42 +0000 X-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.2507.32; Mon, 6 Nov 2023 16:45:41 -0600 From: "Lendacky, Thomas via groups.io" To: CC: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Ard Biesheuvel , Michael Roth Subject: [edk2-devel] [PATCH 0/2] SEV-SNP guest support fixes Date: Mon, 6 Nov 2023 16:45:29 -0600 Message-ID: MIME-Version: 1.0 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: CY4PEPF0000E9CF:EE_|PH8PR12MB8429:EE_ X-MS-Office365-Filtering-Correlation-Id: 897f8928-4800-4afd-5118-08dbdf1a1bc1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 00miq+HBeWDJY1jEzke4/nkXcf8YZuiU4CCMTCNi5MKW5+4SjYD5nD5X8AsMcHKQg8eP7GHjl9j6trTHf6qPoNixU3es4yAjwHfl/VJWhVXr5H0YhSS3JlVnbzNH66cRwyvZIOjs1xc0kEc2XLZRCo8n2qqCIQCnva84M1cP+7pkJJUuZpz6M/WW/mD/BlhfJ491hBTQuipJdwQ/WZ0NrrFff4rmWR96Cg1b/jzMvLfgdQ8PH0He91Zo+lONbUSlQnvt+bUlFchqTmUYNcmjFcJDEJSRN2VDhP0a9yDYivQn/WoWbWc0Tq2gCfG6OFv4jeeEWGKmC0Q70SRrEw+rZHNPSlDNi9IZ/vGPJy59Q/8LqB/oxf7fPHj1LBVnsuEmxMypWENf0fdrGx37+FgEIYyfSMyjNYdOecXA43Xc8qlE5Lxq0le5dtVLgRXWpIeCnKl+jEYVrMtj4kdYC0FwMzya4s9ZEqfw8uyZe0i6KU3z956xqgKllFSOHRkiFj+XaNobFX5jcj5llJcnJoLoMKTW676kovIrOhqCKfF5BQ9HVV5goWJkabD7TAXy9vfDL158o/YOdgGah50lCTEgVSVzMCJ0v61Gn+M6iDSP7dUQnr7lUCZx7YjwrrGYNSxG9fIW6CgsjXDBJ6jyJLP2DXYdarbYmdY2PMvDaB5qB74xECcidhgeSPheGNn8GAb93l+Qph8vgDmyclu89FEtWZUhBWPVtZ67fzcNhbiDBtQ9aY5NBWnJyemYjL34TiOtFr4N1Ehr2UEI9lupqOFydg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 22:45:42.9761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 897f8928-4800-4afd-5118-08dbdf1a1bc1 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: CY4PEPF0000E9CF.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8429 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: HKqhuQUHUKP8ytmmuZDKscOEx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=O8zpJi4h; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io This patch series provides fixes around AP startup and sorting: - The CPUID_EXTENDED_TOPOLOGY CPUID leaf takes a sub-leaf as input. The current SEV-SNP support is attempting to retrieve the this leaf with sub-leaf 0, but is calling AsmCpuid(), which does not clear ECX before invoking the CPUID instruction. Therefore, because of the calling convention, the leaf value becomes the sub-leaf value and ends up returning incorrect information. Change the call from AsmCpuid() to AsmCpuidEx(). - When sorting the CPUs by APIC ID, the VMSA associated with the vCPU should follow the APIC ID. Update the sorting code to swap the VMSA pointer during the sort. --- These patches are based on commit: da219919538b ("BaseTools: GenFw: auto-set nxcompat flag") Tom Lendacky (2): UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf UefiCpuPkg/MpInitLib: Copy SEV-ES save area pointer during APIC ID sorting UefiCpuPkg/Library/MpInitLib/AmdSev.c | 9 ++++++++- UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) --=20 2.42.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110766): https://edk2.groups.io/g/devel/message/110766 Mute This Topic: https://groups.io/mt/102432041/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-