A Unified View of Virtual Machines



Similar documents
Introduction to Virtual Machines

System Virtual Machines

An Overview of Virtual Machine Architectures

Virtual Machines. Adapted from J.S. Smith and R. Nair, VIRTUAL MACHINES, Morgan-Kaufmann Teodor Rus.

CS 695 Topics in Virtualization and Cloud Computing. More Introduction + Processor Virtualization

Virtualization. Jia Rao Assistant Professor in CS

Full and Para Virtualization

Cloud Computing #6 - Virtualization

Chapter 5 Cloud Resource Virtualization

Virtualization. Pradipta De

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

12. Introduction to Virtual Machines

Virtual Machines. Virtual Machines

An Overview of Virtual Machine Architectures

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Virtualization. Dr. Yingwu Zhu

COS 318: Operating Systems. Virtual Machine Monitors

Virtual Machines and Their Architecture

x86 ISA Modifications to support Virtual Machines

Virtualization. Jukka K. Nurminen

Virtualization. ! Physical Hardware. ! Software. ! Isolation. ! Software Abstraction. ! Encapsulation. ! Virtualization Layer. !

Cloud Computing. Up until now

Jukka Ylitalo Tik TKK, April 24, 2006

x86 Virtualization Hardware Support Pla$orm Virtualiza.on

Virtualization. Explain how today s virtualization movement is actually a reinvention

Virtual Machines.

Introduction to Virtual Machines

Virtualization Technology. Zhiming Shen

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtual Computing and VMWare. Module 4

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

COS 318: Operating Systems

Clouds, Virtualization and Security or Look Out Below

Virtual Machines. Virtualization

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization in a Carrier Grade Environment

COM 444 Cloud Computing

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Virtualization. Types of Interfaces

CS 152 Computer Architecture and Engineering. Lecture 22: Virtual Machines

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

Virtual machines and operating systems

Virtualisation M2 P7 2015

Intel Virtualization Technology Overview Yu Ke

matasano Hardware Virtualization Rootkits Dino A. Dai Zovi

OS Virtualization. CSC 456 Final Presentation Brandon D. Shroyer

Virtual Machines. COMP 3361: Operating Systems I Winter

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Hypervisors and Virtual Machines

Basics of Virtualisation

An Introduction to Virtual Machines Implementation and Applications

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

nanohub.org An Overview of Virtualization Techniques

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

Virtualization Technology. Zhonghong Ou Data Communications Software Lab, Aalto University

Virtualization: Concepts, Applications, and Performance Modeling

Multi-core Programming System Overview

CS5460: Operating Systems. Lecture: Virtualization 2. Anton Burtsev March, 2013

Cloud Computing CS

Windows Server Virtualization & The Windows Hypervisor

Virtualization Technologies

General Introduction

Nested Virtualization

Some Future Challenges of Binary Translation. Kemal Ebcioglu IBM T.J. Watson Research Center

ARM Virtualization: CPU & MMU Issues

Intel Virtualization Technology (VT) in Converged Application Platforms

How To Virtualize A Computer System

Hardware Assisted Virtualization

Distributed and Cloud Computing

Distributed Systems. Virtualization. Paul Krzyzanowski

Introduction to Virtualization

Virtual Servers. Virtual machines. Virtualization. Design of IBM s VM. Virtual machine systems can give everyone the OS (and hardware) that they want.

Cloud Architecture and Virtualisation. Lecture 4 Virtualisation

Cloud Computing. Dipl.-Wirt.-Inform. Robert Neumann

Brian Walters VMware Virtual Platform. Linux J. 1999, 63es, Article 6 (July 1999).

COS 318: Operating Systems. Virtual Machine Monitors

Models For Modeling and Measuring the Performance of a Xen Virtual Server

Virtualization VMware Inc. All rights reserved

Arwed Tschoeke, Systems Architect IBM Systems and Technology Group

WHITE PAPER Mainstreaming Server Virtualization: The Intel Approach

Operating System Organization. Purpose of an OS

de virtualisation Octobre Octobre 2009 VL/TR

Operating System Overview. Otto J. Anshus

