Your SlideShare is downloading. ×
lectures
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

lectures

965

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
965
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Figs7/tramplne
  • Transcript

    • 1. CS 8803 Nate Clark (many slides from Jim Smith)
    • 2. Grades
      • 20% - Presentation
      • 8% - Paper writeup
      • 2% - Project proposal
      • 8% - Status report
      • 32% - Final project
      • 30% - Exam
      • Curve
    • 3. Introduction
      • Why virtual machines?
      • They allow transcending of standardized interfaces
      • (which sometimes are 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 technologies will be a key part of most future computer systems
      VMs (c) 2006, J. E. Smith
    • 4. Abstraction
      • Computer systems are built on levels of abstraction
      VMs (c) 2006, J. E. Smith
      • Higher level of abstraction hide details at lower levels
      • Example: files are an abstraction of a disk
      file file abstraction
    • 5. Virtualization
      • Similar to abstraction
        • Except
        • Same level of detail
      • Construct Virtual Disks
        • As files on a larger disk
        • Map state
        • Map operations
      • VMs: do the same thing with the whole “machine”
      • Key concepts: Map state; Map Operations
      VMs (c) 2006, J. E. Smith file file virtualization
    • 6. The Family of Virtual Machines
      • “ 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
      VMs (c) 2006, J. E. Smith
      • There are lots of “virtual machines”
        • IBM VM/370
        • Java
        • VMware products
      Including things not called “virtual machines” IA-32 EL HP Dynamo Transmeta Crusoe
    • 7. “ Machines”
      • Different perspectives on what the Machine is:
      • OS developer
      • Compiler developer
      • Application programmer
      • Instruction Set Architecture
        • ISA
        • Major division between hardware and software
      VMs (c) 2006, J. E. Smith
      • Application Binary Interface
        • ABI
        • User ISA + OS calls
      • Application Program Interface
        • API
        • User ISA + library calls
      I/O devices and Networking System Interconnect (bus) Memory Translation Execution Hardware Application Programs Main Memory Operating System Libraries
    • 8. System Virtual Machines
      • ISA level
      • Provide a system environment
      • VMM manages guest OS + apps
      • Persistent
      • Examples: IBM VM/360, VMware, Transmeta Crusoe
      VMs (c) 2006, J. E. Smith guest process HOST PLATFORM virtual network communication Guest OS VMM guest process guest process guest process Guest OS2 VMM guest process guest process
    • 9. Process Virtual Machines
      • ABI level
      • Runtime manages guest process
      • Guest processes may intermingle with host processes
      • Not persistent
      • Guest and host OSes are often the same
      • Dynamic optimizers are a special case
      • Examples: IA-32 EL, FX!32, Dynamo
      VMs (c) 2006, J. E. Smith HOST OS Disk file sharing network communication guest process create host process guest process runtime runtime guest process runtime host process
    • 10. High Level Language Virtual Machines
      • Constructed at API level
        • User higher level virtual ISA
        • OS abstracted as standard libraries
      • A form of process VM
      VMs (c) 2006, J. E. Smith 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
    • 11. Virtual Machine Architectures VMs (c) 2006, J. E. Smith Multi programmed Systems HLL VMs Co-Designed VMs same ISA different ISA Process VMs System VMs Whole System VMs different ISA same ISA Classic OS VMs Dynamic Binary Optimizers Dynamic Translators Hosted VMs
    • 12. VM Technology – State Mapping
      • VM SW re-maps virtual state to real state
        • Recall virtual disk
        • Registers to registers
        • Registers to memory
        • Memory to memory
        • Memory to disk
      VMs (c) 2006, J. E. Smith Guest Code Guest Data Runtime Data Runtime Code Guest Registers Host Registers Host ABI Address Space Host Register Space
    • 13. VM Technology – Operation Mapping
      • VM SW re-maps operations on state
      • Instruction-level state changes
        • Emulation
      • Protected state changes
        • OS operations
        • Done under VMM control
      • Key concepts: Emulation and Control
      VMs (c) 2006, J. E. Smith
    • 14. VM Technology – Emulation
      • Interpretation
        • Software loop decodes and dispatches each instruction
      VMs (c) 2006, J. E. Smith source code dispatch loop interpreter routines "data" accesses
    • 15. VM Technology – Emulation
      • Binary translation and code caching
        • Translate blocks of instructions at a time
        • Hold translated blocks in code cache
        • This was a key enabler for VMware success
      VMs (c) 2006, J. E. Smith source code binary translator binary translated target code
    • 16. VM Technology – Emulation
      • Staged Emulation
        • Emulation techniques invoked in staged manner
        • Based on performance tradeoffs
      VMs (c) 2006, J. E. Smith Code Cache Translator/ Optimizer Binary Memory Image Profile Data Interpreter Emulation manager
    • 17. Code Caches
      • Contain
        • Basic blocks
        • Superblocks (one entrance, multiple exits)
        • Optimized Superblocks
      • Used in many VMs
        • Dynamic binary translators: Intel IA-32 EL, Compaq FX!32
        • Dynamic binary optimizers: Dynamo family
        • Co-designed virtual machines: Transmeta, IBM DAISY
        • High performance Java virtual machines
        • System VMs with “inefficiently virtualizable” ISAs
        • “ Sandboxing” secure VMs ( x86 DynamoRIO )
      VMs (c) 2006, J. E. Smith
    • 18. Code Caching with Chaining
      • Chaining of blocks in code cache minimizes VM overhead
      VMs (c) 2006, J. E. Smith Superblock Dispatch table lookup code Superblock Superblock Superblock Code Cache
    • 19. VM Technology – Control
      • Interpretation
        • Fine grain control
        • Every dynamic instruction “inspected” before execution
      • Binary translation and code caching
        • Coarser grain control
        • Every static instruction inspected before execution
        • Jumps to VM SW can be inserted anywhere
      • Protection levels
        • Very coarse grain control
        • Every resource-related instruction trapped by protection system
          • Otherwise, use interpretation/translation techniques
        • Used in system VMs
      VMs (c) 2006, J. E. Smith
    • 20. Resource Control in System VMs
      • Traps and interrupts (& sys calls)
        • Transfer to VMM
        • VMM determines appropriate Guest OS
        • VMM transfers to Guest OS
      • Guest OS “return” to user app.
        • Transfer to VMM
        • VMM bounces return back to Guest app.
      • Resource sensitive instructions
        • Trap to VMM
        • VMM checks correctness
        • VMM reads/modifies guest resource
        • Returns to Guest
      VMs (c) 2006, J. E. Smith privileged operation next instruction check privileges perform operation return system call/trap vector location: virtual vector location: Application Guest OS VMM system return
    • 21. VMs and Computer Architecture
      • Use virtualization to give computer architects a layer of software
        • Beneath all conventional software
        • Maintains vision of hardware as seen by conventional software
      • Performance optimizations via Co-designed VMs
        • VM SW can alter/enhance architecture via emulation
      • Resource management – Private Virtual Machines
        • VM SW can manage microarchitecture resources
      VMs (c) 2006, J. E. Smith
    • 22. Co-Designed Virtual Machines
      • Separate the hardware/software interface from the ISA level of abstraction
      • Restore the ISA to its “natural” place
        •  as an I mplementation ISA that reflects actual hardware
      • Support existing ISAs
        •  as a Virtual ISA
      • Let processor designers use both
      • hardware and software
      • A form of system VM
      VMs (c) 2006, J. E. Smith OS libs. User Applications V-ISA I-ISA Hardware Software Hardware OS libs. User Applications ISA
    • 23. VM Technology -- Concealed Memory VMs (c) 2006, J. E. Smith
      • VM software resides in memory concealed from all conventional software
      • This software is available to hardware designer
      Source ISA Data Code Cache VM Code ICache Hierarchy DCache Hierarchy Processor Core Source ISA Code VM Data concealed memory conventional memory
    • 24. Co-Designed VMs
      • Of interest to both architects and micro-architects
        • Offers opportunities for performance, power saving, fault tolerance and other implementation-dependent features
        • Allows transcending conventional ISAs
        • Don’t confuse them with VLIW!
          • Early examples: IBM Daisy and Transmeta Crusoe
        • “ pioneers are the ones with arrows in their backs”
      VMs (c) 2006, J. E. Smith
    • 25. Another Way of Doing Things VMs (c) 2006, J. E. Smith conventional dynamic translation Code Cache Processor Pipeline Software Translator Main Memory Func. Unit Func. Unit . .. Main Memory Cache Hierarchy Processor Pipeline Translation Unit (form uops) Func. Unit Func. Unit Func. Unit . .. Translation Unit (form uops) Cache Hierarchy

    ×