linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Why doesn't arm-smmu (v2) driver take VA_BITS into consideration?
@ 2019-06-27  0:19 Nicolin Chen
  2019-06-27 10:26 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolin Chen @ 2019-06-27  0:19 UTC (permalink / raw)
  To: robin.murphy, will.deacon; +Cc: linux-arm-kernel

Hello Will/Robin,

I am using an Soc that contains arm-smmu v2 engines. I found that
the arm-smmu driver reads GR_ID2 register and defines ias and oas
of each domain based on the corresponding fields of that GR_ID2.

Using my platform for example, it gets 48-bit for all ias and oas,
being translated from those fields so I got these 2 stages:
        Stage-1: 48-bit VA -> 48-bit IPA
        Stage-2: 48-bit IPA -> 48-bit PA

Then the code does below to configure aperture_end to 48-bit:
 914         domain->geometry.aperture_end = (1UL << ias) - 1;

However, my system configures VA_BITS to 39. So aperture_end==48
is a mismatch comparing to VA_BITS_39. Although the aperture_end
is supposed to cap IOVA allocation, this 48-bit cap won't really
do the job at all.

I saw that arm-smmu-v3 driver takes VA_BITS into consideration:
 1765         switch (smmu_domain->stage) {
 1766         case ARM_SMMU_DOMAIN_S1:
 1767                 ias = (smmu->features & ARM_SMMU_FEAT_VAX) ?
 1768                 ias = min_t(unsigned long, ias, VA_BITS);

So I am wondering if it is intentionally designed so by ignoring
VA_BITS? Would you please help me understand this a bit?

Thank you
Nicolin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-28  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27  0:19 Why doesn't arm-smmu (v2) driver take VA_BITS into consideration? Nicolin Chen
2019-06-27 10:26 ` Will Deacon
2019-06-28  8:10   ` Nicolin Chen

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).