On 7/8/25 22:06, Jason Gunthorpe wrote:
On Tue, Jul 08, 2025 at 09:27:55AM -0300, Jason Gunthorpe wrote:
On Tue, Jul 08, 2025 at 01:42:53PM +0800, Baolu Lu wrote:
+void iommu_sva_invalidate_kva_range(unsigned long start, unsigned long end) +{
- struct iommu_mm_data *iommu_mm;
- might_sleep();
Yi Lai yi1.lai@intel.com reported an issue here. This interface could potentially be called in a non-sleepable context.
Oh thats really bad, the notifiers inside the iommu driver are not required to be called in a sleepable context either and I don't really want to change that requirement.
Actually, I have got confused here with the hmm use of notifiers.
The iommu drivers use arch_invalidate_secondary_tlbs so they are already in atomic contexts.
So your idea to use a spinlock seems correct.
Okay, then let me post an updated version.
Thanks, baolu