Virtual Machines (Introduction to Virtual Machines)
Chihun Kim
([email protected])
Virtual Machines
1/35
Contents
Abstraction, Virtualization of Computer System Architecture, Implementation Layers What is VM and Where is VM? What kind of VM
Process VM System VM
Example of Complex VM Usage Rest of the book
Virtual Machines
2/35
Abstraction, Virtualization of Computer System Modern computer system is very complex
Hundreds of millions of transisters Interconnected high-speed I/O devices Networking infrastructures Operating systems, libraries, applications Graphics and networking softwares
To manage this complexity
Levels of Abstractions
seperated by well-defined interfaces
Virtualizations
Virtual Machines
3/35
Abstraction, Virtualization of Computer System Levels of Abstraction
Allows implementation details at lower levels of design to be ignored or simplified Each level is seperated by well-defined interfaces
Design of a higher level can be decoupled from the lower levels
Virtual Machines
4/35
Abstraction, Virtualization of Computer System Disadvantage
Components designed to specification for one interface will not work with those designed for another.
Component A Interface A
Component A
Interface A
Interface B
Component A
Interface B
Virtual Machines
5/35
Abstraction, Virtualization of Computer System Virtualization
Similar to Abstraction but doesnt always hide low layers details Real system is transformed so that it appears to be different
Resource AA BB BB
isomorphism
Resource A B B
Virtualization can be applied not only to subsystem, but to an Entire Machine Virtual Machine
Virtual Machines
6/35
Abstraction, Virtualization of Computer System
Virtualization
Applications or OS Application uses virtual disk as Real disk
Virtualized Disk
Virtualization
File
File
Abstraction
Real Disk
Virtual Machines
7/35
Architecture, Implementation Layers
Architecture
Functionality and Appearance of a computer system but not implementation details Level of Abstraction = Implementation layer
ISA, ABI, API ABI
Operating System Drivers Memory Scheduler Manager Memory Translation Application Programs Libraries
API ISA
Execution Hardware
System Interconnect (Bus) Controllers Controllers Main Memory
8/35
IO Devices, Networking
Virtual Machines
Architecture, Implementation Layers
Implementation Layer : ISA
Instruction Set Architecture Divides hardware and software Concept of ISA originates from IBM 360
IBM System/360 Model (20, 40, 30, 50, 60, 62, 70, 92, 44, 57, 65, 67, 75, 91, 25, 85, 95, 195, 22) : 1964~1971 Various prices, processing power, processing unit, devices But guarantee a software compatibility
User ISA and System ISA
Virtual Machines
9/35
Architecture, Implementation Layers
Implementation Layer : ABI
Application Binary Interface Provides a program with access to the hardware resource and services available in a system Consists of User ISA and System Call Interfaces
Virtual Machines
10/35
Architecture, Implementation Layers
Implementation Layer : API
Application Programming Interface Key element is Standard Library ( or Libraries ) Typically defined at the source code level of High Level Language
clib in Unix environment : supports the UNIX/C programming language
Virtual Machines
11/35
What is a VM and Where is the VM?
What is Machine?
2 perspectives
From the perspective of a process
ABI provides interface between process and machine
From the perspective of a system
Underlying hardware itself is a machine. ISA provides interface between system and machine
Virtual Machines
12/35
What is a VM and Where is the VM?
Machine from the perspective of a process
ABI provides interface between process and machine
Application Software System calls
Application Programs Operating System Drivers
Libraries
User ISA ABI Machine
Memory Scheduler Manager Memory Translation
Execution Hardware
System Interconnect (Bus) Controllers IO Devices, Networking Virtual Machines Controllers Main Memory
13/35
What is a VM and Where is the VM?
Machine from the perspective of a system
ISA provides interface between system and machine
Application Software
Application Programs Operating System Drivers
Libraries
Operating System
Memory Scheduler Manager Memory Translation
System ISA
User ISA ISA Execution Hardware
Machine
System Interconnect (Bus) Controllers IO Devices, Networking Virtual Machines Controllers Main Memory
14/35
What is a VM and Where is the VM?
Virtual Machine is a Machine.
VM virtualizes Machine Itself!
There are 2 types of VM
Process-level VM System-level VM
VM is implemented as combination of
Real hardware Virtualizing software
Virtual Machines
15/35
What is a VM and Where is the VM?
Process VM
VM is just a process from the view of host OS
Application on the VM cannot see the host OS
Application Process Application Software System calls ABI User ISA ABI Machine Host System calls Virtualizing Software Runtime Guest
OS
Virtual User ISA Machine
Hardware
Virtual Machines
16/35
What is a VM and Where is the VM?
System VM
Provides a system environment
Application Software
Applications Guest
Operating System
OS Virtualizing Software ISA Runtime
System ISA
User ISA
Machine
Virtual Machine
Hardware
Virtual Machines
Host
17/35
What is a VM and Where is the VM?
System VM
Example of a System VM as a process
VMWare
Applications
Guest OS Other Host Applications Virtualizing Software (VMWare) Host OS
Hardware
Virtual Machines
18/35
What kind of VMs
Process Virtual Machines
Multiprogramming Emulators and Dynamic Binary Translators Same-ISA Binary Optimizers HLL (High Level Language) Virtual Machines
System Virtual Machines
Whole-System Emulations Codesigned Virtual Machines
Virtual Machines
19/35
What kind of VMs (Process VM)
(1) Multiprogramming
Process VM
First and most common virtual machine
We dont think of this as a VM
Each user is given the illusion of having a complete machine
Virtual Machines
20/35
What kind of VMs (Process VM)
(2) Emulators and Dynamic Binary Translators
Emulates one instruction set on hardware designed for another
As a practical matter, guest and hosts are often the same
Example: FX!32, Aries system
IA-32 Windows Application
Windows OS (for Alpha) Alpha ISA
VM Runtime
FX!32 : guest and host have same ISA
Virtual Machines
21/35
What kind of VMs (Process VM)
Components of Aries system
HP, PA-RISC to IA-64: Transparent Execution, No Recompilation, Cindy Zheng, Carol Thompson, IEEE 2000
HP PA-RISC 7300LC
Program binary for PA-RISC can run on the IA-64 hardware PA-RISC is a microprocessor architecture developed by HP. PA stands for Precision Architecture.
Sometmies, PA is considered to stand for Palo Alto, the location of HPs headquaters. (from Wikipedia)
Virtual Machines
22/35
What kind of VMs (Process VM)
Implemented with
Interpreter or Binary Translator
Interpreter
Emulates the execution of individual source instruction Very slow ( requires 10x processing power )
Binary Translator
Block of source instructions are converted to target instructions Translated blocks are stored in VMs memory Static / dynamic schemes
Virtual Machines
23/35
What kind of VMs (Process VM)
(3) Same-ISA Binary Optimizers
Source ISA and Target ISA are same
Binary optimizer collects a profile and use this information to optimize application on the fly Example: HP Dynamo
Virtual Machines
24/35
What kind of VMs (Process VM)
How HP Dynamo works
HP, Transparent Dynamo Optimization: The Design and Implementation of Dynamo, Vasanth Bala, Evelyn Duesterwald, Sanjeev Banerjia, 1999
Virtual Machines
25/35
What kind of VMs (Process VM)
(4) HLL (High Level Language) Virtual Machines
Main goal is
platform-independence of a application Full cross-platform portability
Binary class files are distributed ISA is part of binary class format Higher level of abstraction
Higher level Virtual ISA OS is abstracted as standard libraries (API)
Virtual Machines
26/35
What kind of VMs (Process VM)
Conventional System and HLL VM
Different layer of distribution
HLL Program Compiler frontend Intermediate Code Compiler backend Object Code Distribution Loader Memory Image
HLL Program Compiler Portable Code Distribution VM loader Virtual Memory Image VM Interpreter / Compiler Host Instructions
(a) Conventional System
(b) HLL VM environment Virtual Machines
27/35
What kind of VMs (Process VM)
Example : Java
Java Source
Java Binary Classes
Java VM Implementation Sparc Workstation
Java VM Implementation X86 PC
Java VM Implementation Apple Mac
Virtual Machines
28/35
What kind of VMs (System VM)
(1) Whole-System Emulations
Host and guest systems dont have a common ISA
Apple PowerPC-based system and Windows PC Sun servers and Windows PC
Both applications and OS code require emulation
Via binary translation
Example: VMWare Challenges
If the properties of hardware resources are significantly different Emulation of ISA features such as virtual memory management or trap handling
Virtual Machines
29/35
What kind of VMs (System VM)
Example : VMWare
Applications
Guest OS Other Host Applications Virtualizing Software (VMWare) Host OS
Hardware
Virtual Machines
30/35
What kind of VMs (System VM)
(2) Codesigned Virtual Machines
Primary goals are
Performance improvement and power efficiency Uses new ISA and hardware features to execute other ISA
VM is a part of hardware design
Includes a binary translator or dynamic optimizer
Applications
Example: Transmeta Crusoe, IBM Daisy
Old ISA
OS
Codesigned VM New ISA New hardware
Virtual Machines
31/35
What kind of VMs (System VM)
Transmeta Crusoe
Transmeta Corp., The Technology Behind CrusoeTM Processors : Low-power x86-compatible processors implemented with Code MorphingTM software, Alexdander Klaiber, 2000
Translated from x86 ISA to Crusoe VLIW ISA by code morphing software
Transmeta Crusoe
Virtual Machines
32/35
What kind of VMs (System VM)
IBM Daisy : ISCA97
Dynamically Architected Instruction Set from Yorktown
http://researchweb.watson.ibm.com/daisy/ Virtual Machines
33/35
Example of Complex Composition
Java Application JVM Linux IA-32 VMWare Windows IA-32 Code Morphing
Crusoe VLIW
Virtual Machines
34/35
The Rest of this Textbook
Chapter.2 Chapter.3 Process VM Chapter.4 Chapter.5 Chapter.6 Chapter.7 System VM Chapter.8 Chapter.9 Bonus Chapter.10
Concepts and Techniques in Emulation : Emulating ISA and Binary Translation Techniques Process VM Architecture and Construction Issues Dynamic Optimization : to improve VM performance Architecture of HLL VM : Popular HLL VM ( Pascal P-code, Java ) HLL VM Implementation Codesigned VM : hardware-based performance enhancements Conventional System VM : Basic mechanisms for implementation Virtualization issues in Multiprocessor environment : Partitioning Future of Virtual Machines
Virtual Machines
35/35