[PATCH v9 11/25] iommu/arm-smmu-v3-kvm: Add the kernel driver

Mostafa Saleh smostafa at google.com
Thu Nov 19 03:18:01 PST 2026


On Fri, Nov 13, 2026 at 09:29:10AM -0800, Nicolin Chen wrote:
> On Thu, Nov 12, 2026 at 01:32:36PM +0000, Mostafa Saleh wrote:
> > On Tue, Nov 10, 2026 at 10:24:58AM -0800, Nicolin Chen wrote:
> > > On Tue, Nov 10, 2026 at 10:41:27AM +0000, Mostafa Saleh wrote:
> > > > In Android, in that case, pKVM clears the FW (called pvmfw) that loads
> > > > the protected VM and authenticate it so any protected VM knows the
> > > > system is not trusted. This part is not upstream yet. [1]
> > > 
> > > You might want to double check a dual-SMMU case, where one gets
> > > accepted by pkvm driver and the other fails and so bound to the
> > > main driver.
> > > 
> > > It seems the pkvm driver would still pkvm_iommu_register_driver
> > > and carry on with an untrusted SMMU. Would it also clear the FW
> > > and mark the system as not trusted?
> > > 
> > 
> > That shouldn't be possible, if one SMMU fail the whole thing will
> > and the driver should clean up after as the probe is done through:
> > 	ret = platform_driver_probe(&smmuv3_nesting_driver, smmuv3_nesting_probe);
> 
> Hmm, if I read __platform_driver_probe correctly:
>  * __driver_attach() doesn't propagate ret from driver_probe_device()
>    via bus_for_each_dev to the caller
>  * bus_for_each_dev(..., is_bound_to_driver) at the end also returns
>    true, as one SMMU is bound to the driver while the other failed
> ?

I double checked, you are right. In android we have the following:
	ret = platform_driver_probe(&kvm_arm_smmu_driver, kvm_arm_smmu_probe);
	if (ret)
		goto err_free;
	if (kvm_arm_smmu_cur != kvm_arm_smmu_count) {
		/* A device exists but failed to probe */
		ret = -EUNATCH;
		goto err_free;
	}

We need that also here, I will add it in the next version.

Thanks,
Mostafa

> 
> Nicolin



More information about the linux-arm-kernel mailing list