Background. IBM sold expensive mainframes to large organizations. Monitor sits between one or more OSes and HW

Similar documents
Background. IBM sold expensive mainframes to large organiza<ons. Monitor sits between one or more OSes and HW

Background. IBM sold expensive mainframes to large organiza<ons. Monitor sits between one or more OSes and HW

Virtual Machines. To do. q VM over time q Implementation methods q Hardware features supporting VM q Next time: Midterm?

CSE 120 Principles of Operating Systems

Lecture 7. Xen and the Art of Virtualization. Paul Braham, Boris Dragovic, Keir Fraser et al. 16 November, Advanced Operating Systems

Xen and the Art of Virtualization. Nikola Gvozdiev Georgian Mihaila

Xen and the Art of Virtualization. CSE-291 (Cloud Computing) Fall 2016

COMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy

Virtual Machine Monitors (VMMs) are a hot topic in

Xen and the Art of Virtualization

Advanced Operating Systems (CS 202) Virtualization

Virtual Machines Disco and Xen (Lecture 10, cs262a) Ion Stoica & Ali Ghodsi UC Berkeley February 26, 2018

Virtualization, Xen and Denali

COS 318: Operating Systems. Virtual Machine Monitors

Virtual Virtual Memory

CS 350 Winter 2011 Current Topics: Virtual Machines + Solid State Drives

DISCO and Virtualization

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

Today s Papers. Virtual Machines Background. Why Virtualize? EECS 262a Advanced Topics in Computer Systems Lecture 19

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

CS533 Concepts of Operating Systems. Jonathan Walpole

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

CSC 5930/9010 Cloud S & P: Virtualization

Virtualization. Pradipta De

Virtualization and memory hierarchy

[537] Virtual Machines. Tyler Harter

CS 550 Operating Systems Spring Introduction to Virtual Machines

CSCE 410/611: Virtualization!

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Virtualization and Virtual Machines. CS522 Principles of Computer Systems Dr. Edouard Bugnion

W4118: virtual machines

Virtual Machines. Part 2: starting 19 years ago. Operating Systems In Depth IX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

Virtualization. Operating Systems, 2016, Meni Adler, Danny Hendler & Amnon Meisels

Module 1: Virtualization. Types of Interfaces

Virtual Machine Security

VIRTUALIZATION: IBM VM/370 AND XEN

Cloud Computing Virtualization

Overview of System Virtualization: The most powerful platform for program analysis and system security. Zhiqiang Lin

Disco: Running Commodity Operating Systems on Scalable Multiprocessors

CSCE 410/611: Virtualization

Computer Architecture Lecture 13: Virtual Memory II

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

CHAPTER 16 - VIRTUAL MACHINES

Virtualization. Adam Belay

Linux and Xen. Andrea Sarro. andrea.sarro(at)quadrics.it. Linux Kernel Hacking Free Course IV Edition

references Virtualization services Topics Virtualization

OS Virtualization. Why Virtualize? Introduction. Virtualization Basics 12/10/2012. Motivation. Types of Virtualization.

Virtualization (II) SPD Course 17/03/2010 Massimo Coppola

Nested Virtualization and Server Consolidation

VMMS: DISCO AND XEN CS6410. Ken Birman

238P: Operating Systems. Lecture 5: Address translation. Anton Burtsev January, 2018

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names

G Disco. Robert Grimm New York University

CSCI 8530 Advanced Operating Systems. Part 19 Virtualization

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names

Knut Omang Ifi/Oracle 6 Nov, 2017

1 Virtualization Recap

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Chapter 5 (Part II) Large and Fast: Exploiting Memory Hierarchy. Baback Izadi Division of Engineering Programs

CS 5600 Computer Systems. Lecture 11: Virtual Machine Monitors

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Lecture 3: O/S Organization. plan: O/S organization processes isolation

System Virtual Machines

143A: Principles of Operating Systems. Lecture 6: Address translation. Anton Burtsev January, 2017

G Xen and Nooks. Robert Grimm New York University

COS 318: Operating Systems

System Virtual Machines

Virtual Machine Monitors!

The Architecture of Virtual Machines Lecture for the Embedded Systems Course CSD, University of Crete (April 29, 2014)

Virtual Machines and Dynamic Translation: Implementing ISAs in Software

Disco. CS380L: Mike Dahlin. September 13, This week: Disco and Exokernel. One lesson: If at first you don t succeed, try try again.

Portland State University ECE 587/687. Virtual Memory and Virtualization

Virtualization. Starting Point: A Physical Machine. What is a Virtual Machine? Virtualization Properties. Types of Virtualization

Virtualization. ! Physical Hardware Processors, memory, chipset, I/O devices, etc. Resources often grossly underutilized

Introduction to Virtual Machines. Carl Waldspurger (SB SM 89 PhD 95) VMware R&D

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

COS 318: Operating Systems

CSE543 - Computer and Network Security Module: Virtualization

CSE543 - Computer and Network Security Module: Virtualization

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

CHAPTER 16 - VIRTUAL MACHINES

Chapter 5 C. Virtual machines

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

CSE 120 Principles of Operating Systems Spring 2017

Xen and the Art of Virtualization

Virtualization. Part 1 Concepts & XEN

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

Virtual to physical address translation

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic

CSE543 - Computer and Network Security Module: Virtualization

Multiprocessor Scheduling. Multiprocessor Scheduling

CS 318 Principles of Operating Systems

Virtual Memory. Kevin Webb Swarthmore College March 8, 2018

Darek Mihocka, Emulators.com Stanislav Shwartsman, Intel Corp. June

x86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT

Advanced Computer Architecture

CS370 Operating Systems

CS5460: Operating Systems

Virtual Memory. Samira Khan Apr 27, 2017

Transcription:

Virtual Machines

