From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.85.221.66, mailfrom: philmd@redhat.com) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by groups.io with SMTP; Mon, 06 May 2019 04:08:36 -0700 Received: by mail-wr1-f66.google.com with SMTP id r7so16654809wrr.13 for ; Mon, 06 May 2019 04:08:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=02NzQPITbNHbbLhQdGAtnp+N5D+v1t60VLtqDPtMmbo=; b=fQnYsOsxB/88Q28CkB97u9hoE3kS7bNtdf12EoZZfDWAzwOxThPrYEeKHnGRpfeeR9 Lmpl/m+tzzJGIqX+OSchz3YZuf+IFdLZIdZkXSYKefySBZlHBwvfGEqblWctd6K8Dstb Fusn7z2qlElTzduQgBwFklkdKzvSsbKSlWo2VYyfcz7q1FFIxPXlhTu6+6Jv43Rf+cpY RXvgNNctxMPcw+kc7CErjE5nk0iWoPwl5ROArLNhou5DLF9shWiqdRPwTnuTYgYbMBcc V649JDtHOwg4EXSPNl5t+D976/UJ1gIUGgcu6S93g/2ZNEsNA7jwyEueX2MuDwEaa9e3 TMug== X-Gm-Message-State: APjAAAVxACLh+6fiGqxtEVHJEwOtlTsUD6Ky9Lm5+hkU+9clodW2LS/+ lEoUwhqTjx2qiq9sMqJfmvJTuw== X-Google-Smtp-Source: APXvYqz0ykVHoQJ+YO3UdTTac3f7eiXxOuWopQ8ur4AA4mfgYKQno2nxHNOPhFzftswkIta4yB7OjA== X-Received: by 2002:adf:80c3:: with SMTP id 61mr18183671wrl.123.1557140915152; Mon, 06 May 2019 04:08:35 -0700 (PDT) Return-Path: Received: from [192.168.1.33] (193.red-88-21-103.staticip.rima-tde.net. [88.21.103.193]) by smtp.gmail.com with ESMTPSA id w7sm13490860wmm.16.2019.05.06.04.08.34 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 04:08:34 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH 2/4] OvmfPkg/PlatformPei: hoist PciBase assignment above the i440fx/q35 branching To: devel@edk2.groups.io, lersek@redhat.com Cc: Ard Biesheuvel , Gerd Hoffmann , Jordan Justen References: <20190504000716.7525-1-lersek@redhat.com> <20190504000716.7525-3-lersek@redhat.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: <884b4b27-5dac-6c29-4075-b876b53a9d78@redhat.com> Date: Mon, 6 May 2019 13:08:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190504000716.7525-3-lersek@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 5/4/19 2:07 AM, Laszlo Ersek wrote: > 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=1666941 > Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1701710 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daudé > --- > OvmfPkg/PlatformPei/Platform.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c > index 5e0a15484230..9c013613a1a0 100644 > --- a/OvmfPkg/PlatformPei/Platform.c > +++ b/OvmfPkg/PlatformPei/Platform.c > @@ -181,6 +181,7 @@ MemMapInitialization ( > > TopOfLowRam = GetSystemMemorySizeBelow4gb (); > PciExBarBase = 0; > + PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; > if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) { > // > // The MMCONFIG area is expected to fall between the top of low RAM and > @@ -192,7 +193,6 @@ MemMapInitialization ( > PciBase = (UINT32)(PciExBarBase + SIZE_256MB); > PciSize = 0xFC000000 - PciBase; > } else { > - PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; > PciSize = 0xFC000000 - PciBase; > } > >