From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: Joerg Roedel <joro@8bytes.org>, Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Will Deacon <Will.Deacon@arm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC] iommu: arm-smmu: stall support
Date: Fri, 22 Sep 2017 11:02:53 +0100 [thread overview]
Message-ID: <32e3ab2c-a996-c805-2a0d-a2e85deb3a50@arm.com> (raw)
In-Reply-To: <20170922090204.GJ8398@8bytes.org>
On 22/09/17 10:02, Joerg Roedel wrote:
> On Tue, Sep 19, 2017 at 10:23:43AM -0400, Rob Clark wrote:
>> I would like to decide in the IRQ whether or not to queue work or not,
>> because when we get a gpu fault, we tend to get 1000's of gpu faults
>> all at once (and I really only need to handle the first one). I
>> suppose that could also be achieved by having a special return value
>> from the fault handler to say "call me again from a wq"..
>>
>> Note that in the drm driver I already have a suitable wq to queue the
>> work, so it really doesn't buy me anything to have the iommu driver
>> toss things off to a wq for me. Might be a different situation for
>> other drivers (but I guess mostly other drivers are using iommu API
>> indirectly via dma-mapping?)
>
> Okay, so since you are the only user for now, we don't need a
> work-queue. But I still want the ->resume call-back to be hidden in the
> iommu code and not be exposed to users.
>
> We already have per-domain fault-handlers, so the best solution for now
> is to call ->resume from report_iommu_fault() when the fault-handler
> returns a special value.
The problem is that report_iommu_fault is called from IRQ context by the
SMMU driver, so the device driver callback cannot sleep.
So if the device driver needs to be able to sleep between fault report and
resume, as I understand Rob needs for writing debugfs, we can either:
* call report_iommu_fault from higher up, in a thread or workqueue.
* split the fault reporting as this patch proposes. The exact same
mechanism is needed for the vSVM work by Intel: in order to inject fault
into the guest, they would like to have an atomic notifier registered by
VFIO for passing down the Page Request, and a new function in the IOMMU
API to resume/complete the fault.
Thanks,
Jean
next prev parent reply other threads:[~2017-09-22 9:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 19:44 [RFC] iommu: arm-smmu: stall support Rob Clark
2017-09-18 11:13 ` Jean-Philippe Brucker
[not found] ` <9c2c136a-8c0f-6196-a135-0135b41c9b6e-5wv7dgnIgG8@public.gmane.org>
2017-09-18 12:11 ` Rob Clark
[not found] ` <CAF6AEGv0WZe-bYXUVYt4WxMX3RFnZxr5038pDg3VOiP8Edx+4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-18 17:33 ` Will Deacon
2017-09-19 12:30 ` Joerg Roedel
2017-09-19 14:23 ` Rob Clark
2017-09-22 9:02 ` Joerg Roedel
2017-09-22 10:02 ` Jean-Philippe Brucker [this message]
2017-09-22 18:42 ` Rob Clark
[not found] ` <CAF6AEGuh0FiNWEAmFm+7-7pc6MV5hKKz9cyA_J0d256bY-nYOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-27 12:15 ` Joerg Roedel
2017-09-27 13:49 ` Jean-Philippe Brucker
2017-09-27 14:35 ` Joerg Roedel
2017-09-27 16:14 ` Rob Clark
2019-05-10 18:23 ` Rob Clark
2019-05-13 18:37 ` Jean-Philippe Brucker
2019-05-14 1:54 ` Rob Clark
2019-05-14 10:24 ` Robin Murphy
2019-05-14 17:17 ` Rob Clark
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=32e3ab2c-a996-c805-2a0d-a2e85deb3a50@arm.com \
--to=jean-philippe.brucker@arm.com \
--cc=Will.Deacon@arm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.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