From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=156.151.31.85; helo=userp2120.oracle.com; envelope-from=nikita.leshchenko@oracle.com; receiver=edk2-devel@lists.01.org Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F01CE2112FABA for ; Thu, 13 Sep 2018 05:28:01 -0700 (PDT) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8DCOQWE106110; Thu, 13 Sep 2018 12:28:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=S3rHHWGMK+98sdv3Ab8zi1anS22KE1XM9DOzWS0unj8=; b=0jBmY8CH0AKWSsHVlMq4HITDRSjw3Jk/MiXPFgIdlGeEWlaJD//UwNOcoh1eG9oYyPRl akkR+HSQiQxwo2JeQtGBFl8bukfD9IpbWqK41q6bwyzCBGXCpzJWPUZ/YBDbHXe2u2EX ae5YqUMHR+Nd78uw5AGnlJ4DvOUbhpqMDxylZ3hwdyl3ERTlaUEaiP470/HJjOjCDBTS uTRXDRpXMQowHnY2VnlrIrs25m1wyYUgSjPIkZlQCwSoBUpEtXIbIGYvY0/NInwWPpud 1WzmJ82KX7MF41Btc+AtVeV8rUm6hVA1dU3BiVyE0YlObRUGiz2TJnQU3Ng1QNTZ9VS1 Gw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2mc72r12e3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 12:28:00 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8DCRxF0025411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 12:27:59 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8DCRwxN015491; Thu, 13 Sep 2018 12:27:58 GMT Received: from [10.30.3.10] (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Sep 2018 05:27:58 -0700 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) From: Nikita Leshenko In-Reply-To: Date: Thu, 13 Sep 2018 14:27:54 +0200 Cc: Liran Alon , edk2-devel@lists.01.org, ard.biesheuvel@linaro.org Message-Id: References: <2fdb6059-86a4-a8d5-a46c-286c62e17864@redhat.com> <8A63AC46-22FF-480A-A109-9902B7076464@oracle.com> To: Laszlo Ersek X-Mailer: Apple Mail (2.3445.9.1) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9014 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809130128 Subject: Re: PciBusDxe: PCI-Express bug with dynamic PcdPciExpressBaseAddress X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 12:28:02 -0000 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > On 11 Sep 2018, at 15:34, Laszlo Ersek wrote: > > "BasePciExpressLib" has the prefix "Base", meaning that it is supposed > to be usable in all types of firmware modules, even in SEC and PEIMs -- > which may not have access to writeable memory except stack (i.e. > writeable global variables). Therefore modifying the original lib > instance so that it depend on writeable globals wouldn't have been right. > > We could have attempted to add the new library instance under MdePkg, > and not ArmVirtPkg, but that's just a (more difficult) special case of > point (1). > > (Obviously if you try to apply the nomenclature I describe above to > "BaseCachingPciExpressLib" as well, you'll see that it doesn't match. > And that's because, when I invented the name for that lib instance, in > 2015, I didn't know about the naming rules myself. :) In reality the lib > instance should be called "DxePciExpressLibCaching" -- with "Dxe" for > prefix, and "Caching" for suffix.) Thanks for the detailed explanation. I guess we have no choice but to copy BaseCachingPciExpressLib (renamed to DxePciExpressLibCaching) from ArmVirt to OVMF as well. In order to prevent such bugs in the future, what do you think about changing the PCD reference in BasePciExpressLib.inf (in MdePkg) from [Pcd] to [FixedPcd]? This way a module that has a dynamic PcdPciExpressBaseAddress will fail to link with the default PCIE library. Is it practical to get such change into MdePkg despite their strict change policy? Nikita > > Thanks > Laszlo >