references Virtualization services Topics Virtualization

Similar documents
Virtualization. Pradipta De

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

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

Chapter 5 C. Virtual machines

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

COMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy

CSCE 410/611: Virtualization!

CS370 Operating Systems

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

Operating Systems 4/27/2015

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

The Challenges of X86 Hardware Virtualization. GCC- Virtualization: Rajeev Wankar 36

CSE 120 Principles of Operating Systems

Virtualization and memory hierarchy

CSCE 410/611: Virtualization

Virtualization. Dr. Yingwu Zhu

COS 318: Operating Systems. Virtual Machine Monitors

Module 1: Virtualization. Types of Interfaces

Virtual Machine Monitors!

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

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

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

Virtual Machine Monitors (VMMs) are a hot topic in

Server Virtualization Approaches

Virtualization. Adam Belay

Advanced Operating Systems (CS 202) Virtualization

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

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

Learning Outcomes. Extended OS. Observations Operating systems provide well defined interfaces. Virtual Machines. Interface Levels

CHAPTER 16 - VIRTUAL MACHINES

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

Lecture 5: February 3

Cloud Computing Virtualization

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

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

CS-580K/480K Advanced Topics in Cloud Computing. VM Virtualization II

System Virtual Machines

CS370 Operating Systems

Distributed Systems COMP 212. Lecture 18 Othon Michail

CSC 5930/9010 Cloud S & P: Virtualization

CS 550 Operating Systems Spring Introduction to Virtual Machines

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

Virtualization. Virtualization

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

Virtual Virtual Memory

1 Virtualization Recap

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

OPERATING SYSTEMS Chapter 13 Virtual Machines. CS3502 Spring 2017

CprE Virtualization. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

Virtual Machines. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

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

System Virtual Machines

A Survey on Virtualization Technologies

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

CS 5600 Computer Systems. Lecture 11: Virtual Machine Monitors

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

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

Introduction to Cloud Computing and Virtualization. Mayank Mishra Sujesha Sudevalayam PhD Students CSE, IIT Bombay

Xen and the Art of Virtualization

Nested Virtualization and Server Consolidation

DISCO and Virtualization

CLOUD COMPUTING IT0530. G.JEYA BHARATHI Asst.Prof.(O.G) Department of IT SRM University

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

Introduction to Virtual Machines. Michael Jantz

CSE 237B Fall 2009 Virtualization, Security and RTOS. Rajesh Gupta Computer Science and Engineering University of California, San Diego.

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

[537] Virtual Machines. Tyler Harter

Virtualization. Guillaume Urvoy-Keller UNS/I3S

LIA. Large Installation Administration. Virtualization

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

Lecture 5. KVM for ARM. Christoffer Dall and Jason Nieh. 5 November, Operating Systems Practical. OSP Lecture 5, KVM for ARM 1/42

Knut Omang Ifi/Oracle 6 Nov, 2017

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


Dr. Song Fu 3/22/2010

Virtual machine architecture and KVM analysis D 陳彥霖 B 郭宗倫

NON SCHOLAE, SED VITAE

Virtual machines are an interesting extension of the virtual-memory concept: not only do we give processes the illusion that they have all of memory

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

Xen and the Art of Virtualization. Nikola Gvozdiev Georgian Mihaila

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

LINUX Virtualization. Running other code under LINUX

Virtual Leverage: Server Consolidation in Open Source Environments. Margaret Lewis Commercial Software Strategist AMD

VIRTUALIZATION: IBM VM/370 AND XEN

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

Reserves time on a paper sign-up sheet. Programmer runs his own program. Relays or vacuum tube hardware. Plug board or punch card input.

Virtualization. ...or how adding another layer of abstraction is changing the world. CIS 399: Unix Skills University of Pennsylvania.

Operating Systems Structure and Processes Lars Ailo Bongo Spring 2017 (using slides by Otto J. Anshus University of Tromsø/Oslo)

EE 660: Computer Architecture Cloud Architecture: Virtualization

Virtualization with XEN. Trusted Computing CS599 Spring 2007 Arun Viswanathan University of Southern California

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

COS 318: Operating Systems

We ve seen lots of examples of virtualization. This is another: a virtual machine monitor. A VMM virtualizes an entire hardware machine.

Concepts. Virtualization

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

CHAPTER 16 - VIRTUAL MACHINES

COS 318: Operating Systems

CS252 Spring 2017 Graduate Computer Architecture. Lecture 18: Virtual Machines

Virtualization History and Future Trends

Transcription:

