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 BCAE5D811C4 for ; Fri, 8 Mar 2024 15:30:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eSVuEpfTjfLatIMT4lMzm+aMiNi9UJnxwTncd7RTxw0=; 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=1709911844; v=1; b=k+eo20KksS026jcohfzV3iXIXZDmXKiEJdJuNK1BFnjXC26dcfp4x+STOZB1qI3kJy4ZrH2k s1YCErrZmzhTvJ4hWoHOqD3R3NRTIJ0X44BVIAkAdn15jliQ0ito7I8PAAtdl0BekJpjZer3pf7 uhWb8iWsD2g1Csvu7FTsxW9MS1IpnWeTdCD/ojtSbIAGSCCW8xqlxx4H2rPos33k3VR3COc/SH6 /oVSAKASdhmjvXfa07ohcYllmFhb+8Ym2Ynsju1eeQ4tOlG6c4wPfFSLKmkFBJOjQaK0ARgU/02 fZgBscT9OfUvMyh11FhFNq5OYvl1wUEU1oEha0bc0+ACQ== X-Received: by 127.0.0.2 with SMTP id D3zkYY7687511xJZ66d4LEXX; Fri, 08 Mar 2024 07:30:44 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.45]) by mx.groups.io with SMTP id smtpd.web11.24828.1709911843815774323 for ; Fri, 08 Mar 2024 07:30:43 -0800 X-Received: from CYXPR02CA0014.namprd02.prod.outlook.com (2603:10b6:930:cf::20) by CY8PR12MB7099.namprd12.prod.outlook.com (2603:10b6:930:61::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.26; Fri, 8 Mar 2024 15:30:39 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:930:cf:cafe::fb) by CYXPR02CA0014.outlook.office365.com (2603:10b6:930:cf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.31 via Frontend Transport; Fri, 8 Mar 2024 15:30:39 +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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) 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:39 +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:38 -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 05/24] OvmfPkg/BaseMemEncryptSevLib: Fix uncrustify errors Date: Fri, 08 Mar 2024 07:30:44 -0800 Message-ID: <394472ce3d32e61e4eac0dda2addd879c700b60f.1709911792.git.thomas.lendacky@amd.com> 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: CY4PEPF0000E9D5:EE_|CY8PR12MB7099:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a8b104b-7965-401d-c261-08dc3f84b598 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: bUGOeuRpEcneNE7AwoP/BC45Y/kd72HdRI0zaJiz+ktJ0CO8jzl3cKRuTV8yqzQdKBH7csyXg8YtekCKcgQ/fPBk6fucIS5PPPImXUCQKjS8wBD450LeMV0P09oqPAWT3q4pmuFXp17+gsFRsaf1Af+IKSELK3q5m2dDB/Y2uYrHN2WzDNKfGfluxaoYGYenTZrc1uH0HigpQoe6yyUV5GL5uBr4fW2inpIXtZi63tDR5KW/ljP78iSiPznwDCGeuGGloj74MkQeNgEio4dztUnC0P/py/J9tiT+fUb3tTSjMLHMO69pH5zvZt2wcWE9BfqN9b9je2o+4osMnG0LDOChLhabL5oYj5u5ABwMfVlvGZW9bVz5Ub07uguXBdYF7jalaUOGY5+MMSg3ccROW9+VGgarbWy1DekVOxkAqt3lwJi35mcqc5HbhUGKOgt3FbgOTqm1xYtJrDaey/vnY04FoqgzIWkZp4lsJyNpCv34NJLXCEZ9brWyc3kbBoIuW6gsABEYvRTi1ZPbiTWD+oQ4S6mQn0yh4M+ckQ77kyDl5oNAnQOMzDyss5gtgbvI25E/+2sMYIXsCGGrzkHCpYvKD0YdkZqYKgbVO6ON8SWIGOeQnrf1tdDnB1PSeagK64Oy3lYxPr6lMdNtddStuGNT75iQL6pVHIqloeVlNr0XQ4yTjXFS8G0VnICSConVOT2gBcZAAU0TznTdDcTRew== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 15:30:39.3750 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8b104b-7965-401d-c261-08dc3f84b598 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7099 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: JGUo2Lq3tfFpnDCGGd8UBVaqx7686176AA= 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=k+eo20Kk; 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 In prep for follow-on patches, fix an area of the code that does not meet the uncrustify coding standards. 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/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.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 (#116530): https://edk2.groups.io/g/devel/message/116530 Mute This Topic: https://groups.io/mt/104810690/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-