[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_io
From: |
Peter Xu |
Subject: |
Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier |
Date: |
Sat, 27 Jun 2020 08:57:14 -0400 |
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
- [RFC v2 0/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Eugenio Pérez, 2020/06/26
- [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Eugenio Pérez, 2020/06/26
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/06/28
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/06/28
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/06/29
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/06/29
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/06/29
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/06/30
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Michael S. Tsirkin, 2020/06/30
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/06/30
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/06/30