All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Julian Ruess <julianr@linux.ibm.com>
Cc: schnelle@linux.ibm.com, wintera@linux.ibm.com, ts@linux.ibm.com,
	oberpar@linux.ibm.com, gbayer@linux.ibm.com,
	Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
	Shameer Kolothum <skolothumtho@nvidia.com>,
	Kevin Tian <kevin.tian@intel.com>,
	mjrosato@linux.ibm.com, alifm@linux.ibm.com, raspl@linux.ibm.com,
	hca@linux.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-pci@vger.kernel.org,
	alex@shazbot.org
Subject: Re: [PATCH v2 1/3] vfio/pci: Rename vfio_config_do_rw() to vfio_pci_config_rw_single() and export it
Date: Fri, 27 Feb 2026 13:51:26 -0700	[thread overview]
Message-ID: <20260227135126.5f3c900f@shazbot.org> (raw)
In-Reply-To: <20260224-vfio_pci_ism-v2-1-f010945373fa@linux.ibm.com>

On Tue, 24 Feb 2026 13:34:32 +0100
Julian Ruess <julianr@linux.ibm.com> wrote:

> A follow-up patch adds a new variant driver for s390 ISM devices. Since
> this device uses a 256 TiB BAR 0 that is never mapped, the variant
> driver needs its own ISM_VFIO_PCI_OFFSET_MASK. To minimally mirror the
> functionality of vfio_pci_config_rw() with such a custom mask, export
> vfio_config_do_rw(). To better distinguish the now exported function
> from vfio_pci_config_rw(), rename it to vfio_pci_config_rw_single()
> emphasizing that it does a single config space read or write.
> 
> Signed-off-by: Julian Ruess <julianr@linux.ibm.com>
> ---
>  drivers/vfio/pci/vfio_pci_config.c | 8 +++++---
>  drivers/vfio/pci/vfio_pci_priv.h   | 4 ++++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index b4e39253f98da61a5e2b6dd0089b2f6aef4b85a0..a724fdd8f4860bd529c5c7501beb1f7156fae9b0 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -1880,8 +1880,9 @@ static size_t vfio_pci_cap_remaining_dword(struct vfio_pci_core_device *vdev,
>  	return i;
>  }
>  
> -static ssize_t vfio_config_do_rw(struct vfio_pci_core_device *vdev, char __user *buf,
> -				 size_t count, loff_t *ppos, bool iswrite)
> +ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev,
> +			      char __user *buf, size_t count, loff_t *ppos,
> +			      bool iswrite)
>  {
>  	struct pci_dev *pdev = vdev->pdev;
>  	struct perm_bits *perm;
> @@ -1970,6 +1971,7 @@ static ssize_t vfio_config_do_rw(struct vfio_pci_core_device *vdev, char __user
>  
>  	return ret;
>  }
> +EXPORT_SYMBOL(vfio_pci_config_rw_single);

EXPORT_SYMBOL_GPL.  Thanks,

Alex


>  
>  ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
>  			   size_t count, loff_t *ppos, bool iswrite)
> @@ -1981,7 +1983,7 @@ ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
>  	pos &= VFIO_PCI_OFFSET_MASK;
>  
>  	while (count) {
> -		ret = vfio_config_do_rw(vdev, buf, count, &pos, iswrite);
> +		ret = vfio_pci_config_rw_single(vdev, buf, count, &pos, iswrite);
>  		if (ret < 0)
>  			return ret;
>  
> diff --git a/drivers/vfio/pci/vfio_pci_priv.h b/drivers/vfio/pci/vfio_pci_priv.h
> index 27ac280f00b975989f6cbc02c11aaca01f9badf3..28a3edf65aeecfa06cd1856637cd33eec1fa3006 100644
> --- a/drivers/vfio/pci/vfio_pci_priv.h
> +++ b/drivers/vfio/pci/vfio_pci_priv.h
> @@ -37,6 +37,10 @@ int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,
>  ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
>  			   size_t count, loff_t *ppos, bool iswrite);
>  
> +ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev,
> +			      char __user *buf, size_t count, loff_t *ppos,
> +			      bool iswrite);
> +
>  ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
>  			size_t count, loff_t *ppos, bool iswrite);
>  
> 


  parent reply	other threads:[~2026-02-27 20:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 12:34 [PATCH v2 0/3] vfio/pci: Introduce vfio_pci driver for ISM devices Julian Ruess
2026-02-24 12:34 ` [PATCH v2 1/3] vfio/pci: Rename vfio_config_do_rw() to vfio_pci_config_rw_single() and export it Julian Ruess
2026-02-26 19:36   ` Niklas Schnelle
2026-02-27 20:51   ` Alex Williamson [this message]
2026-02-24 12:34 ` [PATCH v2 2/3] vfio/ism: Implement vfio_pci driver for ISM devices Julian Ruess
2026-02-26 21:02   ` Niklas Schnelle
2026-02-27 15:52   ` Alexandra Winter
2026-03-02 12:18     ` Julian Ruess
2026-03-02 13:23       ` Alexandra Winter
2026-02-27 22:12   ` Alex Williamson
2026-03-02 22:07   ` Farhan Ali
2026-02-24 12:34 ` [PATCH v2 3/3] MAINTAINERS: add VFIO ISM PCI DRIVER section Julian Ruess
2026-02-26 21:04   ` Niklas Schnelle

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=20260227135126.5f3c900f@shazbot.org \
    --to=alex@shazbot.org \
    --cc=agordeev@linux.ibm.com \
    --cc=alifm@linux.ibm.com \
    --cc=gbayer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=julianr@linux.ibm.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=oberpar@linux.ibm.com \
    --cc=raspl@linux.ibm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=skolothumtho@nvidia.com \
    --cc=ts@linux.ibm.com \
    --cc=wintera@linux.ibm.com \
    --cc=yishaih@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 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.