From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>,
iommu@lists.linux.dev, Kevin Tian <kevin.tian@intel.com>,
kvm@vger.kernel.org, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH v3] vfio: Support VFIO_NOIOMMU with iommufd
Date: Thu, 19 Jan 2023 10:10:34 -0400 [thread overview]
Message-ID: <Y8lPWoRPUrDjLCNn@nvidia.com> (raw)
In-Reply-To: <20230118115831.3e76742d.alex.williamson@redhat.com>
On Wed, Jan 18, 2023 at 11:58:31AM -0700, Alex Williamson wrote:
> On Wed, 18 Jan 2023 13:50:28 -0400
> Jason Gunthorpe <jgg@nvidia.com> wrote:
> > diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h
> > index f8219a438bfbf5..9e94abcf8ee1a8 100644
> > --- a/drivers/vfio/vfio.h
> > +++ b/drivers/vfio/vfio.h
> > @@ -10,10 +10,10 @@
> > #include <linux/device.h>
> > #include <linux/cdev.h>
> > #include <linux/module.h>
> > +#include <linux/vfio.h>
> >
> > struct iommufd_ctx;
> > struct iommu_group;
> > -struct vfio_device;
> > struct vfio_container;
> >
> > void vfio_device_put_registration(struct vfio_device *device);
> > @@ -88,6 +88,12 @@ bool vfio_device_has_container(struct vfio_device *device);
> > int __init vfio_group_init(void);
> > void vfio_group_cleanup(void);
> >
> > +static inline bool vfio_device_is_noiommu(struct vfio_device *vdev)
> > +{
> > + return IS_ENABLED(CONFIG_VFIO_NOIOMMU) &&
> > + vdev->group->type == VFIO_NO_IOMMU;
> > +}
>
>
> What about:
>
> static inline bool vfio_group_type_is_noiommu(struct vfio_group *group)
For Yi's series to work we can't refer to device->group outside
group.c - it should be compiled out entirely in some kconfigs.
So this function is the right signature for the call sites I added
> which would allow us to pickup the group.c use with only extending the
> callers here as s/vdev/vdev->group/?
I think this would an OK mini-cleanup for group.c..
Are you OK with it as is?
Jason
next prev parent reply other threads:[~2023-01-19 14:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 17:50 [PATCH v3] vfio: Support VFIO_NOIOMMU with iommufd Jason Gunthorpe
2023-01-18 18:58 ` Alex Williamson
2023-01-19 14:10 ` Jason Gunthorpe [this message]
2023-01-30 18:28 ` Jason Gunthorpe
2023-01-30 19:29 ` Alex Williamson
2023-02-03 19:58 ` Jason Gunthorpe
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=Y8lPWoRPUrDjLCNn@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=yi.l.liu@intel.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.