[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260126190935.GV1134360@nvidia.com>
Date: Mon, 26 Jan 2026 15:09:35 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Robin Murphy <robin.murphy@....com>
Cc: Will Deacon <will@...nel.org>, Nicolin Chen <nicolinc@...dia.com>,
bhelgaas@...gle.com, joro@...tes.org, praan@...gle.com,
baolu.lu@...ux.intel.com, kevin.tian@...el.com,
miko.lenczewski@....com, linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH RFCv1 3/3] iommu/arm-smmu-v3: Allow ATS to be always on
On Mon, Jan 26, 2026 at 06:49:07PM +0000, Robin Murphy wrote:
> (assuming SSIDSIZE > 0 and it does anything at all - note that strictly we
> cannot assume this bypass trick is *always* possible, since an SMMU is
> permitted to support ATS without supporting SubStreams).
Yes, I think Nicolin has captured those conditions in computing
it... We don't have a logic to disable bypass in that case though.
> > So, I think a CD table pointer to a fully invalid L1 table of at least
> > size 1 should be OK?
> >
> > Or stated another way, why would ie be OK to have a 1 level table with
> > an non-valid CD table entry for SSID0 but not OK to have a 2 level
> > table that returns non-valid at the first walk?
>
> S1ContextPtr itself is reachable since S1 is enabled, so it cannot point to
> nonsense. But the S1DSS==Bypass behaviour does state:
> "Note: Such a transaction does not fetch a CD, and therefore does not report
> F_CD_FETCH, C_BAD_CD or a stage 2 Translation-related fault with CLASS ==
> CD."
Yes
However, taken together:
* S1CDMax is set to substream 0 only
* S1DSS is set such that "does not fetch a CD" for SSID = 0
* SSID >0 doesn't fetch CDs because of S1CDMax
Then it seems to be saying that it will never use S1ContextPtr? ie it
is IGNORED?
> So if we're not intending to actually allow traffic on the SubStream(s),
> then it should be fine to use either a 1-level table of invalid CDs, or a
> 2-level format with an empty L1CD table to gracefully terminate any config
> prefetches.
Yes, so arm_smmu_alloc_cd_tables() is fine since it creates a valid
value for S1ContextPtr such that any future use can happen without
changing S1ContextPtr.
Jason
Powered by blists - more mailing lists