From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT9Dt-0001NJ-Dl for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WT9Ds-0007fX-Cz for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:15:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT9Ds-0007fP-5d for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:15:52 -0400 Message-ID: <53341671.40404@redhat.com> Date: Thu, 27 Mar 2014 13:15:45 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1395894926-16633-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1395894926-16633-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] exec: Limit translation limiting in address_space_translate to xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org, Stefano Stabellini Il 27/03/2014 05:35, Alexey Kardashevskiy ha scritto: > 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 > --- > > I need this change for VFIO-on-sPAPR series as it is going to support > 16MB IOMMU pages. Thanks. > --- > 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); > } > Stefano, can you include this in your Xen tree for 2.1? Paolo