public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Max Gurtovoy <mgurtovoy@nvidia.com>,
	cohuck@redhat.com, kvm@vger.kernel.org,
	alex.williamson@redhat.com
Cc: oren@nvidia.com, jgg@nvidia.com
Subject: Re: [PATCH 1/1] vfio/pci: remove CONFIG_VFIO_PCI_ZDEV from Kconfig
Date: Thu, 18 Feb 2021 15:56:48 -0500	[thread overview]
Message-ID: <f2814341-c5e2-4dd4-19aa-0183acf734ed@linux.ibm.com> (raw)
In-Reply-To: <20210218104435.464773-1-mgurtovoy@nvidia.com>

On 2/18/21 5:44 AM, Max Gurtovoy wrote:
> In case we're running on s390 system always expose the capabilities for
> configuration of zPCI devices. In case we're running on different
> platform, continue as usual.
> 
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>

Sanity-tested on s390 to verify that zdev caps are still available after 
CONFIG_VFIO_PCI_ZDEV is removed.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>

> ---
>   drivers/vfio/pci/Kconfig            | 12 ------------
>   drivers/vfio/pci/Makefile           |  2 +-
>   drivers/vfio/pci/vfio_pci.c         | 12 +++++-------
>   drivers/vfio/pci/vfio_pci_private.h |  2 +-
>   4 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
> index 40a223381ab6..ac3c1dd3edef 100644
> --- a/drivers/vfio/pci/Kconfig
> +++ b/drivers/vfio/pci/Kconfig
> @@ -45,15 +45,3 @@ config VFIO_PCI_NVLINK2
>   	depends on VFIO_PCI && PPC_POWERNV
>   	help
>   	  VFIO PCI support for P9 Witherspoon machine with NVIDIA V100 GPUs
> -
> -config VFIO_PCI_ZDEV
> -	bool "VFIO PCI ZPCI device CLP support"
> -	depends on VFIO_PCI && S390
> -	default y
> -	help
> -	  Enabling this option exposes VFIO capabilities containing hardware
> -	  configuration for zPCI devices. This enables userspace (e.g. QEMU)
> -	  to supply proper configuration values instead of hard-coded defaults
> -	  for zPCI devices passed through via VFIO on s390.
> -
> -	  Say Y here.
> diff --git a/drivers/vfio/pci/Makefile b/drivers/vfio/pci/Makefile
> index 781e0809d6ee..eff97a7cd9f1 100644
> --- a/drivers/vfio/pci/Makefile
> +++ b/drivers/vfio/pci/Makefile
> @@ -3,6 +3,6 @@
>   vfio-pci-y := vfio_pci.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o
>   vfio-pci-$(CONFIG_VFIO_PCI_IGD) += vfio_pci_igd.o
>   vfio-pci-$(CONFIG_VFIO_PCI_NVLINK2) += vfio_pci_nvlink2.o
> -vfio-pci-$(CONFIG_VFIO_PCI_ZDEV) += vfio_pci_zdev.o
> +vfio-pci-$(CONFIG_S390) += vfio_pci_zdev.o
>   
>   obj-$(CONFIG_VFIO_PCI) += vfio-pci.o
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index 706de3ef94bb..65e7e6b44578 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -807,6 +807,7 @@ static long vfio_pci_ioctl(void *device_data,
>   		struct vfio_device_info info;
>   		struct vfio_info_cap caps = { .buf = NULL, .size = 0 };
>   		unsigned long capsz;
> +		int ret;
>   
>   		minsz = offsetofend(struct vfio_device_info, num_irqs);
>   
> @@ -832,13 +833,10 @@ static long vfio_pci_ioctl(void *device_data,
>   		info.num_regions = VFIO_PCI_NUM_REGIONS + vdev->num_regions;
>   		info.num_irqs = VFIO_PCI_NUM_IRQS;
>   
> -		if (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV)) {
> -			int ret = vfio_pci_info_zdev_add_caps(vdev, &caps);
> -
> -			if (ret && ret != -ENODEV) {
> -				pci_warn(vdev->pdev, "Failed to setup zPCI info capabilities\n");
> -				return ret;
> -			}
> +		ret = vfio_pci_info_zdev_add_caps(vdev, &caps);
> +		if (ret && ret != -ENODEV) {
> +			pci_warn(vdev->pdev, "Failed to setup zPCI info capabilities\n");
> +			return ret;
>   		}
>   
>   		if (caps.size) {
> diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h
> index 5c90e560c5c7..9cd1882a05af 100644
> --- a/drivers/vfio/pci/vfio_pci_private.h
> +++ b/drivers/vfio/pci/vfio_pci_private.h
> @@ -214,7 +214,7 @@ static inline int vfio_pci_ibm_npu2_init(struct vfio_pci_device *vdev)
>   }
>   #endif
>   
> -#ifdef CONFIG_VFIO_PCI_ZDEV
> +#ifdef CONFIG_S390
>   extern int vfio_pci_info_zdev_add_caps(struct vfio_pci_device *vdev,
>   				       struct vfio_info_cap *caps);
>   #else
> 


  reply	other threads:[~2021-02-18 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 10:44 [PATCH 1/1] vfio/pci: remove CONFIG_VFIO_PCI_ZDEV from Kconfig Max Gurtovoy
2021-02-18 20:56 ` Matthew Rosato [this message]
2021-02-19 11:45 ` Cornelia Huck

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=f2814341-c5e2-4dd4-19aa-0183acf734ed@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=mgurtovoy@nvidia.com \
    --cc=oren@nvidia.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox