sounds good to me too, the earlier the less to clean up.You are correct.I'm not sure whether tying above logic to SVA is the rightUnfortunately, it is dangerous to disable SM after boot. SM uses
approach. 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
different root/device contexts and pasid table formats. Disabling SM
after boot requires changing above from SM format into legacy
format.
Since ioasid registration failure is a rare case. How about movingIt makes sense to me.
this part of code up to the early stage of intel_iommu_init() and
returning error if hardware present vcmd capability but software
fails to register a custom ioasid allocator?