KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V).
KVM was envisioned and created by Qumranet, which was later acquired by Red Hat.
KVM is a very neat implementation of virtualization for x86 as the original code was less than 10,000 lines of code. It is implemented as a kernel module, and uses a number of features of the Linux kernel, instead of implementing them (e.g., scheduling of virtual machines is taken care by the kernel), unlike xen where all these features had to be taken care of by the hypervisor. Thus code reuse is something that KVM relies upon.
Following are the ways how KVM virtualizes various components of the real PC.
CPU Virtualization: CPU virtualization is taken care of by Intel VT or AMD-V technology, and KVM adds glue code to effectively use these technologies. KVM loads and saves a number of registers when a VM is scheduled or when it exits respectively.
I/O Virtualization: KVM does I/O virtualization with the help of qemu, which emulates devices. KVM also supports passthrough devices where the VM can directly access I/O devices using IOMMU.
Memory Virtualization: Earlier design of KVM virtualized memory using shadow page tables, which is a software only approach to virtualizing memory. There is a high cost of synchronizing the shadow page tables with the page tables belonging to OS. Later, Intel and AMD came up with their own versions of nested page tables which is mostly a hardware approach to virtualizing memory.