0

I am aware of that KVM provides hardware acceleration feature by utilises the virtualisation extension in CPU chips like Intel VT. So that VCPUs can be directly mapped to physical CPUs to achieve almost native speed.

Since Linux kernel includes the drivers for hard disk, network and memory. Why do we need QEMU for server virtualisation?(assume that we don't need to emulate devices like graphic card).

In addition to that, with paravirtulization support provided by virtio drivers. Disk I/O and network performance are significantly improved. Why can't we just use KVM and virtio. What is the role of QEMU in this case?

TheFirefly
  • 103
  • 3

1 Answers1

2

QEMU is virtual hardware. CPUs, chipsets, I/O buses, interrupt controllers, basic peripherals, and other odds and ends hardware APIs that make a platform work. Emulation is sufficiently good that it is possible to run a dozen platforms on alien hardware. Slowly, due to the overhead in re-writing CPU instructions, but possible. Slow relative to native that is, QEMU is a "quick emulator".

Host Linux kernel is something like virtual firmware and drivers. Low level prodding the actual hardware to make it go. Linux of course can run user space programs on its own, in this case those programs are virtual machines emulating hardware.

KVM adds accelerated drivers that make use of hardware-assisted virtualization. Removing emulation and other overheads make it faster. Emulating any hardware platform is no longer possible. But in practice, it is more efficient to buy ARM, POWER, or x86 and each run guests of their native architecture.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • Hi John, thanks for the answer. Is it correct to understand that QEMU is more like a management tool that calls APIs exposed by dev/kvm and virtio in the particular case of server virtualisation? – TheFirefly Apr 21 '20 at 02:29
  • No, that is an oversimplification. qemu-kvm uses KVM to remove emulation overhead, and virto for faster drivers. QEMU still does actual work to create pretend hardware. – John Mahowald Apr 21 '20 at 12:33