From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgyhu-0002eZ-Lv for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:43:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sgyho-00035Q-Gx for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:42:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgyho-00035B-8z for qemu-devel@nongnu.org; Tue, 19 Jun 2012 09:42:52 -0400 Message-ID: <4FE081CE.1060001@redhat.com> Date: Tue, 19 Jun 2012 15:42:38 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1340087992-2399-1-git-send-email-benh@kernel.crashing.org> <1340087992-2399-8-git-send-email-benh@kernel.crashing.org> In-Reply-To: <1340087992-2399-8-git-send-email-benh@kernel.crashing.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws, David Gibson Hi, > Note that usb_packet_map() invokes dma_memory_map() with a NULL invalidate > callback function. When IOMMU support is added, this will mean that > usb_packet_map() and the corresponding usb_packet_unmap() must be called in > close proximity without dropping the qemu device lock Well, that isn't guaranteed ... > - otherwise the guest > might invalidate IOMMU mappings while they are still in use by the device > code. Guest tearing down mapping while usb packets using them are still in flight would be a guest bug. Still not impossible to happen though. How is this case supposed to be handled? cheers, Gerd