On Wed, Jul 16, 2025 at 08:36:38AM +0000, Shameerali Kolothum Thodi wrote: > > > + g_hash_table_foreach(bs->configs, smmuv3_accel_ste_range, range); > > > > This will not work correctly? > > > > The bs->configs is a cache that gets an entry inserted to when a > > config is fetched via smmuv3_get_config(), which gets invoked by > > smmuv3_notify_iova() and smmuv3_translate() only. > > > > But CMDQ_OP_CFGI_ALL can actually happen very early, e.g. Linux > > driver does that in the probe() right after SMMU CMDQ is enabled, > > at which point neither smmuv3_notify_iova nor smmuv3_translate > > could ever get invoked, meaning that the g_hash_table is empty. > > > > Without the acceleration, this foreach works because vSMMU does > > not need to do anything since the cache is indeed empty. > > > > But, with accel, it must call smmuv3_accel_install_nested_ste(). > > Ok. The only place I can see CMDQ_OP_CFGI_ALL get invoked by Linux > kernel is during arm_smmu_device_reset() and that is to clear all. > But I am not sure we will have any valid STEs at that time. Just curious, > are you seeing any issues with this at the moment?
I recall that (not for this series) I hit some issue with a guest having "iommu.passthrough=y" string in its bootcmd. The guest OS initialized all SIDs to a Config.Bypass mode accordingly. But that was not handled correctly by QEMU so the host was not getting any request to program a stage-1 bypass STE to the HW. So, I think there would be a similar issue here. Nicolin