RE: [PATCH v10 05/22] kvm/vfio: Accept vfio device file from userspace

Liu, Yi L
2023-05-12T07:58:02Z

> From: Cédric Le Goater <clegoate@redhat.com>
> Sent: Thursday, May 11, 2023 3:11 PM
>
> On 4/26/23 17:03, Yi Liu wrote:
> > This defines KVM_DEV_VFIO_FILE* and make alias with KVM_DEV_VFIO_GROUP*.
> > Old userspace uses KVM_DEV_VFIO_GROUP* works as well.
> >
> > diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c
> > index 8f7fa07e8170..10a3c7ccadf1 100644
> > --- a/virt/kvm/vfio.c
> > +++ b/virt/kvm/vfio.c
> > @@ -286,18 +286,18 @@ static int kvm_vfio_set_file(struct kvm_device *dev, long
> attr,
> > int32_t fd;
> >
> > switch (attr) {
> > - case KVM_DEV_VFIO_GROUP_ADD:
> > + case KVM_DEV_VFIO_FILE_ADD:
> > if (get_user(fd, argp))
> > return -EFAULT;
> > return kvm_vfio_file_add(dev, fd);
> >
> > - case KVM_DEV_VFIO_GROUP_DEL:
> > + case KVM_DEV_VFIO_FILE_DEL:
> > if (get_user(fd, argp))
> > return -EFAULT;
> > return kvm_vfio_file_del(dev, fd);
> >
> > #ifdef CONFIG_SPAPR_TCE_IOMMU
> > - case KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE:
> > + case KVM_DEV_VFIO_FILE_SET_SPAPR_TCE:
>
> This should still be DEV_VFIO_GROUP_SET_SPAPR_TCE. Same below.

Thanks. It's a rebase mistake.

Regards,
Yi Liu