[PATCH v8 04/25] iommu/arm-smmu-v3: Move IDR parsing to common functions

Jason Gunthorpe jgg at nvidia.com
Wed Sep 23 04:52:57 PDT 2026


On Wed, Sep 23, 2026 at 10:09:06AM +0000, Mostafa Saleh wrote:
> > > +	if (coherent && !disable_msipolling &&
> > > +	    smmu->features & ARM_SMMU_FEAT_MSI)
> > > +		smmu->options |= ARM_SMMU_OPT_MSIPOLL;
> > 
> > Will pKVM ever use MSIPOLL?
> 
> No, this version does not support MSI and hides it.
> And this check can not be moved because disable_msipolling is a
> module_param.

Could you move the above if into the shared area and have the callers
mask off options if they don't want it?

> > > +	if (smmu->features & ARM_SMMU_FEAT_HYP &&
> > > +	    cpus_have_cap(ARM64_HAS_VIRT_HOST_EXTN))
> > > +		smmu->features |= ARM_SMMU_FEAT_E2H;
> > 
> > Why is ARM64_HAS_VIRT_HOST_EXTN left behind?
> > 
> 
> cpus_have_cap() can not be used in the hypervisor.
> Also, ARM_SMMU_FEAT_E2H is not exactly FEAT_HYP. As it defines the
> world the translation lives in based on the kernel EL.

But don't you need this FEAT to issue invalidations correctly?
pkvm never issues a S1 invalidation?

> With pKVM at EL2 ARM64_HAS_VIRT_HOST_EXTN is always true anyway.

> And the hypervisor never owns a page table itself, so it never
> checks this feature.

? I thought the whole point of this was for pkvm to own a S2?

Maybe same as I suggested for MSIPOLL, set the FEAT and mask it later
if it can't be used. If KVM implicitly knows it has
ARM64_HAS_VIRT_HOST_EXTN then it should operate with ARM_SMMU_FEAT_E2H
set.

> Otherwise, I think we can move this check and use cpus_have_final_cap()
> instead as it can be used in the hypervisor.

Or that, I don't know the difference

Jason



More information about the linux-arm-kernel mailing list