mbox series

[0/3] iommu/arm-smmu: Qualcomm bootsplash/efifb

Message ID 20191226221709.3844244-1-bjorn.andersson@linaro.org
Headers show
Series iommu/arm-smmu: Qualcomm bootsplash/efifb | expand

Message

Bjorn Andersson Dec. 26, 2019, 10:17 p.m. UTC
These patches implements the stream mapping inheritance that's necessary in
order to not hit a security violation as the display hardware looses its stream
mapping during initialization of arm-smmu in various Qualcomm platforms.

This was previously posted as an RFC [1], changes since then involves the
rebase and migration of the read-back code to the Qualcomm specific
implementation, the mapping is maintained indefinitely - to handle probe
deferring clients - and rewritten commit messages.

[1] https://lore.kernel.org/linux-arm-msm/20190605210856.20677-1-bjorn.andersson@linaro.org/

Bjorn Andersson (3):
  iommu/arm-smmu: Don't blindly use first SMR to calculate mask
  iommu/arm-smmu: Expose s2cr and smr structs to impl
  iommu/arm-smmu: Allow inherting stream mapping from bootloader

 drivers/iommu/arm-smmu-qcom.c | 35 ++++++++++++++++++
 drivers/iommu/arm-smmu.c      | 70 +++++++++++++++++++++++------------
 drivers/iommu/arm-smmu.h      | 15 ++++++++
 3 files changed, 96 insertions(+), 24 deletions(-)

-- 
2.24.0

Comments

Will Deacon Jan. 8, 2020, 9:16 a.m. UTC | #1
On Thu, Dec 26, 2019 at 02:17:06PM -0800, Bjorn Andersson wrote:
> These patches implements the stream mapping inheritance that's necessary in
> order to not hit a security violation as the display hardware looses its stream
> mapping during initialization of arm-smmu in various Qualcomm platforms.
> 
> This was previously posted as an RFC [1], changes since then involves the
> rebase and migration of the read-back code to the Qualcomm specific
> implementation, the mapping is maintained indefinitely - to handle probe
> deferring clients - and rewritten commit messages.

I don't think we should solve this in a Qualcomm-specific manner. Please can
you take a look at the proposal from Thierry [1] and see whether or not it
works for you?

Thanks,

Will

[1] https://lore.kernel.org/lkml/20191209150748.2471814-1-thierry.reding@gmail.com
Robin Murphy May 24, 2021, 12:48 p.m. UTC | #2
On 2021-05-24 13:03, Lee Jones wrote:
> On Wed, 8 Jan 2020 at 09:16, Will Deacon <will@kernel.org> wrote:

> 

>> On Thu, Dec 26, 2019 at 02:17:06PM -0800, Bjorn Andersson wrote:

>>> These patches implements the stream mapping inheritance that's necessary

>> in

>>> order to not hit a security violation as the display hardware looses its

>> stream

>>> mapping during initialization of arm-smmu in various Qualcomm platforms.

>>>

>>> This was previously posted as an RFC [1], changes since then involves the

>>> rebase and migration of the read-back code to the Qualcomm specific

>>> implementation, the mapping is maintained indefinitely - to handle probe

>>> deferring clients - and rewritten commit messages.

>>

>> I don't think we should solve this in a Qualcomm-specific manner. Please

>> can

>> you take a look at the proposal from Thierry [1] and see whether or not it

>> works for you?

>>

> 

> Did this or Thierry's solution ever gain traction?

> 

> Or are all the parties still 'solving' this downstream?


I think this particular series is what eventually ended up upstream as 
07a7f2caaa5a and f9081b8ff593 (plus a couple of tweaks later). Progress 
is slow on the more general solution, but still happening - I see there 
was a new version recently which I've not had time to properly look at yet.

Robin.
Bjorn Andersson May 25, 2021, 3:28 a.m. UTC | #3
On Mon 24 May 07:03 CDT 2021, Lee Jones wrote:

> On Wed, 8 Jan 2020 at 09:16, Will Deacon <will@kernel.org> wrote:

> 

> > On Thu, Dec 26, 2019 at 02:17:06PM -0800, Bjorn Andersson wrote:

> > > These patches implements the stream mapping inheritance that's necessary

> > in

> > > order to not hit a security violation as the display hardware looses its

> > stream

> > > mapping during initialization of arm-smmu in various Qualcomm platforms.

> > >

> > > This was previously posted as an RFC [1], changes since then involves the

> > > rebase and migration of the read-back code to the Qualcomm specific

> > > implementation, the mapping is maintained indefinitely - to handle probe

> > > deferring clients - and rewritten commit messages.

> >

> > I don't think we should solve this in a Qualcomm-specific manner. Please

> > can

> > you take a look at the proposal from Thierry [1] and see whether or not it

> > works for you?

> >

> 

> Did this or Thierry's solution ever gain traction?

> 


There was a few pieces that landed in the common code which allowed us
to deal with the quirks of the Qualcomm platform (turned out that just
reading back the settings wasn't the only piece necessary).

The "generic" solution is essentially the second half of
qcom_smmu_cfg_probe(), which ensures that as the SMMU is reset it will
do so with bypass mappings for all stream mappings the boot loader left
us.

> Or are all the parties still 'solving' this downstream?

> 


I believe that Qualcomm has adopted the upstream solution in their
downstream kernel.

Regards,
Bjorn