📜 ⬆️ ⬇️

The hardware paravirtualization mode will be available in the Xen 4.4 hypervisor and the Linux 3.14 kernel.


Transfer. Original on the Xen blog .

From the translator: currently the stable version of the Xen hypervisor supports two virtualization modes. In the paravirtual (PV) mode, the equipment is not emulated, and the guest OS must be specially modified to work in such an environment. Starting with version 3.0, the Linux kernel supports launching in paravirtual mode without recompiling with third-party patches. The advantage of the PV mode is that it does not require support for hardware virtualization from the CPU, and also does not spend computational (sometimes very significant) resources to emulate hardware on a PCI bus.
The hardware virtualization mode (HVM) appeared in Xen, starting with version 3.0 of the hypervisor, and requires hardware support. In this mode, QEMU is used to emulate virtual devices, which is very slow even with paravirtual drivers. However, over time, support for hardware virtualization in hardware has become so widespread that it is used even in notebook CPUs. Therefore, developers have a desire to use fast switching of the execution context between the hypervisor and the guest OS and in paravirtual mode, using the capabilities of the equipment. So a new mode appeared - hardware paravirtualization, which will be available in Xen, starting with version 4.4.

The Linux 3.14 kernel will support the new mode developed by Mukesh Rathor
from Oracle Corporation. The hardware paravirtualization (PVH) mode allows the guest OS to use the hardware capabilities of the platform, but does not require hardware emulation using QEMU. This is an impressive step in the evolution of the para-virtual mode.

The history and subtleties of the implementation of the PVH regime are described in detail in the article The Paravirtualization Spectrum, Part 2: From poles to a spectrum .
')
In short, the guest OS in Xen can now work in hardware virtualization (HVM) or paravirtualization (PV) mode. In PV mode, the guest OS kernel allows the hypervisor to program tables of memory pages, segments, etc. If the processor supports EPT / NPT extensions, then the cost of managing the memory in HVM mode (when the guest OS manages memory) is much less than when the hypervisor does in PV mode. So, in the new mode, the hypervisor does not manage memory and system calls inside the guest OS — all this happens inside the virtual machine container.

Such a “hybrid” paravirtualization mode is called “hardware paravirtualization” (PVH).

The advantages of this approach are in reducing the amount of code, more performance when making system calls (there is no context switching between the guest OS and the hypervisor), less delays in performing various operations, in a word - in a faster response of the guest OS.

The code implementing the PVH mode will be available in Xen, starting with version 4.4 (the 3rd release candidate of this version has already been released). If you compare the new mode with the para-virtualization mode, but there are almost no differences, except that the guest OS runs in HVM mode (but without PCI devices) and runs much faster. We are still working on the intricacies of ABI in the new mode, so ABI is still unstable.

This means that the next version of Xen may not even work with the current version of Linux ABI (and maybe it will). The new regime is highly experimental and unstable. We intend to bring it to the level of practical application, and by all means we strive for this goal.

It will help us a lot if users try to use the new mode, so that we can track errors and problems that we couldn’t imagine during the development phase.

How to use hardware paravirtualization?

The guest OS will boot as paravirtual, but the xen-detect utility will show that it is running in hardware virtualization mode.

The following features have not been tested:


The following functions do not work:


If you find an error, please send us the following information to xen-devel@lists.xenproject.org:


Please save your kernel images (vmlinuz). We may need them in the future, but they are too large to send them via e-mail.

Source: https://habr.com/ru/post/211034/


All Articles