Virtualization. Guillaume Urvoy-Keller UNS

Instruction Set Design

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Virtualization in Linux KVM + QEMU

Virtualization and the U2 Databases

ELEC 377. Operating Systems. Week 1 Class 3

Virtual Machine Learning: Thinking Like a Computer Architect

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Virtualization for Future Internet

VMkit A lightweight hypervisor library for Barrelfish

Virtualization. Introduction to Virtualization Virtual Appliances Benefits to Virtualization Example Virtualization Products

Transcription:

A Unified View of Virtual Machines First ACM/USENIX Conference on Virtual Execution Environments J. E. Smith June 2005 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) VEE '05 (c) 2005, J. E. Smith 2 1

Oh, the other kind of virtual machine IBM VM370 VMware Pascal Pcode Java Microsoft CLI Transmeta Code Morphing FX!32 Dynamo VEE '05 (c) 2005, J. E. Smith 3 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 VEE '05 (c) 2005, J. E. Smith 4 2

Overview Virtualization A common framework/set of terms The architecture of Virtual Machines Higher level concepts There is more than a bag of tricks A general set of problems Across VM types VM primitives To support solutions to VM problems A Killer App An academic discipline A course in VMs? VEE '05 (c) 2005, J. E. Smith 5 Abstraction Computer systems are built on levels of abstraction Higher level of abstraction hide details at lower levels Example: files are an abstraction of a disk filelibraries Operating System abstraction Drivers Memory Manager System Interconnect (bus) Controllers Software Application Programs Scheduler Execution Hardware file Memory Translation Controllers I/O devices and Networking Main Memory Hardware VEE '05 (c) 2005, J. E. Smith 6 3

Virtualization Similar to abstraction Except Details not necessarily hidden Construct Virtual Disks virtualization file file As files on a larger disk Map state Implement functions VMs: do the same thing with the whole machine VEE '05 (c) 2005, J. E. Smith 7 The Machine Different perspectives on what the Machine is: OS developer Application Programs Libraries Operating System Instruction Set Architecture ISA Major division between hardware and software System Interconnect (bus) I/O devices and Networking Execution Hardware Memory Translation Main Memory VEE '05 (c) 2005, J. E. Smith 8 4

The Machine Different perspectives on what the Machine is: Compiler developer Application Programs Libraries Operating System Application Binary Interface ABI User ISA + OS calls System Interconnect (bus) I/O devices and Networking Execution Hardware Memory Translation Main Memory VEE '05 (c) 2005, J. E. Smith 9 The Machine Different perspectives on what the Machine is: Application programmer Application Programs Libraries Operating System Application Program Interface API User ISA + library calls System Interconnect (bus) I/O devices and Networking Execution Hardware Memory Translation Main Memory VEE '05 (c) 2005, J. E. Smith 10 5

System Virtual Machines Provide a system environment Constructed at ISA level Persistent Examples: IBM VM/360, VMware, Transmeta Crusoe Guest OS VMM HOST PLATFORM Guest OS2 VMM virtual network communication VEE '05 (c) 2005, J. E. Smith 11 Process Virtual Machines Constructed at ABI level Runtime manages Not persistent Guest es may intermingle with host es As a practical matter, and host OSes are often the same Dynamic optimizers are a special case Examples: IA-32 EL, FX!32, Dynamo runtime host create file sharing HOST OS Disk runtime runtime host network communication VEE '05 (c) 2005, J. E. Smith 12 6

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 Intermediate Code Object Code (ISA) Memory Image Traditional Compiler front-end Compiler back-end Loader Portable Code (Virtual ISA ) Virt. Mem. Image Host Instructions HLL VM Compiler VM loader VM Interpreter/Translator VEE '05 (c) 2005, J. E. Smith 13 The Virtual Machine Space Process VMs System VMs same ISA different ISA same ISA different ISA Multi programmed Systems Dynamic Translators Classic OS VMs Whole System VMs Dynamic Binary Optimizers HLL VMs Hosted VMs Co-Designed VMs VEE '05 (c) 2005, J. E. Smith 14 7

