From nobody Fri Dec 27 02:26:26 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504108410179987.09562287164; Wed, 30 Aug 2017 08:53:30 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EC59B21E70D27; Wed, 30 Aug 2017 08:53:24 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73C6421E70D22 for ; Wed, 30 Aug 2017 08:53:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E60537EA94; Wed, 30 Aug 2017 15:53:24 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-136.rdu2.redhat.com [10.10.120.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id E923C8F34E; Wed, 30 Aug 2017 15:53:23 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E60537EA94 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 30 Aug 2017 17:53:08 +0200 Message-Id: <20170830155317.30917-3-lersek@redhat.com> In-Reply-To: <20170830155317.30917-1-lersek@redhat.com> References: <20170830155317.30917-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 30 Aug 2017 15:53:25 +0000 (UTC) Subject: [edk2] [PATCH 02/11] OvmfPkg/BaseMemEncryptSevLib: break DEBUG calls to multiple lines X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" None of the DEBUG macro invocations in SetMemoryEncDec() fit on a single line. Break them to multiple lines, for (a) conforming to the coding style spec, (b) easier modification in later patches. Cc: Brijesh Singh Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c | 68 ++++++++++++= ++------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c b/Ovm= fPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c index dbaad7766dbe..83e3d8992173 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.c @@ -286,18 +286,26 @@ SetMemoryEncDec ( PageMapLevel4Entry =3D (VOID*) (Cr3BaseAddress & ~PgTableMask); PageMapLevel4Entry +=3D PML4_OFFSET(PhysicalAddress); if (!PageMapLevel4Entry->Bits.Present) { - DEBUG ((DEBUG_WARN, - "%a:%a ERROR bad PML4 for %lx\n", gEfiCallerBaseName, __FUNCTION__, - PhysicalAddress)); + DEBUG (( + DEBUG_WARN, + "%a:%a ERROR bad PML4 for %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); return RETURN_NO_MAPPING; } =20 PageDirectory1GEntry =3D (VOID*) ((PageMapLevel4Entry->Bits.PageTableB= aseAddress<<12) & ~PgTableMask); PageDirectory1GEntry +=3D PDP_OFFSET(PhysicalAddress); if (!PageDirectory1GEntry->Bits.Present) { - DEBUG ((DEBUG_WARN, - "%a:%a ERROR bad PDPE for %lx\n", gEfiCallerBaseName, - __FUNCTION__, PhysicalAddress)); + DEBUG (( + DEBUG_WARN, + "%a:%a ERROR bad PDPE for %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); return RETURN_NO_MAPPING; } =20 @@ -311,17 +319,25 @@ SetMemoryEncDec ( // if (!(PhysicalAddress & (BIT30 - 1)) && Length >=3D BIT30) { SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode); - DEBUG ((DEBUG_VERBOSE, - "%a:%a Updated 1GB entry for %lx\n", gEfiCallerBaseName, - __FUNCTION__, PhysicalAddress)); + DEBUG (( + DEBUG_VERBOSE, + "%a:%a Updated 1GB entry for %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); PhysicalAddress +=3D BIT30; Length -=3D BIT30; } else { // // We must split the page // - DEBUG ((DEBUG_VERBOSE, - "%a:%a Spliting 1GB page\n", gEfiCallerBaseName, __FUNCTION__)); + DEBUG (( + DEBUG_VERBOSE, + "%a:%a Spliting 1GB page\n", + gEfiCallerBaseName, + __FUNCTION__ + )); Split1GPageTo2M(((UINT64)PageDirectory1GEntry->Bits.PageTableBaseA= ddress)<<30, (UINT64*) PageDirectory1GEntry, 0, 0); continue; } @@ -333,9 +349,13 @@ SetMemoryEncDec ( PageDirectory2MEntry =3D (VOID*) ((PageUpperDirectoryPointerEntry->B= its.PageTableBaseAddress<<12) & ~PgTableMask); PageDirectory2MEntry +=3D PDE_OFFSET(PhysicalAddress); if (!PageDirectory2MEntry->Bits.Present) { - DEBUG ((DEBUG_WARN, - "%a:%a ERROR bad PDE for %lx\n", gEfiCallerBaseName, __FUNCTION_= _, - PhysicalAddress)); + DEBUG (( + DEBUG_WARN, + "%a:%a ERROR bad PDE for %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); return RETURN_NO_MAPPING; } // @@ -354,9 +374,13 @@ SetMemoryEncDec ( // // We must split up this page into 4K pages // - DEBUG ((DEBUG_VERBOSE, - "%a:%a Spliting 2MB page at %lx\n", gEfiCallerBaseName,__FUNCT= ION__, - PhysicalAddress)); + DEBUG (( + DEBUG_VERBOSE, + "%a:%a Spliting 2MB page at %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); Split2MPageTo4K (((UINT64)PageDirectory2MEntry->Bits.PageTableBa= seAddress) << 21, (UINT64*) PageDirectory2MEntry, 0, 0); continue; } @@ -365,9 +389,13 @@ SetMemoryEncDec ( PageTableEntry =3D (VOID*) (PageDirectoryPointerEntry->Bits.PageTa= bleBaseAddress<<12 & ~PgTableMask); PageTableEntry +=3D PTE_OFFSET(PhysicalAddress); if (!PageTableEntry->Bits.Present) { - DEBUG ((DEBUG_WARN, - "%a:%a ERROR bad PTE for %lx\n", gEfiCallerBaseName, - __FUNCTION__, PhysicalAddress)); + DEBUG (( + DEBUG_WARN, + "%a:%a ERROR bad PTE for %lx\n", + gEfiCallerBaseName, + __FUNCTION__, + PhysicalAddress + )); return RETURN_NO_MAPPING; } SetOrClearCBit (&PageTableEntry->Uint64, Mode); --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel