From nobody Thu Dec 18 22:21:56 2025 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+104970+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+104970+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684319097; cv=none; d=zohomail.com; s=zohoarc; b=THGtc2+oEZsDuRYT992Vg7cbhS1RN03W0yrni4buBImiveL7bdqctGVyk8ox4zON7oTI56PD9lt4yi8Me1DWLuPjTnWZVAk/v09+stQ/MLmi9labLarLBvqcZP6rKI8bFPeNiz3IrVgWX3khufOR2BPAyBGoVi2FkmD10rWu3pw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684319097; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=uEQJshnLESkNrhJTX497cRc4lDcZk2QfvHxWrQAvx7s=; b=fYflIhsp8fXGYBm9teLQnrcLNZ8F0XezIq07pqDX6t570CR0cOO2n66jqd3zQrUuJ+IbMHCwWbM6oWE5luYHcm8qycOMl9eo+QwwdXwN8vwe213MXH9wQ7Cwv/xdNccFJ8yIQTQvbnRWV+KytVxYjmIlfsQ9QZHfFGo+uZTlCE0= 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+104970+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 1684319097186652.8176127478871; Wed, 17 May 2023 03:24:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sD2fYY1788612xy1hzbL4TzM; Wed, 17 May 2023 03:24:56 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.45974.1684319096118959788 for ; Wed, 17 May 2023 03:24:56 -0700 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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-492-ZVSsi_05N5akV3Nghw0u8A-1; Wed, 17 May 2023 06:24:50 -0400 X-MC-Unique: ZVSsi_05N5akV3Nghw0u8A-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8EDF8101A54F; Wed, 17 May 2023 10:24:50 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.130]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59FB42026D16; Wed, 17 May 2023 10:24:50 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 15DC818023A3; Wed, 17 May 2023 12:24:49 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jordan Justen , Oliver Steffen , Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Jiewen Yao Subject: [edk2-devel] [PATCH 1/3] OvmfPkg/PlatformInitLib: check PcdUse1GPageTable Date: Wed, 17 May 2023 12:24:47 +0200 Message-Id: <20230517102449.1334621-2-kraxel@redhat.com> In-Reply-To: <20230517102449.1334621-1-kraxel@redhat.com> References: <20230517102449.1334621-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: fvEVSykAHdlEkDu1uZBH2ZMSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684319096; bh=A388zyM7LFNea29d3xznMr+Pdix+uxnfCAa1pNl+xEc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Ml7jLdRG2O66IHtiyiRgdpOuag6+XitJF7V0SXJfU9owf+CpQqLiLBFOiyuDLNjRW8f p5JCAdDfHldlgl91Qv+aLf8yYw8dz/Cq05Zmxz4tfT8F48fSZ0Y4jguyiVXbXi7CYmjfo sRjuaJJfh97ZC65GWc4e0m30Z4siklgISzY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684319098958100011 Content-Type: text/plain; charset="utf-8"; x-default="true" If PcdUse1GPageTable is not enabled restrict the physical address space used to 1TB, to limit the amount of memory needed for identity mapping page tables. The same already happens in case the processor has no support for gigabyte pages. Signed-off-by: Gerd Hoffmann --- OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 + OvmfPkg/Library/PlatformInitLib/MemDetect.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/= Library/PlatformInitLib/PlatformInitLib.inf index 86a82ad3e084..5a79d95b689c 100644 --- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf +++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf @@ -58,6 +58,7 @@ [LibraryClasses.X64] =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress + gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable =20 [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/MemDetect.c index acf90b4e93fd..1102b00ecbf0 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -663,6 +663,11 @@ PlatformAddressWidthFromCpuid ( PhysBits =3D 40; } =20 + if (!FixedPcdGetBool (PcdUse1GPageTable) && (PhysBits > 40)) { + DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 40 (PcdUse1GPageTable is = false)\n", __func__)); + PhysBits =3D 40; + } + PlatformInfoHob->PhysMemAddressWidth =3D PhysBits; PlatformInfoHob->FirstNonAddress =3D LShiftU64 (1, PlatformInfoHob= ->PhysMemAddressWidth); } --=20 2.40.1 -=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 (#104970): https://edk2.groups.io/g/devel/message/104970 Mute This Topic: https://groups.io/mt/98944978/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-