From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Fri, 03 May 2019 17:07:28 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3E67307D911; Sat, 4 May 2019 00:07:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-107.rdu2.redhat.com [10.10.121.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38B855DA35; Sat, 4 May 2019 00:07:25 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Gerd Hoffmann , Jordan Justen Subject: [PATCH 2/4] OvmfPkg/PlatformPei: hoist PciBase assignment above the i440fx/q35 branching Date: Sat, 4 May 2019 02:07:13 +0200 Message-Id: <20190504000716.7525-3-lersek@redhat.com> In-Reply-To: <20190504000716.7525-1-lersek@redhat.com> References: <20190504000716.7525-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 04 May 2019 00:07:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable In the MemMapInitialization() function, we currently assign PciBase different values, on both branches of the board type check. Hoist the PciBase assignment from the i440fx branch in front of the "if". This is a no-op for the i440fx branch. On the q35 branch, we overwrite this value, hence the change is a no-op on q35 as well. This is another refactoring for simplifying the rest of this series. Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jordan Justen Ref: https://bugzilla.redhat.com/show_bug.cgi?id=3D1666941 Ref: https://bugzilla.redhat.com/show_bug.cgi?id=3D1701710 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/PlatformPei/Platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platfor= m.c index 5e0a15484230..9c013613a1a0 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -181,6 +181,7 @@ MemMapInitialization ( =20 TopOfLowRam =3D GetSystemMemorySizeBelow4gb (); PciExBarBase =3D 0; + PciBase =3D (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { // // The MMCONFIG area is expected to fall between the top of low RA= M and @@ -192,7 +193,6 @@ MemMapInitialization ( PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); PciSize =3D 0xFC000000 - PciBase; } else { - PciBase =3D (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; PciSize =3D 0xFC000000 - PciBase; } =20 --=20 2.19.1.3.g30247aa5d201