On Sat, Jun 27, 2020 at 03:26:45AM -0400, Yan Zhao wrote: > > - assert(entry->iova >= notifier->start && entry_end <= notifier->end); > > + if (notifier->notifier_flags & IOMMU_NOTIFIER_ARBITRARY_MASK) { > > + tmp.iova = MAX(tmp.iova, notifier->start); > > + tmp.addr_mask = MIN(tmp.addr_mask, notifier->end); > NIT: > tmp.addr_mask = MIN(entry_end, notifier->end) - tmp.iova;
Right. Thanks. :) > > + assert(tmp.iova <= tmp.addr_mask); > no this assertion then. Or change it into: assert(MIN(entry_end, notifier->end) >= tmp.iova); To double confirm no overflow. -- Peter Xu