From: Jason Gunthorpe <jgg@nvidia.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org,
Robin Murphy <robin.murphy@arm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Lu Baolu <baolu.lu@linux.intel.com>,
Kevin Tian <kevin.tian@intel.com>, Joerg Roedel <jroedel@suse.de>,
Fabiano Rosas <farosas@linux.ibm.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
Murilo Opsfelder Araujo <muriloo@linux.ibm.com>,
Alex Williamson <alex.williamson@redhat.com>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH kernel] powerpc/iommu: Add simple iommu_ops to report capabilities
Date: Tue, 5 Jul 2022 08:57:51 -0300 [thread overview]
Message-ID: <YsQnP/jBG22FnPMA@nvidia.com> (raw)
In-Reply-To: <20220705062235.2276125-1-aik@ozlabs.ru>
On Tue, Jul 05, 2022 at 04:22:35PM +1000, Alexey Kardashevskiy wrote:
> I have not looked into the domains for ages, what is missing here? With this
> on top of 5.19-rc1 VFIO works again on my POWER9 box. Thanks,
Does this solve all the problems or just coherency? It seems like it
should solve everything now as there will be a IOMMU_DOMAIN_BLOCKED
and the ref logic will succeed to assign it?
> +static struct iommu_domain *spapr_tce_iommu_domain_alloc(unsigned int type)
> +{
> + struct iommu_domain *domain = kzalloc(sizeof(*domain), GFP_KERNEL);
> +
> + if (!domain)
> + return NULL;
This should only succeed if type is IOMMU_DOMAIN_BLOCKED
> +static struct iommu_group *spapr_tce_iommu_device_group(struct device *dev)
> +{
> + struct iommu_group *grp = dev->iommu_group;
> +
> + if (!grp)
> + grp = ERR_PTR(-ENODEV);
It looks like this should just always fail since the code code already
checks iommu_group before calling this? (Arguably ppc should be
refactored to use the normal probe_device and device_group ops to
create groups, but that doesn't seem critical for this.
Thanks
Jason
prev parent reply other threads:[~2022-07-05 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 6:22 [PATCH kernel] powerpc/iommu: Add simple iommu_ops to report capabilities Alexey Kardashevskiy
2022-07-05 9:41 ` Robin Murphy
2022-07-05 11:57 ` 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=YsQnP/jBG22FnPMA@nvidia.com \
--to=jgg@nvidia.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=baolu.lu@linux.intel.com \
--cc=danielhb413@gmail.com \
--cc=farosas@linux.ibm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jroedel@suse.de \
--cc=kevin.tian@intel.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=muriloo@linux.ibm.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