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 4E923D81111 for ; Tue, 30 Jan 2024 12:32:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+xdGTCXOTNZuk1Xl3kLdDOhV1njYSIGyBrABp/NrKew=; c=relaxed/simple; d=groups.io; h=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=1706617939; v=1; b=aWt+zjs+XKZ8serZB1XWX9jBwshsQbuBBfQoui/C5xT6R9dHnVlcIBdKU4HFXd9BtX1R3wzJ 4RUXTNqiWQzcYcFYDDX3oet/9sGoEp++QoPUA+wXPO4EsbsxBCyvg0+x0AwxJA+PP1iohTrMvoI 5TopNftV4WfTYqrG5rGfpFZA= X-Received: by 127.0.0.2 with SMTP id RFNCYY7687511xeTBZ08gcKO; Tue, 30 Jan 2024 04:32:19 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.17191.1706617938295679860 for ; Tue, 30 Jan 2024 04:32:18 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-CbJSPaKnP3-A8V_Kvnb0OQ-1; Tue, 30 Jan 2024 07:32:11 -0500 X-MC-Unique: CbJSPaKnP3-A8V_Kvnb0OQ-1 X-Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C6EE28C9773; Tue, 30 Jan 2024 12:32:10 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECCF5492BC7; Tue, 30 Jan 2024 12:32:09 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8C3CB1800D5B; Tue, 30 Jan 2024 13:32:04 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Erdem Aktas , Oliver Steffen , Jiewen Yao , Ard Biesheuvel , Min Xu , Tom Lendacky , Gerd Hoffmann , Michael Roth , Liming Gao , Laszlo Ersek Subject: [edk2-devel] [PATCH v2 2/5] MdeModulePkg/DxeIplPeim: rename variable Date: Tue, 30 Jan 2024 13:32:01 +0100 Message-ID: <20240130123204.764453-3-kraxel@redhat.com> In-Reply-To: <20240130123204.764453-1-kraxel@redhat.com> References: <20240130123204.764453-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: T5qqUkoPqzHoClVbXIrewfN2x7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=aWt+zjs+; 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=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) Rename Page5LevelSupported to Page5LevelEnabled. The variable is set to true in case 5-paging level is enabled (64-bit PEI) or will be enabled (32-bit PEI), it does *not* tell whenever the 5-level paging is supported by the CPU. Signed-off-by: Gerd Hoffmann --- .../Core/DxeIplPeim/X64/VirtualMemory.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c index 1d240e95966e..df6196a41cd5 100644 --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c @@ -696,7 +696,7 @@ CreateIdentityMappingPageTables ( UINTN TotalPagesNum; UINTN BigPageAddress; VOID *Hob; - BOOLEAN Page5LevelSupport; + BOOLEAN Page5LevelEnabled; BOOLEAN Page1GSupport; PAGE_TABLE_1G_ENTRY *PageDirectory1GEntry; UINT64 AddressEncMask; @@ -744,15 +744,15 @@ CreateIdentityMappingPageTables ( // If cpu has already run in 64bit long mode PEI, Page table Level in DXE must align with previous level. // Cr4.UintN = AsmReadCr4 (); - Page5LevelSupport = (Cr4.Bits.LA57 != 0); - if (Page5LevelSupport) { + Page5LevelEnabled = (Cr4.Bits.LA57 != 0); + if (Page5LevelEnabled) { ASSERT (PcdGetBool (PcdUse5LevelPageTable)); } } else { // // If cpu runs in 32bit protected mode PEI, Page table Level in DXE is decided by PCD and feature capability. // - Page5LevelSupport = FALSE; + Page5LevelEnabled = FALSE; if (PcdGetBool (PcdUse5LevelPageTable)) { AsmCpuidEx ( CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS, @@ -763,12 +763,12 @@ CreateIdentityMappingPageTables ( NULL ); if (EcxFlags.Bits.FiveLevelPage != 0) { - Page5LevelSupport = TRUE; + Page5LevelEnabled = TRUE; } } } - DEBUG ((DEBUG_INFO, "AddressBits=%u 5LevelPaging=%u 1GPage=%u\n", PhysicalAddressBits, Page5LevelSupport, Page1GSupport)); + DEBUG ((DEBUG_INFO, "AddressBits=%u 5LevelPaging=%u 1GPage=%u\n", PhysicalAddressBits, Page5LevelEnabled, Page1GSupport)); // // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses @@ -776,7 +776,7 @@ CreateIdentityMappingPageTables ( // due to either unsupported by HW, or disabled by PCD. // ASSERT (PhysicalAddressBits <= 52); - if (!Page5LevelSupport && (PhysicalAddressBits > 48)) { + if (!Page5LevelEnabled && (PhysicalAddressBits > 48)) { PhysicalAddressBits = 48; } @@ -811,7 +811,7 @@ CreateIdentityMappingPageTables ( // // Substract the one page occupied by PML5 entries if 5-Level Paging is disabled. // - if (!Page5LevelSupport) { + if (!Page5LevelEnabled) { TotalPagesNum--; } @@ -831,7 +831,7 @@ CreateIdentityMappingPageTables ( // By architecture only one PageMapLevel4 exists - so lets allocate storage for it. // PageMap = (VOID *)BigPageAddress; - if (Page5LevelSupport) { + if (Page5LevelEnabled) { // // By architecture only one PageMapLevel5 exists - so lets allocate storage for it. // @@ -853,7 +853,7 @@ CreateIdentityMappingPageTables ( PageMapLevel4Entry = (VOID *)BigPageAddress; BigPageAddress += SIZE_4KB; - if (Page5LevelSupport) { + if (Page5LevelEnabled) { // // Make a PML5 Entry // @@ -947,7 +947,7 @@ CreateIdentityMappingPageTables ( ZeroMem (PageMapLevel4Entry, (512 - IndexOfPml4Entries) * sizeof (PAGE_MAP_AND_DIRECTORY_POINTER)); } - if (Page5LevelSupport) { + if (Page5LevelEnabled) { Cr4.UintN = AsmReadCr4 (); Cr4.Bits.LA57 = 1; AsmWriteCr4 (Cr4.UintN); -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114779): https://edk2.groups.io/g/devel/message/114779 Mute This Topic: https://groups.io/mt/104052211/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-