From patchwork Wed Jun 1 01:38:33 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: 834532 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p511dU09024499 for ; Wed, 1 Jun 2011 01:39:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758616Ab1FABj0 (ORCPT ); Tue, 31 May 2011 21:39:26 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:39474 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933090Ab1FABjO (ORCPT ); Tue, 31 May 2011 21:39:14 -0400 Received: by mail-bw0-f46.google.com with SMTP id 15so4139763bwz.19 for ; Tue, 31 May 2011 18:39:13 -0700 (PDT) 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; bh=p1k9z12mo9nCOOsyEdW8XHgsbTYvwzrVbvmHhWGhbrg=; b=btpzZPmZSKdCvk+/m4ZlFvccRTVFxMI4bqIg9xjOsM/AYaOyUD5WN7jQQjne3Z6f+B i8t3BAWU2x/XdyRfnu5d1lj0uenT2FQ91/gYai/J8aUfp2ya4ThTOheQDv5F3KxbQkY2 BlbeqRCUdgkSKJ6rZlQ/z0DLJgIfaRCIwEtiM= 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=eP17Qh5ueORdZEXBTLVOlUc2rw9S7+tg3Uur1jANdUMocmx+KOtjJ57h1jfIPijNxQ qYIBG66S/neKFnUK7DvoYzIhzV6wO3OG/TnZ5iUxhuKkL71A2kBH4A2QwDrmeckQViOW DIETnLyTpjxM94pm/S0zt/ZVVlcNCe1JoJbak= Received: by 10.205.24.9 with SMTP id rc9mr6085379bkb.92.1306892353289; Tue, 31 May 2011 18:39:13 -0700 (PDT) Received: from localhost.localdomain ([188.25.93.127]) by mx.google.com with ESMTPS id ag6sm453451bkc.18.2011.05.31.18.39.11 (version=SSLv3 cipher=OTHER); Tue, 31 May 2011 18:39:12 -0700 (PDT) From: Eduard - Gabriel Munteanu To: mst@redhat.com Cc: seabios@seabios.org, kevin@koconnor.net, joro@8bytes.org, blauwirbel@gmail.com, paul@codesourcery.com, avi@redhat.com, anthony@codemonkey.ws, av1474@comtv.ru, yamahata@valinux.co.jp, kvm@vger.kernel.org, qemu-devel@nongnu.org, benh@kernel.crashing.org, aik@ozlabs.ru, agraf@suse.de, aliguori@us.ibm.com, dwg@au1.ibm.com, rth@twiddle.net, david@gibson.dropbear.id.au, Eduard - Gabriel Munteanu Subject: [RFC PATCH 11/13] pcnet: use the DMA memory access interface Date: Wed, 1 Jun 2011 04:38:33 +0300 Message-Id: <1306892315-7306-12-git-send-email-eduard.munteanu@linux360.ro> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1306892315-7306-1-git-send-email-eduard.munteanu@linux360.ro> References: <1306892315-7306-1-git-send-email-eduard.munteanu@linux360.ro> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Jun 2011 01:39:30 +0000 (UTC) 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 9415a1e..6c2186e 100644 --- a/hw/pcnet-pci.c +++ b/hw/pcnet-pci.c @@ -217,13 +217,13 @@ static CPUReadMemoryFunc * const pcnet_mmio_read[] = { 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); + pci_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); + pci_memory_read(dma_opaque, addr, buf, len); } static void pci_pcnet_cleanup(VLANClientState *nc) @@ -292,6 +292,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; if (!pci_dev->qdev.hotplugged) { static int loaded = 0;