]> git.proxmox.com Git - mirror_qemu.git/commitdiff
exec: Limit translation limiting in address_space_translate to xen
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 7 May 2014 13:40:39 +0000 (13:40 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 7 May 2014 16:14:36 +0000 (16:14 +0000)
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: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
exec.c

diff --git a/exec.c b/exec.c
index 91513c6c43d47a84157a46ad33042e60911bacaf..cf120496f7e4467351e9ea425882432ace3866e0 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -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);
     }