Introduction to Virtual Machines Michael Jantz Acknowledgements - - PowerPoint PPT Presentation

introduction to virtual machines
SMART_READER_LITE
LIVE PREVIEW

Introduction to Virtual Machines Michael Jantz Acknowledgements - - PowerPoint PPT Presentation

Introduction to Virtual Machines Michael Jantz Acknowledgements Slides adapted from Chapter 1 in Virtual Machines: Versatile Platforms for Systems and Processes by James E. Smith and Ravi Nair Credit to Prasad A. Kulkarni some slides


slide-1
SLIDE 1

Introduction to Virtual Machines

Michael Jantz

slide-2
SLIDE 2

Acknowledgements

  • Slides adapted from Chapter 1 in Virtual

Machines: Versatile Platforms for Systems and Processes by James E. Smith and Ravi Nair

  • Credit to Prasad A. Kulkarni – some slides

were borrowed from his course on Virtual Machines at the University of Kansas

2

slide-3
SLIDE 3

Introduction to Virtual Machines

  • Abstraction and interfaces
  • Virtualization
  • Computer system architecture
  • Process virtual machines
  • System virtual machines

3

slide-4
SLIDE 4

Abstraction

  • Mechanism to manage complexity in

computer systems.

  • Partitions design of a system into levels
  • Allows higher levels to ignore the

implementation details of lower levels

4

slide-5
SLIDE 5

Interfaces

  • Define the communication b/w two entities
  • Hierarchical relationship
  • Linear relationship
  • Software can run on any machine

supporting a compatible interface

5

PowerPC MacOS MacIntosh apps. x86 Linux Linux apps x86 Windows Windows apps.

slide-6
SLIDE 6

Interfaces: Advantages

  • Allows de-coupling of design tasks
  • Work on different components can progress

independently

  • Helps manage system complexity
  • Each component provides an abstraction of

itself to the outside world

6

slide-7
SLIDE 7

Interfaces: Disadvantages

  • Limit flexibility
  • Developers must work within the constraints
  • f the interface
  • Can be confining
  • ARM binaries on x86 machine?
  • Windows applications on Linux?

7

MacOS MacIntosh apps x86 x86 Windows apps. Linux

slide-8
SLIDE 8

Interfaces: Disadvantages

  • Inhibits innovation
  • Hard to change instruction sets
  • Application software cannot directly exploit

microprocessor features

  • Software is supposed to be architecture

independent!

8

slide-9
SLIDE 9

Virtualization

  • Map the interface of one system to a real

system that actually implements it

  • Removes constraints imposed by interfaces
  • Improves availability of application software
  • Removes the assumption of a single regime,

improves security and failure isolation

  • Provide a different view to a particular

computer resource

  • Not necessarily a simpler view

9

slide-10
SLIDE 10

Virtualization

  • Creates an isomorphism that maps a

virtual guest to a real host

10

Si S Si ' S

j'

Guest Host

V( S

i)

V(S

j)

e(S

i)

e '(Si')

j

slide-11
SLIDE 11

Virtualization vs. Abstraction

  • Virtualization does not necessarily hide details

11

file file virtualization

slide-12
SLIDE 12

Virtual Machines

  • Virtualization applied to the entire machine
  • Adds a layer of software to a real machine

to support the desired architecture

  • Process of virtualization
  • Maps virtual resources or state to real

resources

  • Uses real machine instructions to carry out

actions specified by the VM instructions

12

slide-13
SLIDE 13

Benefits of VM's

  • Flexibility
  • Portability
  • Isolation
  • Security

13

slide-14
SLIDE 14

Computer Architecture

  • Architecture: functionality and appearance
  • f a computer system
  • Implementation: embodiment of the

architecture

14

slide-15
SLIDE 15

Computer Architecture

  • Computer systems

consist of:

  • Layers of abstraction
  • Well-defined interfaces

15

I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries

slide-16
SLIDE 16

The ISA Interface

  • Interface between

hardware & software

  • Two parts
  • System ISA
  • User ISA

16

I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries

slide-17
SLIDE 17

The ISA Interface

  • System ISA
  • Important for OS

developers

17

I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries

slide-18
SLIDE 18

The ABI Interface

  • Application Binary

Interface (ABI)

  • User ISA + system calls
  • Important for compiler

