lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220302142355.GJ219866@nvidia.com>
Date:   Wed, 2 Mar 2022 10:23:55 -0400
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Cornelia Huck <cohuck@...hat.com>
Cc:     Yishai Hadas <yishaih@...dia.com>, alex.williamson@...hat.com,
        bhelgaas@...gle.com, saeedm@...dia.com, linux-pci@...r.kernel.org,
        kvm@...r.kernel.org, netdev@...r.kernel.org, kuba@...nel.org,
        leonro@...dia.com, kwankhede@...dia.com, mgurtovoy@...dia.com,
        maorg@...dia.com, ashok.raj@...el.com, kevin.tian@...el.com,
        shameerali.kolothum.thodi@...wei.com
Subject: Re: [PATCH V9 mlx5-next 08/15] vfio: Have the core code decode the
 VFIO_DEVICE_FEATURE ioctl

On Wed, Mar 02, 2022 at 11:00:08AM +0100, Cornelia Huck wrote:
> > diff --git a/include/linux/vfio.h b/include/linux/vfio.h
> > index 76191d7abed1..ca69516f869d 100644
> > +++ b/include/linux/vfio.h
> > @@ -55,6 +55,7 @@ struct vfio_device {
> >   * @match: Optional device name match callback (return: 0 for no-match, >0 for
> >   *         match, -errno for abort (ex. match with insufficient or incorrect
> >   *         additional args)
> > + * @device_feature: Fill in the VFIO_DEVICE_FEATURE ioctl
> >   */
> >  struct vfio_device_ops {
> >  	char	*name;
> > @@ -69,8 +70,39 @@ struct vfio_device_ops {
> >  	int	(*mmap)(struct vfio_device *vdev, struct vm_area_struct *vma);
> >  	void	(*request)(struct vfio_device *vdev, unsigned int count);
> >  	int	(*match)(struct vfio_device *vdev, char *buf);
> > +	int	(*device_feature)(struct vfio_device *device, u32 flags,
> > +				  void __user *arg, size_t argsz);
> >  };
> 
> Is the expectation that most drivers will eventually implement
> ->device_feature()?

I would say probably no, but it depends on what future features are
designed. Maybe we will make a new all-driver one someday?

> migration; mostly asking because e.g. ->match() is explicitly marked as
> "optional". As the only callback every driver implements seems to be
> ->ioctl() (if we also include the samples), "optional" or not does not
> seem to be particularly relevant anyway.

The comment could have said optional here too, but it is also clear
from the code.

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