From nobody Mon Feb 9 07:23:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1559811804; cv=none; d=zoho.com; s=zohoarc; b=Q8XFcVhwh6lOo8WjmAmdexqcauq5jFPe1lS/eyNGKnetmVqxh9HlrnAnflnw6RELeglRizokD0oHe41YdF5DR/W+D3IuulGw9NBGcTd4ILifjS3+xA3Z8SMjG8Rv6zkoTV0AwSO5LL7D0QQHZzW3S+42a+TVMX0sEDlFiRCYVGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559811804; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nC7CFuM+jiHOqEGvAL/p4vyRf9QfbVau4XLE6f+hWI8=; b=ktuCggqB3RLe/LCW/QRWV+BO1B5KYogp281yI/cYHmm7LhYr+OBKaG4XssB58TB9hUHp5asWXCRKzO0vvvHbsrNsY7oEi7bk6ho7vJTW/IslU0jq4iyYrW9ht3JDy4SWEFt46DqHOZ4M6J9YMPfieLQg7WhN3YYFVCDFQ6gndpA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1559811804291377.0363592955837; Thu, 6 Jun 2019 02:03:24 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hYoHn-0006V7-5g; Thu, 06 Jun 2019 09:02:15 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hYoHl-0006Ul-SR for xen-devel@lists.xenproject.org; Thu, 06 Jun 2019 09:02:13 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c5479f42-8839-11e9-a0c2-1b6837f47d8e; Thu, 06 Jun 2019 09:02:12 +0000 (UTC) X-Inumbo-ID: c5479f42-8839-11e9-a0c2-1b6837f47d8e Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=SoftFail smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa2.hc3370-68.iphmx.com: domain of roger.pau@citrix.com is inclined to not designate 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: j6PBXJhpDnQ5xIl08Ghi8vbgcz8dK5iL90vWZ3kXChEpBdI3HpVXS9myWpGwhZPQQWxCbWri69 V83uBScLorp+dTEWTL5avbVlTsdrx9pGfs0HU9NDtBahbQ7W8dSxazlq9xAxGf3QdtIx5fotLQ rTHOyE7yiP7rLXAqzxaytWhKdfbs9EzZdL0g0v64XvEq/Ke3MPPDwKDYo6VOeSs6i7WEsrZwVD S636brFMzQKPJ9tMsdoujEIo1eGhA8U//HGNLfAHEfCpK8Kps90fqhc4ZL4gkNcXX7dAwE6HYp p98= X-SBRS: -0.9 X-MesageID: 1385804 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,558,1557201600"; d="scan'208";a="1385804" From: Roger Pau Monne To: Date: Thu, 6 Jun 2019 11:01:36 +0200 Message-ID: <20190606090146.77381-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190606090146.77381-1-roger.pau@citrix.com> References: <20190606090146.77381-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 02/12] pci: introduce a pci_sbdf_t field to pci_dev 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: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" And use an union with the current seg, bus and devfn fields to make fields point to the same underlying data. No functional change. Suggested-by: Jan Beulich Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich Reviewed-by: Paul Durrant --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- xen/drivers/vpci/header.c | 7 ++----- xen/include/xen/pci.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c index efb6ca90e3..046b1c610e 100644 --- a/xen/drivers/vpci/header.c +++ b/xen/drivers/vpci/header.c @@ -461,9 +461,6 @@ static int init_bars(struct pci_dev *pdev) unsigned int i, num_bars, rom_reg; struct vpci_header *header =3D &pdev->vpci->header; struct vpci_bar *bars =3D header->bars; - pci_sbdf_t sbdf =3D { - .sbdf =3D PCI_SBDF3(pdev->seg, pdev->bus, pdev->devfn), - }; int rc; =20 switch ( pci_conf_read8(pdev->seg, pdev->bus, slot, func, PCI_HEADER_T= YPE) @@ -530,7 +527,7 @@ static int init_bars(struct pci_dev *pdev) else bars[i].type =3D VPCI_BAR_MEM32; =20 - rc =3D pci_size_mem_bar(sbdf, reg, &addr, &size, + rc =3D pci_size_mem_bar(pdev->sbdf, reg, &addr, &size, (i =3D=3D num_bars - 1) ? PCI_BAR_LAST : 0); if ( rc < 0 ) { @@ -560,7 +557,7 @@ static int init_bars(struct pci_dev *pdev) } =20 /* Check expansion ROM. */ - rc =3D pci_size_mem_bar(sbdf, rom_reg, &addr, &size, PCI_BAR_ROM); + rc =3D pci_size_mem_bar(pdev->sbdf, rom_reg, &addr, &size, PCI_BAR_ROM= ); if ( rc > 0 && size ) { struct vpci_bar *rom =3D &header->bars[num_bars]; diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index ec98274675..f4908abd8b 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -83,9 +83,15 @@ struct pci_dev { struct arch_msix *msix; =20 struct domain *domain; - const u16 seg; - const u8 bus; - const u8 devfn; + + union { + struct { + const uint8_t devfn; + const uint8_t bus; + const uint16_t seg; + }; + const pci_sbdf_t sbdf; + }; =20 u8 phantom_stride; =20 --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel