Virtual Machines: Versatile Platforms
for Systems and Processes
INTRODUCTION
This material is based on the book, Virtual Machines: Versatile Platforms for
Systems and Processes, Copyright 2005 by Elsevier Inc. All rights reserved.
It has been used and/or modified with permission from Elsevier Inc.
Course Objectives
Study VM architectures and applications
Study key implementation technologies
Focus on architecture and microarchitecture
aspects
Cover significant case studies
Introduction 3
Introduction
Why are virtual machines interesting?
They allow transcending of interfaces
(which often seem to be an obstacle to innovation)
They enable innovation in flexible, adaptive software & hardware,
security, network computing (and others)
They involve computer architecture in a pure sense
Virtualization will be a key part of future computer systems
A fourth major discipline? (with HW, System SW, Application SW)
Introduction 4
Advantages of Standard Interfaces
Major design tasks are decoupled
• In space and time
Different hardware and software development
schedules
Software can run on any machine
supporting a compatible interface
MacIntosh apps. Windows apps. Linux apps
MacOS Windows Linux
PowerPC x86 x86
Introduction 5
There are also disadvantages…
Software compiled for one ISA will not run on hardware
with a different ISA
• Apple Mac (PowerPC) binaries on an x86?
Even if ISAs are the same, OSes may differ
• Windows NT applications on a Solaris x86?
Binary may not be optimized for the specific hardware
platform it runs on
• Intel Pentium 4 binaries on an AMD Athlon?
MacIntosh apps Windows apps.
MacOS
Linux
x86 x86
Introduction 6
Disadvantages (contd.)
Innovation may be inhibited by fixed ISA
• Hard to add new instructions
OR remove obsolete ones
• What was the most recent (successful) new ISA?
Or new OS?
Difficult for software to interact directly with
implementation
• Performance features
• Power management
• Fault tolerance
• Software is supposed to be implementation independent
Introduction 7
Hardware Resources
Conventional system software manages
hardware resources directly
• An OS manages the physical memory of a specific
size
• I/O devices are managed as physical entities
Difficult to share resources except through OS
• All users of hardware must use the same OS
• All users are vulnerable to attack from other users
sharing the resource (via security holes in OS)
Introduction 8
Abstraction
Software
Computer systems are built Application
Programs
on levels of abstraction fileLibraries
file
Higher level of abstraction abstraction
Operating System
hide details at lower levels Drivers
Memory
Manager
Scheduler
Example: files are an Execution Hardware
abstraction of a disk Memory
Translation
System Interconnect
(bus)
Controllers Controllers
I/O devices
Main
and
Memory
Networking
Hardware
Introduction 9
Virtualization
An isomorphism from guest to host
• Map guest state to host state
• Implement “equivalent” functions
e(Si )
Si Sj
Guest
V(Si ) V(Sj )
e'(Si')
Si' Sj'
Host
Introduction 10
Virtualization
Similar to abstraction
Except
• Details not necessarily hidden virtualization
Construct Virtual Disks file
file
• As files on a larger disk
• Map state
• Implement functions
VMs: do the same thing
with the whole “machine”
Introduction 11
The “Machine”
Different perspectives on
what the Machine is: Application
Programs
OS developer
Libraries
Compiler developer
Application programmer Operating System
Instruction Set Architecture Execution Hardware
Memory
Application Program Interface System Interconnect
Translation
(bus)
• API
• User ISA + library calls I/O devices
Main
and
Memory
Networking
Introduction 12
The “Machine”
Different perspectives on Application
Programs
what the Machine is:
Libraries
OS developer
Operating System
Execution Hardware
Instruction Set Architecture Memory
Translation
• ISA System Interconnect
(bus)
• Major division between hardware
I/O devices
and software and
Main
Memory
Networking
Introduction 13
The “Machine”
Different perspectives on Application
Programs
what the Machine is:
Libraries
Compiler developer
Operating System
Execution Hardware
Application Binary Interface Memory
Translation
• ABI System Interconnect
(bus)
• User ISA + OS calls
I/O devices
Main
and
Memory
Networking
Introduction 14
The “Machine”
Different perspectives on Application
Programs
what the Machine is:
Libraries
Application programmer
Operating System
Execution Hardware
Application Program Interface Memory
Translation
System Interconnect
• API (bus)
• User ISA + library calls I/O devices
Main
and
Memory
Networking
Introduction 15
Virtual Machines
add Virtualizing Software to a Host platform
and support Guest process or system on a Virtual Machine (VM)
Example: System Virtual Machine
Applications Applications
Guest
OS OS
Virtualizing
VMM Software
Virtual
Machine
Hardware
Host "Machine"
Introduction 16
The Family of Virtual Machines
Lots of things are called “virtual machines”
IBM VM/370
Java
VMware
Some things not called “virtual machines”, are virtual machines
IA-32 EL
Introduction 17
Taking a Unified View
“The subjects of virtual machines and
emulators have been treated as entirely
separate. … they have much in common. Not
only do the usual implementations have many
shared characteristics, but this commonality
extends to the theoretical concepts on which
they are based”
-- Efrem G. Wallach, 1973
Introduction 18
Major Program Interfaces
ISA Interface -- supports all conventional
software
Application Software
System Calls
Operating System
System ISA User ISA
ISA
Application Binary Interface (ABI)
-- supports application software only
Application Software
System Calls
Operating System
System ISA User ISA
ABI
Introduction 19
System Virtual Machines
Provide a system
guest
environment guest guest guest guest guest
process process process
process process process
Constructed at ISA Guest OS2
Guest OS
level
Persistent VMM VMM
Examples: IBM
VM/360, VMware, HOST PLATFORM
Transmeta Crusoe
virtual
network communication
Introduction 20
System Virtual Machines
Native VM System Virtual
Virtual
• VMM privileged mode Machine
Machine
Virtual
• Guest OS user mode Machine Non-privileged
VMM modes
VMM
• Example: classic IBM
VMs HostHost
OS OS
VMM Privileged
User-mode Hosted VM Mode
Hardware
• VMM runs as user Hardware
Hardware
application
Dual-mode Hosted VM
• Parts of VMM privileged;
parts non-
privileged
• Example VMware
Introduction 21
Process VMs
Execute application binaries with an ISA different from
hardware platform
Couple at ABI level via Runtime System
Examples: IA-32 EL, FX!32
Guest Application Process Application Process
Runtime Virtualizing
Software
OS Virtual
Machine
Host Machine
Hardware
Introduction 22
Process Virtual Machines
Constructed at ABI level
Runtime manages guest
process host guest
Not persistent process process
Guest processes may runtime
intermingle with host guest guest
process host
processes process
process
As a practical matter, guest runtime
runtime
create
and host OSes are often
the same HOST OS
Dynamic optimizers are a
special case file sharing
Disk
Examples: IA-32 EL, FX!32, network communication
Dynamo
Introduction 23
Same-ISA Dynamic Binary Optimizers
Optimize Binary at Runtime HP Apps
An ABI level optimization
A type of Process VM UNIX
Example HP Dynamo
• Can optimize for dynamic
properties of program HP PA
• Can optimize for a specific
processor implementation
Introduction 24
HLL VMs
Java and CLI are recent examples
Binary class files are distributed
“ISA” is part of binary class format
OS interaction via APIs (part of VM platform)
Java Binary Classes
Java VM
Architecture
VM VM VM
implementation implementation implementation
Sparc x86 Apple
Workstation PC Mac
Introduction 25
High Level Language Virtual Machines
Raise the level of abstraction
• User higher level virtual ISA
• OS abstracted as standard libraries
Process VM (or API VM)
HLL Program HLL Program
Compiler front-end Compiler
Intermediate Code Portable Code
( Virtual ISA )
Compiler back-end
Object Code VM loader
(ISA) Virt. Mem. Image
Loader VM Interpreter/Translator
Memory Image Host Instructions
Traditional HLL VM
Introduction 26
Co-Designed VMs
Perform both translation and
optimization X86 Apps
VM provides interface between
standard ISA software and Windows
implementation ISA
Primary goal is performance or
power efficiency
Use proprietary implementation ISA
VLIW
Transmeta Crusoe and IBM Daisy
best-known examples
Introduction 27
Composition
apps 1
OS 1
apps 2
OS 1
ISA 2
Introduction 28
Composition: Example
Java application
JVM
Linux x86
VMware
Windows x86
Code Morphing
Crusoe VLIW
Introduction 29
Summary (Taxonomy)
VM type (Process or System)
Host/Guest ISA same or different
Process VMs System VMs
different different
same ISA same ISA
ISA ISA
Multiprogrammed IA-32 EL IBM VM/370 Virtual PC
Systems FX!32 for Mac
VMware
HP
Dynamo Transmeta
Java VM
Crusoe
MS CLI
Introduction 30