From: Robin Murphy <robin.murphy@arm.com>
To: Krishna Reddy <vdumpa@nvidia.com>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: Timo Alho <talho@nvidia.com>, Thierry Reding <treding@nvidia.com>,
Bryan Huntsman <bhuntsman@nvidia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Mikko Perttunen <mperttunen@nvidia.com>,
"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
Sachin Nikam <Snikam@nvidia.com>,
Nicolin Chen <nicolinc@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Yu-Huan Hsu <YHsu@nvidia.com>,
Pritesh Raithatha <praithatha@nvidia.com>,
"will@kernel.org" <will@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Bitan Biswas <bbiswas@nvidia.com>
Subject: Re: [PATCH v8 3/3] iommu/arm-smmu: Add global/context fault implementation hooks
Date: Wed, 1 Jul 2020 20:14:10 +0100 [thread overview]
Message-ID: <446ffe79-3a44-5d41-459f-b698a1cc361b@arm.com> (raw)
In-Reply-To: <BYAPR12MB282244D2B008E1C8CA57916BB36C0@BYAPR12MB2822.namprd12.prod.outlook.com>
On 2020-07-01 19:48, Krishna Reddy wrote:
>>>> + for (inst = 0; inst < nvidia_smmu->num_inst; inst++) {
>>>> + irq_ret = nvidia_smmu_global_fault_inst(irq, smmu, inst);
>>>> + if (irq_ret == IRQ_HANDLED)
>>>> + return irq_ret;
>>>
>>> Any chance there could be more than one SMMU faulting by the time we
>>> service the interrupt?
>
>> It certainly seems plausible if the interconnect is automatically load-balancing requests across the SMMU instances - say a driver bug caused a buffer to be unmapped too early, there could be many in-flight accesses to parts of that buffer that aren't all taking the same path and thus could now fault in parallel.
>> [ And anyone inclined to nitpick global vs. context faults, s/unmap a buffer/tear down a domain/ ;) ]
>> Either way I think it would be easier to reason about if we just handled these like a typical shared interrupt and always checked all the instances.
>
> It would be optimal to check at the same time across all instances.
>
>>>> + for (idx = 0; idx < smmu->num_context_banks; idx++) {
>>>> + irq_ret = nvidia_smmu_context_fault_bank(irq, smmu,
>>>> + idx,
>>>> + inst);
>>>> +
>>>> + if (irq_ret == IRQ_HANDLED)
>>>> + return irq_ret;
>>>
>>> Any reason why we don't check all banks?
>
>> As above, we certainly shouldn't bail out without checking the bank for the offending domain across all of its instances, and I guess the way this works means that we would have to iterate all the banks to achieve that.
>
> With shared irq line, the context fault identification is not optimal already. Reading all the context banks all the time can be additional mmio read overhead. But, it may not hurt the real use cases as these happen only when there are bugs.
Right, I did ponder the idea of a whole programmatic
"request_context_irq" hook that would allow registering the handler for
both interrupts with the appropriate context bank and instance data, but
since all interrupts are currently unexpected it seems somewhat hard to
justify the extra complexity. Obviously we can revisit this in future if
you want to start actually doing something with faults like the qcom GPU
folks do.
Robin.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-01 19:15 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 0:10 [PATCH v8 0/3] Nvidia Arm SMMUv2 Implementation Krishna Reddy
2020-06-30 0:10 ` [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage Krishna Reddy
2020-06-30 0:16 ` Nicolin Chen
2020-06-30 5:54 ` Pritesh Raithatha
2020-06-30 8:19 ` Jon Hunter
2020-06-30 14:53 ` Robin Murphy
2020-06-30 15:17 ` Jon Hunter
2020-07-01 18:18 ` Krishna Reddy
2020-07-01 18:56 ` Robin Murphy
2020-07-01 19:12 ` Krishna Reddy
2020-06-30 17:04 ` Krishna Reddy
2020-06-30 10:17 ` Jon Hunter
2020-06-30 16:23 ` Krishna Reddy
2020-06-30 16:32 ` Jon Hunter
2020-06-30 16:44 ` Jon Hunter
2020-06-30 17:16 ` Krishna Reddy
2020-06-30 19:03 ` Jon Hunter
2020-06-30 20:21 ` Krishna Reddy
2020-06-30 0:10 ` [PATCH v8 2/3] dt-bindings: arm-smmu: Add binding for Tegra194 SMMU Krishna Reddy
2020-06-30 6:01 ` Pritesh Raithatha
2020-06-30 8:21 ` Jon Hunter
2020-06-30 12:27 ` Robin Murphy
2020-07-01 18:28 ` Krishna Reddy
2020-07-01 18:47 ` Jon Hunter
2020-07-01 19:00 ` Krishna Reddy
2020-07-01 19:31 ` Jon Hunter
2020-07-01 19:39 ` Krishna Reddy
2020-07-02 16:05 ` Robin Murphy
2020-07-01 19:03 ` Robin Murphy
2020-06-30 0:10 ` [PATCH v8 3/3] iommu/arm-smmu: Add global/context fault implementation hooks Krishna Reddy
2020-06-30 0:19 ` Nicolin Chen
2020-06-30 5:58 ` Pritesh Raithatha
2020-06-30 8:37 ` Jon Hunter
2020-06-30 12:13 ` Robin Murphy
2020-06-30 12:42 ` Jon Hunter
2020-07-01 18:48 ` Krishna Reddy
2020-07-01 19:14 ` Robin Murphy [this message]
2020-07-01 19:22 ` Krishna Reddy
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=446ffe79-3a44-5d41-459f-b698a1cc361b@arm.com \
--to=robin.murphy@arm.com \
--cc=Snikam@nvidia.com \
--cc=YHsu@nvidia.com \
--cc=bbiswas@nvidia.com \
--cc=bhuntsman@nvidia.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathanh@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=nicoleotsuka@gmail.com \
--cc=nicolinc@nvidia.com \
--cc=praithatha@nvidia.com \
--cc=talho@nvidia.com \
--cc=treding@nvidia.com \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
/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).