Background IBM sold expensive mainframes to large organizations Some wanted to run different OSes at the same time (because applications were developed on old OSes) Solution: IBM developed virtual machine monitor (VMM) or hypervisor (circa 1974) Monitor sits between one or more OSes and HW Gives the illusion that each OS controls the HW Monitor multiplexes running OSes A level of indirection: apps assume separate CPU, unlimited memory; now another layer to provide similar illusion to OS

Today s World Why VMMs now? Are there new reasons for using VMMs?

Resurgence in VMs Sparked by work on Disco (system from Stanford/ Rosenblum) Resulted in VMware -- now a market leader in virtualization

Outline Disco project Design space for virtualization Xen project

Virtualizing CPU Basic technique: limited direct execution Ideal case: VMM jumps to first instruction of the OS and let the OS run Generalize a context switch on processes to machine switch save the entire machine state of one OS including registers, PC, and privileged hardware state restore the target OS state Guest OS cannot run privileged instructions (like TLB ops); VMM must intercept these ops and emulate them

System Call Primer Consider: open(char*path, int flags, mode_t mode) open: push dword mode push dword flags push dword path mov eax, 5 push eax int 80h Process code, hardware, and OS cooperate to implement the interface Trap: switches to kernel mode, jumps to OS trap handler; trap handlers registered by OS at startup

Virtualized Platform Application remains the same Trap handler is inside the VMM; executed in kernel mode What should the VMM do? does not know the details of the guest OSes but knows where the OS s trap handler is (when the guest OS attempted to install trap handlers, VMM intercepts the call and records the information) so jump into OS; which executes the actual handler, performs another privileged instruction (iret on x86), bounces back into VMM VMM performs a real return from trap and returns to app

Execution Privileges OS cannot be in kernel mode Disco project: MIPS hardware had a supervisor mode kernel > supervisor > user supervisor can access little more memory than user, but cannot execute privileged instructions No extra mode: run OS in user mode and use memory protection (page tables and TLBs) to protect OS data structures appropriately x86 has 4 protection rings, so extra mode is available

Virtualizing Memory Normally: each program has a private address space OS virtualizes memory for its processes Now: multiple OSes can share the actual physical memory and must do so transparently So we have virtual memory (VM), physical memory (PM), and machine memory (MM) OS maps virtual to physical addresses via its per-process page tables, VMM maps the resulting physical address to machine memory via its per-os page tables

Address Translation Primer Assume a system with software-managed Translation Lookaside Buffer (TLB) TLB maps virtual address to physical address for each instruction TLB miss: trap into the OS which looks up page tables and installs translation and retries instruction Consider virtualized system: Application traps into VMM; VMM jumps to OS trap handler OS tries to install (VM, PM) in TLB, but this traps VMM installs (VM, MM), returns to OS and then App VMM maintains (PM, MM) mappings and even does paging

Information Gap VMM often doesn t know what the OS is doing For example, if OS has nothing else to run: go into an idle loop and spin waiting for the next interrupt Another example: most OSes zero pages before giving to processes for security VMM also has to the do the same, resulting in double work! One option is inference of OS behavior, another is paravirtualization

Announcements Project timeline: Proposal (feb 17th) Intermediate report (feb 28th) Class presentation (march 10/11th) Final project (march 17th)

Virtual Machines Recap System manager is no longer the OS; it is the VMM or the hypervisor OS no longer runs in privileged mode OS thinks it is running in most privileged mode: virtualization transparently provided by VMM CPU is virtualized just as with processes Memory is virtualized using clever handling of page tables VMM interposes on system calls, execution of privileged instructions by OS

What are the design goals in building a virtualization solution?

Design Space App is not modified App is modified OS is not modified Disco (VMWare) --- OS is modified Xen Denali Why is paravirtualization needed? What are the issues regarding which solution is better?

Xen Key idea: change the machine-os interface to make VMs simpler and higher performance Pros: better performance on x86, some simplifications in VM implementation, OS might want to know that it is virtualized Cons: must modify the guest OS Aims for performance isolation

Xen & Paravirtualization VM-style virtualization on an uncooperative architecture Support full-featured multi-user multi-application OSes contrast with Denali: thin OSes for lightweight services OSes are ported to a new x86-xeno architecture call to Xen for privileged operations porting requires source code Retain compatibility with OS API Must virtualize application visible architecture features

Performance

Fully virtualizing the MMU Constraints: Hardware-based TLB No tags on TLB Use shadow page tables Guest OS maintains virtual to physical mem map VMM maintains virtual to machine mem map Guest reads of page table is free Guest writes need switching to VMM Accessed/dirty bits require upcalls into OS

Paravirtualizing the MMU Paravirtualization obviates the need for shadows modify the guest OS to handle sparse memory maps Guest OSes allocate and manage their own PTs map Xen into top 64 MB in all address spaces Updates to page tables must be passed to Xen for validation (use batching) Validation rules: only map a page if owned by the requesting guest OS only map a page containing PTEs for read-only access Xen tracks page ownership and current use

Memory Benchmarks

I/O Virtualization Need to minimize cost of transferring bulk data via Xen copying costs time copying pollutes caches copying requires intermediate memory Device classes network disk graphics

I/O Virtualization Xen uses rings of buffer descriptors descriptors are small, cheap to copy and validate descriptors refer to bulk data no need to map or copy the data into Xen s address space exception: checking network packet headers prior to TX Use zero-copy DMA to transfer bulk data between hardware and guest OS net TX: DMA packet payload separately from header net RX: page-flip receive buffers into guest address space

TCP Results

Other Nice Ideas Domain 0: run the VMM management at user level easier to debug Network and disk are virtual devices virtual block devices: similar to SCSI disks model each guest OS has a virtual network interface connected to a virtual firewall router