Re: [PATCH 2/3] firmware: qcom: scm: Add function to set the maximum IOMMU pool size

From: AngeloGioacchino Del Regno
Date: Fri Dec 10 2021 - 11:29:01 EST


Il 09/12/21 00:44, Marijn Suijten ha scritto:
On 2021-12-08 07:30:28, Alex Elder wrote:
On 12/8/21 2:34 AM, Marijn Suijten wrote:
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxxx>

This is not necessary for basic functionality of the IOMMU, but
it's an optimization that tells to the TZ what's the maximum
mappable size for the secure IOMMUs, so that it can optimize
the data structures in the TZ itself.

Are there no users of this function? -Alex

I should have probably mentioned in the cover letter that this function
and the one introduced in patch 3/3 are going to be used in upcoming
patches for IOMMUs found in msm8976, msm8974 and related SoCs (with the
side-note that I don't see this particular set_cp_pool_size used in the
branch that this was submitted from, but it's most likely used elsewhere
or planned ahead to be used in the near future - I expect Angelo to be
able to comment on that more accurately).


This function is used in the secured iommu pagetable setup, but not for
all of the "SCM feature versions" (only for version >= 1.1.1, downstream
reads it with a call to scm_feat_version()).

It's not strictly necessary for functionality, hence why Marijn isn't
seeing any call to this in the branch that he was browsing: the spirit here
is to first introduce code that does a minimal (but, of course, working)
setup of the IOMMUs found in MSM8956/76 (which can be adapted with very
minimal changes to other SoCs), and *only then* to add these performance
enhancements to the mix.

...and this is why this commit is here :))

By the way, if my memory isn't failing me, that SCM call should be usable
on all AArch64 SoCs (so, 8956, 8994 and the rest).