[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/8] PCI: replace stray uses of PCI_{DEVFN,BDF}2()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 13 Apr 2022 13:48:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vV4IBIpBa4dX2xqjgatPHaXMPaAyCwe4ek7jEDdMCIk=; b=ci3eX5Rz2fc/wQbLnW20ZBn1rAcCchJBCtE1FDPFtP7ZA0F63XdJhyg0tDfYdUDhOG3lWXjNfBh9MuG+1+C2b1I62Afr3axOQ4sOseEv6QDq3d6YVkcY41XJdrLcMDTRrbly5PjEcfE2ukAxM0yZ9V1m+4A4cBDlqWl830fqcx5TatbfvmbC1iV/sH91K61Nw0PHEp4tdRSOpwhDqykbD221yUVVlL4yXuPZMnsuSBBWYtHHd+E5SatNlUvVF355A05acKrR1BA0F/uIUTEdF71GE8FL9W7ndC4WCI2ERUTjHwu/JUY6Zv9u9TD/tKKU/ziZXHlsezT3McEZJinzLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gM+5onBvvTKLzFwFyVpfDDHRfTNh29jT8VTkhzG4kXvf4Bt54Hc2ddmhHGiktVzZ++SzGqW/Dg9BSocRcXeNVMV8wgBMPpbpSCdjwqccacTAdMUkKciMJqtsuwEKGkK2kRK3eEGtFh50KxNqWg1XLkRpyqxTWu4TMu5dcWerG3uUwdI6dSz+TZwjWRqX55mhwlNniGmhjh0spQNorHLz8U1njkA3kO9rKd26d20mHpuBCxE3haO58SMzGcNuDxLd38CmYXYdIxuxpyD7+qEHgj+9PT2bRvTGDpyibnJIQwdKsBXzMWbmrYjbDajEgajSpC9tOX/Bek33J9lGCRX17Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 13 Apr 2022 13:48:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYTYhA4nLWVzOAC0uoUDkBvluxmqzt3yyA
  • Thread-topic: [PATCH 7/8] PCI: replace stray uses of PCI_{DEVFN,BDF}2()

Hi Jan,

> On 11 Apr 2022, at 10:40, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> There's no good reason to use these when we already have a pci_sbdf_t
> type object available. This extends to the use of PCI_BUS() in
> pci_ecam_map_bus() as well.
> 
> No change to generated code (with gcc11 at least, and I have to admit
> that I didn't expect compilers to necessarily be able to spot the
> optimization potential on the original code).
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Note that the Arm changes are "blind": I haven't been able to spot a way
> to at least compile test the changes there; the code looks to be
> entirely dead.
> 
> --- a/xen/arch/arm/pci/ecam.c
> +++ b/xen/arch/arm/pci/ecam.c
> @@ -28,8 +28,7 @@ void __iomem *pci_ecam_map_bus(struct pc
>         container_of(bridge->ops, const struct pci_ecam_ops, pci_ops);
>     unsigned int devfn_shift = ops->bus_shift - 8;
>     void __iomem *base;
> -
> -    unsigned int busn = PCI_BUS(sbdf.bdf);
> +    unsigned int busn = sbdf.bus;
> 
>     if ( busn < cfg->busn_start || busn > cfg->busn_end )
>         return NULL;
> @@ -37,7 +36,7 @@ void __iomem *pci_ecam_map_bus(struct pc
>     busn -= cfg->busn_start;
>     base = cfg->win + (busn << ops->bus_shift);
> 
> -    return base + (PCI_DEVFN2(sbdf.bdf) << devfn_shift) + where;
> +    return base + (sbdf.df << devfn_shift) + where;

I think this should be sbdf.bdf instead (typo you removed the b).

Cheers
Bertrand




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.