I'm not sure whether tying above logic to SVA is the right approach.beenioasid_register_allocator(&iommu->pasid_allocator);It's insufficient to disable scalable mode by only clearing
+ if (ret) {
+ pr_warn("Custom PASID allocator
registeration failed\n");
+ /*
+ * Disable scalable mode on this
IOMMU if there
+ * is no custom allocator. Mixing
SM capable vIOMMU
+ * and non-SM vIOMMU are not
supported.
+ */
+ intel_iommu_sm = 0;
intel_iommu_sm. The DMA_RTADDR_SMT bit in root entry has already
set. Probably, you need toYeah, I think disable SVA is better. We can still do gIOVA in SM. I
for each iommu
clear DMA_RTADDR_SMT in root entry
Alternatively, since vSVA is the only customer of this custom PASID
allocator, is it possible to only disable SVA here?
guess we need to introduce a flag for sva_enabled.
If vcmd interface doesn't work, the whole SM mode doesn't make
sense which is based on PASID-granular protection (SVA is only one
usage atop). If the only remaining usage of SM is to map gIOVA using
reserved PASID#0, then why not disabling SM and just fallback to
legacy mode?
Based on that I prefer to disabling the SM mode completely (better
through an interface), and move the logic out of CONFIG_INTEL_
IOMMU_SVM