Features/KVM

From QEMU
Revision as of 11:16, 13 September 2015 by Stefan Weil (talk | contribs) (→‎QEMU 1.2 (planned): QEMU 1.2 was finished a long time ago)

KVM (Kernel Virtual Machine) is a Linux kernel module that allows a user space program to utilize the hardware virtualization features of various processors. Today, it supports recent Intel and AMD processors (x86 and x86_64), PPC 440, PPC 970, S/390, ARM (Cortex A15, AArch64), and MIPS32 processors.

QEMU can make use of KVM when running a target architecture that is the same as the host architecture. For instance, when running qemu-system-x86 on an x86 compatible processor, you can take advantage of the KVM acceleration - giving you benefit for your host and your guest system.

qemu-kvm fork for x86 (deprecated, use upstream QEMU now)

The KVM project is maintaining a fork of QEMU called qemu-kvm. Currently (close to the 1.1 release) it still provides the best performance and certain additional features for using KVM with QEMU on x86. Any other architecture is already fully supported by QEMU itself. The goal is to merge all remaining feature differences into QEMU upstream, provide a migration path from qemu-kvm and suspend the development of this fork. The status of this work is:

QEMU 1.1

  • support for in-kernel irqchips, not enabled by default, use -machine accel=kvm,kernel_irqchip=on to activate it
  • no support of MSI with in-kernel irqchip (will be disabled for all device when the in-kernel irqchip is enabled)
  • no PCI device assignment

QEMU 1.2

  • full support for MSI with in-kernel irqchip, including fast MSI injection for vhost-net
  • PCI device assignment using KVM kernel interfaces (VFIO-based assignment will follow)
  • resolve differences in VGA BIOS and resolution

QEMU 1.3

  • as of the 1.3 release all qemu-kvm features have been merged into upstream QEMU

Broken features in qemu-kvm

  • CPU hot-plugging, used to work via monitor command cpu_set, will be added to upstream via hot-plugging of CPUs as a devices (monitor commands device_add/del)

Remaining differences

  • historic command line switches
    • -no-kvm (use -machine accel=...)
    • -no-kvm-irqchip (use -machine kernel_irqchip=...)
    • -no-kvm-pit (ignored by recent qemu-kvm, switch off irchip completely)
    • -no-kvm-pit-reinjection (use -global kvm-pit.lost_tick_policy=discard)
    • -tdf (ignored by recent qemu-kvm, drift compensation for userspace timer devices will be re-introduced generically)
    • -drive ...,boot=on (BIOS can boot from IDE, AHCI and virtio natively, use proprietary option ROM to boot from LSI SCSI controller)
  • testdev (helper device to test QEMU/KVM internals)

Links