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 036637803CD for ; Mon, 29 Jan 2024 20:15:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZeSdOo3ngxyqT1gqMpniFBJ6p8dgE9LDIqVGbJtw0io=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706559328; v=1; b=nbDPp+k14Ua8h+QmMPJYp+9Bd6d2K4rD1Gq44sKrwcugzrzfqf2wHBHCrR7n3/g/NI/EycDY OOqg8eV29wLfSS/kocFSzx30imREjIP/ELj0AaL82H/eRRhYVJScXSimsAI/rlBmuEUO4ejAzW/ bPwQpBCjUcgjDb174+af3mMM= X-Received: by 127.0.0.2 with SMTP id ALlOYY7687511xlMuYYFKfIY; Mon, 29 Jan 2024 12:15:28 -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.web11.1025.1706559327940792002 for ; Mon, 29 Jan 2024 12:15:28 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-gJ7nO3mhP9qrhuN5np6mHg-1; Mon, 29 Jan 2024 15:15:23 -0500 X-MC-Unique: gJ7nO3mhP9qrhuN5np6mHg-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 4F085862DC3; Mon, 29 Jan 2024 20:15:23 +0000 (UTC) X-Received: from [10.39.192.97] (unknown [10.39.192.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5F3D107BD; Mon, 29 Jan 2024 20:15:21 +0000 (UTC) Message-ID: <111056fb-1651-0023-34c8-b51bd913d14c@redhat.com> Date: Mon, 29 Jan 2024 21:15:20 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 1/3] MdeModulePkg: fix PcdUse5LevelPageTable assert To: devel@edk2.groups.io, kraxel@redhat.com Cc: Oliver Steffen , Ard Biesheuvel , Michael Roth , Min Xu , Tom Lendacky , Erdem Aktas , Jiewen Yao , Liming Gao References: <20240129120201.344234-1-kraxel@redhat.com> <20240129120201.344234-2-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240129120201.344234-2-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QsBXkZU1jJmdWKTr4j4uODYmx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=nbDPp+k1; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/29/24 13:01, Gerd Hoffmann wrote: > PcdUse5LevelPageTable documentation says: >=20 > Indicates if 5-Level Paging will be enabled in long mode. 5-Level > Paging will not be enabled when the PCD is TRUE but CPU doesn't support > 5-Level Paging. >=20 > So running in 4-level paging mode with PcdUse5LevelPageTable=3DTRUE is > possible. The only invalid combination is 5-level paging being active > with PcdUse5LevelPageTable=3DFALSE. >=20 > Fix the ASSERT accordingly. >=20 > Signed-off-by: Gerd Hoffmann > --- > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModule= Pkg/Core/DxeIplPeim/X64/VirtualMemory.c > index 980c2002d4f5..1d240e95966e 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > @@ -745,7 +745,9 @@ CreateIdentityMappingPageTables ( > // > Cr4.UintN =3D AsmReadCr4 (); > Page5LevelSupport =3D (Cr4.Bits.LA57 !=3D 0); > - ASSERT (PcdGetBool (PcdUse5LevelPageTable) =3D=3D Page5LevelSupport)= ; > + if (Page5LevelSupport) { > + ASSERT (PcdGetBool (PcdUse5LevelPageTable)); > + } > } else { > // > // If cpu runs in 32bit protected mode PEI, Page table Level in DXE = is decided by PCD and feature capability. FWIW, my observation at [1] was not that the PCD was incorrectly named -- I= noted that the *local variable* "Page5LevelSupport" was a misnomer. [1] http://mid.mail-archive.com/640e533e-5252-32da-c155-a25e3065eb78@redhat= .com https://edk2.groups.io/g/devel/message/114318 I proposed "Page5LevelEnabled" instead. But, it's not a show-stopper in any case. (I was a bit surprised to see the= PCD rename in v2, but that would also have been an improvement.) Reviewed-by: Laszlo Ersek -=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 (#114743): https://edk2.groups.io/g/devel/message/114743 Mute This Topic: https://groups.io/mt/104029635/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-