From: Robin Murphy <robin.murphy@arm.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
Alex Williamson <alex.williamson@redhat.com>
Cc: Manoj Vishwanathan <manojvishy@google.com>,
Will Deacon <will@kernel.org>, Joerg Roedel <joro@8bytes.org>,
linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
David Dillow <dillow@google.com>
Subject: Re: [PATCH v1 0/4] vfio/iommu: Flag to allow userspace to set DMA buffers system cacheable
Date: Tue, 27 Aug 2024 18:31:17 +0100 [thread overview]
Message-ID: <a0cfcbe4-cab4-48b2-bcba-0bc28d97e996@arm.com> (raw)
In-Reply-To: <20240826231749.GM3773488@nvidia.com>
On 27/08/2024 12:17 am, Jason Gunthorpe wrote:
> On Mon, Aug 26, 2024 at 11:04:47AM -0600, Alex Williamson wrote:
>> On Mon, 26 Aug 2024 07:16:37 +0000
>> Manoj Vishwanathan <manojvishy@google.com> wrote:
>>
>>> Hi maintainers,
>>>
>>> This RFC patch introduces the ability for userspace to control whether
>>> device (DMA) buffers are marked as cacheable, enabling them to utilize
>>> the system-level cache.
>>>
>>> The specific changes made in this patch are:
>>>
>>> * Introduce a new flag in `include/linux/iommu.h`:
>>> * `IOMMU_SYS_CACHE` - Indicates if the associated page should be cached in the system's cache hierarchy.
>>> * Add `VFIO_DMA_MAP_FLAG_SYS_CACHE` to `include/uapi/linux/vfio.h`:
>
> You'll need a much better description of what this is supposed to do
> when you resend it.
>
> IOMMU_CACHE already largely means that pages should be cached.
>
> So I don't know what ARM's "INC_OCACHE" actually is doing. Causing
> writes to land in a cache somewhere in hierarchy? Something platform
> specific?
Kinda both - the Inner Non-Cacheable attribute means it's still
fundamentally non-snooping and non-coherent with CPU caches, but the
Outer Write-back Write-allocate attribute can still control allocation
in a system cache downstream of the point of coherency if the platform
is built with such a thing (it's not overly common).
However, as you point out, this is in direct conflict with the Inner
Write-back Write-allocate attribute implied by the IOMMU_CACHE which
VFIO adds in further down in vfio_iommu_map(). Plus the way it's
actually implemented in patch #2, IOMMU_CACHE still takes precedence and
would lead to this new value being completely ignored, so there's a lot
which smells suspicious here...
Thanks,
Robin.
> I have no idea. By your description it sounds similar to the
> x86 data placement stuff, whatever that was called, and the more
> modern TPH approach.
>
> Jason
next prev parent reply other threads:[~2024-08-27 17:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 7:16 [PATCH v1 0/4] vfio/iommu: Flag to allow userspace to set DMA buffers system cacheable Manoj Vishwanathan
2024-08-26 7:16 ` [PATCH v1 1/4] iommu: Add IOMMU_SYS_CACHE flag for system cache control Manoj Vishwanathan
2024-08-26 7:16 ` [PATCH v1 2/4] iommu/io-pgtable-arm: Force outer cache for page-level MAIR via user flag Manoj Vishwanathan
2024-08-26 7:16 ` [PATCH v1 3/4] vfio: Add VFIO_DMA_MAP_FLAG_SYS_CACHE to control device access to system cache Manoj Vishwanathan
2024-08-26 7:16 ` [PATCH v1 4/4] vfio/type1: Add support for VFIO_DMA_MAP_FLAG_SYS_CACHE Manoj Vishwanathan
2024-08-26 17:04 ` [PATCH v1 0/4] vfio/iommu: Flag to allow userspace to set DMA buffers system cacheable Alex Williamson
2024-08-26 17:36 ` Manoj Vishwanathan
2024-08-26 23:17 ` Jason Gunthorpe
2024-08-27 17:31 ` Robin Murphy [this message]
2024-08-28 2:55 ` Manoj Vishwanathan
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=a0cfcbe4-cab4-48b2-bcba-0bc28d97e996@arm.com \
--to=robin.murphy@arm.com \
--cc=alex.williamson@redhat.com \
--cc=dillow@google.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manojvishy@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).