Database Reference
In-Depth Information
Guest
applications
Guest
applications
Guest
applications
Guest OS
Guest OS
Unprivileged
mode
Applications
Guest OS
Hypervisor
Hypervisor
Privileged
mode
OS
Hypervisor
Host OS
Host OS
Hardware
Hardware
Hardware
Hardware
Traditional
systems
Native
system VMs
User-mode hosted
system VMs
Dual-mode hosted
system VMs
FIGURE 16.11
Different system VM classes.
mode. This system is called user-mode hosted system VM . In this case, privileged
instructions from guest OS(s) still need to trap to the hypervisor. In return, the hyper-
visor needs also to trap to the host OS. Clearly, this increases the overhead by add-
ing one more trap per every privileged instruction. Nonetheless, the hypervisor can
utilize the functions already available on the host OS to manage hardware resources.
Finally, the hypervisor can operate partly in privileged mode and partly in user mode
in a system referred to as dual-mode hosted system VM . This way, the hypervisor can
make use of the host OS's resource management functions and also preclude the one
more trap per each privileged instruction incurred in user-mode-hosted system VMs.
16.6 CPU VIRTUALIZATION
Virtualizing a CPU entails two major steps: (1) multiplexing a physical CPU (pCPU)
among virtual CPUs (vCPUs) associated with virtual machines (this is usually referred
to as vCPU scheduling), and (2) virtualizing the ISA of a pCPU to make vCPUs
with different ISAs run on this pCPU. First, we present some conditions for virtu-
alizing ISAs. Second, we describe ISA virtualization. Third, we make distinction
between two types of ISA virtualization, full virtualization and paravirtualization.
Fourth, we discuss Emulation, a major technique for virtualizing CPUs. Fifth, we
recognize between two kinds of VMs: Simultaneous Multiprocessing (SMP) and
Uniprocessors (UP) VMs. Finally, we close with a discussion on vCPU scheduling.
As examples, we present two popular Xen vCPU schedulers.
16.6.1 t he C onDitions For v irtualizing isa s
The key to virtualize a CPU lies in the execution of both privileged and unprivileged
instructions issued by guest virtual processors. The set of any processor instruc-
tions is documented and provided in the ISA. Besides, special privileges to system
resources are permitted by defining modes of operations (or rings) in the ISA. Each
 
Search WWH ::




Custom Search