[PATCH] iommu/arm-smmu-v3: Add HAFT support for SVA
Robin Murphy
robin.murphy at arm.com
Fri Jul 3 11:57:04 PDT 2026
On 03/07/2026 5:49 pm, Jason Gunthorpe wrote:
> On Wed, Jul 01, 2026 at 06:45:17PM +0100, Robin Murphy wrote:
>
>> @@ -211,6 +213,9 @@ bool arm_smmu_sva_supported(struct arm_smmu_device *smmu)
>> if (system_supports_bbml2_noabort())
>> feat_mask |= ARM_SMMU_FEAT_BBML2;
>>
>> + if (system_supports_haft())
>> + feat_mask |= ARM_SMMU_FEAT_HAFT;
>
> I fear this is going to make SVA stop working on systems it currently
> does work on, so it might be a major regression.
>
> SMMU HTTU is not a commonly implemented feature.. I think of all the
> NVIDIA ARM chips only one supports it. Given that a quick internal
> check is raising concerns this will be breaking for us. We need to
> check in more detail which cores have HAFT.
>
> Breaking already deployed SVA would be a major functional regression.
>
> I think this should start by just enabling SMMU HAFT when CPU HAFT is
> on, when possible. Maybe print a warning on the mismatch instead of
> failing.
>
> Since we can't break already deployed SVA a full solution would either
> have to somehow turn off CPU HAFT or we ignore the gap in the AF
> updates..
TBH I do not know how bad the implications of
pmd_young()/pmdp_test_and_clear_young() returning a false-negative are,
but if we aren't considering mismatched CPUs harmless then surely the
same must apply for SVA. In the POE/GCS cases all that can really be
broken is users' expectations, if they've opted in to additional
security features, but also opted in to SVA wherein those features can't
protect against DMA. Here, though, it's the kernel mm layer itself
that's impacted, and I'm not confident to say that that isn't more serious.
This came about as a sudden "oh crap" moment when answering an internal
query about SMMU features, and it seemed prudent to do _something_ for
the sake of correctness ASAP. Making HAFT depend on !SVA could only
easily be done at the config level, which seems arguably even more
over-reaching, and given that CPUs supporting HAFT aren't common yet -
at least from Arm it seems to be only the big cores of the latest C1
generation so far - in a pinch this felt like the least-worst option for
the short term. If someone has time to look into whether it's possible
to dynamically switch arch_has_hw_nonleaf_pmd_young (and whatever else)
post-init, then that's an obvious follow-up, but I can say for sure that
that someone is not me...
Thanks,
Robin.
More information about the linux-arm-kernel
mailing list