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 6ACBBD811CD for ; Fri, 8 Mar 2024 15:30:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sVH3IrGUFJhkESIBGiyx7zHCvAFBrHmYxWZFjudiqcc=; c=relaxed/simple; d=groups.io; h=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=20240206; t=1709911815; v=1; b=gB7FZP1PdKEGfExJ4LioEy5lZ6/Q+u3i+s6yG4ncCfhchLvcM3t4XqTHq8llLImukgJrJl8i 29BAa9jcOOdtWw73WD9erI/ck8jU9JN2pw8YWl53kqyWcVdHKrOEHl2AbHskZJ9p7d4w4NfLQCY z+jkgtvnvLwCKR8Ka2Luomfvp+7Njgc/AEs9ajf3oe2BAVlU6xhSK6OHoKIftFO6zhHUlKgPsGA UrIW/pZr+fR1524DOTZ0E9AakevexnUGriahpd7x3rIA7Rlp25wfABl0MH9npHqHpS/A8BMzjpl /jCQfruTmgS4HCWXC5uicKMF8Ivzmc3TLC4jNI1334tZg== X-Received: by 127.0.0.2 with SMTP id BqYIYY7687511xMJl3BH0TxT; Fri, 08 Mar 2024 07:30:15 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.63]) by mx.groups.io with SMTP id smtpd.web10.24754.1709911814480568212 for ; Fri, 08 Mar 2024 07:30:14 -0800 X-Received: from MN2PR16CA0006.namprd16.prod.outlook.com (2603:10b6:208:134::19) by MW6PR12MB8914.namprd12.prod.outlook.com (2603:10b6:303:244::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 15:30:11 +0000 X-Received: from BL6PEPF0001AB71.namprd02.prod.outlook.com (2603:10b6:208:134:cafe::b4) by MN2PR16CA0006.outlook.office365.com (2603:10b6:208:134::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27 via Frontend Transport; Fri, 8 Mar 2024 15:30:11 +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 BL6PEPF0001AB71.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7362.11 via Frontend Transport; Fri, 8 Mar 2024 15:30:11 +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; Fri, 8 Mar 2024 09:30:09 -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 v3 01/24] OvmfPkg/BaseMemEncryptLib: Fix error check from AsmRmpAdjust() Date: Fri, 08 Mar 2024 07:30:14 -0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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: BL6PEPF0001AB71:EE_|MW6PR12MB8914:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fa3f397-a60e-4877-9f74-08dc3f84a4ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: /Bnqv1ohd3p5dNZsbwLxIEg2az2KirQmmoLlcVMi3+kFp3hjJafztCXj75H69ClFv/vNQKSkyct8xszqGNT2oPUWN6GTSdZzUn64+A72vhVJvVEnh6wacUluq7wWuye/wc2FdjH4/yvIbhZjL1CUbJ4E7OZ15MPmoZr49vFxmW55kxSLXIwj6DyxrO8kw8zTAoNjvlgkz1Sp8nU5gwzLKgD8G1fxA7I75Zn+Es/Y8mPSSyRkVqqWJnpuQpLiiQL3xlXlqypEsXAnv6vs/TChpOYR0DmggV3vQKMeaQhc0yJT+zVp8ZOxd1GvKZPE2UFKufgkTU7SYUyyHRdMYd74MknaBbgwQF3ckF1ZGj2VPJYHK/ugw3LoFmd3fUcAmyNEledUil3Wkf7FuNm31mj+JMx39dciKXm8N8TW0VfGNRvVQ8vrGv9jUZCtuZwTT9FyHbjQLyBUp/kuGWs0XKl6cs77jexGZWW7/iU1gWpKjVNehj5yA4i1QuXp4kjWvjbUvtnPekTv7LoP1bpWAnO4ZFfwOwxQARlh+lO7Bi4YOjLhX6yvaVGMt+8oOtTsVoakEwob1WCZP55bJFpl1UY2PZIC7df2EMF8BjbfczRbtKpIOF1C3c8odReydTNENAAiNjb7wlWP/eNWYBYyswy6qqhnvGHW2r+K/fIW1OAMsHkpURkPoGQoG9D0AyDXd3ovK+Ic6vpHVd3WHVdiyzGx+g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 15:30:11.4346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9fa3f397-a60e-4877-9f74-08dc3f84a4ec 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: BL6PEPF0001AB71.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8914 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: 7FZW71lcXCDc3Q4w200mmQLKx7686176AA= 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=20240206 header.b=gB7FZP1P; 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 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. Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Laszlo Ersek Cc: Michael Roth Cc: Min Xu Reviewed-by: Gerd Hoffmann 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.43.2 -=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 (#116526): https://edk2.groups.io/g/devel/message/116526 Mute This Topic: https://groups.io/mt/104810674/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-