From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: kevin.tian@intel.com, alex.williamson@redhat.com,
ashok.raj@intel.com, zhangfei.gao@foxmail.com,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
christian.koenig@amd.com
Subject: Re: [PATCH v2 1/1] iommu: Bind process address spaces to devices
Date: Mon, 1 Apr 2019 11:10:23 +0100 [thread overview]
Message-ID: <31f7cee6-730c-7ca1-5107-358b8aa8f7b9@arm.com> (raw)
In-Reply-To: <20190325144241.GC25350@8bytes.org>
Hi Joerg,
On 25/03/2019 14:44, Joerg Roedel wrote:
> Hey Jean-Philippe,
>
> thanks for the patch, I think we are on the finish line with this
> interface. Just one small question below.
>
> On Wed, Mar 20, 2019 at 03:02:58PM +0000, Jean-Philippe Brucker wrote:
>> +int iommu_sva_set_ops(struct iommu_sva *handle,
>> + const struct iommu_sva_ops *sva_ops)
>> +{
>> + const struct iommu_ops *ops = handle->dev->bus->iommu_ops;
>> +
>> + if (!ops || !ops->sva_set_ops)
>> + return -ENODEV;
>> +
>> + return ops->sva_set_ops(handle, sva_ops);
>> +}
>
> What is the purpose of the sva_set_ops call-back in iommu-ops? Is the
> IOMMU driver supposed to do some extra setup work with the provided ops?
> Otherwise we can just store the pointer in 'struct iommu_sva' without
> calling into the iommu driver.
Right that would be simpler. I added the sva_set_ops callback so that
IOMMU driver can use the same lock in unbind() and sva_set_ops(). But I
think it's safe to assume that device drivers don't call unbind() before
setting the ops.
Thanks,
Jean
prev parent reply other threads:[~2019-04-01 10:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 15:02 [PATCH v2 0/1] IOMMU SVA device driver interface Jean-Philippe Brucker
2019-03-20 15:02 ` [PATCH v2 1/1] iommu: Bind process address spaces to devices Jean-Philippe Brucker
2019-03-25 14:44 ` Joerg Roedel
2019-04-01 10:10 ` Jean-Philippe Brucker [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=31f7cee6-730c-7ca1-5107-358b8aa8f7b9@arm.com \
--to=jean-philippe.brucker@arm.com \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=christian.koenig@amd.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zhangfei.gao@foxmail.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).