mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 10:45:28 +00:00
Revert "exec: Respect as_tranlsate_internal length clamp"
This reverts commit c3c1bb9. It causes problems with boards that declare memory regions shorter than the registers they contain. Backports commit 4025446f0ac6213335c22ec43f3c3d8362ce7286 from qemu
This commit is contained in:
parent
1cc51e4b53
commit
aad1027c96
|
@ -349,6 +349,7 @@ 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);
|
||||
|
@ -363,7 +364,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 = &as->uc->io_mem_unassigned;
|
||||
break;
|
||||
|
@ -372,6 +373,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
|
|||
as = iotlb.target_as;
|
||||
}
|
||||
|
||||
*plen = len;
|
||||
*xlat = addr;
|
||||
return mr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue