From: Robin Murphy <firstname.lastname@example.org>
To: Bjorn Andersson <email@example.com>,
Will Deacon <firstname.lastname@example.org>
Cc: Rob Clark <email@example.com>,
firstname.lastname@example.org, Sibi Sankar <email@example.com>,
Subject: Re: [PATCH v3 6/8] iommu/arm-smmu: Add impl hook for inherit boot mappings
Date: Tue, 13 Oct 2020 17:47:55 +0100 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
On 2020-10-12 08:31, Bjorn Andersson wrote:
> On Mon 21 Sep 23:08 CEST 2020, Will Deacon wrote:
>> On Sat, Sep 12, 2020 at 10:25:59PM -0500, Bjorn Andersson wrote:
>>> On Fri 11 Sep 12:13 CDT 2020, Robin Murphy wrote:
>>>> On 2020-09-04 16:55, Bjorn Andersson wrote:
>>>>> Add a new operation to allow platform implementations to inherit any
>>>>> stream mappings from the boot loader.
>>>> Is there a reason we need an explicit step for this? The aim of the
>>>> cfg_probe hook is that the SMMU software state should all be set up by then,
>>>> and you can mess about with it however you like before arm_smmu_reset()
>>>> actually commits anything to hardware. I would have thought you could
>>>> permanently steal a context bank, configure it as your bypass hole, read out
>>>> the previous SME configuration and tweak smmu->smrs and smmu->s2crs
>>>> appropriately all together "invisibly" at that point.
>>> I did this because as of 6a79a5a3842b ("iommu/arm-smmu: Call
>>> configuration impl hook before consuming features") we no longer have
>>> setup pgsize_bitmap as we hit cfg_probe, which means that I need to
>>> replicate this logic to set up the iommu_domain.
>>> If I avoid setting up an iommu_domain for the identity context, as you
>>> request in patch 8, this shouldn't be needed anymore.
>>>> If that can't work, I'm very curious as to what I've overlooked.
>>> I believe that will work, I will rework the patches and try it out.
>> Did you get a chance to rework this?
> Finally got a chance to dig through this properly.
> Initial results where positive and with an implementation of cfg_probe
> in qcom_smmu_impl I'm able to probe the arm-smmu driver just fine - and
> display (e.g. efifb) stays alive.
> Unfortunately as the display driver (drivers/gpu/drm/msm) is about to
> probe a new iommu domain is created, which due to its match against
> qcom_smmu_client_of_match becomes of type IOMMU_DOMAIN_IDENTITY.
> This results in a S2CR of BYPASS type, which the firmware intercepts and
> turns the stream into a type FAULT.
> So while the cfg_probe looks very reasonable we're still in need of a
> mechanism to use the fake identity context for the iommu domain
> associated with the display controller.
Yes, we'll still need some kind of hook somewhere to make identity
domains work at all - my point about cfg_probe was to keep the
reservation and configuration of the special identity context, plus the
handling of the initial SME state, simple and entirely internal to the
impl. In terms of where said hook should be, TBH it might actually work
out pretty clean to simply hook GR0 register accesses so you can rewrite
between S2CR bypass entries and translation entries targeting your
reserved context on-the-fly. Failing that, something to massage "type"
and "cbndx" in arm_smmu_domain_add_master() would be the next best
option, I think.
> The workings of the display driver is that it gets the iommu domain
> setup for byass and then after that creates a translation context for
> this same stream where it maps the framebuffer.
> For testing purposes I made def_domain_type always return 0 in the qcom
> impl and the result is that we get a few page faults while probing the
> display driver, but these are handled somewhat gracefully and the
> initialization did proceed and the system comes up nicely (but in the
> case that the display driver would probe defer this leads to an storm of
> faults as the screen continues to be refreshed).
> TL;DR I think we still need to have a way to get the arm-smmu driver to
> allow the qcom implementation to configure identity domains to use
> translation - but we can make the setup of the identity context a detail
> of the qcom driver.
iommu mailing list
next prev parent reply other threads:[~2020-10-13 16:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 15:55 [PATCH v3 0/8] iommu/arm-smmu: Support maintaining bootloader mappings Bjorn Andersson
2020-09-04 15:55 ` [PATCH v3 1/8] iommu/arm-smmu: Refactor context bank allocation Bjorn Andersson
2020-09-08 18:42 ` Jordan Crouse
2020-09-08 18:46 ` Jordan Crouse
2020-09-11 8:18 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 2/8] iommu/arm-smmu: Delay modifying domain during init Bjorn Andersson
2020-09-11 8:20 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 3/8] iommu/arm-smmu: Consult context bank allocator for identify domains Bjorn Andersson
2020-09-11 8:21 ` Sai Prakash Ranjan
2020-09-11 8:24 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 4/8] iommu/arm-smmu-qcom: Emulate bypass by using context banks Bjorn Andersson
2020-09-11 8:25 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 5/8] iommu/arm-smmu-qcom: Consistently initialize stream mappings Bjorn Andersson
2020-09-11 8:26 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 6/8] iommu/arm-smmu: Add impl hook for inherit boot mappings Bjorn Andersson
2020-09-11 8:27 ` Sai Prakash Ranjan
2020-09-11 17:13 ` Robin Murphy
2020-09-13 3:25 ` Bjorn Andersson
2020-09-21 21:08 ` Will Deacon
2020-09-24 15:55 ` Bjorn Andersson
2020-10-12 7:31 ` Bjorn Andersson
2020-10-13 16:47 ` Robin Murphy [this message]
2020-09-04 15:55 ` [PATCH v3 7/8] iommu/arm-smmu: Provide helper for allocating identity domain Bjorn Andersson
2020-09-11 8:28 ` Sai Prakash Ranjan
2020-09-04 15:55 ` [PATCH v3 8/8] iommu/arm-smmu-qcom: Setup identity domain for boot mappings Bjorn Andersson
2020-09-11 8:29 ` Sai Prakash Ranjan
2020-09-11 17:29 ` Robin Murphy
2020-09-05 22:27 ` [PATCH v3 0/8] iommu/arm-smmu: Support maintaining bootloader mappings Rob Clark
2020-09-09 14:46 ` Laurentiu Tudor
2020-09-10 22:56 ` John Stultz
2020-09-11 8:16 ` Sai Prakash Ranjan
2020-09-11 16:10 ` Amit Pundir
2020-09-16 10:09 ` Laurentiu Tudor
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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).