Kernel KVM virtualization development
 help / color / mirror / Atom feed
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 v2] vfio: Support VFIO_NOIOMMU with iommufd
Date: Wed, 18 Jan 2023 11:47:12 -0400	[thread overview]
Message-ID: <Y8gUgL+VWaL8WOZK@nvidia.com> (raw)
In-Reply-To: <20230117150256.1937d343.alex.williamson@redhat.com>

On Tue, Jan 17, 2023 at 03:02:56PM -0700, Alex Williamson wrote:
> > diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
> > index bb24b2f0271e03..e166ad7ce6e755 100644
> > --- a/drivers/vfio/group.c
> > +++ b/drivers/vfio/group.c
> > @@ -133,9 +133,12 @@ static int vfio_group_ioctl_set_container(struct vfio_group *group,
> >  
> >  	iommufd = iommufd_ctx_from_file(f.file);
> >  	if (!IS_ERR(iommufd)) {
> > -		u32 ioas_id;
> > +		if (IS_ENABLED(CONFIG_VFIO_NOIOMMU) &&
> > +		    group->type == VFIO_NO_IOMMU)
> 
> 
> We can't have type == VFIO_NO_IOMMU without CONFIG_VFIO_NOIOMMU in any
> of these cases, so I'm assuming the IS_ENABLED() is just a
> micro-optimization for the compiler here.  It's repeated enough that
> maybe it deserves a macro though.  Thanks,

Yes, I put it in an inline for Yi

And did the other stuff

Thanks,
Jason

      reply	other threads:[~2023-01-18 15:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 20:07 [PATCH v2] vfio: Support VFIO_NOIOMMU with iommufd Jason Gunthorpe
2023-01-11  5:01 ` Tian, Kevin
2023-01-17  5:14 ` Liu, Yi L
2023-01-17 13:33   ` Jason Gunthorpe
2023-01-17 13:51     ` Liu, Yi L
2023-01-17 22:02 ` Alex Williamson
2023-01-18 15:47   ` Jason Gunthorpe [this message]

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=Y8gUgL+VWaL8WOZK@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox