From nobody Mon Sep 16 19:15:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+114375+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114375+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1706170866; cv=none; d=zohomail.com; s=zohoarc; b=e4unxWTpmPPokMU52ey3sO9hwEFuSXi/c6s6k54w2HK8hRmobsgghuEn67OvYD1patsHRHkUH2emK3lDL/iEwbdoyG31LH+VAw6zPl5/kX3a7hxGB49uNG6X7CSFgLDsKAQl1eagAGCUtNYrxhMofHte196UWCysq5rNC9E567M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706170866; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=rVRaBFPv2JIarnA0CG6kLrLwtcNr8ZWM9zPwM4dfYsE=; b=mz0gwTIt1cBoX2z9adliOk5K/RY4yTEFDt8O8u+9Ba/sPzLbGIu4PNctt5b5cSrVDrUjfmi1z1ze66gYwvxdb8BCfM95ciViJ42XPuBSu/0T2041EaBINDB11/nswTnFmnVLM6OO3LlwLsCR6jAgGgUvqr3Q6yD019wryYdjAZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114375+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1706170866129109.65010608285627; Thu, 25 Jan 2024 00:21:06 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=mhquKtooTOGUgmAv1Id0hdj25D2On1acKJc+CwnhUXA=; 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=1706170865; v=1; b=jeIevXVXGxABkCTh1Zld91ssOQ0VQ3BWNOJ1/Nwm+99VoBMH71nOVC7688jLWpl5l2LPg8CL mzjDGzJcgtAuUDfK3oW7QgOVPZXK8kt1TLmHb1/clNu4SHTmYUUtH3bHKA5gXqoqr20JpbxvqWW cklxZHve2ogtCKrPk3Z6nrVM= X-Received: by 127.0.0.2 with SMTP id GsPpYY1788612xmnBWUkA3VZ; Thu, 25 Jan 2024 00:21:05 -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.12514.1706170864970255999 for ; Thu, 25 Jan 2024 00:21:05 -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-581-EY4_v0aIMDSyADMHWxlV8A-1; Thu, 25 Jan 2024 03:21:00 -0500 X-MC-Unique: EY4_v0aIMDSyADMHWxlV8A-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 8DD80106D064; Thu, 25 Jan 2024 08:21:00 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EE6BC15E61; Thu, 25 Jan 2024 08:21:00 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EBDB31801A90; Thu, 25 Jan 2024 09:20:57 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Liming Gao , =?UTF-8?q?L=C3=A1szl=C3=B3=20=C3=89rsek?= , Oliver Steffen , Gerd Hoffmann Subject: [edk2-devel] [PATCH v2 2/2] MdeModulePkg/VirtualMemory: fix 5-level paging assert Date: Thu, 25 Jan 2024 09:20:57 +0100 Message-ID: <20240125082057.309133-3-kraxel@redhat.com> In-Reply-To: <20240125082057.309133-1-kraxel@redhat.com> References: <20240125082057.309133-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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: X6tTS9F41StJeiseKVeMt4wnx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1706170867368100010 Content-Type: text/plain; charset="utf-8"; x-default="true" The ResetVector decides at runtime (depending on CPU capabilities) whenever it uses 5-level paging or not. Firmware builds with 5-level paging enabled (PcdEnable5LevelPageTable=3DTRUE) may run run in 4-level paging mode. The code handles that just fine, by looking at the la57 bit in cr4 instead of checking PcdEnable5LevelPageTable. So the ASSERT is too strict. Change it to ensure the build was configured with PcdEnable5LevelPageTable=3DTRUE when running in 5-level paging mode. Signed-off-by: Gerd Hoffmann --- MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePk= g/Core/DxeIplPeim/X64/VirtualMemory.c index 46528e4f719d..9e194ef8cc55 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 (PcdEnable5LevelPageTable) =3D=3D Page5LevelSupport= ); + if (Page5LevelSupport) { + ASSERT (PcdGetBool (PcdEnable5LevelPageTable)); + } } else { // // If cpu runs in 32bit protected mode PEI, Page table Level in DXE is= decided by PCD and feature capability. --=20 2.43.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 (#114375): https://edk2.groups.io/g/devel/message/114375 Mute This Topic: https://groups.io/mt/103950406/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-