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 9D061740038 for ; Thu, 22 Feb 2024 17:30:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CpP5hHfLUkmef4dQ1pSO7djcIz2CBqrMHLfR07lggbo=; 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=1708623053; v=1; b=XPQNwSh1yRoHIJw2duSvf4bjqz3cbU4COUjPZwyADZueCI5fapGjmPDGOzsrZWiIH2oW/Hrf Y1/kQLKe95iJX6YkWx/6q6HmtqptWhF7nYR+1E5KTwtTGQ+WXXOt1Y0mYi8jrvn+lRI1X5eDN0U 82lq6ECkhv4MulIlB7mw/SUw= X-Received: by 127.0.0.2 with SMTP id i48yYY7687511xOeF2VOoKLw; Thu, 22 Feb 2024 09:30:53 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.87]) by mx.groups.io with SMTP id smtpd.web11.18791.1708623052541732031 for ; Thu, 22 Feb 2024 09:30:52 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H79Mu9W0oysKjLpcTOkuDe7GTUzkkRP6KjztAI/a9L3n9BVjwsgDeBXsPi1yp3G+pK2RhyES7//MlZknPQbVtaa4qP9MTHS1hQ48Tufx1H2PHzf1TKLY85jSM6zeVU1q6ho5TAd1UWHO4Pyp2/K5tAg5Z1y1EBNCLnxqPH+Gi3RrjJB0h6vOqPYfGFOs1H+XKKjHH3DxrSIBk4rD8dtArJjWJVnL5mjSgdoL9//zEGUIsupsx4vaEREAAJWUGitWcA+LInAv22o84krLuUxsY2If+u9jaPSngLQllxnd5G6a7FQhcpiGveyerTLBEQuwhQadv6QM2Of0zuZOXeRRUQ== 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=Vj/tWvx2Gt+sfj5BXC2hy3lF2pI8vfyxj1nGqJaSnL8=; b=RVOAF4WkmASSXcH0l6Gko23jDKLG0s7I4QvTDtnmZjOa+Xjha9sk8GNwHfwcXbkymg9lWy64+tAlBg1vrFDF/YGWXkXhhqMgb/7Td9+qJMlJOSI+ZbOvuwzApl1PhEgB9EVeUPRAuibMA7Jgwdvsqc8DH6CAJnh/fP+19SgAJO5zDDaY2Ih+x78rZg2FOUcikgwO9uPUJt1iKy2H8PbUEtzMhj7Vw5YEz8xvJhR3CNAaS7vKIkhnHCgrRFsvjSkuxQG42nfRy1QNaOS9gLKaSd0DgMDusza6BGteAhVh1O/jFjrXM4gVAb0ozncv9pq4Ji5ooIcwHGtlXebh7u+Hkg== 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 BN0PR04CA0065.namprd04.prod.outlook.com (2603:10b6:408:ea::10) by MW3PR12MB4362.namprd12.prod.outlook.com (2603:10b6:303:5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.23; Thu, 22 Feb 2024 17:30:48 +0000 X-Received: from BN2PEPF000044A5.namprd04.prod.outlook.com (2603:10b6:408:ea:cafe::e7) by BN0PR04CA0065.outlook.office365.com (2603:10b6:408:ea::10) 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: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 BN2PEPF000044A5.mail.protection.outlook.com (10.167.243.104) 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:48 +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:47 -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 05/23] OvmfPkg/BaseMemEncryptSevLib: Fix uncrustify errors Date: Thu, 22 Feb 2024 11:29:44 -0600 Message-ID: <6841345508132c7af71431ba071e40a9088605fc.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: BN2PEPF000044A5:EE_|MW3PR12MB4362:EE_ X-MS-Office365-Filtering-Correlation-Id: c90b3389-8ad3-4b7c-1cd7-08dc33cc0233 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 8YNg5rfRmuJdXFrbe6DxuMWJT9b9W2MjwHfYA/BIfyvolj17D/X3J8fJZddZTR0zfgRMb2Mkg7Eaw95bKgqOdMDbsIaqzVfPXNAz0iI1mFNuq/P7zKWEfXiGTSb53iNsQqeDzeHP6rCfB9y2R3HaWd798+V6t2/itUaW9r8ZXhDKehWr0SidxJBW01l6gDlV4vbZoBqiZCph3HG6CdqrScyTWEmBzGut8NYe/9x+gSlXdFFfR+glqVXlJ3ocECP+3hRlSwL5kmH0Nip6hpGAUazin6I2NLSCpEh48nlnvknsr+uw7KzYhtDGAP+Ea+jk4P1w67nnJ3PJiiZgpnzSc1ndTLsA0rMxDZFjSVB7T4IUM/RDzVCjCSw6ou2Qxt8MaX8aciwQ75R6BLSAvbY/L5gB+WtbYwNVhJRlDHzptCEs0jeoPf0ejJ7fTIaKnp/RoJzlEYGCp/l2z4ChR6oAADnvog11ZwEVtO8YXqGDe9M29lE8oDAhA6nSuCsYUBQbX8w/Ko7bPdKYu7KPM83CKaS1PAZzrdnqeCnnHUjv5ZGgl+X+RjPeF3vigkRsFstw7etnmLW2tyszV7i1XEZDUYcOYhY3/1F2q+38mS96EdTlOKC73ZVJSvLriEOnl4UvePYAeE01V1eP9t+ROYqoWw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 17:30:48.2548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c90b3389-8ad3-4b7c-1cd7-08dc33cc0233 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: BN2PEPF000044A5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4362 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: W4n4EIpZlEGuMS0UYNqCkCDkx7686176AA= 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=XPQNwSh1; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4654 In prep for follow-on patches, fix an area of the code that does not meet the uncrustify coding standards. Signed-off-by: Tom Lendacky --- OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c | 27= +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInt= ernal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern= al.c index 46c6682760d5..6a11adb06efb 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.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 @@ -78,7 +78,9 @@ PvalidateRange ( IN BOOLEAN Validate ) { - UINTN RmpPageSize, Ret, i; + UINTN RmpPageSize; + UINTN Index; + UINTN Ret; EFI_PHYSICAL_ADDRESS Address; =20 for ( ; StartIndex <=3D EndIndex; StartIndex++) { @@ -96,7 +98,7 @@ PvalidateRange ( // the RMP entry is 4K and we are validating it as a 2MB. // if ((Ret =3D=3D PVALIDATE_RET_SIZE_MISMATCH) && (RmpPageSize =3D=3D Pv= alidatePageSize2MB)) { - for (i =3D 0; i < PAGES_PER_LARGE_ENTRY; i++) { + for (Index =3D 0; Index < PAGES_PER_LARGE_ENTRY; Index++) { Ret =3D AsmPvalidate (PvalidatePageSize4K, Validate, Address); if (Ret) { break; @@ -135,18 +137,19 @@ BuildPageStateBuffer ( ) { EFI_PHYSICAL_ADDRESS NextAddress; - UINTN i, RmpPageSize; + UINTN RmpPageSize; + UINTN Index; =20 // Clear the page state structure SetMem (Info, sizeof (*Info), 0); =20 - i =3D 0; + Index =3D 0; NextAddress =3D EndAddress; =20 // // Populate the page state entry structure // - while ((BaseAddress < EndAddress) && (i < SNP_PAGE_STATE_MAX_ENTRY)) { + while ((BaseAddress < EndAddress) && (Index < SNP_PAGE_STATE_MAX_ENTRY))= { // // Is this a 2MB aligned page? Check if we can use the Large RMP entry= . // @@ -160,14 +163,14 @@ BuildPageStateBuffer ( NextAddress =3D BaseAddress + EFI_PAGE_SIZE; } =20 - Info->Entry[i].GuestFrameNumber =3D BaseAddress >> EFI_PAGE_SHIFT; - Info->Entry[i].PageSize =3D RmpPageSize; - Info->Entry[i].Operation =3D MemoryStateToGhcbOp (State); - Info->Entry[i].CurrentPage =3D 0; - Info->Header.EndEntry =3D (UINT16)i; + Info->Entry[Index].GuestFrameNumber =3D BaseAddress >> EFI_PAGE_SHIFT; + Info->Entry[Index].PageSize =3D RmpPageSize; + Info->Entry[Index].Operation =3D MemoryStateToGhcbOp (State); + Info->Entry[Index].CurrentPage =3D 0; + Info->Header.EndEntry =3D (UINT16)Index; =20 BaseAddress =3D NextAddress; - i++; + Index++; } =20 return NextAddress; --=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 (#115840): https://edk2.groups.io/g/devel/message/115840 Mute This Topic: https://groups.io/mt/104512941/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-