KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

KVM-79 Released: pci device assignment, pci device hot plug

Today, kvm-79 was released featuring full support for host pci device assignment and hot-plugging host pci devices. In order to use these features at this time, linux 2.6.28 is required on the host. This release also includes another qemu merge which recently got kvm support.

New PCI device assignment support

The new pci device assignment allows you to assign a device on your host to a guest. There is a new command line option –pcidevice added for this support. As an example, if you have a pci device sitting at 04:08.0 ( pci bus:dev.fn) you can use the following option when starting kvm guest to assign the device.

-pcidevice host=04:08.0

A couple of things to note when using this new feature.

  • The host driver for the device, if any, needs to be removed first or assignment will fail.
  • Currently, you cannot assign a device that shares irq with another host device
  • The raw_io capability is needed for this to work
  • This works only with the in-kernel irqchip method. In order to use the userspace irqchip, a kernel module (irqhook) and some extra changes are needed.
     

In order to hot plug host pci devices into your guest , you have to issue the command from your monitor using the pci_add command.

 

Changelog

The official changelog from the kvm maintainers are as follows:
Changes from kvm-78:
- merge qemu-svn
- fix qcow2 problems with scsi
- 'info chardev' monitor command
- device assignment userspace (Amit Shah, Muli Ben Yehudah, Ben-Ami Yassour,
Weidong Han, Or Sagi, Nir Peleg, Glauber Costa, Xiantao Zhang)
- multiple processor infrastructure for ppc (Hollis Blanchard)
- fix error handling in eventfd() emulation (Mark McLoughlin)
- handle large mtu with virtio-net (Mark McLoughlin)
- move x86 specific device assignment code to x86 files (Christian Ehrhardt)
- fix 'pci_add' command descriptor (Weidong Han)
- enable pci function level reset for device assignment (Sheng Yang)
- fix incorrect handling of aliases gfns (Izik Eidus)
- ppc optimizations (Hollis Blanchard, Christian Ehrhardt)
- disallow guests from setting memory type when using EPT (Sheng Yang)
- fix cpuid leaf 11 loop termination (Nitin A Kamble)
- fix cpuid multiple leaf iteration (Nitin A Kamble)
- fix ia64 uniprocessor build (Xiantao Zhang)
- fix ppc Kbuild constraints (Hollis Blanchard)
- fix pit initialization memory leak

Kvm-79 can be downloaded here
 

 

Comments

Hello, here i'm again and

Hello,

here i'm again and asking: has someone tested this with a grafic card and a windows within a vm? I see that this would have the potential to play all windows games on linux.

Hi, I've been trying to use

Hi,

I've been trying to use this with video capture card, but it failed :((

I have shared interrupts and found no way to change device IRQ assigments.

To Anonymous: I suppose you

To Anonymous:

I suppose you need to use a motherboard with a chipset that supports VT-d...and even if you have a chipset with VT-d, you can't be sure that the manufacturer of the motherboard has enabled the support. The Xen wiki contains a list of motherboards with VT-d:
http://wiki.xensource.com/xenwiki/VTdHowTo

Best Regards
Kenni