From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B6C431A1E30 for ; Tue, 11 Oct 2016 10:03:49 -0700 (PDT) Received: by mail-it0-x236.google.com with SMTP id l13so110919769itl.1 for ; Tue, 11 Oct 2016 10:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yxlkbR4D8HOuLki1WmZ5efBhuHGK/bOQeHsSoMM2S4c=; b=QFpSX+YT4CCWFK9dG2XzuLC4+koqjF0Sf3R4+QRFmRuPfR8xgkVvMwkmMWFFgP5aKn kHa/GB7mc96WZfQfHPTCeSLHDREmr+MphlMmdDB7AQ9xZk+zNXOpG+WCrMi90oj1BOV8 +vn8r5aCKjjd8Z0H581bENZbSh1e46rxEb54g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yxlkbR4D8HOuLki1WmZ5efBhuHGK/bOQeHsSoMM2S4c=; b=e1TiCOQjDy3aieXLfZK/9unKUEJTpIyfx8OqU28pHuLpKa5Ku2R3Q0qUrmDGhESEM6 O1etjbznsRl+3UY2hpGT2NnjP15Qr5bzfV6vfNIhsPMZS9HPzY/ZJkix3cDyLQMknzGX oCqIuL3BakpL0DRZet/sgNVfv9x9xnNB9vLZ6D4qsJ85SOFjEYrSmV+kYqSlvDFkSdtc EB7TOQNiBEjXaK7fgxytQkHQyQngbcwX9sPDOXPTYx5YwQv6yTT3nlZvKDHt3eKFzRSW yzJuCG20NK2G58NlQbGZo3GFwPCXcX6ynIB1PIb86tgAdfss/XrS53MdGRcu1K+rY1K5 Efrg== X-Gm-Message-State: AA6/9Rms/2XlolD48TEMFA6odDRCMlzKYnbLytFrMLh6ZEiwZEcsl95Jv+P9NRrDpUgMMebOhxc6Aw8azeLDjsSb X-Received: by 10.36.111.209 with SMTP id x200mr18500908itb.59.1476205428927; Tue, 11 Oct 2016 10:03:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Tue, 11 Oct 2016 10:03:48 -0700 (PDT) In-Reply-To: References: <20161011050113.197540-1-ruiyu.ni@intel.com> From: Ard Biesheuvel Date: Tue, 11 Oct 2016 18:03:48 +0100 Message-ID: To: Laszlo Ersek Cc: Ruiyu Ni , "edk2-devel@lists.01.org" Subject: Re: [PATCH] MdeModulePkg/MdeModulePkg.dec: Fix EBC build failure of PciBus driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 17:03:50 -0000 Content-Type: text/plain; charset=UTF-8 On 11 October 2016 at 11:52, Laszlo Ersek wrote: > On 10/11/16 07:01, Ruiyu Ni wrote: >> When PciBus is built as EBC, PcdPciDegradeResourceForOptionRom does >> not have associated value resulting build failure. >> The patch sets the default value to TRUE, covering the EBC ARCH. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ruiyu Ni >> Cc: Ard Biesheuvel >> --- >> MdeModulePkg/MdeModulePkg.dec | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec >> index f870b83..42fef75 100644 >> --- a/MdeModulePkg/MdeModulePkg.dec >> +++ b/MdeModulePkg/MdeModulePkg.dec >> @@ -746,7 +746,6 @@ [PcdsFeatureFlag] >> # @Prompt Turn on PS2 Mouse Extended Verification >> gEfiMdeModulePkgTokenSpaceGuid.PcdPs2MouseExtendedVerification|TRUE|BOOLEAN|0x00010075 >> >> -[PcdsFeatureFlag.X64] >> ## Indicates whether 64-bit PCI MMIO BARs should degrade to 32-bit in the presence of an option ROM >> # On X64 platforms, Option ROMs may contain code that executes in the context of a legacy BIOS (CSM), >> # which requires that all PCI MMIO BARs are located below 4 GB >> > > Hmmmm, I wonder if this is the right thing to do. As far as I understand > the original patch (commit 065ae7d717f9e), it added > PcdPciDegradeResourceForOptionRom twice to the DEC file expressly for > the purpose of providing different defaults (per arch), without having > to update the DSC files of existing platforms. > > The original patch didn't name EBC in either of the sections -- which is > why the EBC compilation would fail --, but I don't think that including > EBC in either section (manually or implicitly, as illustrated by the > patch) would be correct. > > Namely, EBC is an instruction set that is independent of the platform > that executes it. The suggested patch is correct if the EBC build of > PciBusDxe is expected to run on x64 platforms, but it is incorrect if > the exact same binary is expected to run on aarch64 platforms. > > Meaning that for EBC, *both* default values (TRUE and FALSE) are > incorrect on some platforms. > This may be true, but do we care? Building this driver as EBC is a validation exercise more than anything else, and so how an EBC PciBusDxe module should behave on a 64-bit architecture in the presence of an option ROM is strictly hypothetical. (Note that EBC is primarily intended for the use in option ROMS, and given that we need this driver to dispatch option ROMs in the first place, I would expect platforms that require this driver to ship with a native build of it.) > With that in mind, I propose that we declare > PcdPciDegradeResourceForOptionRom only once in MdeModulePkg.dec, > regardless of architecture -- that is, in the plain [PcdsFeatureFlag] > section --, and require all platforms that include PciBusDxe to set the > feature flag in their DSCs if they disagree with the (now centralized) > default. > > In practical terms, this would turn this patch into a series of patches, > first adding the DSC changes -- for platforms that are in-tree --, and > then unifying the declaration. > > I expect this will create some churn for out-of-tree modules, but that > seems justified -- considering EBC, the PCD would have to be customized > in some platform DSCs *anyway*, regardless of what default we picked for > EBC. > > The following DSC files include PciBusDxe.inf: > > ArmVirtPkg/ArmVirtQemu.dsc > ArmVirtPkg/ArmVirtQemuKernel.dsc > CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc > CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc > EmulatorPkg/EmulatorPkg.dsc > MdeModulePkg/MdeModulePkg.dsc > Nt32Pkg/Nt32Pkg.dsc > OvmfPkg/OvmfPkgIa32.dsc > OvmfPkg/OvmfPkgIa32X64.dsc > OvmfPkg/OvmfPkgX64.dsc > QuarkPlatformPkg/Quark.dsc > QuarkPlatformPkg/QuarkMin.dsc > Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc > Vlv2TbltDevicePkg/PlatformPkgIA32.dsc > Vlv2TbltDevicePkg/PlatformPkgX64.dsc > This would be the strictly correct way, but given the above, I don't really see the point. Thanks, Ard.