From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: pci-passthrough logging Date: Sun, 21 Feb 2010 11:47:50 +0200 Message-ID: <4B810146.3010601@redhat.com> References: <4B7F25B9.3010000@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Vikram Ambrose Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50889 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769Ab0BUJrx (ORCPT ); Sun, 21 Feb 2010 04:47:53 -0500 In-Reply-To: <4B7F25B9.3010000@gmx.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/20/2010 01:58 AM, Vikram Ambrose wrote: > Hello, > > I'm new to kvm and I'm trying to log pci config and mmio read/writes > for a particular pci (pci-e to be precise) device that I've > passthrough to qemu-kvm (dma=none). > > I put a printk into kvm_iodevice_read/write() in > linux/virt/kvm/iodev.h but the log seems to get corrupted when the > action picks up. > > I looked at qemu-kvm/hw/pci_host.c and found > pci_host_data_write/read_mmio[]. But I don't know where those are > implemented, nor exactly what they do for that matter. > > I appologise for the n00b nature of my problem, but there isnt any > documentation on the pci-passthrough architecture in > linux/Documentation/kvm or in qemu-kvm. > > Does anyone know where/how to log pci-passthrough accesses? For config-space accesses, hook assigned_dev_pci_{read,write}_config(). For mmio, hook slow_bar_{read,write}*(), and hack assigned_dev_register_regions() to select the slow path (otherwise kvm will let the guest write directly to the device). For pio, hook assigned_dev_ioport_{read,write)*(). -- error compiling committee.c: too many arguments to function