A Discipline or a Bag of Tricks? A number of VM techniques were invented (and reinvented) on an ad hoc basis Many common emulation techniques: Code caches, Inline caching, Staged emulation Is there more than a collection of techniques? I.e., Some over-arching problems and meta-architecture solutions? Guidelines for defining new architectures to make them efficiently virtualizable Useful primitives for supporting VMs VEE '05 (c) 2005, J. E. Smith 15 Virtualizability (Goldberg, Popek,, 74) Classic work in formalizing OS VM concepts Defines basic VM properties Defines properties of instruction sets Proves that VMM can be constructed if instruction set properties hold Extends to recursive VMs VEE '05 (c) 2005, J. E. Smith 16 8

Privileged Instructions, Definition: Trap if executed in user mode; not in supervisor mode This is a defined term Privileged instructions are required to trap No-op in user mode is not enough VEE '05 (c) 2005, J. E. Smith 17 Control Sensitive instructions: Instructions that provide control of resources: 1. All instructions that change the amount of (memory) resources (or the mapping) 2. All instructions that change the or mode Examples: Load TLB (if TLB is architected) Load control register Return to user mode VEE '05 (c) 2005, J. E. Smith 18 9

Behavior Sensitive instructions: Instructions whose behavior depends on configuration of specific resources: 1. All instructions whose results depend on the mapping of physical memory 2. All instructions whose behavior depends on the mode Examples: Load physical address POPF (Intel x86): Interrupt-enable flag remains unaffected in user mode VEE '05 (c) 2005, J. E. Smith 19 Instruction Types -- Summary Non- Privileged Innocuous Privileged Sensitive Behaviorsensitive Controlsensitive Sensitive Innocuous Instructions: Those that are not control or behavior sensitive VEE '05 (c) 2005, J. E. Smith 20 10

Virtual Machine requirements 1. All innocuous instructions are executed by the hardware directly 2. The allocator must be invoked when any program attempts to affect system resources 3. Any program executes exactly as on real hardware except For timing Availability of system resources A VMM satisfies all three requirements Perhaps better to say efficient VMM VEE '05 (c) 2005, J. E. Smith 21 Virtual Machines: Main Theorem A virtual machine monitor can be constructed if the set of sensitive instructions is a subset of the set of privileged instructions Proof shows Equivalence by interpreting privileged instructions and executing remaining instructions natively Resource control by having all instructions that change resources trap to the VMM Efficiency by executing all non-privileged instructions directly on hardware A key aspect of the theorem is that it is easy to check VEE '05 (c) 2005, J. E. Smith 22 11

Recursive Virtualization Running a VMM as a VM on a VM on a VM. Theorem: A conventional third generation computer is recursively virtualizable if it is (a) virtualizable, and (b) a VMM without any timing dependences can be constructed for it Proof A VMM is a program and from the VM theorem will be identically performing except for timing dependences and resource constraints. Timing is excluded in the theorem; Resource constraints only limit the depth of recursion. VEE '05 (c) 2005, J. E. Smith 23 Designing-In Virtualizability Goldberg and Popek work is in this direction HLL VMs (Java and CLI) are examples Problems with conventional ISAs protecting VM software ISAs with fixed logical resources state recoverability and mobility HLL VMs solve, sidestep, or avoid these issues VEE '05 (c) 2005, J. E. Smith 24 12

VM Architecture: Protecting VM Software VM SW must be close enough to conventional SW to interact efficiently But, VM implementation SW must be protected from conventional SW (and must not change behavior of conventional SW) VEE '05 (c) 2005, J. E. Smith 25 Protecting VM Software: System VMs Use Ring Compression Leads to inefficiency in ring emulation ring 1 ring 0 user system VMM Intel VT-x solution add another set of rings Conventional operation non-root mode VMX operation root mode 4 Rings 4 Rings 4 Rings VEE '05 (c) 2005, J. E. Smith 26 13

