KVM Virtualization Architecture and implementation principles __KVM

Source: Internet
Author: User
Directory

Directory KVM Virtualization Architecture DEVKVM QEMU Openstackkvmqemu The virtualization implementation of KVM

KVM Virtualization Architecture

The KVM is a virtualized module embedded in the Linux operating system standard kernel that converts a Linux standard kernel into a VMM, and a Linux standard kernel with a KVM module can support Guestos that is loaded via KVM tools. So under such operating system platform, the computer physical hardware layer directly is the VMM virtualization layer, but does not have the independent Hostos operating system layer. in such an environment, Hostos is a VMM.

each Guestos created by the KVM is a single process on the Hostos (or VMM). The applications that run in the User-space on the Guestos can be understood to be threads in the process.

Note that KVM is only part of the virtualization solution, and other requirements are required to achieve full virtualization:
1. The virtualization support provided by CPU processors (Vt-x hardware-assisted virtualization, which can create virtualized processors for Guestos, is essentially an isolation of registers and a division of instruction sets).
2. Memory can be virtualized into a stand-alone virtualization address via KVM (/DEV/KVM)
3. I/O virtualization (QEMU)

==> KVM virtualization = KVM Kernel module +/DEV/KVM + QEMU /DEV/KVM

The KVM kernel module in the Linux operating system standard kernel generates a device named/DEV/KVM with a/DEV/KVM device that enables Guestos address space (memory address, disk address) to be independent of the standard kernel or any other Guestos address space. The Linux operating system directory structure contains devices under the/dev directory tree that are common to all user-space processes or threads (whether on Guestos or VMM), but each opens a different process or thread for the/DEV/KVM device. All you can use are unique and distinct address mappings (to support guestos isolation).

The KVM kernel module provides memory virtualization through the/DEV/KVM device, giving the Guestos a relatively independent address space to the kernel or other guestos. Each guestos has its own address space, and these address spaces are created when the Guestos is instantiated. The physical memory mapped to Guestos is actually mapped to the virtual memory of the corresponding process in the Guestos in VMM.
There are two translation methods that support the guest address to the host (VMM) address: A set of Shadow page tables (Shadow page table) that are maintained by applying Linuxos can also use VMM (host kernel) when accessing unmapped memory locations To support the memory conversion process.

so in general, the/DEV/KVM device's role is to isolate the addresses between different guestos, or to isolate the addresses between Guestos and Hostos (VMM) QEMU

QEMU is an I/O virtualization solution that enables virtualization of a complete computer physical layer environment (EG. disk, graphics adapter, network device).

All I/O requests generated in Guestos are intercepted by QEMU and sent back to the user mode in the QEMU process simulation. Openstack, KVM, QEMU relationship

KVM is used to simulate the operation of the CPU, but it lacks support for network and I/O. QEMU-KVM is a complete simulator that provides complete network and I/O support based on KVM. Openstack in order to cross the VM, so not directly control the QEMU-KVM, but through the libvit of the library to indirectly control QEMU-KVM. implementation of the virtualization of KVM

The KVM kernel module introduces a new process pattern in addition to the existing Kernel mode and User mode for the Linux standard kernel. This new pattern is called the Guest mode mode, which, as the name suggests, is used to execute Guestos code.
The implementation mode of the Linux standard kernel can be defined for different operational content and purposes. The presence of Guest mode is intended to execute Guestos code, but only for those that are not I/O. I/O code also needs QEMU for support.

Guestos can be run in two modes: the Guestos that runs in guest mode can support the standard kernel. Guestos, which runs under User mode, supports its own kernel and user-space (applications).

Similarly, Guestos can only perform I/O operations under User mode, and this is managed separately using QEMU-KVM.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.