Re: [RFC PATCH v4 03/16] iommu/arm-smmu-v3: Add initial pSMMU realm viommu plumbing

From: Jason Gunthorpe

Date: Thu Sep 03 2026 - 14:24:16 EST


On Thu, Sep 03, 2026 at 04:13:20PM +0100, Suzuki K Poulose wrote:
> On 03/09/2026 15:47, Jason Gunthorpe wrote:
> > On Thu, Sep 03, 2026 at 10:58:06AM +0530, Aneesh Kumar K.V wrote:
> > > > Do you mean the SMMUv3 driver triggers RD creation? That feels
> > > > wrong. Did you mean the VMM just does it earlier?
> > >
> > > Currently, CCA creates the realm lazily as part of another operation.
> > > Realm creation is triggered by kvm_arm_rmi_populate() or
> > > kvm_arch_vcpu_run_pid_change()
> >
> > Okay, that's not what I would have guessed. But critically is there
> > some way for userspace to specify any realm creation parameters (like
> > rpv, ats_plane and so one) prior to the lazy creation?
>
> There would be, eventually. Based on the feedback from KVM arm64
> maintainers, we are trying to keep the ABI as generic as possible as the
> normal VMs. Thus, for now we have not included the Realm specific
> parameter configuration (which was present in the earlier versions)
> in the latest version of the KVM support.
>
> We have some ideas on how to do the configuration step. e.g. for MEC,
> see the following thread :
>
> https://lore.kernel.org/all/46d78aa2-cacb-4efd-ae62-3026f5fe9b3f@xxxxxxx/

I see, well please convay to the KVM folks that the iommu side needs
the RD to be setup prior to creating viommu objects and needs to be able
to supply realm parameters like ats_plane to work..

Don't see a reason to twist the API to accomodate KVM being out of
order for now. It is up to you if you want to try to do the lazy
create or try to get a defined creation momement with parameters (I
prefer this from an aesthetic perspective at least)

Jason