Protecting VM Software: Process VMs Can also use ring compression in a sense Both runtime SW and application SW are part of user address space Dynamo mode switch between emulation mode and runtime mode VEE '05 (c) 2005, J. E. Smith 27 Protecting VM Software: Process VMs Translated code should only access memory image Translated code should not jump outside code cache (emulation s/w sets up links) Change protections on mode switch Multiple system calls at mode switch time High overhead Runtime mode Runtime Data Runtime Code Code Cache Guest Data Guest Code N R/W Ex R/W N R/W R/W N N N Ex N R/W R Emulation mode Runtime Data Runtime Code Code Cache Guest Data Guest Code VEE '05 (c) 2005, J. E. Smith 28 14

Protecting VM Software: Process VMs Needs a good solution Performance issues (just noted) Problems with access to VM-generated tables in emulation mode Some VM tables remain unprotected Register spill areas VEE '05 (c) 2005, J. E. Smith 29 Fixed Logical Resources Conventional ISAs support fixed memory and register spaces System VMs have mechanisms that virtualize these resources Process VMs are more limited VM runtime consumes part of memory space Optimizers need more register resources R eserved by System F re e C o m m itte d R e se rve d C o m m itte d R e se rve d 7 F F F F F F F 7 F F E F F F F C o m m itte d F re e R eserved by System 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 VEE '05 (c) 2005, J. E. Smith 30 15

Fixed Logical Resources No problem for IA32 VMs on a RISC RISCs have 64-bit address space and large register file Problem for same-isa optimizers Will be problem when 64-bit x86 becomes the common SW base HLL VMs have a very interesting approach Key point is that logical resources do not have a bounded size Can the HLL VM approach be extended to a complete ISA? At some point the logical must become physical VEE '05 (c) 2005, J. E. Smith 31 Precise Traps (Exceptions) A problem at every level of the architecture stack The one problem everyone seems to agree on Actually, precise traps are a solution to problems: Recoverability Capturing State Recoverability After exception handling, can execution resume correctly? Often constrains optimizations due to problems w/ state update Capturing state Can entire execution state be picked up and moved? Common assumption for standard es VM techniques can be applied for full systems HLL VMs do not have this capability rely on underlying Are there other solutions? VEE '05 (c) 2005, J. E. Smith 32 16

Perf.. Primitives: Code Cache Support Indirect jumps are big performance problem Translation of source PC to target PC Add Jump TLB A hardware cache of dispatch table entries Similar to software-managed TLB in virtual memory Write_JTLB instruction tag tag TPC TPC MUX TPC SPC HASH tag tag Tag compare select tag TPC hit JTLB VEE '05 (c) 2005, J. E. Smith 33 Perf.. Primitives: Visible Micro-ops ops Factor out u-ops and let VM software use them Example: HW/SW co-designed Java VM Avoid extra translation layer that discards meta-data u-ops Main Memory Code Cache Ifetch x86 Decode u-op Decode Pipeline VEE '05 (c) 2005, J. E. Smith 34 17

Problems with Perf.. Enhancements How can we make them visible without making them legacy? Already Intel has legacy microcode Maybe in a vertically integrated environment e.g. IBM AS/400 Recursive virtualizability What if conventional software uses the feature? Can the software still run on a VM that relies on the feature? JTLB Intel VT-x VEE '05 (c) 2005, J. E. Smith 35 A Killer App? Security! HLL VMs Support for secure network computing is a major objective Security built-in and continues to evolve Process VMs All code can be inspected before being executed Program Shepherding System VMs Provide isolation Simple VMM can provide final checks Co-Designed VMs Concealed memory allows secure implementation of primitives VEE '05 (c) 2005, J. E. Smith 36 18

A Course in VMs? Teaches architecture in the pure sense The meaning and importance of compatibility Teaches the non-obvious, but difficult parts of an architecture Simple virtualization also means simple abstraction => better interface design (?) Pulls together virtually all the levels of computer system hardware and software both + and - VEE '05 (c) 2005, J. E. Smith 37 Conclusions Common framework/terms? Not now but should be settled on More than a bag of tricks? Yes, there are some higher concepts Demonstration through examples Also performance primitives but not without problems Is it an academic discipline? A course in VMs can be done, but it is challenging A unifying conference? VEE!! VEE '05 (c) 2005, J. E. Smith 38 19