Commit fe680d0d authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Stefano Stabellini
Browse files

exec: Limit translation limiting in address_space_translate to xen



The address_space_translate() function cuts the returned plen (page size)
to hardcoded TARGET_PAGE_SIZE. This function can be used on pages bigger
than that so this limiting should not be used on such pages.

Since originally the limiting was introduced for XEN, we can safely
limit this piece of code to XEN. So does the patch.

Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
parent 8d1dc5d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
        as = iotlb.target_as;
    }

    if (memory_access_is_direct(mr, is_write)) {
    if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
        hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
        len = MIN(page, len);
    }