Skip to content

Break up ioctl dispatch functions to one function per ioctl

Jason Gunthorpe kvm llvm 2 versions – Applied

Status from this message: Applied to vfio next branch for v6.1. Thanks,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 2 repliesApplied
  2. v18 patches 17 repliesSuperseded

Changes in v2 from the cover letter

- 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/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8vfio-pci: Fix vfio_pci_ioeventfd() to return intdrivers/vfio/pci/vfio_pci_priv.h drivers/vfio/pci/vfio_pci_rdwr.c+4 -40 replies
2/8vfio-pci: Break up vfio_pci_core_ioctl() into one function per ioctldrivers/vfio/pci/vfio_pci_core.c+68 -290 replies
3/8vfio-pci: Re-indent what was vfio_pci_core_ioctl()drivers/vfio/pci/vfio_pci_core.c+349 -3620 replies
4/8vfio-pci: Replace 'void __user *' with proper types in the ioctl functionsdrivers/vfio/pci/vfio_pci_core.c+28 -300 replies
5/8vfio: Fold VFIO_GROUP_GET_DEVICE_FD into vfio_group_get_device_fd()drivers/vfio/vfio_main.c+11 -130 replies
6/8vfio: Fold VFIO_GROUP_SET_CONTAINER into vfio_group_set_container()drivers/vfio/vfio_main.c+24 -270 replies
7/8vfio: Follow the naming pattern for vfio_group_ioctl_unset_container()drivers/vfio/vfio_main.c+16 -111 reply
8/8vfio: Split VFIO_GROUP_GET_STATUS into a functiondrivers/vfio/vfio_main.c+30 -310 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchKevin Tian
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] Break up ioctl dispatch functions to one function per ioctl

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/[email protected]

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

Signature · 1 line
2.37.2