From nobody Mon Feb 9 11:46:40 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=1559899467; cv=none; d=zoho.com; s=zohoarc; b=dKWJXpddFpGjegMJs8StA4gIDg0KMotdNiGKyuInJQuAZ6Hd1nHoid0GA4z+bYTpg+UTsNFpVIZ9Zz1rvcFrXWtszWYN1gpH2LWlQwn4qgSd1Zw/mlxc4T0/j2PyNplaPQGfzjcg7t10GuHVc7F9CeOnZCWPUe50ZgtYCsHX5NM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559899467; 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=onoTbsL3O5NBF0diIfOpB9H6CQ4zyRctWrvrRoazlIY=; b=S8tbXzATpXjqSD5arevI97FzlCLhOE2JyFOWOcFdQsNiAVMI0UOWBboJXCeRReWCcJ2fwGOnFPHZVhG31/l7Rcj8jRLmlnAypJcmmlfqw5NUo3RbdzRJBOcuHxIrJaZJhx2wRnMCGIrnBzdQzvnBPMZ0ZxX+ptXBsHvwZBh/Txs= 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 1559899467694459.0420306108498; Fri, 7 Jun 2019 02:24:27 -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 1hZB5l-0002bY-Q6; Fri, 07 Jun 2019 09:23:21 +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 1hZB5k-0002ao-23 for xen-devel@lists.xenproject.org; Fri, 07 Jun 2019 09:23:20 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e21882c2-8905-11e9-9937-b3ce5be5ba34; Fri, 07 Jun 2019 09:23:17 +0000 (UTC) X-Inumbo-ID: e21882c2-8905-11e9-9937-b3ce5be5ba34 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: fX+4LGZ+RwwDHXJC1AvP3KvU5cdgDKV5fDd04KS7N3HfMTJjiRxLI4R9FxCeMliAYHcpxS59hP uc4R268fUtaKpty71THUZ78PHLGFhPLO45vDqCS5s/mOhxEkG1ShJ5hfkW4rMeZPGfG97kbDpD ICjdd4jbMye/Hdc87S9Kr6ptnP7ixKqQlUrt8P9F9iIC7Jp8yYc/rQqSaVsRCF5HAIYmWPRvaC ysp3OxVdMQUvufGOMhct09Um3Qq0uhKYb9bVJjR2yoafqbGK8z3hhTq0CRZE+nqPYpxAELaRvn pQE= X-SBRS: -0.9 X-MesageID: 1438396 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,562,1557201600"; d="scan'208";a="1438396" From: Roger Pau Monne To: Date: Fri, 7 Jun 2019 11:22:25 +0200 Message-ID: <20190607092232.83179-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190607092232.83179-1-roger.pau@citrix.com> References: <20190607092232.83179-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 06/13] pci: make PCI_SBDF3 return a 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: 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 fix it's callers. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich --- 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/common/compat/memory.c | 4 ++-- xen/common/memory.c | 4 ++-- xen/drivers/passthrough/pci.c | 4 +--- xen/include/xen/pci.h | 3 ++- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c index 13fd64ddf5..2eb79efa65 100644 --- a/xen/common/compat/memory.c +++ b/xen/common/compat/memory.c @@ -27,8 +27,8 @@ static int get_reserved_device_memory(xen_pfn_t start, xe= n_ulong_t nr, u32 id, void *ctxt) { struct get_reserved_device_memory *grdm =3D ctxt; - u32 sbdf =3D PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus, - grdm->map.dev.pci.devfn); + uint32_t sbdf =3D PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.b= us, + grdm->map.dev.pci.devfn).sbdf; =20 if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf !=3D id) ) return 0; diff --git a/xen/common/memory.c b/xen/common/memory.c index b8be19a890..03db7bfa9e 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -968,8 +968,8 @@ static int get_reserved_device_memory(xen_pfn_t start, = xen_ulong_t nr, u32 id, void *ctxt) { struct get_reserved_device_memory *grdm =3D ctxt; - u32 sbdf =3D PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus, - grdm->map.dev.pci.devfn); + uint32_t sbdf =3D PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.b= us, + grdm->map.dev.pci.devfn).sbdf; =20 if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf !=3D id) ) return 0; diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 535c7e511b..e88689425d 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -762,9 +762,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, { unsigned int idx =3D pos + PCI_SRIOV_BAR + i * 4; u32 bar =3D pci_conf_read32(seg, bus, slot, func, idx); - pci_sbdf_t sbdf =3D { - .sbdf =3D PCI_SBDF3(seg, bus, devfn), - }; + pci_sbdf_t sbdf =3D PCI_SBDF3(seg, bus, devfn); =20 if ( (bar & PCI_BASE_ADDRESS_SPACE) =3D=3D PCI_BASE_ADDRESS_SPACE_IO ) diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index 53d786da66..05ee115715 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -38,7 +38,8 @@ ((pci_sbdf_t) { .sbdf =3D (((s) & 0xffff) << 16) | PCI_BDF(b,d,f) }) #define PCI_SBDF2(s,bdf) \ ((pci_sbdf_t) { .sbdf =3D (((s) & 0xffff) << 16) | ((bdf) & 0xffff) }) -#define PCI_SBDF3(s,b,df) ((((s) & 0xffff) << 16) | PCI_BDF2(b, df)) +#define PCI_SBDF3(s,b,df) \ + ((pci_sbdf_t) { .sbdf =3D (((s) & 0xffff) << 16) | PCI_BDF2(b, df) }) =20 typedef union { uint32_t sbdf; --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel