From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi4c3-0004N5-6Y for qemu-devel@nongnu.org; Wed, 07 May 2014 12:22:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi4by-0003cs-Q9 for qemu-devel@nongnu.org; Wed, 07 May 2014 12:22:31 -0400 Received: from smtp.citrix.com ([66.165.176.89]:54276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi4by-0003cX-Ee for qemu-devel@nongnu.org; Wed, 07 May 2014 12:22:26 -0400 From: Stefano Stabellini Date: Wed, 7 May 2014 17:21:52 +0100 Message-ID: <1399479718-7351-1-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PULL 1/7] exec: Limit translation limiting in address_space_translate to xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: olaf@aepfle.de, xen-devel@lists.xensource.com, Stefano Stabellini , Alexey Kardashevskiy , qemu-devel@nongnu.org, anthony@codemonkey.ws, Anthony.Perard@citrix.com, pbonzini@redhat.com From: Alexey Kardashevskiy 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 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Stefano Stabellini --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 1.7.10.4