From: Cornelia Huck <cohuck@redhat.com> To: Matthew Rosato <mjrosato@linux.ibm.com> Cc: thuth@redhat.com, pmorel@linux.ibm.com, schnelle@linux.ibm.com, rth@twiddle.net, david@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, mst@redhat.com, pbonzini@redhat.com, alex.williamson@redhat.com, qemu-s390x@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: Re: [PATCH v3 10/10] s390x/pci: get zPCI function info from host Date: Fri, 9 Oct 2020 17:48:07 +0200 [thread overview] Message-ID: <20201009174807.6d800999.cohuck@redhat.com> (raw) In-Reply-To: <1602097455-15658-11-git-send-email-mjrosato@linux.ibm.com> On Wed, 7 Oct 2020 15:04:15 -0400 Matthew Rosato <mjrosato@linux.ibm.com> wrote: > We use the capability chains of the VFIO_DEVICE_GET_INFO ioctl to retrieve > the CLP information that the kernel exports. > > To be compatible with previous kernel versions we fall back on previous > predefined values, same as the emulation values, when the ioctl is found > to not support capability chains. If individual CLP capabilities are not > found, we fall back on default values for only those capabilities missing > from the chain. > > This patch is based on work previously done by Pierre Morel. > > Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> > --- > hw/s390x/meson.build | 1 + > hw/s390x/s390-pci-bus.c | 10 +- > hw/s390x/s390-pci-vfio.c | 197 +++++++++++++++++++++++++++++++++++++++ > include/hw/s390x/s390-pci-bus.h | 1 + > include/hw/s390x/s390-pci-clp.h | 12 ++- > include/hw/s390x/s390-pci-vfio.h | 19 ++++ > 6 files changed, 233 insertions(+), 7 deletions(-) > create mode 100644 hw/s390x/s390-pci-vfio.c > create mode 100644 include/hw/s390x/s390-pci-vfio.h (...) > diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c > new file mode 100644 > index 0000000..43684c6 > --- /dev/null > +++ b/hw/s390x/s390-pci-vfio.c > @@ -0,0 +1,197 @@ > +/* > + * s390 vfio-pci interfaces > + * > + * Copyright 2020 IBM Corp. > + * Author(s): Matthew Rosato <mjrosato@linux.ibm.com> > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or (at > + * your option) any later version. See the COPYING file in the top-level > + * directory. > + */ > + > +#include <sys/ioctl.h> > +#include <linux/vfio.h> > +#include <linux/vfio_zdev.h> > + > +#include "qemu/osdep.h" > +#include "hw/s390x/s390-pci-bus.h" > +#include "hw/s390x/s390-pci-clp.h" > +#include "hw/s390x/s390-pci-vfio.h" > +#include "hw/vfio/pci.h" > + > +#ifndef DEBUG_S390PCI_VFIO > +#define DEBUG_S390PCI_VFIO 0 > +#endif > + > +#define DPRINTF(fmt, ...) \ > + do { \ > + if (DEBUG_S390PCI_VFIO) { \ > + fprintf(stderr, "S390pci-vfio: " fmt, ## __VA_ARGS__); \ > + } \ > + } while (0) Not really a fan of DPRINTF. Can you maybe use trace events instead? Other than that, looks good to me.
WARNING: multiple messages have this Message-ID (diff)
From: Cornelia Huck <cohuck@redhat.com> To: Matthew Rosato <mjrosato@linux.ibm.com> Cc: thuth@redhat.com, kvm@vger.kernel.org, pmorel@linux.ibm.com, david@redhat.com, schnelle@linux.ibm.com, qemu-s390x@nongnu.org, qemu-devel@nongnu.org, pasic@linux.ibm.com, borntraeger@de.ibm.com, alex.williamson@redhat.com, mst@redhat.com, pbonzini@redhat.com, rth@twiddle.net Subject: Re: [PATCH v3 10/10] s390x/pci: get zPCI function info from host Date: Fri, 9 Oct 2020 17:48:07 +0200 [thread overview] Message-ID: <20201009174807.6d800999.cohuck@redhat.com> (raw) In-Reply-To: <1602097455-15658-11-git-send-email-mjrosato@linux.ibm.com> On Wed, 7 Oct 2020 15:04:15 -0400 Matthew Rosato <mjrosato@linux.ibm.com> wrote: > We use the capability chains of the VFIO_DEVICE_GET_INFO ioctl to retrieve > the CLP information that the kernel exports. > > To be compatible with previous kernel versions we fall back on previous > predefined values, same as the emulation values, when the ioctl is found > to not support capability chains. If individual CLP capabilities are not > found, we fall back on default values for only those capabilities missing > from the chain. > > This patch is based on work previously done by Pierre Morel. > > Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> > --- > hw/s390x/meson.build | 1 + > hw/s390x/s390-pci-bus.c | 10 +- > hw/s390x/s390-pci-vfio.c | 197 +++++++++++++++++++++++++++++++++++++++ > include/hw/s390x/s390-pci-bus.h | 1 + > include/hw/s390x/s390-pci-clp.h | 12 ++- > include/hw/s390x/s390-pci-vfio.h | 19 ++++ > 6 files changed, 233 insertions(+), 7 deletions(-) > create mode 100644 hw/s390x/s390-pci-vfio.c > create mode 100644 include/hw/s390x/s390-pci-vfio.h (...) > diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c > new file mode 100644 > index 0000000..43684c6 > --- /dev/null > +++ b/hw/s390x/s390-pci-vfio.c > @@ -0,0 +1,197 @@ > +/* > + * s390 vfio-pci interfaces > + * > + * Copyright 2020 IBM Corp. > + * Author(s): Matthew Rosato <mjrosato@linux.ibm.com> > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or (at > + * your option) any later version. See the COPYING file in the top-level > + * directory. > + */ > + > +#include <sys/ioctl.h> > +#include <linux/vfio.h> > +#include <linux/vfio_zdev.h> > + > +#include "qemu/osdep.h" > +#include "hw/s390x/s390-pci-bus.h" > +#include "hw/s390x/s390-pci-clp.h" > +#include "hw/s390x/s390-pci-vfio.h" > +#include "hw/vfio/pci.h" > + > +#ifndef DEBUG_S390PCI_VFIO > +#define DEBUG_S390PCI_VFIO 0 > +#endif > + > +#define DPRINTF(fmt, ...) \ > + do { \ > + if (DEBUG_S390PCI_VFIO) { \ > + fprintf(stderr, "S390pci-vfio: " fmt, ## __VA_ARGS__); \ > + } \ > + } while (0) Not really a fan of DPRINTF. Can you maybe use trace events instead? Other than that, looks good to me.
next prev parent reply other threads:[~2020-10-09 15:48 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-07 19:04 [PATCH v3 00/10] Retrieve zPCI hardware information from VFIO Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-07 19:04 ` [PATCH v3 01/10] s390x/pci: Move header files to include/hw/s390x Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 9:50 ` Cornelia Huck 2020-10-09 9:50 ` Cornelia Huck 2020-10-07 19:04 ` [PATCH v3 02/10] vfio: Create shared routine for scanning info capabilities Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-07 19:04 ` [PATCH v3 03/10] update-linux-headers: Add vfio_zdev.h Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-07 19:04 ` [PATCH v3 04/10] linux-headers: update against 5.9-rc8 Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-07 19:04 ` [PATCH v3 05/10] s390x/pci: create a header dedicated to PCI CLP Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-07 19:04 ` [PATCH v3 06/10] s390x/pci: use a PCI Group structure Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 10:53 ` Cornelia Huck 2020-10-09 10:53 ` Cornelia Huck 2020-10-07 19:04 ` [PATCH v3 07/10] s390x/pci: clean up s390 PCI groups Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 10:54 ` Cornelia Huck 2020-10-09 10:54 ` Cornelia Huck 2020-10-07 19:04 ` [PATCH v3 08/10] s390x/pci: use a PCI Function structure Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 10:56 ` Cornelia Huck 2020-10-09 10:56 ` Cornelia Huck 2020-10-07 19:04 ` [PATCH v3 09/10] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 9:53 ` Cornelia Huck 2020-10-09 9:53 ` Cornelia Huck 2020-10-07 19:04 ` [PATCH v3 10/10] s390x/pci: get zPCI function info from host Matthew Rosato 2020-10-07 19:04 ` Matthew Rosato 2020-10-09 15:48 ` Cornelia Huck [this message] 2020-10-09 15:48 ` Cornelia Huck 2020-10-09 16:10 ` Matthew Rosato 2020-10-09 16:10 ` Matthew Rosato
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201009174807.6d800999.cohuck@redhat.com \ --to=cohuck@redhat.com \ --cc=alex.williamson@redhat.com \ --cc=borntraeger@de.ibm.com \ --cc=david@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=mjrosato@linux.ibm.com \ --cc=mst@redhat.com \ --cc=pasic@linux.ibm.com \ --cc=pbonzini@redhat.com \ --cc=pmorel@linux.ibm.com \ --cc=qemu-devel@nongnu.org \ --cc=qemu-s390x@nongnu.org \ --cc=rth@twiddle.net \ --cc=schnelle@linux.ibm.com \ --cc=thuth@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.