From: Jason Gunthorpe <jgg@nvidia.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Joerg Roedel <jroedel@suse.de>,
kvm@vger.kernel.org, Fabiano Rosas <farosas@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org,
Daniel Henrique Barboza <danielhb413@gmail.com>,
Nicholas Piggin <npiggin@gmail.com>,
Murilo Opsfelder Araujo <muriloo@linux.ibm.com>,
kvm-ppc@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
Oliver O'Halloran <oohall@gmail.com>,
Joel Stanley <joel@jms.id.au>,
Robin Murphy <robin.murphy@arm.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains
Date: Sun, 10 Jul 2022 03:29:51 -0300 [thread overview]
Message-ID: <Yspx307fxRXT67XG@nvidia.com> (raw)
In-Reply-To: <8329c51a-601e-0d93-41b4-2eb8524c9bcb@ozlabs.ru>
On Sat, Jul 09, 2022 at 12:58:00PM +1000, Alexey Kardashevskiy wrote:
> driver->ops->attach_group on POWER attaches a group so VFIO claims ownership
> over a group, not devices. Underlying API (pnv_ioda2_take_ownership()) does
> not need to keep track of the state, it is one group, one ownership
> transfer, easy.
It should not change, I think you can just map the attach_dev to the group?
> What is exactly the reason why iommu_group_claim_dma_owner() cannot stay
> inside Type1 (sorry if it was explained, I could have missed)?
It has nothing to do with type1 - the ownership system is designed to
exclude other in-kernel drivers from using the group at the same time
vfio is using the group. power still needs this protection regardless
of if is using the formal iommu api or not.
> Also, from another mail, you said iommu_alloc_default_domain() should fail
> on power but at least IOMMU_DOMAIN_BLOCKED must be supported, or the whole
> iommu_group_claim_dma_owner() thing falls apart.
Yes
> And iommu_ops::domain_alloc() is not told if it is asked to create a default
> domain, it only takes a type.
"default domain" refers to the default type pased to domain_alloc(),
it will never be blocking, so it will always fail on power.
"default domain" is better understood as the domain used by the DMA
API
Jason
next prev parent reply other threads:[~2022-07-10 6:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 13:55 [PATCH kernel] powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains Alexey Kardashevskiy
2022-07-07 15:10 ` Jason Gunthorpe
2022-07-08 5:00 ` Alexey Kardashevskiy
2022-07-08 6:34 ` Alexey Kardashevskiy
2022-07-08 7:32 ` Tian, Kevin
2022-07-08 9:45 ` Alexey Kardashevskiy
2022-07-08 10:18 ` Tian, Kevin
2022-07-29 2:21 ` Alexey Kardashevskiy
2022-07-29 2:53 ` Oliver O'Halloran
2022-07-29 3:10 ` Tian, Kevin
2022-07-29 3:50 ` Alexey Kardashevskiy
2022-07-29 4:24 ` Tian, Kevin
2022-07-29 12:09 ` Jason Gunthorpe
2022-07-08 11:55 ` Jason Gunthorpe
2022-07-08 13:10 ` Alexey Kardashevskiy
2022-07-08 13:19 ` Jason Gunthorpe
2022-07-08 13:32 ` Alexey Kardashevskiy
2022-07-08 13:59 ` Jason Gunthorpe
2022-07-09 2:58 ` Alexey Kardashevskiy
2022-07-10 6:29 ` Jason Gunthorpe [this message]
2022-07-10 12:32 ` Alexey Kardashevskiy
2022-07-11 13:24 ` Alexey Kardashevskiy
2022-07-11 18:46 ` Jason Gunthorpe
2022-07-12 2:27 ` Alexey Kardashevskiy
2022-07-12 5:44 ` 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=Yspx307fxRXT67XG@nvidia.com \
--to=jgg@nvidia.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=farosas@linux.ibm.com \
--cc=joel@jms.id.au \
--cc=jroedel@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=muriloo@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).