From: Jason Gunthorpe via iommu <iommu@lists.linux-foundation.org>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Will Deacon <will@kernel.org>, Cornelia Huck <cohuck@redhat.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Christoph Hellwig <hch@lst.de>,
Alex Williamson <alex.williamson@redhat.com>,
Robin Murphy <robin.murphy@arm.com>,
David Woodhouse <dwmw2@infradead.org>,
Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v2 3/4] iommu: Redefine IOMMU_CAP_CACHE_COHERENCY as the cap flag for IOMMU_CACHE
Date: Fri, 8 Apr 2022 09:21:10 -0300 [thread overview]
Message-ID: <20220408122110.GU2120790@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB527673C3360785759CEFF5708CE99@BN9PR11MB5276.namprd11.prod.outlook.com>
On Fri, Apr 08, 2022 at 08:21:55AM +0000, Tian, Kevin wrote:
> (CC Jason Wang)
>
> > From: Jason Gunthorpe
> > Sent: Thursday, April 7, 2022 11:24 PM
> >
> > While the comment was correct that this flag was intended to convey the
> > block no-snoop support in the IOMMU, it has become widely implemented
> > and
> > used to mean the IOMMU supports IOMMU_CACHE as a map flag. Only the
> > Intel
> > driver was different.
> >
> > Now that the Intel driver is using enforce_cache_coherency() update the
> > comment to make it clear that IOMMU_CAP_CACHE_COHERENCY is only
> > about
> > IOMMU_CACHE. Fix the Intel driver to return true since IOMMU_CACHE
> > always
> > works.
> >
> > The two places that test this flag, usnic and vdpa, are both assigning
> > userspace pages to a driver controlled iommu_domain and require
> > IOMMU_CACHE behavior as they offer no way for userspace to synchronize
> > caches.
> >
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
>
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
>
> btw the comment about vsnic and vdpa matches my thought. But
> a recent change in Qemu [1] possibly wants confirmation from
> Jason Wang.
>
> [1] https://lore.kernel.org/all/20220304133556.233983-20-mst@redhat.com/
That patch seems to have run into the confusion this series is
addressing.
VFIO_DMA_CC_IOMMU and snoop control is absolutely not needed by
VDPA. We expect the VDPA kernel driver to be well behaved and not
cause its device to generate no-snoop TLPs.
VDPA needs IOMMU_CACHE only.
Jason
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
Cornelia Huck <cohuck@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Joerg Roedel <joro@8bytes.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Will Deacon <will@kernel.org>, Jason Wang <jasowang@redhat.com>,
Robin Murphy <robin.murphy@arm.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 3/4] iommu: Redefine IOMMU_CAP_CACHE_COHERENCY as the cap flag for IOMMU_CACHE
Date: Fri, 8 Apr 2022 09:21:10 -0300 [thread overview]
Message-ID: <20220408122110.GU2120790@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB527673C3360785759CEFF5708CE99@BN9PR11MB5276.namprd11.prod.outlook.com>
On Fri, Apr 08, 2022 at 08:21:55AM +0000, Tian, Kevin wrote:
> (CC Jason Wang)
>
> > From: Jason Gunthorpe
> > Sent: Thursday, April 7, 2022 11:24 PM
> >
> > While the comment was correct that this flag was intended to convey the
> > block no-snoop support in the IOMMU, it has become widely implemented
> > and
> > used to mean the IOMMU supports IOMMU_CACHE as a map flag. Only the
> > Intel
> > driver was different.
> >
> > Now that the Intel driver is using enforce_cache_coherency() update the
> > comment to make it clear that IOMMU_CAP_CACHE_COHERENCY is only
> > about
> > IOMMU_CACHE. Fix the Intel driver to return true since IOMMU_CACHE
> > always
> > works.
> >
> > The two places that test this flag, usnic and vdpa, are both assigning
> > userspace pages to a driver controlled iommu_domain and require
> > IOMMU_CACHE behavior as they offer no way for userspace to synchronize
> > caches.
> >
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
>
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
>
> btw the comment about vsnic and vdpa matches my thought. But
> a recent change in Qemu [1] possibly wants confirmation from
> Jason Wang.
>
> [1] https://lore.kernel.org/all/20220304133556.233983-20-mst@redhat.com/
That patch seems to have run into the confusion this series is
addressing.
VFIO_DMA_CC_IOMMU and snoop control is absolutely not needed by
VDPA. We expect the VDPA kernel driver to be well behaved and not
cause its device to generate no-snoop TLPs.
VDPA needs IOMMU_CACHE only.
Jason
next prev parent reply other threads:[~2022-04-08 12:21 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 15:23 [PATCH v2 0/4] Make the iommu driver no-snoop block feature consistent Jason Gunthorpe via iommu
2022-04-07 15:23 ` Jason Gunthorpe
2022-04-07 15:23 ` [PATCH v2 1/4] iommu: Introduce the domain op enforce_cache_coherency() Jason Gunthorpe via iommu
2022-04-07 15:23 ` Jason Gunthorpe
2022-04-08 8:05 ` Tian, Kevin
2022-04-08 8:05 ` Tian, Kevin
2022-04-09 12:44 ` Lu Baolu
2022-04-09 12:44 ` Lu Baolu
2022-04-11 14:11 ` Jason Gunthorpe via iommu
2022-04-11 14:11 ` Jason Gunthorpe
2022-04-08 8:27 ` Tian, Kevin
2022-04-08 8:27 ` Tian, Kevin
2022-04-07 15:23 ` [PATCH v2 2/4] vfio: Move the Intel no-snoop control off of IOMMU_CACHE Jason Gunthorpe via iommu
2022-04-07 15:23 ` Jason Gunthorpe
2022-04-08 8:16 ` Tian, Kevin
2022-04-08 8:16 ` Tian, Kevin
2022-04-09 12:50 ` Lu Baolu
2022-04-09 12:50 ` Lu Baolu
2022-04-12 7:44 ` Tian, Kevin
2022-04-12 7:44 ` Tian, Kevin
2022-04-12 13:13 ` Lu Baolu
2022-04-12 13:13 ` Lu Baolu
2022-04-12 13:20 ` Jason Gunthorpe via iommu
2022-04-12 13:20 ` Jason Gunthorpe
2022-04-12 23:04 ` Tian, Kevin
2022-04-12 23:04 ` Tian, Kevin
2022-04-13 11:37 ` Lu Baolu
2022-04-13 11:37 ` Lu Baolu
2022-04-08 15:47 ` Alex Williamson
2022-04-08 15:47 ` Alex Williamson
2022-04-11 14:13 ` Jason Gunthorpe via iommu
2022-04-11 14:13 ` Jason Gunthorpe
2022-04-07 15:23 ` [PATCH v2 3/4] iommu: Redefine IOMMU_CAP_CACHE_COHERENCY as the cap flag for IOMMU_CACHE Jason Gunthorpe via iommu
2022-04-07 15:23 ` Jason Gunthorpe
2022-04-08 8:21 ` Tian, Kevin
2022-04-08 8:21 ` Tian, Kevin
2022-04-08 12:21 ` Jason Gunthorpe via iommu [this message]
2022-04-08 12:21 ` Jason Gunthorpe
2022-04-09 12:51 ` Lu Baolu
2022-04-09 12:51 ` Lu Baolu
2022-04-07 15:23 ` [PATCH v2 4/4] vfio: Require that devices support DMA cache coherence Jason Gunthorpe via iommu
2022-04-07 15:23 ` Jason Gunthorpe
2022-04-08 8:26 ` Tian, Kevin
2022-04-08 8:26 ` Tian, Kevin
2022-04-08 12:22 ` Jason Gunthorpe via iommu
2022-04-08 12:22 ` Jason Gunthorpe
2022-04-08 13:28 ` Robin Murphy
2022-04-08 13:28 ` Robin Murphy
2022-04-08 13:37 ` Jason Gunthorpe via iommu
2022-04-08 13:37 ` Jason Gunthorpe
2022-04-08 15:48 ` Alex Williamson
2022-04-08 15:48 ` Alex Williamson
2022-07-01 4:57 ` Alexey Kardashevskiy
2022-07-01 4:57 ` Alexey Kardashevskiy
2022-07-01 6:07 ` Tian, Kevin
2022-07-01 6:07 ` Tian, Kevin
2022-07-01 6:24 ` Alexey Kardashevskiy
2022-07-01 6:24 ` Alexey Kardashevskiy
2022-04-07 17:03 ` [PATCH v2 0/4] Make the iommu driver no-snoop block feature consistent Robin Murphy
2022-04-07 17:03 ` Robin Murphy
2022-04-07 17:43 ` Jason Gunthorpe via iommu
2022-04-07 17:43 ` Jason Gunthorpe
2022-04-07 18:02 ` Robin Murphy
2022-04-07 18:02 ` Robin Murphy
2022-04-07 19:08 ` Jason Gunthorpe via iommu
2022-04-07 19:08 ` Jason Gunthorpe
2022-04-07 19:27 ` Robin Murphy
2022-04-07 19:27 ` Robin Murphy
2022-04-08 12:18 ` Jason Gunthorpe via iommu
2022-04-08 12:18 ` Jason Gunthorpe
2022-04-08 13:11 ` Robin Murphy
2022-04-08 13:11 ` Robin Murphy
2022-04-08 13:35 ` Jason Gunthorpe via iommu
2022-04-08 13:35 ` Jason Gunthorpe
2022-04-08 17:44 ` Robin Murphy
2022-04-08 17:44 ` Robin Murphy
2022-04-12 2:51 ` Tian, Kevin
2022-04-12 2:51 ` Tian, Kevin
2022-04-08 9:08 ` Tian, Kevin
2022-04-08 9:08 ` Tian, Kevin
2022-04-08 10:11 ` Robin Murphy
2022-04-08 10:11 ` Robin Murphy
2022-04-12 2:49 ` Tian, Kevin
2022-04-12 2:49 ` Tian, Kevin
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=20220408122110.GU2120790@nvidia.com \
--to=iommu@lists.linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=dwmw2@infradead.org \
--cc=hch@lst.de \
--cc=jasowang@redhat.com \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/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.