writers

18

I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries

slide-19
SLIDE 19

The API Interface

  • Application

Programming Interface (API)

  • User ISA + library calls
  • Important for

application programmers

19

I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries

slide-20
SLIDE 20

Major Program Interfaces

  • ISA – supports all conventional software
  • ABI – supports application software only

20

System Calls User ISA System ISA

ISA

Application Software Operating System System Calls User ISA System ISA

ABI

Application Software Operating System

slide-21
SLIDE 21

Process Virtual Machines

  • Supports an individual process
  • Run SW for a different OS and different ISA
  • Couple at ABI level via runtime system

21

Virtualizing Software Application Process Machine OS Hardware

Guest Runtime Host

Application Process

Virtual Machine

slide-22
SLIDE 22

Process Virtual Machines

  • Guest processes intermingle

with host processes

  • Binaries encapsulated by

the runtime

  • PVM does not include OS
  • Examples:
  • Java
  • IA-32 EL
  • Dynamic optimizers

(dynamo)

HOST OS

Disk

file sharing network communication guest process create host process guest process

runtime runtime

guest process

runtime

host process

22

slide-23
SLIDE 23

PVM: Multiprogramming

  • OS provides PVMs for each application
  • System calls + user ISA == PVM to

execute multiple, concurrent processes

  • Each process is given the illusion of

having the entire machine to itself

23

slide-24
SLIDE 24

PVM: Emulators

  • Execute binaries compiled for one ISA on

a machine with a different ISA

  • Emulation methods
  • Interpretation
  • Fast startup, but slow steady-state
  • Dynamic binary translation
  • High startup overhead, faster steady-state
  • Uses a code cache to store translated blocks
  • Examples: Java, IA32-EL

24

slide-25
SLIDE 25

PVM: Binary Optimizers

  • Same source and target ISAs
  • Main task is optimization
  • ABI level optimization
  • May also collect performance profiles
  • May also enhance security
  • e.g., HP's Dynamo

25

slide-26
SLIDE 26

PVM: High-Level Language VMs

  • Designed for VM execution
  • Aim to minimize HW- and OS-specific features

26

HLL Program Intermediate Code Memory Image Object Code (ISA) Compiler front-end Compiler back-end Loader HLL Program Portable Code ( Virtual ISA ) Host Instructions

  • Virt. Mem. Image

Compiler VM loader VM Interpreter/Translator Traditional HLL VM

slide-27
SLIDE 27

PVM: High-Level Language VMs

  • Distribution format is binary class files
  • Virtualized ISA (no real implementation)
  • OS interaction via API
  • Examples: Java, Micosoft CLI

27

Sparc Workstation Java Binary Classes x86 PC Apple Mac VM implementation VM implementation VM implementation

Java VM Architecture

slide-28
SLIDE 28

System Virtual Machines

  • Supports an OS with many user-level processes
  • Couple at the ISA level
  • Examples: VMWare, Transmeta Crusoe

28

Hardware "Machine" OS Applications Virtualizing Software

Virtual Machine

OS Applications

Guest VMM Host

slide-29
SLIDE 29

Classic System Virtual Machine

  • Original meaning of the term virtual machine
  • All guest and host software use the same ISA
  • VMM runs on bare hardware (privileged mode)
  • VMM intercepts all privileged operations for the guest OS's

29

Linux process Win process HOST PLATFORM

virtual network communication

Guest OS (Windows) Win process Win process Guest OS2 (Linux)

VMM

Linux process Linux process

slide-30
SLIDE 30

Hosted VM

  • VMM built on top of existing OS
  • Advantages
  • Installs just like a user-level application
  • Host OS provides driver support
  • Drawbacks
  • Less efficient

30

slide-31
SLIDE 31

Whole System VMs

  • Host and guest do not use a common ISA
  • Both app and OS code require emulation
  • Typically implemented as a hosted VMM
  • Example: VirtualPC

31

slide-32
SLIDE 32

Co-designed Virtual Machines

  • Designed to enable innovative ISA's and/or

hardware implementations

  • As if the VM software is part of the HW
  • Applications / OS never directly execute native

ISA instructions

  • Useful for backwards compatibility
  • Example: Transmeta Crusoe

32

slide-33
SLIDE 33

VM Taxonomy

33