From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaEF-0006hz-Hr for qemu-devel@nongnu.org; Mon, 31 Aug 2015 21:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWaED-00049i-Oc for qemu-devel@nongnu.org; Mon, 31 Aug 2015 21:19:15 -0400 Date: Tue, 1 Sep 2015 11:00:50 +1000 From: David Gibson Message-ID: <20150901010050.GN11475@voom.redhat.com> References: <1440746120-21577-1-git-send-email-gwshan@linux.vnet.ibm.com> <1440746120-21577-6-git-send-email-gwshan@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IoFIGPN1N3g1Ryqz" Content-Disposition: inline In-Reply-To: <1440746120-21577-6-git-send-email-gwshan@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v7 5/8] Obsolete PCI_MSIX_FLAGS_BIRMASK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gavin Shan Cc: aik@ozlabs.ru, peter.maydell@linaro.org, thuth@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --IoFIGPN1N3g1Ryqz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 28, 2015 at 05:15:17PM +1000, Gavin Shan wrote: > This replaces PCI_MSIX_FLAGS_BIRMASK with PCI_MSIX_TABLE_BIR. Also, > 3 more macros regarding MSIx table offset, MSIx PBA BAR index and > MSIx PBA offset and this uses them. Besides, PCI_ERR_UNC_TRAIN is > replaced with PCI_ERR_UNC_UND. The changes were introduced by > below Linux upstream commits: >=20 > commit 24bc69da ("PCI: Clean up MSI/MSI-X capability #defines") > commit 846fc709 ("PCI/AER: Rename PCI_ERR_UNC_TRAIN to PCI_ERR_UNC_UND") >=20 > Signed-off-by: Gavin Shan Reviewed-by: David Gibson > --- > hw/i386/kvm/pci-assign.c | 4 ++-- > hw/pci/msix.c | 2 +- > hw/pci/pcie_aer.c | 2 +- > hw/s390x/s390-pci-bus.c | 8 ++++---- > hw/vfio/pci.c | 8 ++++---- > hw/xen/xen_pt_msi.c | 4 ++-- > tests/libqos/pci.c | 8 ++++---- > 7 files changed, 18 insertions(+), 18 deletions(-) >=20 > diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c > index 74d22f4..74154b1 100644 > --- a/hw/i386/kvm/pci-assign.c > +++ b/hw/i386/kvm/pci-assign.c > @@ -1320,8 +1320,8 @@ static int assigned_device_pci_cap_init(PCIDevice *= pci_dev, Error **errp) > PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL); > =20 > msix_table_entry =3D pci_get_long(pci_dev->config + pos + PCI_MS= IX_TABLE); > - bar_nr =3D msix_table_entry & PCI_MSIX_FLAGS_BIRMASK; > - msix_table_entry &=3D ~PCI_MSIX_FLAGS_BIRMASK; > + bar_nr =3D msix_table_entry & PCI_MSIX_TABLE_BIR; > + msix_table_entry &=3D PCI_MSIX_TABLE_OFFSET; > dev->msix_table_addr =3D pci_region[bar_nr].base_addr + msix_tab= le_entry; > dev->msix_max =3D msix_max; > } > diff --git a/hw/pci/msix.c b/hw/pci/msix.c > index 7716bf3..2788be2 100644 > --- a/hw/pci/msix.c > +++ b/hw/pci/msix.c > @@ -250,7 +250,7 @@ int msix_init(struct PCIDevice *dev, unsigned short n= entries, > ranges_overlap(table_offset, table_size, pba_offset, pba_size))= || > table_offset + table_size > memory_region_size(table_bar) || > pba_offset + pba_size > memory_region_size(pba_bar) || > - (table_offset | pba_offset) & PCI_MSIX_FLAGS_BIRMASK) { > + (table_offset | pba_offset) & PCI_MSIX_TABLE_BIR) { > return -EINVAL; > } > =20 > diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c > index f1847ac..1def4a4 100644 > --- a/hw/pci/pcie_aer.c > +++ b/hw/pci/pcie_aer.c > @@ -828,7 +828,7 @@ typedef struct PCIEAERErrorName { > static const struct PCIEAERErrorName pcie_aer_error_list[] =3D { > { > .name =3D "TRAIN", > - .val =3D PCI_ERR_UNC_TRAIN, > + .val =3D PCI_ERR_UNC_UND, > .correctable =3D false, > }, { > .name =3D "DLP", > diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c > index 560b66a..7dac2c0 100644 > --- a/hw/s390x/s390-pci-bus.c > +++ b/hw/s390x/s390-pci-bus.c > @@ -507,10 +507,10 @@ static int s390_pcihost_setup_msix(S390PCIBusDevice= *pbdev) > pba =3D pci_host_config_read_common(pbdev->pdev, pos + PCI_MSIX_PBA, > pci_config_size(pbdev->pdev), sizeof(pba)); > =20 > - pbdev->msix.table_bar =3D table & PCI_MSIX_FLAGS_BIRMASK; > - pbdev->msix.table_offset =3D table & ~PCI_MSIX_FLAGS_BIRMASK; > - pbdev->msix.pba_bar =3D pba & PCI_MSIX_FLAGS_BIRMASK; > - pbdev->msix.pba_offset =3D pba & ~PCI_MSIX_FLAGS_BIRMASK; > + pbdev->msix.table_bar =3D table & PCI_MSIX_TABLE_BIR; > + pbdev->msix.table_offset =3D table & PCI_MSIX_TABLE_OFFSET; > + pbdev->msix.pba_bar =3D pba & PCI_MSIX_PBA_BIR; > + pbdev->msix.pba_offset =3D pba & PCI_MSIX_PBA_OFFSET; > pbdev->msix.entries =3D (ctrl & PCI_MSIX_FLAGS_QSIZE) + 1; > pbdev->msix.available =3D true; > return 0; > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > index 4023d8e..0481d05 100644 > --- a/hw/vfio/pci.c > +++ b/hw/vfio/pci.c > @@ -2244,10 +2244,10 @@ static int vfio_early_setup_msix(VFIOPCIDevice *v= dev) > pba =3D le32_to_cpu(pba); > =20 > vdev->msix =3D g_malloc0(sizeof(*(vdev->msix))); > - vdev->msix->table_bar =3D table & PCI_MSIX_FLAGS_BIRMASK; > - vdev->msix->table_offset =3D table & ~PCI_MSIX_FLAGS_BIRMASK; > - vdev->msix->pba_bar =3D pba & PCI_MSIX_FLAGS_BIRMASK; > - vdev->msix->pba_offset =3D pba & ~PCI_MSIX_FLAGS_BIRMASK; > + vdev->msix->table_bar =3D table & PCI_MSIX_TABLE_BIR; > + vdev->msix->table_offset =3D table & PCI_MSIX_TABLE_OFFSET; > + vdev->msix->pba_bar =3D pba & PCI_MSIX_PBA_BIR; > + vdev->msix->pba_offset =3D pba & PCI_MSIX_PBA_OFFSET; > vdev->msix->entries =3D (ctrl & PCI_MSIX_FLAGS_QSIZE) + 1; > =20 > /* > diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c > index 263e051..ff84dbe 100644 > --- a/hw/xen/xen_pt_msi.c > +++ b/hw/xen/xen_pt_msi.c > @@ -555,8 +555,8 @@ int xen_pt_msix_init(XenPCIPassthroughState *s, uint3= 2_t base) > & XC_PAGE_MASK); > =20 > xen_host_pci_get_long(hd, base + PCI_MSIX_TABLE, &table_off); > - bar_index =3D msix->bar_index =3D table_off & PCI_MSIX_FLAGS_BIRMASK; > - table_off =3D table_off & ~PCI_MSIX_FLAGS_BIRMASK; > + bar_index =3D msix->bar_index =3D table_off & PCI_MSIX_TABLE_BIR; > + table_off =3D table_off & PCI_MSIX_TABLE_OFFSET; > msix->table_base =3D s->real_device.io_regions[bar_index].base_addr; > XEN_PT_LOG(d, "get MSI-X table BAR base 0x%"PRIx64"\n", msix->table_= base); > =20 > diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c > index 4e630c2..55fe5bf 100644 > --- a/tests/libqos/pci.c > +++ b/tests/libqos/pci.c > @@ -110,16 +110,16 @@ void qpci_msix_enable(QPCIDevice *dev) > qpci_config_writew(dev, addr + PCI_MSIX_FLAGS, val | PCI_MSIX_FLAGS_= ENABLE); > =20 > table =3D qpci_config_readl(dev, addr + PCI_MSIX_TABLE); > - bir_table =3D table & PCI_MSIX_FLAGS_BIRMASK; > + bir_table =3D table & PCI_MSIX_TABLE_BIR; > offset =3D qpci_iomap(dev, bir_table, NULL); > - dev->msix_table =3D offset + (table & ~PCI_MSIX_FLAGS_BIRMASK); > + dev->msix_table =3D offset + (table & PCI_MSIX_TABLE_OFFSET); > =20 > table =3D qpci_config_readl(dev, addr + PCI_MSIX_PBA); > - bir_pba =3D table & PCI_MSIX_FLAGS_BIRMASK; > + bir_pba =3D table & PCI_MSIX_PBA_BIR; > if (bir_pba !=3D bir_table) { > offset =3D qpci_iomap(dev, bir_pba, NULL); > } > - dev->msix_pba =3D offset + (table & ~PCI_MSIX_FLAGS_BIRMASK); > + dev->msix_pba =3D offset + (table & PCI_MSIX_PBA_OFFSET); > =20 > g_assert(dev->msix_table !=3D NULL); > g_assert(dev->msix_pba !=3D NULL); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --IoFIGPN1N3g1Ryqz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV5PjCAAoJEGw4ysog2bOSH7kP/RRysw+rXv+z0G3FhD94yZct /vAk1FTrYOxe9G4urOVUUuPJiFTpjW30feUzn+t+T0CEAHjMFAO+baYNNmzyqLFJ yFJW47sq0PLMaDOXbqQjsc/yho6MBl0viZHY98Ocb59Q/6VBviP0qcT5D+iPAdiw +x/GiBVMIT6Sk5mEVFbRdSiIMhben+aZxVd4rUigCX2wwMeOySpvFDzBoUrnAVKI /npFpvSFOKTaffye4IoFszC9DyLtvX/3j2TqCHDqnOXO+haSoHq7r9lZTMA5bMCh Sv5WAQULWSjawMU5r3vxMK7Wy+q5Mzaj+OiTSJu9tFnfaTi7HKcwvdWGX5AySi0Q 3Z3pY92IZRJTdk58bLlt+KkXi/iDdCuGcJViDkn0VrrgHzYsQVD4tnvrDNFdjE7h rbeYHb5lcCux9p7ZDmdoiS5rQTqSblLzZLddrw4aAWBHcgs/sAYZDzYWaf8nb5HS EjGyBFSqkRCadVPI968sVtpq0QXYUwaNKqbnwT53Er+uOHrvEH/Z0pHPRu6jraEG l06GOTp2qs80isIJdUr8Zoyy1KHHm7B7kdSSkyudQ2gKEy6srWu1Ue2m/Oz0sTbY 9m2cPWpDceh5KoofKubtuy3w33rGps5IQ85fv2hYizP0IODBno09LYmkKf3f+ovR ihMV/6+FEI3OB2XNa0wv =xJZ0 -----END PGP SIGNATURE----- --IoFIGPN1N3g1Ryqz--