From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LV0cd-0004RG-N3 for qemu-devel@nongnu.org; Thu, 05 Feb 2009 04:34:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LV0ca-0004NG-V8 for qemu-devel@nongnu.org; Thu, 05 Feb 2009 04:34:11 -0500 Received: from [199.232.76.173] (port=58887 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV0ca-0004My-6m for qemu-devel@nongnu.org; Thu, 05 Feb 2009 04:34:08 -0500 Received: from mx2.redhat.com ([66.187.237.31]:41893) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LV0cZ-0004F4-Hr for qemu-devel@nongnu.org; Thu, 05 Feb 2009 04:34:07 -0500 From: Avi Kivity Date: Thu, 5 Feb 2009 11:33:55 +0200 Message-Id: <1233826439-16856-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] Block DMA helpers (v2) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori The current dma mapping API is fairly complex to use: mapping can fail when bounce resources are exhausted, requiring the caller to reschedule, and the interface is fairly low level. This patchset introduces block device oriented helpers to centralize this logic. Devices need only submit a scatter/gather list, and the helpers will do all the dirty work of mapping, rescheduling, and unmapping. IDE has been converted to the new API. Changes from v1: - added license and copyright for new files Avi Kivity (4): Add a scatter-gather list type and accessors Add qemu_iovec_reset() Introduce block dma helpers Convert IDE to use new dma helpers Makefile.target | 2 +- cutils.c | 6 ++ dma-helpers.c | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ dma.h | 41 +++++++++++++++ hw/ide.c | 76 ++++----------------------- qemu-common.h | 1 + 6 files changed, 214 insertions(+), 67 deletions(-) create mode 100644 dma-helpers.c create mode 100644 dma.h