1 / 10

CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines

CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines. Mark Zbikowski and Gary Kimura. What is “ Virtualization ” ?. Beyond the buzz-word du jour: Abstraction of computing resources Hide the physical characteristics of a resource Allow multiple “ instances ” of the resource

amanda
Download Presentation

CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 451: Operating SystemsWinter 2012Module 18Virtual Machines Mark Zbikowski and Gary Kimura

  2. What is “Virtualization”? • Beyond the buzz-word du jour: • Abstraction of computing resources • Hide the physical characteristics of a resource • Allow multiple “instances” of the resource • Why? • Sharing the resource among multiple clients • Disks (I/O system) • Cpu (scheduler and context switches) • Memory (processes and virtual memory) • Fault isolation • Application • Operating System • Hardware(!)

  3. Classes of Virtualization • Resource • aggregation, spanning, or concatenation combines individual components into larger resources or resource pools (RAID) • VPN or NAT • Multiprocessor/multicore • Encapsulation: hide complexity by the creation with simplified interface.

  4. Classes of Virtualization • Platform • 1960’s term: virtual machines used hardware and software • Host running sofware using hardware assistance to execute a guest • Guest can be application or entire OS • Guest runs as if it were installed on bare metal • Typically many guests run on a single host

  5. Platform Virtualization – What? • Emulation/simulation • Software/hardware decodes each instruction and emulates the guest hardware • Emulate completely different CPU (VirtualPC on PowerPC Mac) • Typically slow (but some clever tricks can be used) • Native/Full Virtualization • Host emulates only enough hardware to allow guest to run unmodified • OS-Level Virtualization • “personalities” • Underlying OS emulates programming environment: Win32, POSIX, OS/2

  6. Platform Virtualization – How? • Emulation/Simulation • Naively, very slow: decode and execute instruction • Why not play compiler? • “dynamic recompilation” • Decode sequence of guest instructions (basic block) • Generate native host instructions • Hash table of guest address -> codelet block • Memory management emulation difficult • Simulate page directory/table and TLB • Java VM and VirtualPC

  7. Platform Virtualization – Difficulties • Requirements • Fidelity: guest executes identically to execution on native hardware, barring timing effects • Performance: an overwhelming majority of guest instructions are executed by the hardware without intervention by host • Safety: host manages all hardware resources • X86 is not classically virtualizable • Run guest in unprivileged mode (“deprivileging”) • Trap to host on illegal instructions, emulate effects in guest • Illegal instructions: • CR (chip control registers) • I/O port • Memory-mapped devices

  8. More x86 woes • Primary and shadow structures • Host maintains shadows of guest’s primary structures • On-CPU state: • Page directory pointer • Processor status register (interrupt state, flags, debug state) • Trivial to maintain • Off-CPU state: • Page tables • Encodes mappings and permissions • Modified by guest AND guest H/W

  9. Improving host performance • Allow slightly modified guests • Augment the “hardware” to add host-calls • VMWare Tools/VirtualPC Machine Additions • Device drivers that export the I/O at a high level for emulation • Dynamic recompliation • Hardware extensions • Intel VMRUN VMEXIT instructions • Hardware maintains shadow state • Traps to host when needed • Too limited to be of value

  10. Platform Virtualization • Emulating an “environment” • “Win32 API” implemented on Windows 95 • Native API to DOS/Win-based kernel • Windows NT built to allow emulation • DLLs in application address space emulate Windows 95 API but run on an entirely different operating system • Vast majority of Windows 95 applications ran on Windows NT 4 without modification • Java • Byte-code defines a virtual machine • Emulator written in portable C, can be compiled and run on almost all hardware architectures • Pcode can be run anywhere • Dynamic recompilation (aka incremental compilation)

More Related