public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* PCI device passthrough for FreeDOS guests
@ 2009-07-13 16:16 Carl-Daniel Hailfinger
  2009-07-14  1:49 ` Han, Weidong
  0 siblings, 1 reply; 2+ messages in thread
From: Carl-Daniel Hailfinger @ 2009-07-13 16:16 UTC (permalink / raw)
  To: kvm developers

Hi,

I want to trace the PCI device accesses (config space, I/O ports, memory
BARs) of a DOS application (EEPROM flasher) and it seems KVM can help
with this.
The current plan is to install KVM, use FreeDOS as a guest, activate
passthrough for the PCI device I'm interested in and log the accesses
somehow.

Possible problems I'd have to solve:
- According to
http://www.linux-kvm.org/wiki/images/d/d0/KvmForum2008$kdf2008_14.pdf
PCI device passthrough needs a CPU with VT-d/IOMMU support.
- http://www.linux-kvm.org/page/TODO says passthrough won't work for
conventional PCI devices (I assume a PCI graphics card is such a device).
- http://www.linux-kvm.org/page/TODO says passthrough won't work for
devices without Function Level Reset (FLR).
- http://www.linux-kvm.org/page/TODO says VT support for real mode is
not good, so FreeDOS might be a problem.
- The KVM wiki does not mention how to get PCI passthrough working.
- No idea if logging of PCI accesses is possible with KVM or if I have
to use helper tools for that.

Any insights/hints are appreciated. If KVM is the wrong tool for my
task, please point me in the right direction.

Please CC me as I'm not subscribed to the list. Thanks.

Regards,
Carl-Daniel

P.S. The linux-kvm.org wiki returns zero results if you search the wiki
text for "PCI", but a Google search finds quite a few pages mentioning
PCI. Is there a bug in the seach function?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: PCI device passthrough for FreeDOS guests
  2009-07-13 16:16 PCI device passthrough for FreeDOS guests Carl-Daniel Hailfinger
@ 2009-07-14  1:49 ` Han, Weidong
  0 siblings, 0 replies; 2+ messages in thread
From: Han, Weidong @ 2009-07-14  1:49 UTC (permalink / raw)
  To: 'Carl-Daniel Hailfinger', 'kvm developers'

Carl-Daniel Hailfinger wrote:
> Hi,
> 
> I want to trace the PCI device accesses (config space, I/O ports,
> memory BARs) of a DOS application (EEPROM flasher) and it seems KVM
> can help with this.
> The current plan is to install KVM, use FreeDOS as a guest, activate
> passthrough for the PCI device I'm interested in and log the accesses
> somehow.
> 
> Possible problems I'd have to solve:
> - According to
> http://www.linux-kvm.org/wiki/images/d/d0/KvmForum2008$kdf2008_14.pdf
> PCI device passthrough needs a CPU with VT-d/IOMMU support.
> - http://www.linux-kvm.org/page/TODO says passthrough won't work for
> conventional PCI devices (I assume a PCI graphics card is such a

It supports conventional PCI devices passgthrough now. 

> device). - http://www.linux-kvm.org/page/TODO says passthrough won't
> work for devices without Function Level Reset (FLR).

FLR is not must for passthrough. If the device status is correct, passthrough can work. FLR is used to keep device in correct status before and after passthrough. Now more device reset methods are supported, such as secondary bus reset and D0hot->D3 transition. So even the device won't support PCIe FLR, it still can be reset. It's not a problem now.

The VT-d TODO is obsolete. I will update it.

> - http://www.linux-kvm.org/page/TODO says VT support for real mode is
> not good, so FreeDOS might be a problem.
> - The KVM wiki does not mention how to get PCI passthrough working.

There is VT-d Howto: http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM. pls refer to it to passthrough pci.

> - No idea if logging of PCI accesses is possible with KVM or if I have
> to use helper tools for that.

You can log PCI accesses. Pls refer to qemu-kvm/hw/device-assignment.c.

Regards,
Weidong

> 
> Any insights/hints are appreciated. If KVM is the wrong tool for my
> task, please point me in the right direction.
> 
> Please CC me as I'm not subscribed to the list. Thanks.
> 
> Regards,
> Carl-Daniel
> 
> P.S. The linux-kvm.org wiki returns zero results if you search the
> wiki text for "PCI", but a Google search finds quite a few pages
> mentioning PCI. Is there a bug in the seach function?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-14  1:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 16:16 PCI device passthrough for FreeDOS guests Carl-Daniel Hailfinger
2009-07-14  1:49 ` Han, Weidong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox