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 C7208941D90 for ; Fri, 2 Feb 2024 19:18:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=mNDrUvyp9F8CN7Dr2cDQwU54DrwcwIJU60uarKvN1QM=; 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=1706901534; v=1; b=e2XIUNMYm8dX7qS2uBLDuwVq/BuDScVN10qSdVx8ZbvjGlmyaq345YGPD9WhmVJz8IV/QStk z+OfYvu+4Da4Eyt2XfRHz1aB5lgL7IXW4y7uANPyJc9TJ58DEuvJVbT+Hv/I66HXCxoXlNbobUX 7DnOowiw0Q70pa16J3kBGuSo= X-Received: by 127.0.0.2 with SMTP id gPagYY7687511xoy7fPG53P3; Fri, 02 Feb 2024 11:18:54 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.40]) by mx.groups.io with SMTP id smtpd.web11.1118.1706901533760242862 for ; Fri, 02 Feb 2024 11:18:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aj0gd0BA2bUmx47IiFIPsJrJZU3b5Obg0SD15LJdZlB4xVmDeHRyArIZcv3KXVqfmeTrR4f/3V7wk9hPESnMYyF/DcNmbDImUN09va/Zu5FX6MvnFHoUFdPY+oS5ZcWg31D3W2TOoJuu8yR0sJK2yY/jpfhK+OoQwtNS+/QIqP5Tv/bkVjbMjdO8ZqMglW6foqp6Ufb2dey321e13qej0wiK7516IsxN7pFbCNrUzy+fbyyJ82sk4mhMwMrZ2VyxSMjipT7hkuKGdaJ8DHsJ6lS3tNQPsL49uKR3MglAfcgvdeVsV7hjRfyeOK3JKz76MfCn4iSDD4+I9+ky819Gyw== 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=18/Bf/9m+e1A7P2LV3Yg6yThOr5J+MKmvoigibKNzeQ=; b=l5SukTGSR130mKlJvtk8OlRWJ69G3PzRdi7WyVNSvDBmT9zXQ/hnzXfWx/2h6QMDRcpliJws5hEIs30dEWIUdIhn1FmcZf4W9PbmDVrAmCJM3MGd+2lMnZEG8uKdKV0rGMmKNqauZmqTMKZ32B/8YIkc4ZBN/Qndjey1OnF7LSZpdxhuINtgR/xLjKadcZ0mNi3X77vA6DCsQ7YHU79VHz3TE1jVNrUuwON0788Jx0SAUnOipo5mfKM4myL1ozQ5dNrY6Twe0hAnO9n14cueUB5EMR32/v70YFRuKCdZBy+OVu0cciyn5haksraPbaK7pN+fpK8WcmTEd2Ln/ee3Iw== 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 BYAPR05CA0082.namprd05.prod.outlook.com (2603:10b6:a03:e0::23) by DM6PR12MB4481.namprd12.prod.outlook.com (2603:10b6:5:2af::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.13; Fri, 2 Feb 2024 19:18:48 +0000 X-Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:a03:e0:cafe::19) by BYAPR05CA0082.outlook.office365.com (2603:10b6:a03:e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24 via Frontend Transport; Fri, 2 Feb 2024 19:18:48 +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 DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Fri, 2 Feb 2024 19:18:47 +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.34; Fri, 2 Feb 2024 13:18:47 -0600 From: "Lendacky, Thomas via groups.io" To: CC: Ard Biesheuvel , Erdem Aktas , Gerd Hoffmann , Jiewen Yao , Laszlo Ersek , Min Xu , Michael Roth Subject: [edk2-devel] [PATCH] OvmfPkg/ResetVector: Fix SNP CPUID table processing results for ECX/EDX Date: Fri, 2 Feb 2024 13:18:37 -0600 Message-ID: <700474bfff6dc0eff732c0a86c94bf0d78f0f18b.1706901517.git.thomas.lendacky@amd.com> 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: DS3PEPF000099E1:EE_|DM6PR12MB4481:EE_ X-MS-Office365-Filtering-Correlation-Id: fe070e9f-c118-41df-f8ad-08dc2423c82d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: VSyEfLAQa7mRmtMx8TRpxtNncbgEg8gLsPRKYx0a/ms3x/58BwXrcL6Wv01g1Q9ZnAVX1TUV/jNeisco0k1yxos74p3w9vrSDH54TGy5speRyMk3pdcf/YOYfiddky0yo7E8wxHAPQLZqVDY3PSN/L3AX3K7Qs3zhYXNzRzFjQTRpYFxwXG65u+TP/kspqhrA0fx9yj32L/6pO4DfvkFJ+uaEsgvgROoWcJMfgHfe38GXcn9pQTVPp1v5eRpieyGqTyMdp3E5KEIX/epJvFbmZc0QZZr57zuKtG/05bLrph8zLZI5znh+KI4u2sLtBm020uIEJfD1sCbix/dy83i8XFVvd9dP8mkmXrLypV0QrIrYkceT55unOEZfO18gXbh19CC9qb1rH3+8RQO9QIe+12thZtv76MXBsAh4Mu8Usox0rY1wU38m+rffkOYdcTBgLfcVpUdcL4mCDwVlGydMwTM5/pCaZ3wb/6lqRNeFnKZ+qtOS1ZLv+4qrues+qBBw8QQQa1WaIiXvvQG6xBizfNC7pxGmRMK3yWNHd3LzeX9Ud0+5BwmisuJGxzpPTIOkEeneuUyV/ptovORI1gHQcxSOV6mu2ySU0YWYsFTq8v4GjPQQXJ/fqpcnl78hxNAxCVNIda4PUcUviTXbla0VS4e/KzVWsdXUJ5+7zSkhb7UnS276nzMFAxG2IlkDfiBBNkdkZMuSeQg9OgQannX94qNw3OZHSI3VLS36O/FiEuVcdWwdp1sOA9/hC/ADhhaHPxDy18e6P3uuiYeMn19Ag== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 19:18:47.9272 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe070e9f-c118-41df-f8ad-08dc2423c82d 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: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4481 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: p3itkoPyxZLLUYX60oyQMPE9x7686176AA= 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=e2XIUNMY; 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 The current support within the boot SNP CPUID table processing mistakenly swaps the ECX and EDX results. It does not have an effect at this time because current CPUID results checking does not check ECX or EDX. However, any future CPUID checks that need to check ECX or EDX may have erroneous behavior. Fix the assembler code to save ECX and EDX to the proper locations. Fixes: 34819f2caccb ("OvmfPkg/ResetVector: use SEV-SNP-validated CPUID valu= es") Signed-off-by: Tom Lendacky --- OvmfPkg/ResetVector/Ia32/AmdSev.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32= /AmdSev.asm index 3abc8300c403..043c88a7abbe 100644 --- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm +++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm @@ -395,9 +395,9 @@ SnpCpuidEntryFound: mov [esp + VC_CPUID_RESULT_EAX], eax mov eax, [ecx + SNP_CPUID_ENTRY_EBX] mov [esp + VC_CPUID_RESULT_EBX], eax - mov eax, [ecx + SNP_CPUID_ENTRY_EDX] - mov [esp + VC_CPUID_RESULT_ECX], eax mov eax, [ecx + SNP_CPUID_ENTRY_ECX] + mov [esp + VC_CPUID_RESULT_ECX], eax + mov eax, [ecx + SNP_CPUID_ENTRY_EDX] mov [esp + VC_CPUID_RESULT_EDX], eax jmp VmmDoneSnpCpuid =20 --=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 (#115066): https://edk2.groups.io/g/devel/message/115066 Mute This Topic: https://groups.io/mt/104126108/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-