diff --git a/qemu/exec.c b/qemu/exec.c index 1b5bf500..ae0c7b83 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -341,7 +341,6 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, IOMMUTLBEntry iotlb; MemoryRegionSection *section; MemoryRegion *mr; - hwaddr len = *plen; for (;;) { section = address_space_translate_internal(as->dispatch, addr, &addr, plen, true); @@ -356,7 +355,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, iotlb = mr->iommu_ops->translate(mr, addr, is_write); addr = ((iotlb.translated_addr & ~iotlb.addr_mask) | (addr & iotlb.addr_mask)); - len = MIN(len, (addr | iotlb.addr_mask) - addr + 1); + *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1); if (!(iotlb.perm & (1 << is_write))) { mr = &as->uc->io_mem_unassigned; break; @@ -365,7 +364,6 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, as = iotlb.target_as; } - *plen = len; *xlat = addr; return mr; }