From patchwork Fri May 10 16:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 10939179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E96B76 for ; Fri, 10 May 2019 16:13:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1E9128C10 for ; Fri, 10 May 2019 16:13:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2C5C28CB8; Fri, 10 May 2019 16:13:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B3E528C10 for ; Fri, 10 May 2019 16:13:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hP87W-0004Un-NO; Fri, 10 May 2019 16:11:38 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hP87V-0004Ui-RP for xen-devel@lists.xenproject.org; Fri, 10 May 2019 16:11:37 +0000 X-Inumbo-ID: 4929c58a-733e-11e9-8980-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 4929c58a-733e-11e9-8980-bc764e045a96; Fri, 10 May 2019 16:11:36 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,453,1549929600"; d="scan'208";a="85330707" From: Roger Pau Monne To: Date: Fri, 10 May 2019 18:10:51 +0200 Message-ID: <20190510161056.48648-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 0/5] pci: expand usage of pci_sbdf_t X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP pci: expand usage of pci_sbdf_t Start by switching the seg, bus and devfn fields of pci_dev to a single pci_sdbf_t field, and fixup the users. Also change the pci_conf and pci capabilities related functions to use pci_sbdf_t as parameter instead of passing the sbdf in multiple parameters. Finally also introduce a printf format specifier to print a pci_sbdf_t. IMO pci_sbdf_t it's nicer to use than passing around a sbdf in multiple fields. However it's hard to expand the usage of pci_sbdf_t in the code base without changing some of the core pci functions and the pci_dev struct fields, hence this patch set. Note there's still more low hanging fruit that could benefit from switching to pci_sbdf_t, this patch series just changes some of the more core pci functions to use pci_sbdf_t. This series should not introduce any functional changes. Roger Pau Monne (5): pci: use pci_sbdf_t in pci_dev pci: use function generation macros for pci_config_{write,read} pci: switch pci_conf_{read/write} to use pci_sbdf_t print: introduce a format specifier for pci_sbdf_t pci: switch PCI capabilities related functions to use pci_sbdf_t docs/misc/printk-formats.txt | 5 + xen/arch/x86/cpu/amd.c | 27 +- xen/arch/x86/dmi_scan.c | 9 +- xen/arch/x86/hvm/vmsi.c | 16 +- xen/arch/x86/mm.c | 2 +- xen/arch/x86/msi.c | 288 +++++++---------- xen/arch/x86/oprofile/op_model_athlon.c | 12 +- xen/arch/x86/x86_64/mmconf-fam10h.c | 13 +- xen/arch/x86/x86_64/mmconfig-shared.c | 26 +- xen/arch/x86/x86_64/pci.c | 136 +++----- xen/common/vsprintf.c | 18 ++ xen/drivers/acpi/reboot.c | 8 +- xen/drivers/char/ehci-dbgp.c | 78 +++-- xen/drivers/char/ns16550.c | 80 ++--- xen/drivers/passthrough/amd/iommu_acpi.c | 17 +- xen/drivers/passthrough/amd/iommu_cmd.c | 17 +- xen/drivers/passthrough/amd/iommu_detect.c | 10 +- xen/drivers/passthrough/amd/iommu_init.c | 37 ++- xen/drivers/passthrough/amd/iommu_intr.c | 22 +- xen/drivers/passthrough/amd/iommu_map.c | 10 +- xen/drivers/passthrough/amd/pci_amd_iommu.c | 65 ++-- xen/drivers/passthrough/ats.h | 14 +- xen/drivers/passthrough/pci.c | 325 ++++++++------------ xen/drivers/passthrough/vtd/dmar.c | 56 ++-- xen/drivers/passthrough/vtd/intremap.c | 19 +- xen/drivers/passthrough/vtd/iommu.c | 108 +++---- xen/drivers/passthrough/vtd/qinval.c | 2 +- xen/drivers/passthrough/vtd/quirks.c | 102 +++--- xen/drivers/passthrough/vtd/utils.c | 6 +- xen/drivers/passthrough/vtd/x86/ats.c | 11 +- xen/drivers/passthrough/x86/ats.c | 32 +- xen/drivers/pci/pci.c | 40 +-- xen/drivers/video/vga.c | 21 +- xen/drivers/vpci/header.c | 65 ++-- xen/drivers/vpci/msi.c | 17 +- xen/drivers/vpci/msix.c | 39 +-- xen/drivers/vpci/vpci.c | 42 +-- xen/include/xen/pci.h | 45 ++- 38 files changed, 836 insertions(+), 1004 deletions(-)