aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-04-01 09:57:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-04-01 10:06:38 +0200
commit4025446f0ac6213335c22ec43f3c3d8362ce7286 (patch)
treefb3bcf6306d7b1b9ccaa42b2c9e8c1a83c936f81 /exec.c
parenta59629fcc6f603e19b516dc08f75334e5c480bd0 (diff)
Revert "exec: Respect as_tranlsate_internal length clamp"
This reverts commit c3c1bb99d1c11978d9ce94d1bdcf0705378c1459. It causes problems with boards that declare memory regions shorter than the registers they contain. Reported-by: Zoltan Balaton <balaton@eik.bme.hu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index 6d1e1e4c75..874ecfc2c6 100644
--- a/exec.c
+++ b/exec.c
@@ -380,6 +380,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
IOMMUTLBEntry iotlb;
MemoryRegionSection *section;
MemoryRegion *mr;
+ hwaddr len = *plen;
rcu_read_lock();
for (;;) {
@@ -394,7 +395,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));
- *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;
@@ -405,9 +406,10 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
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;