From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.5517.1610528784036289129 for ; Wed, 13 Jan 2021 01:06:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RKxsLg2F; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610528783; 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=L/YQRCDumy2INToKJjV+yvHUQZuHfkuiGWzqbkzPzr0=; b=RKxsLg2FeZoGblFyHtRFrI7oYdhbdY+/JV8SNDOOpZ9ipVKiIX9si8LKqLqHPnzRJJOXsY HlLhUcYK43FEu9gU8k9rHJRCV8g2NDvQbQpUEJ67K08hayWxqmXYE2GUWLxOvOD4HJCZe9 68xHUfYZAArJt2cOFcv0UqncCsu9yyY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-563-V_cmKyjtMOGmvBC9N50TGg-1; Wed, 13 Jan 2021 04:06:16 -0500 X-MC-Unique: V_cmKyjtMOGmvBC9N50TGg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E97A780DDFD; Wed, 13 Jan 2021 09:06:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-238.ams2.redhat.com [10.36.112.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 551F46D01A; Wed, 13 Jan 2021 09:06:11 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 3/9] OvmfPkg/PciHostBridgeLib: Extract InitRootBridge/UninitRootBridge To: Jiahui Cen , devel@edk2.groups.io Cc: Jordan Justen , Ard Biesheuvel , Rebecca Cran , Peter Grehan , Anthony Perard , Julien Grall , Leif Lindholm , Sami Mujawar , xieyingtai@huawei.com, wu.wubin@huawei.com, Yubo Miao References: <20210112094549.10238-1-cenjiahui@huawei.com> <20210112094549.10238-4-cenjiahui@huawei.com> <30a121d3-97b0-d8f3-6089-68ed4ca8465b@redhat.com> From: "Laszlo Ersek" Message-ID: Date: Wed, 13 Jan 2021 10:06:10 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/13/21 07:00, Jiahui Cen wrote: > Hi Laszlo, > > On 2021/1/13 9:28, Laszlo Ersek wrote: >> On 01/12/21 10:45, Jiahui Cen via groups.io wrote: >>> Extract InitRootBridge/UninitRootBridge to PciHostBridgeUtilityLib as >>> common utility functions. No change of functionality. >>> >>> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 >>> >>> Cc: Jordan Justen >>> Cc: Laszlo Ersek >>> Cc: Ard Biesheuvel >>> Cc: Anthony Perard >>> Cc: Julien Grall >>> Signed-off-by: Jiahui Cen >>> Signed-off-by: Yubo Miao >>> --- >>> OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 2 - >>> OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf | 7 + >>> OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h | 75 ++++++++++ >>> OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h | 56 ------- >>> OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 158 +------------------- >>> OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 3 +- >>> OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c | 155 +++++++++++++++++++ >>> 7 files changed, 243 insertions(+), 213 deletions(-) >> >> (1) Renaming OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH to >> PCI_ROOT_BRIDGE_DEVICE_PATH is not only unnecessary, it carries a risk >> of conflicting with something that PciHostBridgeLib in MdeModulePkg >> might introduce in the future. Please undo this rename. >> >> (2) Renaming "mRootBridgeDevicePathTemplate" to "mRootBridgeDevicePath" >> is not necessary. Although this rename is not risky, it makes the review >> (before/after comparison) of this patch more difficult than needed. >> Please undo this rename. The word "template" is correct BTW, because we >> modify the device path after we allocate & copy it from the template -- >> see UID. >> > > Right. I will fix them. > >> (3) Unfortunately, the original PciHostBridgeLib instance fails to list >> its PcdLib dependency, both between the #include directives, and in the >> INF file. I'm not asking you to fix that up, but please do spell out the >> PcdLib #include and INF file depencency in the new >> PciHostBridgeUtilityLib instance. (See the PcdGet16() call in >> PciHostBridgeUtilityInitRootBridge().) >> > > For the original PciHostBridgeLib, should I fix the dependency > in a new patch? Or just in this patch? If you can add a separate patch for that, it's appreciated. It's not required though -- up to you. Thanks Laszlo