From mboxrd@z Thu Jan 1 00:00:00 1970 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.web11.51060.1673516079657486476 for ; Thu, 12 Jan 2023 01:34:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U6FDW8tJ; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673516078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b3zj8JS0Y6ZCPwYWqHe3ChS+ovCrHKoW+IyTc9XeSwg=; b=U6FDW8tJQ6dQ0qRYWhNeHL4umSRlizWJrrL7Z144kDLUJ21zQsk+GWDWECqsnAq4oozrxn r6Q9K1w4Q2DEC1cOjixQJ6ENRL5rGeIh+uJkaGJHxNv/44X9jMYx6FZU3bUYAEpDT4anNC 9DzzAIXCKbMZ3VZEMjHP+OxlRUJs51c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-158-rKb4lcgXMwemqasIoZNyFw-1; Thu, 12 Jan 2023 04:34:32 -0500 X-MC-Unique: rKb4lcgXMwemqasIoZNyFw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3EFA2817232; Thu, 12 Jan 2023 09:34:31 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.238]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7376540C2064; Thu, 12 Jan 2023 09:34:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 94FAF18009B7; Thu, 12 Jan 2023 10:34:25 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , =?UTF-8?q?L=C3=A1szl=C3=B3=20=C3=89rsek?= , Ard Biesheuvel , Jordan Justen , Pawel Polawski , Jiewen Yao , Gerd Hoffmann Subject: [PATCH v3 6/8] OvmfPkg/PlatformInitLib: update address space layout comment Date: Thu, 12 Jan 2023 10:34:23 +0100 Message-Id: <20230112093425.1228300-7-kraxel@redhat.com> In-Reply-To: <20230112093425.1228300-1-kraxel@redhat.com> References: <20230112093425.1228300-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; 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 --- OvmfPkg/Library/PlatformInitLib/Platform.c | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/PlatformInitLib/Platform.c index 9ab0342fd8c0..ea3e969ca061 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -149,26 +149,12 @@ PlatformMemMapInitialization ( return; } - PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob); - PciExBarBase = 0; - if (PlatformInfoHob->HostBridgeDevId == 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 = PcdGet64 (PcdPciExpressBaseAddress); - ASSERT (PlatformInfoHob->LowMemory <= PciExBarBase); - ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB); - PciBase = (UINT32)(PciExBarBase + SIZE_256MB); - } else { - ASSERT (PlatformInfoHob->LowMemory <= PlatformInfoHob->Uc32Base); - PciBase = 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 @@ -178,6 +164,22 @@ PlatformMemMapInitialization ( // 0xFED20000 gap 896 KB // 0xFEE00000 LAPIC 1 MB // + PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob); + PciExBarBase = 0; + if (PlatformInfoHob->HostBridgeDevId == 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 = PcdGet64 (PcdPciExpressBaseAddress); + ASSERT (PlatformInfoHob->LowMemory <= PciExBarBase); + ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB); + PciBase = (UINT32)(PciExBarBase + SIZE_256MB); + } else { + ASSERT (PlatformInfoHob->LowMemory <= PlatformInfoHob->Uc32Base); + PciBase = PlatformInfoHob->Uc32Base; + } + PciSize = 0xFC000000 - PciBase; PlatformAddIoMemoryBaseSizeHob (PciBase, PciSize); -- 2.39.0