[PATCH v5 17/27] iommu/arm-smmu-v3-kvm: Probe SMMU HW
Mostafa Saleh
smostafa at google.com
Fri Dec 12 08:07:11 PST 2025
On Fri, Nov 28, 2025 at 01:07:48PM -0400, Jason Gunthorpe wrote:
> On Mon, Nov 17, 2025 at 06:48:04PM +0000, Mostafa Saleh wrote:
>
> > +/*
> > + * Mini-probe and validation for the hypervisor.
> > + */
> > +static int smmu_probe(struct hyp_arm_smmu_v3_device *smmu)
> > +{
> > + u32 reg;
> > +
> > + /* IDR0 */
> > + reg = readl_relaxed(smmu->base + ARM_SMMU_IDR0);
> > + smmu->features = smmu_idr0_features(reg);
> > +
> > + /*
> > + * Some MMU600 and MMU700 have errata that prevent them from using nesting,
> > + * not sure how can we identify those, so it's recommended not to enable this
> > + * drivers on such systems.
> > + * And preventing any of those will be too restrictive
> > + */
>
> This driver is doing nesting though ??
>
> Shouldn't you detect those IPs and not support a S1 at all so there is
> no nesting? Identity only?
I can see that the errarta are fixed in r1p1, and from the MMU-700 TRM,
we can extract this information from IIDR[1], I guess we can allow
nesting for all SMMUs except the one affected. Actually we can do that
at the moment from the main driver too, I can prepare a patch for that.
However nesting is still mandatroy, the fallback path for the KVM driver
if nesting is not supported (just S2 for example) is to fail and let the
upstream driver probe the platform devices with KVM out of the picture.
The main reason for this is that the KVM driver relies on CFGI to know
which SIDs to configure, for s2 only cases there won’t be trap and emulate
as the hypervisor would be take control of all the SMMUs (as v3 of this
series which requires HVCs)
It might be useful to support only S2 SMMUs, but I’d like to keep this
series simple and then we can build on top of it.
[1] https://developer.arm.com/documentation/101542/0001/Functional-description/Constraints-and-limitations-of-use/SMMUv3-implementation
Thanks,
Mostafa
>
> Jason
More information about the linux-arm-kernel
mailing list