references Virtualization services Virtual machines Intel Virtualization technology IEEE xplorer, May 2005 Comparison of software and hardware techniques for x86 virtualization ASPLOS 2006 Memory resource management in VMware ESX server OSDI 2002 Virtualizing I/O devices on Vmware Workstation USENIX 2002 Xen and the art of virtualization SOSP 2003 1 2 Topics 1. What is a VM? 2. Process vs System VMs 3. Virtualizing the Processor 4. Virtualizing Memory 5. Virtualizing I/O 6. VM Performance Issues 7. Intel VT-x Technology 8. Paravirtualization Virtualization We have seen Vdisk, VIP, Vnode An abstraction mapped to real resources Traditionally, a single OS virtualizes system resources among processes Process Virtualization What if we ran multiple OSes on the same physical hardware? System Virtualization Virtual Machine Monitor: A new layer of software () multiplexes the OSes 3 4 1

System Models Process Virtualization Non-virtual Machine Virtual Machine Multiprogramming Multiple programs resident in memory Same ISA (Instruction Set Architecture) High level language (HLL) VM Different ISA Emulators Interpreter or Dynamic BT Java VM 5 6 System Virtualization Support multiple guest operating systems simultaneously Why? Workload Isolation Applications on older versions of the OS does not affect applications on a new OS XP XP VISTA XP XP newapp XP 7 8 2

Workload consolidation Instead of separate, maybe underutilized, vertical stacks (H/W, OS, APP) several OSes on the same H/W Workload migration A guest OS can migrate to new H/W running a App1 Os1 App2 App3 Os2 OS3 20% 40% 20% Mail server Web server Db server HW 9 10 Virtualization: Where is it going really!? Mobile Virtualization: WHAT? OS1 Windows Linux NT Virtual Machine OS1 Windows linux Virtual Machine Desktop Virtualization WHAT? WHY? Mobile Virtualization 2010 OS1 Service Enterprise Consumer Provider OS OS OS Virtual Machine Server Virtualization 2005 Mobile Platform Virtualization 2000 11 Blackberry OS and Apple OS on the same smart phone!!! 12 3

System Virtualization Even dilbert knows Support multiple guest operating systems simultaneously on the same H/W Why is it hard? 13 14 System virtualization challenges Not every x86 instruction traps uniformly is the new kernel Just run the OS as a user application But OS accesses privileged state? Trap into Some instructions behave differently in user mode Kernel was written assuming it runs in privilege 0 Guest OS must feel it is running on a real machine 15 Canonical example: popf instruction Same instruction behaves differently depending on execution mode User Mode: changes ALU flags Kernel Mode: changes ALU and system flags Does not generate a trap in user mode Could use additional rings Ring 0,, ring 1 or 2 for guest OS, ring 3 for app Today only two rings used (0 for kernel, 3 for user mode) 16 4

System virtualization challenges is the new kernel How to virtualize memory? Page tables within each OS. Traditionally OS context switches Processes PTE entries point to distinct physical frame numbers (unless shared) needs to context switch entire VM Must support all features of memory management Segments, pages, combined etc Allocation, replacement? System virtualization challenges is the new kernel How to virtualize I/O? OS schedules I/O and CPU tasks Multiplexing an demultiplex I/O data Need to support real I/O devices In-bound and out-bound end points What about device drivers? Think about virtualizing nintendo or wii players 17 18 System VM models Role of Guest Apps Guest OS Native Type I Guest Apps Guest OS Host OS Hosted Type II Guest Apps Modified Guest OS Para Virtualization Virtual Machine Monitor () A new layer of software Provides illusion of multiple isolated machines. Arbitrate access to hardware resources for multiple guest OSes. Layer between hardware and guest OS tasks Manage state (privileged) Manage resources Vmware Vmware XEN 19 20 5

Characteristics of Popek and Goldberg criteria Fidelity: software on the executes identically to its execution on hardware, barring timing effects Performance: An overwhelming majority of guest instructions are executed by the h/w without the intervention of the Safety: manages all h/w resources CPU scheduling schedules each guest OS Round robin or weighted round robin Need to keep state of each guest OS when timer interrupts Meta level scheduler schedules guest OS Guest OS schedules processes Issues? 21 22 Execution cycle 1. Meta Timer Interrupt in running VM. 2. Context switch to. 3. saves state of running VM. 4. determines next VM to execute. 5. sets meta timer interrupt. 6. restores state of next VM. 7. sets PC to timer interrupt handler of next VM. 8. Next VM active. Resource Virtualization 1. Processor 2. Memory 3. I/O 23 24 6

