From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi3gU-0005J6-4P for qemu-devel@nongnu.org; Wed, 07 May 2014 11:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi3gN-0005ov-GW for qemu-devel@nongnu.org; Wed, 07 May 2014 11:23:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi3gN-0005oq-7V for qemu-devel@nongnu.org; Wed, 07 May 2014 11:22:55 -0400 Message-ID: <536A4FBB.50105@redhat.com> Date: Wed, 07 May 2014 17:22:35 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1399475403-5408-1-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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 , Stefano Stabellini Cc: Olaf Hering , "xen-devel@lists.xensource.com Devel" , Alexey Kardashevskiy , QEMU Developers , Anthony Liguori , Anthony PERARD Il 07/05/2014 17:12, Peter Maydell ha scritto: >> > - 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); >> > } > We should put this patch in (both as an efficiency thing and an > expedient fix) but we really need to either track down which > callers of this API are relying on the returned plen not being > truncated, or we need to fix Xen to not truncate either. This > is just a bandaid IMHO. Fixing Xen to not truncate is not possible because of the Xen mapcache, unless of course QEMU is changed to avoid the mapcache completely on 64-bit hosts. I'm not sure if that makes sense from the Xen point of view. Regarding fixing callers, a known one is virtio-scsi which is a bug and on my todo list. But another is VFIO, which cannot accept truncation if the IOMMU page size is greater than TARGET_PAGE_SIZE. Paolo