From nobody Tue Feb 10 07:21:31 2026 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+100785+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+100785+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678172102; cv=none; d=zohomail.com; s=zohoarc; b=XG89q0EcL6M/M80OY1jt9rTTxxOYGMjbyD0xUZ22CdD4TtWdtCYSt6atJdpysj30ujiJih3YEjObu6S0hoMQ06KYM+q3lS0d5NbtyXhc8zL73erVhGtHlm9pC1PaWsu1TkTotSBdC4p3Wl4Z5+XatJLIya8XKREXeXCQPPoBfgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678172102; 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=Yp6ihH4wJZrLk12mOZGMLVdiT+SlLzz0ybBEIrH3rbI=; b=eksdtytq7V3DlHhfk40d1BOmiAwHMWgeyGnPVwYB7TzFtjN0cS4rJZENFUr9xtpJd9tGIh2VMdQFpc+PaUo6+GLDfpTsTL38OqkhClHh7tzmunMdOegIKtlxSQ5EQJSxOz/0QjyvPOc/vn2/y2PR59N0+GP2A8Zss1wpGay6Mgg= 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+100785+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 1678172102608394.33672362002415; Mon, 6 Mar 2023 22:55:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7s0fYY1788612xXWUitWrRpJ; Mon, 06 Mar 2023 22:55:02 -0800 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.8961.1678172101119966546 for ; Mon, 06 Mar 2023 22:55:01 -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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-KreJ0fXSPu-NxcnnR6CeXQ-1; Tue, 07 Mar 2023 01:54:57 -0500 X-MC-Unique: KreJ0fXSPu-NxcnnR6CeXQ-1 X-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D74D85A588; Tue, 7 Mar 2023 06:54:56 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D7E340C10FA; Tue, 7 Mar 2023 06:54:56 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E9091180092D; Tue, 7 Mar 2023 07:54:54 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Tom Lendacky , Jiewen Yao , Erdem Aktas , Anthony Perard , Gerd Hoffmann , Jordan Justen , Oliver Steffen , Min Xu , Michael Roth , James Bottomley , Pawel Polawski , Ard Biesheuvel , Julien Grall Subject: [edk2-devel] [PATCH v2 1/3] OvmfPkg/PlatformInitLib: update address space layout comment Date: Tue, 7 Mar 2023 07:54:52 +0100 Message-Id: <20230307065454.1434251-2-kraxel@redhat.com> In-Reply-To: <20230307065454.1434251-1-kraxel@redhat.com> References: <20230307065454.1434251-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: mAHS0IK9nlAvdKjhYtSNmf6Mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678172102; bh=6vGsY3ZuYCKHsNcb+q0uNYBOB2zOixV7Udfv4iv1fFc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=uZRhq4zN0vy/ErYX/K/pKOo1eOd+oGvtFoTDDJGjQiiI6z4YZoSjxrP1/c8CVWhlS82 If7WSf6BU89e48c9FM7KZF2FCmLfOjOk8VudYvV5/zJy8vV/+PtHwaEZtBlQnihd7A/DU ttOMEtIa3QwkY/bG30CcEMsBiX2wemWU8+4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678172104437100010 Content-Type: text/plain; charset="utf-8"; x-default="true" Move the commment up so it is placed just before the address space calculations start. Also add q35 memory layout. Signed-off-by: Gerd Hoffmann Reviewed-by: Anthony PERARD --- OvmfPkg/Library/PlatformInitLib/Platform.c | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/P= latformInitLib/Platform.c index 9fee6e481038..678e8e329023 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -152,26 +152,12 @@ PlatformMemMapInitialization ( return; } =20 - PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob); - PciExBarBase =3D 0; - if (PlatformInfoHob->HostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { - // - // The MMCONFIG area is expected to fall between the top of low RAM and - // the base of the 32-bit PCI host aperture. - // - PciExBarBase =3D PcdGet64 (PcdPciExpressBaseAddress); - ASSERT (PlatformInfoHob->LowMemory <=3D PciExBarBase); - ASSERT (PciExBarBase <=3D MAX_UINT32 - SIZE_256MB); - PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); - } else { - ASSERT (PlatformInfoHob->LowMemory <=3D PlatformInfoHob->Uc32Base); - PciBase =3D PlatformInfoHob->Uc32Base; - } - // // address purpose size // ------------ -------- ------------------------- - // max(top, 2g) PCI MMIO 0xFC000000 - max(top, 2g) + // max(top, 2g) PCI MMIO 0xFC000000 - max(top, 2g) (pc) + // 0xB0000000 MMCONFIG 256 MB (q35) + // 0xC0000000 PCI MMIO 960 MB (q35) // 0xFC000000 gap 44 MB // 0xFEC00000 IO-APIC 4 KB // 0xFEC01000 gap 1020 KB @@ -181,6 +167,22 @@ PlatformMemMapInitialization ( // 0xFED20000 gap 896 KB // 0xFEE00000 LAPIC 1 MB // + PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob); + PciExBarBase =3D 0; + if (PlatformInfoHob->HostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { + // + // The MMCONFIG area is expected to fall between the top of low RAM and + // the base of the 32-bit PCI host aperture. + // + PciExBarBase =3D PcdGet64 (PcdPciExpressBaseAddress); + ASSERT (PlatformInfoHob->LowMemory <=3D PciExBarBase); + ASSERT (PciExBarBase <=3D MAX_UINT32 - SIZE_256MB); + PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); + } else { + ASSERT (PlatformInfoHob->LowMemory <=3D PlatformInfoHob->Uc32Base); + PciBase =3D PlatformInfoHob->Uc32Base; + } + PciSize =3D 0xFC000000 - PciBase; PlatformAddIoMemoryBaseSizeHob (PciBase, PciSize); =20 --=20 2.39.2 -=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 (#100785): https://edk2.groups.io/g/devel/message/100785 Mute This Topic: https://groups.io/mt/97444649/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-