From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYYPm-0004fs-B3 for qemu-devel@nongnu.org; Wed, 14 Nov 2012 03:33:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYYPj-0002Ci-8i for qemu-devel@nongnu.org; Wed, 14 Nov 2012 03:33:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYYPi-0002CK-Mn for qemu-devel@nongnu.org; Wed, 14 Nov 2012 03:33:38 -0500 Message-ID: <50A3575B.1040800@redhat.com> Date: Wed, 14 Nov 2012 09:33:31 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1352870630-18311-1-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1352870630-18311-1-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] usb: Fix (another) bug in usb_packet_map() for IOMMU handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-devel@nongnu.org On 11/14/12 06:23, David Gibson wrote: > Elements in qemu SGLists can cross IOMMU page boundaries. So, in commit > 39c138c8420f51a7da7b35233a8d7400a0b589ac "usb: Fix usb_packet_map() in the > presence of IOMMUs", I changed usb_packet_map() to split up each SGList > element on IOMMU page boundaries and each resulting piece of qemu's memory > space separately to the iovec the usb code uses internally. > > That was correct in concept, but the patch has a bug. The 'base' variable > correctly steps through the dma address of each piece, but then we call > the dma_memory_map() function on the base address of the whole SGList > element every time. > > This patch fixes at least one problem using XHCI on the pseries guest > machine. It didn't affect OHCI because that doesn't use usb_packet_map(). > In theory it also affects EHCI, but we haven't observed that in practice. > I think the transfers were small enough on EHCI that they never crossed an > IOMMU page boundary in practice. Patch added to usb patch queue. thanks, Gerd