diff mbox

[Xen-devel,PULL,1/7] exec: Limit translation limiting in address_space_translate to xen

Message ID 1399479718-7351-1-git-send-email-stefano.stabellini@eu.citrix.com
State Accepted
Commit fe680d0dac85e0f2d6c3b53838c250f6e0b1f49b
Headers show

Commit Message

Stefano Stabellini May 7, 2014, 4:21 p.m. UTC
From: Alexey Kardashevskiy <aik@ozlabs.ru>

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/exec.c b/exec.c
index 91513c6..cf12049 100644
--- 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);
     }