* pci-passthrough logging
@ 2010-02-19 23:58 Vikram Ambrose
2010-02-21 9:47 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Vikram Ambrose @ 2010-02-19 23:58 UTC (permalink / raw)
To: kvm
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?
thanks,
Vik.
PS: This is a "one off" question, so I'm not subscribed to the list,
please make sure my email addresses is in the reply fields.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: pci-passthrough logging
2010-02-19 23:58 pci-passthrough logging Vikram Ambrose
@ 2010-02-21 9:47 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-02-21 9:47 UTC (permalink / raw)
To: Vikram Ambrose; +Cc: kvm
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-21 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 23:58 pci-passthrough logging Vikram Ambrose
2010-02-21 9:47 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox