|
@@ -1900,7 +1900,6 @@ int memory_region_register_iommu_notifier(MemoryRegion *mr,
|
|
|
iommu_mr = IOMMU_MEMORY_REGION(mr);
|
|
|
assert(n->notifier_flags != IOMMU_NOTIFIER_NONE);
|
|
|
assert(n->start <= n->end);
|
|
|
- assert(n->end <= memory_region_size(mr));
|
|
|
assert(n->iommu_idx >= 0 &&
|
|
|
n->iommu_idx < memory_region_iommu_num_indexes(iommu_mr));
|
|
|
|
|
@@ -1924,6 +1923,7 @@ uint64_t memory_region_iommu_get_min_page_size(IOMMUMemoryRegion *iommu_mr)
|
|
|
|
|
|
void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n)
|
|
|
{
|
|
|
+ MemoryRegion *mr = MEMORY_REGION(iommu_mr);
|
|
|
IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_GET_CLASS(iommu_mr);
|
|
|
hwaddr addr, granularity;
|
|
|
IOMMUTLBEntry iotlb;
|
|
@@ -1936,7 +1936,7 @@ void memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n)
|
|
|
|
|
|
granularity = memory_region_iommu_get_min_page_size(iommu_mr);
|
|
|
|
|
|
- for (addr = n->start; addr < n->end; addr += granularity) {
|
|
|
+ for (addr = 0; addr < memory_region_size(mr); addr += granularity) {
|
|
|
iotlb = imrc->translate(iommu_mr, addr, IOMMU_NONE, n->iommu_idx);
|
|
|
if (iotlb.perm != IOMMU_NONE) {
|
|
|
n->notify(n, &iotlb);
|