From patchwork Sat Jan 29 17:40:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard - Gabriel Munteanu X-Patchwork-Id: 80953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 47D61B70FF for ; Sun, 30 Jan 2011 05:09:10 +1100 (EST) Received: from localhost ([127.0.0.1]:43787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjF2M-0003fT-F6 for incoming@patchwork.ozlabs.org; Sat, 29 Jan 2011 12:56:38 -0500 Received: from [140.186.70.92] (port=60148 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEnT-0005GH-Hw for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjEnO-0004jF-9k for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:15 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:63211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjEnO-0004g9-2l for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:10 -0500 Received: by mail-fx0-f45.google.com with SMTP id 12so4523795fxm.4 for ; Sat, 29 Jan 2011 09:41:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:in-reply-to:references; bh=dxwTyBO4spE6wNunFZFvMS1WKTlVZUpjyDrXraxXWms=; b=gAVnDM+27PmKyQqNqDeirLiCosSV3QE/2qGr7N1VUYfl+whbR8sUQyO+MjBUlogHQj zND+VX4GS04/AN8/XNdeS+RWN2RVUxLKG2CssXfBfB6raKil3NAhRP4UpLFgi2DZhx9G TXWqCipEvij6SJKs2tlloa5saNzismGmf8gho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=DgbH1h6OHdCwTCVMhRg2YRS9qBkKHpw80f5yLZVRTuJf7EawfBzg6Z3BVMK+3lYRoV 9SkxJM4YqqtETahO+xqqK9gtfBAEsU2PZZ1TefNTEMf3bge8mw5E1UhNEDUjHeOp3jcV wGAXb1yYcRughCIr1mng6q/ZNaRa43GAiL9DA= Received: by 10.223.100.15 with SMTP id w15mr3834565fan.121.1296322869691; Sat, 29 Jan 2011 09:41:09 -0800 (PST) Received: from localhost.localdomain ([188.25.244.101]) by mx.google.com with ESMTPS id 21sm6822801fav.17.2011.01.29.09.41.08 (version=SSLv3 cipher=RC4-MD5); Sat, 29 Jan 2011 09:41:08 -0800 (PST) From: Eduard - Gabriel Munteanu To: joro@8bytes.org Date: Sat, 29 Jan 2011 19:40:32 +0200 Message-Id: <800fc3514ae6d70eb429a10259b241f8eb790a3c.1296321798.git.eduard.munteanu@linux360.ro> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.45 Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, blauwirbel@gmail.com, yamahata@valinux.co.jp, paul@codesourcery.com, Eduard - Gabriel Munteanu , avi@redhat.com Subject: [Qemu-devel] [PATCH 11/13] pcnet: use the DMA memory access interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/pcnet-pci.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index 339a401..3f55c42 100644 --- a/hw/pcnet-pci.c +++ b/hw/pcnet-pci.c @@ -230,13 +230,13 @@ static void pcnet_mmio_map(PCIDevice *pci_dev, int region_num, static void pci_physical_memory_write(void *dma_opaque, target_phys_addr_t addr, uint8_t *buf, int len, int do_bswap) { - cpu_physical_memory_write(addr, buf, len); + dma_memory_write(dma_opaque, addr, buf, len); } static void pci_physical_memory_read(void *dma_opaque, target_phys_addr_t addr, uint8_t *buf, int len, int do_bswap) { - cpu_physical_memory_read(addr, buf, len); + dma_memory_read(dma_opaque, addr, buf, len); } static void pci_pcnet_cleanup(VLANClientState *nc) @@ -306,6 +306,7 @@ static int pci_pcnet_init(PCIDevice *pci_dev) s->irq = pci_dev->irq[0]; s->phys_mem_read = pci_physical_memory_read; s->phys_mem_write = pci_physical_memory_write; + s->dma_opaque = &pci_dev->dma; if (!pci_dev->qdev.hotplugged) { static int loaded = 0;