SeriesOperating Systems12 / 16

Virtualization

Module 12 of CS 6200 - Graduate Introduction to Operating Systems @ Georgia Tech.

What is Virtualization?#

Overview#

Virtualization enables concurrent execution of multiple operating systems (and their applications) on the same physical machine. Each combination of OS, applications, and virtual resources is called a virtual machine.

virtualization

With virtualization, each OS running on the system integrates with the same underlying hardware resources. The virtualization layer (also known as virtual machine monitor [VMM]) supports management of physical hardware to share across virtual machines.

Virtualization is a relatively old concept - it originated at IBM in the 1960s in the context of mainframe computing and timesharing. Companies such as IBM were interested in increasing the efficiency of computing resource usage, and virtualization offered a means of limiting hardware while increasing compute. Today, virtualization is the foundation of modern cloud computing platforms such as AWS and Azure.

Formal Definition + Benefits#

A virtual machine is an efficient, isolated duplicate of the real machine. Popek and Goldberg (1974)

Any virtual machine has the following characteristics:

  1. Fidelity \rightarrow provides environment essentially identical to the original machine.
  2. Performance \rightarrow programs show at worst only minor decreases in speed.
  3. Safety & Isolation \rightarrow VMM is in complete control of system resources.

Virtualization is beneficial for a number of reasons:

Due to limited popularity in mainframe technology and cheap hardware, virtualization was not widely adopted in the past. More recently, server underutilization and datacenter growth contributed to an increase in virtualization efforts.

Virtualization Implementation#

Models#

There are two primary models for implementing virtualization:

hypervisor-based
hosted

Hardware Protection#

To uphold proper security standards, virtualization must guarantee the following:

Common hardware tends to have more than two protection levels. For example, x86 CPU architectures offer four protection rings (levels 0 through 3) and two protection modes (root vs. non-root). Protection rings have decreasing privilege with increasing level; for root mode, all hardware access operations are permitted.

CPU Virtualization#

In this context, we might implement Processor Virtualization as follows:

For non-privileged operations, VM instructions may bypass the VMM to directly execute on hardware. Privileged instructions trigger a VM exit, which refers to control switch from the VM to VMM. The VMM may then proceed as appropriate by 1) terminating the VM if the privileged instruction is illegal, or 2) emulating the required hardware if the instruction is permitted. Note that VM exits are analogous to the trap mechanism for regulating user-kernel control.

Certain instructions may alter critical system resources. If the VMM fails to account for this, there could be negative impacts on other VMs running on the same physical machine. Two approaches were taken to mitigate this issue:

Memory Virtualization#

Memory Virtualization refers to the implementation of memory within a virtual system.

To achieve full memory virtualization, each VM must have a contiguous physical address space starting at 0. Full memory virtualization systems may therefore distinguish between virtual vs. physical vs. machine address.

Alternatively, we can take a paravirtualization approach by modifying the VM itself. This no longer requires each VM to have continuous physical memory starting at 0. Instead, a paravirtualization memory system might explicitly register page tables with the VMM to determine the appropriate VA \rightarrow MA translation.

Device Virtualization#

Device Virtualization poses additional challenges due to the diverse nature of devices. In contrast to CPU / memory, there is no standard specification of device interface and behavior. To account for this diversity, device virtualization is typically accomplished using one of three primary models:

Hardware Virtualization#

Finally, modern hardware components such as the CPU have been explicitly designed to better support virtualization efforts. For example, consider Intel’s evolution of virtualization technology.

intel-virtualization

(all images obtained from Georgia Tech GIOS course materials)

License

CC BY-NC-SA 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Related Posts