From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPwvP-0006py-Lh for qemu-devel@nongnu.org; Thu, 22 Jan 2009 05:36:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPwvN-0006oV-Oz for qemu-devel@nongnu.org; Thu, 22 Jan 2009 05:36:38 -0500 Received: from [199.232.76.173] (port=50706 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPwvN-0006oG-CK for qemu-devel@nongnu.org; Thu, 22 Jan 2009 05:36:37 -0500 Received: from mx2.redhat.com ([66.187.237.31]:37623) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPwvM-0000Gs-PV for qemu-devel@nongnu.org; Thu, 22 Jan 2009 05:36:37 -0500 From: Avi Kivity Date: Thu, 22 Jan 2009 12:36:22 +0200 Message-Id: <1232620587-11625-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 0/5] Direct memory access for devices (v2) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org One of the deficiencies of the current device layer is that it can only access guest RAM via cpu_physical_memory_rw(). This means that the device emulation code must copy the memory to or from a temporary buffer, even though the host offers APIs which allow direct access to memory. This reduces efficiency on DMA capable devices, especially disks. This patchset introduces a complement to the read/write API, cpu_physical_memory_map() which allows device emulation code to map guest memory directly. The API bounces memory regions which cannot be mapped (such as mmio regions) using an internal buffer. As an example, IDE emulation is converted to use the new API. This exposes another deficiency: lack of scatter/gather support in the block layer. To work around this, a vectored block API is introduced, currently emulated by bouncing. Additional work is needed to convert all block format drivers to use the vectored API. Changes from v1: - documented memory mapping API - added access_len parameter to unmap operation, to indicate how much memory was actually accessed - move QEMUIOVector to cutils.c, and add flatten/unflatten operations - change block format driver API to accept a QEMUIOVector rather than a bare struct iovec Avi Kivity (5): Add target memory mapping API Add map client retry notification I/O vector helpers Vectored block device API Convert IDE to directly access guest memory block.c | 68 +++++++++++++++++++++++++++ block.h | 8 +++ cpu-all.h | 8 +++ cutils.c | 47 +++++++++++++++++++ exec.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/ide.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++------ qemu-common.h | 12 +++++ 7 files changed, 402 insertions(+), 16 deletions(-)