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 D4A41D8106C for ; Thu, 22 Feb 2024 17:30:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=FDhpbEqrFqEbd3bLSEdBLOdYb67uyXR32lFzHNi1vZg=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: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=1708623024; v=1; b=NJmGsAou3X753jcJBbYPIbDHTX0ohNVStI99/pr0s1b1Tq3U7f1EFqHHPa1WW3xE4qwZUrJP RGCJ7Jv/xL765/4LwZHNuvP1MROgbXdCG/Ngyfc/qW+3Ne+LEwsZJ+iHr+MnkMt71b3lT5sz9K5 ZQVzRDXGcMCqjO81ZfojVpvA= X-Received: by 127.0.0.2 with SMTP id 6SASYY7687511xriP4Aa5K5b; Thu, 22 Feb 2024 09:30:24 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.79]) by mx.groups.io with SMTP id smtpd.web11.18769.1708623023908928587 for ; Thu, 22 Feb 2024 09:30:24 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jOZ7LxOw/9f7YRTXKEfybQ3NS9lVgn8LMEcCjo9ZZlCAYuCTvs5OXMKcypf/GC/OAto17wZY61UdZAdvSzUYIkYewcQV30JEgyXcglzCyHSXCilW8aIcuBQXUwwg/+cl7sYF92J7i5yc3lM2zHQsdu69cFY2+0BvN11llN5mTCZKqENwtyZ148w8qkDxS6vZKI8JRJUPPBtCTQc69xrS8xlXm2tlTnMJAagznEKaiWzlJvE69Rk62JWvJLhysomekM4nWTx6KnkCNicWRtiSaf4DTEO5Jio0uPiT7jFP9AxJTS8DcvKmBw3k3dY0tPTkbQEvLNiLQ5Xj9Mnhr4kkaA== 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=BnYkH98LaMvH9VO9t0LKbSnRbCduz1DsITrJLhjmzQQ=; b=Nm5XPzsX8APp5JTPdBUTHKYtq7LHon/nrjGuInXxTOZV3K99EEeX7/h9uBc2AGRvxb2CKjZN8nxwdmg+arjRYmrHk4SVaMIQJ09T+5VgYWm600afY8lBnezpfKUQEL6SgRk+Od5k46oGgG5gbxt+4kvkoDj0ehhwMj4i2Bi8iavpHFxgdYjqsMS+edvUFQx8GJ434dfW3p6G4tAfMQHS9WDYqGhkUz2IguQX16tA7o60yEdmEPmQran6ncbm1GiS5MvsQu8UHpikfxDPC3b0kOr8wMd0le4r992wyANY+CHadiPE7sByILceq32D/IPrIBHqe1JXCgIH3jp33qBUpA== 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 BN9PR03CA0678.namprd03.prod.outlook.com (2603:10b6:408:10e::23) by BL1PR12MB5897.namprd12.prod.outlook.com (2603:10b6:208:395::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.24; Thu, 22 Feb 2024 17:30:21 +0000 X-Received: from BN2PEPF000044AB.namprd04.prod.outlook.com (2603:10b6:408:10e:cafe::d) by BN9PR03CA0678.outlook.office365.com (2603:10b6:408:10e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.43 via Frontend Transport; Thu, 22 Feb 2024 17:30:21 +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 BN2PEPF000044AB.mail.protection.outlook.com (10.167.243.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 17:30:21 +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.35; Thu, 22 Feb 2024 11:30:18 -0600 From: "Lendacky, Thomas via groups.io" To: CC: Ard Biesheuvel , Erdem Aktas , Gerd Hoffmann , Jiewen Yao , Laszlo Ersek , Liming Gao , Michael D Kinney , Min Xu , Zhiguang Liu , "Rahul Kumar" , Ray Ni , Michael Roth Subject: [edk2-devel] [PATCH v2 01/23] OvmfPkg/BaseMemEncryptLib: Fix error check from AsmRmpAdjust() Date: Thu, 22 Feb 2024 11:29:40 -0600 Message-ID: <9c849da1a38577043c512eca4ed9c9e15d0c0941.1708623001.git.thomas.lendacky@amd.com> In-Reply-To: References: 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: BN2PEPF000044AB:EE_|BL1PR12MB5897:EE_ X-MS-Office365-Filtering-Correlation-Id: e3be3afa-3363-43a2-acad-08dc33cbf20f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: FiqE2M9+ni7X0/m4O2AIoDK3CF2KRzkcW2+6ctcOIyT7Mgldn9n4ZmRaWMfxTwFiwqkF79eTS8pMEYebwf13psojmkTvqBOUyzhZlrEi9xYJ337UONYDin4eBgY9gTBTVM55EDTJ+v2m2HSUzn7Cxi+fxQplpZqag+VnH9i8xYaX/93g5pUjRR5k4Ul4DDL7XLFZfxDO1voItG6Lcp4I4eqRZiR40OFjiCqNTyK2tGAaYfbBE8Y0VYxQoyLDHIY/BZ9liCFFLbcT8P7txesRHQh9ndR8AL5G1BcZH62iMprnUQ8JQH6req1YVQmcSadchVVIrnUbOoPDAjPFt1WPS5jXaLfW2nOMiK1OKZE/PQ+oID1qeujOpUjTPv/Vha9lpiSyZYvrNXHivC8rAVgbNj966FjaEV3qCKultjJMYudyVSdzVS8EEv4oxP5dR6OX+UEX/AOjuXZQhWYmBuFSMNxtpK0uVBIxtzgAIzq0FnTiwV7W7R9ftBx8IqgDGyDFQpjGImAgRpcwRR12x1hKl5BClPhyp6xZyETcF+VlVfUEFPetT9JvyOjFJa7nm3q0Ln0BCwHXaoJcNa5riOW0HslFJnTChz5GyBmvrc2W/sR8iED/C2Ek2pjDEFCu+uhzFD1TDpbcRD8XJCqh3PZnSA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 17:30:21.1790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3be3afa-3363-43a2-acad-08dc33cbf20f 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: BN2PEPF000044AB.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5897 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: uEPFTnoBe5kbxCpumvfELe5Vx7686176AA= 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=NJmGsAou; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4654 The AsmRmpAdjust() function returns a UINT32, however in SevSnpIsVmpl0() the return value is checked with EFI_ERROR() when it should just be compared to 0. Fix the error check. Signed-off-by: Tom Lendacky --- OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValidate.c | 8 +++= +---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValida= te.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValidate.c index 7797febb8ac6..be43a44e4e1d 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValidate.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValidate.c @@ -2,7 +2,7 @@ =20 SEV-SNP Page Validation functions. =20 - Copyright (c) 2021 AMD Incorporated. All rights reserved.
+ Copyright (c) 2021 - 2024, AMD Incorporated. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -31,8 +31,8 @@ SevSnpIsVmpl0 ( VOID ) { - UINT64 Rdx; - EFI_STATUS Status; + UINT64 Rdx; + UINT32 Status; =20 // // There is no straightforward way to query the current VMPL level. @@ -44,7 +44,7 @@ SevSnpIsVmpl0 ( Rdx =3D 1; =20 Status =3D AsmRmpAdjust ((UINT64)gVmpl0Data, 0, Rdx); - if (EFI_ERROR (Status)) { + if (Status !=3D 0) { return FALSE; } =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 (#115836): https://edk2.groups.io/g/devel/message/115836 Mute This Topic: https://groups.io/mt/104512928/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-