Virtualizing Processor Guest OS should not access privilege state Any trap should be handled by the trap handler of the should not execute the trap but just handle Process Operating System (user mode) (user mode) (kernel mode) trap trap from guest OS JMP to guest OS trap handler BEGIN: OS trap handler decode trap and execute appropriate syscall routine RTT from Trap intercept return from trap do a real return from trap to user process start running again x86 obstacles to virtualization Visibility of privileged state Can read current privilege level Cpl read on %cs low bits indicate PL Sensitive instructions Certain instructions behave differently based on the CPL This disrupts x86 binary distribution 25 26 CPU virtualization Para virtualization For each critical instruction in the ISA (guest OS) replace with modified critical instruction Define a replacement sequence E.g., POPF{} to POPF {} Rebuild OS to use POPF and will support POPF Need access to source code CPU virtualization Interpreter Run OS code inside a binary translator/interpreter Every instruction designed to behave appropriately Too much overhead Does not satisfy P&G criterion 27 28 7

CPU virtualization Binary translation Translate critical instructions at runtime Code is translated only when it is about to execute Replace critical instructions with acceptable instructions Code cache to improve performance Lots of details CPU virtualization H/W support; new processors support virtualization Intel and AMD VT-x architecture VT-x has a new operating mode; enabled with VMXON/VMXOFF Provides two new forms of operation: root operation (fully privileged, intended for ) and non-root operation (not fully privileged, intended for guest OS) guest OS runs at ring 0; apps running on guest OS run at ring 3 and runs in new higher mode (VMX) -- equivalently -1 privilege 29 30 Virtual memory Each Process has its own page table that maps to physical frame that the VM is running in Guest OS should not map any Virtual page to any physical page No isolation On the other hand need PTE to translate virtual addresses to physical addresses More than one PTBR (one for each VM) Shadow Page Tables Guest OS maintains its own page tables. Virtual to real memory mapping. maintains shadow page tables Virtual to physical memory mapping. Used by hardware to translate virtual addresses. validates guest page table updates. Replicates guest changes in shadow page table. Virtualize page table pointer register. manages real page table pointer. Updates page table ptr when switching VMs. 31 32 8

Shadow page table Shadow Page Tables guest reads Guest Page Table Process Shadow page table (read only) Trap to Real page table Write real PTE guest writes Accessed & dirty bits Guest OS Updates Shadow Page Table Physical memory MMU 33 34 Reclaiming memory In non-virtualized system, OS uses page replacement algorithms to decide which page to evict What should the do? Swap an entire VM Swap pages belonging to individual VMs needs to decide the page as well as the which guest Oss page What policy to use? What if it conflicts with guest OS page replacement policy Double paging Swap lists, free lists are maintained by each VM also pages out, the guest OS selects the same page needs to bring back the page into memory and write back into virtual paging device So the guest OS needs to decide what pages to swap We need to induce the guest OS to start swapping 35 36 9

Ballooning Create a balloon device ( a driver) inside each guest OS Driver can ask for physical pages inflates balloon when in need of pages deflates balloon when it does not need Linux Windows XP Free BSD Ballooning instructs balloon to inflate Driver can ask for physical pages Causes memory pressure on guest OS Guest OS kicks in page swap process Freed pages can be allocated to another guest OS Linux Windows XP Free BSD SWAP Physical memory 37 Physical memory 38 Ballooning limitations Driver may be uninstalled, disabled Upper bounds on ballon sizes may need to imposed Should not penalize one guest OS over another Page sharing What if many guest OSes are identical copies Unlike a guest OS, which knows text segments of processes (on fork, e.g.,), has no idea Nice to find shared read-only pages, at least Idea: scan physical pages and seek matches So identical pages point to the same PFN A Copy-on-write bit is set and if modified make a copy and make the pages different 39 40 10

Virtualizing I/O All I/O operations are privileged must intercept all guest OS I/O operations must implement all device drivers Many devices are chatty Type II VM may be better Uses device drivers in the host OS Need to switch between world and host world Hosted vs. Native World switching is expensive 41 42 Connections Virtualizing a network card Each Virtual NIC appears as a full fledged PCI controller with its own MAC address All Virtual NICs form a bridge with physical NIC The physical NIC in promiscuous mode picks up all packets and forwards it to all virtual NICs For virtual networks, ethernet interface is not required How does IP networking work? 43 44 11

Virtualizing a Network Card 45 12