From: Jason Gunthorpe <jgg@nvidia.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Yan Zhao <yan.y.zhao@intel.com>,
Kevin Tian <kevin.tian@intel.com>
Subject: Re: [ANNOUNCE] PUCK Notes - 2024.01.24 - Memtypes for non-coherent DMA
Date: Wed, 24 Jan 2024 15:42:27 -0400 [thread overview]
Message-ID: <20240124194227.GK1455070@nvidia.com> (raw)
In-Reply-To: <20240124182444.2598714-1-seanjc@google.com>
On Wed, Jan 24, 2024 at 10:24:44AM -0800, Sean Christopherson wrote:
> - ARM's architecture doesn't guarantee coherency for mismatched memtypes, so
> KVM still needs to figure out a solution for ARM, and possibly RISC-V as
> well. But for CPU<->CPU access, KVM guarantees host safety, just not
> functional correctness for the guest, i.e. finding a solution can likely be
> deferred until a use case comes along.
Regarding the side discussion on ARM DMA coherency enforcement..
Reading the docs more fully, SMMU has no analog to the Intel/AMD
per-page "ignore no snoop" functionality. The driver does the correct
things at the IOMMU API level to indicate this.
Various things say SMMU should map PCIe No Snoop to Normal-iNC-oNC-OSH
on the output transaction.
ARM docs recommend that the VMM clear the "No Snoop Enable" in the PCI
endpoint config space if they want to block No Snoop. I guess this
works for everything and is something we should think about
generically in VFIO to better support iommu drivers that lack
IOMMU_CAP_ENFORCE_CACHE_COHERENCY.
ARM KVM probably needs to do something with
kvm_arch_register_noncoherent_dma() to understand that the VM can
still make the cache incoherent even if FWB is set.
Relatedly the SMMU nested translation design is similar to KVM where
the S1 can contribute memory attributes. The STE.S2FWB behaves
similarly to the KVM where it prevents the S1 from overriding
cachable in the S2.
The nested patches are still to be posted but the current draft does
not set S2FWB, I will get that fixed.
We may have another vfio/iommufd/smmu issue where non-RAM pages are
mapped into the SMMU with IOMMU_CACHABLE, unclear when this would be
practically important but it seems wrong.
Jason
prev parent reply other threads:[~2024-01-24 19:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 18:24 [ANNOUNCE] PUCK Notes - 2024.01.24 - Memtypes for non-coherent DMA Sean Christopherson
2024-01-24 19:42 ` 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=20240124194227.GK1455070@nvidia.com \
--to=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=yan.y.zhao@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