IOMMUTLBEntry iotlb;
MemoryRegionSection *section;
MemoryRegion *mr;
+ hwaddr len = *plen;
rcu_read_lock();
for (;;) {
iotlb = mr->iommu_ops->translate(mr, addr, is_write);
addr = ((iotlb.translated_addr & ~iotlb.addr_mask)
| (addr & iotlb.addr_mask));
- *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1);
+ len = MIN(len, (addr | iotlb.addr_mask) - addr + 1);
if (!(iotlb.perm & (1 << is_write))) {
mr = &io_mem_unassigned;
break;
if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
- *plen = MIN(page, *plen);
+ len = MIN(page, len);
}
+ *plen = len;
*xlat = addr;
rcu_read_unlock();
return mr;