Chinaunix首页 | 论坛 | 博客
  • 博客访问: 589853
  • 博文数量: 197
  • 博客积分: 7001
  • 博客等级: 大校
  • 技术积分: 2155
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-24 00:29
文章分类

全部博文(197)

文章存档

2022年(1)

2019年(2)

2015年(1)

2012年(100)

2011年(69)

2010年(14)

2007年(3)

2005年(7)

分类: 虚拟化

2011-10-14 11:37:43

来自Beautiful Architecture 第七章

VMM相比OS的优点
However, it is unsatisfactory because the user has much less flexibility and performance isolation.

paravirtualization
The idea of paravirtualization is to remove all the features of an architecture (such as the x86) that are difficult or expensive to virtualize, and to replace these with paravirtual operations that communicate directly with the virtualization layer. The technique was first used in Denali,a virtual machine monitor that hosts the specially written Ilwaco guest operating system. Xen went one step further by running paravirtualized versions of commodity operating systems.*

One backend can support frontends from Linux, BSD, or Windows, whereas the
same frontend can be used with various backends, so features such as copy-on-write,
encryption, and compression can be added transparently to the guest.

xen的影响
the fact that Xen was released as open source software, has brought us to a
point where proprietary operating system developers are paravirtualizing parts of their code,so that they will run more efficiently on hypervisors such as Xen. Even more encouragingly, the paravirtual operations developed for Xen and other hypervisors have been standardized in the latest version of the Linux kernel. By incorporating Xen (and other hypervisor) support in the standard kernel, the uptake of virtualization becomes even easier.

HOSTED VIRTUALIZATION
In this case, each virtual machine effectively becomes a process in the host operating system. The host operating system is responsible for the management functions that domain zero performs on Xen. The hosted hypervisor and management software are like a regular application, which sits on top of (and might plug into) a commodity operating system;  The main advantage of this approach is that installing a hosted hypervisor is as simple as installing a new application, whereas installing a native hypervisor such as Xen is more akin to installing a new operating system. Therefore hosted virtualization is better suited for nonexpert users.
On the other hand, the advantage of a native hypervisor is that it can achieve better performance, because the native hypervisor is a far thinner layer of software than the combined host operating system and hypervisor.

Changes to the device architecture between Xen 1.0 and 2.0
In version 1.0,the virtual backends were implemented inside the hypervisor: all domains, including domain zero, accessed the hardware through these devices. In version 2.0, the hypervisor was slimmed down, and domain zero was given access to the hardware with native drivers. Therefore, the backend drivers moved to domain zero.

how a split device is used. (copyless transfer and asynchronous notification.)
The guest provides the frontend driver with a page of memory, either containing data to be written or to hold data that is read in (1). The frontend driver places a request in the next available slot in the shared ring-buffer, which contains a reference to the provided page (2), and tells the hypervisor to notify the driver domain that a request is pending (3). The backend wakes up and maps the provided page into its address space (4) so that the hardware can interact with it using DMA (5). Finally, the backend notifies the frontend that the request has completed (6), and the frontend notifies the guest application (7).

Xen supports a shared memory mechanism called grant tables, whereby each virtual machine maintains a table that defines which of its pages can be accessed by other virtual machines. An index in this table is called a grant reference, which, when given to another virtual machine, acts as a capability.

The advantages of asynchronous notification:much-improved throughput(request和response批量处理)

The latest version of Xen includes code from Bochs and QEMU, which are both emulators.
However, even though they use parts of Bochs and QEMU, Xen’s hardware virtual machines are virtualized and not emulated. The Bochs code provides the BIOS, which supports the boot process, and QEMU provides emulated drivers for a range of common devices. However, these pieces of code are only invoked at startup and when an I/O operation is attempted. The majority of other instructions run directly on the CPU.

It’s often true that a naïvely hardware-virtualized operating system performs worse than a paravirtualized operating system, but there are two mitigating factors.
First, the processor vendors are continually developing new features that optimize
virtualization.例如 IOMMU,再如Enhancing the memory management hardware can also remove the need for shadow page tables.It should be noted that Xen’s shadow page table implementation is highly optimized, and achieves competitive performance, but still has some overhead when compared with paravirtualized page tables.

一个非常有趣的技术:Xen can modify the virtual hardware on which the operating system runs. To this end, the emulated hardware provides a Xen platform device, which appears as a PCI device to unmodified guest operating systems and provides access to the virtual platform. It is then possible to write frontend devices for the unmodified operating systems, which operate in the same way as frontends in paravirtualized operating systems. By doing this, we achieve I/O performance in hardware virtual machines that is comparable to the paravirtualized case.

Lessons Learned
Looking back, there are two main lessons that can be drawn from Xen: the importance of
paravirtualization, and the benefits of open source development.

Further Reading
Fraser, Keir, et al. “Safe hardware access with the Xen virtual machine monitor,”
Proceedings of the 1st OASIS Workshop, October, 2004.
The following papers describe some of the new chipset and processor technology that has been developed to aid virtualization:
Ben-Yehuda, Muli, et al. “Using IOMMUs for virtualization in Linux and Xen,”
Proceedings of the 2006 Ottawa Linux Symposium, July, 2006.
Dong, Yaozu, et al. “Extending Xen with Intel virtualization technology,” Intel®
Technology Journal, August, 2006.

阅读(841) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~