kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	kvm@vger.kernel.org, llvm@lists.linux.dev,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Subject: [PATCH v2 0/8] Break up ioctl dispatch functions to one function per ioctl
Date: Wed, 31 Aug 2022 17:15:55 -0300	[thread overview]
Message-ID: <0-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com> (raw)

Move ioctl dispatch functions for the group FD and PCI to follow a common
pattern:

 - One function per ioctl
 - Function name has 'ioctl' in it
 - Function takes in a __user pointer of the correct type

At least PCI has grown its single ioctl function to over 500 lines and
needs splitting. Group is split up in the same style to make some coming
patches more understandable.

This is based on the "Remove private items from linux/vfio_pci_core.h"
series as it has a minor conflict with it.

v2:
 - Rebase onto the v2 "Remove private items" series with
   vfio_pci_core_register_dev_region()
 - Pull the locking into vfio_group_ioctl_unset_container()
 - Add missing blank line before vfio_group_ioctl_get_status()
 - Remove stray whitespace in 'return vfio_group_ioctl_set_container'
 - Remove the 'ret' variable in vfio_group_fops_unl_ioctl() since
   everything just returns directly
v1: https://lore.kernel.org/r/0-v1-11d8272dc65a+4bd-vfio_ioctl_split_jgg@nvidia.com

Jason Gunthorpe (8):
  vfio-pci: Fix vfio_pci_ioeventfd() to return int
  vfio-pci: Break up vfio_pci_core_ioctl() into one function per ioctl
  vfio-pci: Re-indent what was vfio_pci_core_ioctl()
  vfio-pci: Replace 'void __user *' with proper types in the ioctl
    functions
  vfio: Fold VFIO_GROUP_GET_DEVICE_FD into vfio_group_get_device_fd()
  vfio: Fold VFIO_GROUP_SET_CONTAINER into vfio_group_set_container()
  vfio: Follow the naming pattern for vfio_group_ioctl_unset_container()
  vfio: Split VFIO_GROUP_GET_STATUS into a function

 drivers/vfio/pci/vfio_pci_core.c | 800 ++++++++++++++++---------------
 drivers/vfio/pci/vfio_pci_priv.h |   4 +-
 drivers/vfio/pci/vfio_pci_rdwr.c |   4 +-
 drivers/vfio/vfio_main.c         | 161 ++++---
 4 files changed, 496 insertions(+), 473 deletions(-)


base-commit: c444ddba00ccce817f6e1ca6b71b041dd1007a17
-- 
2.37.2


             reply	other threads:[~2022-08-31 20:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31 20:15 Jason Gunthorpe [this message]
2022-08-31 20:15 ` [PATCH v2 1/8] vfio-pci: Fix vfio_pci_ioeventfd() to return int Jason Gunthorpe
2022-08-31 20:15 ` [PATCH v2 2/8] vfio-pci: Break up vfio_pci_core_ioctl() into one function per ioctl Jason Gunthorpe
2022-08-31 20:15 ` [PATCH v2 3/8] vfio-pci: Re-indent what was vfio_pci_core_ioctl() Jason Gunthorpe
2022-08-31 20:15 ` [PATCH v2 4/8] vfio-pci: Replace 'void __user *' with proper types in the ioctl functions Jason Gunthorpe
2022-08-31 20:16 ` [PATCH v2 5/8] vfio: Fold VFIO_GROUP_GET_DEVICE_FD into vfio_group_get_device_fd() Jason Gunthorpe
2022-08-31 20:16 ` [PATCH v2 6/8] vfio: Fold VFIO_GROUP_SET_CONTAINER into vfio_group_set_container() Jason Gunthorpe
2022-08-31 20:16 ` [PATCH v2 7/8] vfio: Follow the naming pattern for vfio_group_ioctl_unset_container() Jason Gunthorpe
2022-09-01  2:20   ` Tian, Kevin
2022-08-31 20:16 ` [PATCH v2 8/8] vfio: Split VFIO_GROUP_GET_STATUS into a function Jason Gunthorpe
2022-09-02 18:42 ` [PATCH v2 0/8] Break up ioctl dispatch functions to one function per ioctl Alex Williamson

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=0-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=trix@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: 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;
as well as URLs for NNTP newsgroup(s).