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

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

Virtualization. Pradipta De

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

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

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

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

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

VIRTUALIZATION: IBM VM/370 AND XEN

Virtualization History and Future Trends

references Virtualization services Topics Virtualization

W4118: virtual machines

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

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

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

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

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

The Future of Virtualization

Module 1: Virtualization. Types of Interfaces

Virtualization. Virtualization

CS 550 Operating Systems Spring Introduction to Virtual Machines

CSE 120 Principles of Operating Systems

Chapter 5 C. Virtual machines

Cloud Computing Virtualization

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

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

Software Virtualization Based Rootkits

COMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy

Operating Systems 4/27/2015

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

Virtualization. Adam Belay

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

Virtual Machine Monitors (VMMs) are a hot topic in

Virtualization and memory hierarchy

Virtual Machine Security

Bringing Virtualization to the x86 Architecture with the Original VMware Workstation

System Virtual Machines

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

CHAPTER 16 - VIRTUAL MACHINES

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

System Virtual Machines

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

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

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

CIS Operating Systems CPU Mode. Professor Qiang Zeng Spring 2018

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

T Jarkko Turkulainen, F-Secure Corporation

Virtual Machine Monitors!

Intel VMX technology

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

Introduction Construction State of the Art. Virtualization. Bernhard Kauer OS Group TU Dresden Dresden,

Concepts. Virtualization

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

CS370 Operating Systems

Disco: Running Commodity Operating Systems on Scalable Multiprocessors

Virtualization. Guillaume Urvoy-Keller UNS/I3S

Hardware Assisted Virtualization

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. Dr. Yingwu Zhu

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

Virtual Machines. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Advanced Operating Systems (CS 202) Virtualization

COS 318: Operating Systems. Virtual Machine Monitors

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

Virtual Machines. 2 Disco: Running Commodity Operating Systems on Scalable Multiprocessors([1])

NAVAL POSTGRADUATE SCHOOL MONTEREY, CALIFORNIA 1W9112«080 THESIS ANALYZING THE INTEL PENTIUM'S CAPABILITY TO SUPPORT A SECURE VIRTUAL MACHINE MONITOR

MEMORY HIERARCHY DESIGN. B649 Parallel Architectures and Programming

The Application Of Virtual Machine Technology Under x86 On The Computer Security Field. BING SUN LinkTrust.

Xen and the Art of Virtualization. Nikola Gvozdiev Georgian Mihaila

Advanced Operating Systems

Nested Virtualization and Server Consolidation

MultiNyx: A Multi-Level Abstraction Framework for Systematic Analysis of Hypervisors. Pedro Fonseca, Xi Wang, Arvind Krishnamurthy

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

CSCI 8530 Advanced Operating Systems. Part 19 Virtualization

Knut Omang Ifi/Oracle 6 Nov, 2017

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

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

Lecture 4: Extensibility (and finishing virtual machines) CSC 469H1F Fall 2006 Angela Demke Brown

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

Virtualization. Darren Alton

Testing System Virtual Machines

NON SCHOLAE, SED VITAE

Virtual Machine Systems

CHAPTER 16 - VIRTUAL MACHINES

Mach External pager. IPC Costs. Why the difference? Example of IPC Performance. First generation microkernels were slow Mach, Chorus, Amoeba

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

Distributed Systems COMP 212. Lecture 18 Othon Michail

Faculty of Computer Science Institute for System Architecture, Operating Systems Group. Virtualization. Henning Schild. Dresden,

Part I. X86 architecture overview. Secure Operating System Design and Implementation x86 architecture. x86 processor modes. X86 architecture overview

Chapter 12. CPU Structure and Function. Yonsei University


Xen is not just paravirtualization

CS 252 Graduate Computer Architecture. Lecture 15: Virtual Machines

W4118: interrupt and system call. Junfeng Yang

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

Memory hierarchy. 1. Module structure. 2. Basic cache memory. J. Daniel García Sánchez (coordinator) David Expósito Singh Javier García Blas

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

Virtualization. Part 1 Concepts & XEN

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

LINUX Virtualization. Running other code under LINUX

Πποχωπημένη Κατανεμημένη Υπολογιστική

Transcription:

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

Traditional operating system

Virtual machines

A bit of history Virtual machines were popular in 60s-70s Share resources of mainframe computers [Goldberg 1974] Run multiple single-user operating systems Interest is lost by 80s-90s Development of multi-user OS Rapid drop in hardware cost Hardware support for virtualizaiton is lost

What is the problem? Hardware is not designed to be multiplexed Loss of isolation

Virtual machine Efficient duplicate of a real machine Compatibility Performance Isolation

Trap and emulate

What needs to be emulated? CPU and memory Register state Memory state Memory management unit Page tables, segments Platform Interrupt controller, timer, buses BIOS Peripheral devices Disk, network interface, serial line

x86 is not virtualizable Some instructions (sensitive) read or update the state of virtual machine and don't trap (nonprivileged) 17 sensitive, non-privileged instructions [Robin et al 2000]

x86 is not virtualizable (II) Examples popf doesn't update interrupt flag (IF) Impossible to detect when guest disables interrupts push %cs can read code segment selector (%cs) and learn its CPL Guest gets confused

Solution space Parse the instruction stream and detect all sensitive instructions dynamically Interpretation (BOCHS, JSLinux) Binary translation (VMWare, QEMU) Change the operating system Paravirtualization (Xen, L4, Denali, Hyper-V) Make all sensitive instructions privileged! Hardware supported virtualization (Xen, KVM, VMWare) Intel VT-x, AMD SVM

Basic blocks of a virtual machine monitor: QEMU example

Interpreted execution: BOCHS, JSLinux

What does it mean to run guest? Bochs internal emulation loop Similar to nonpipelined CPU like 8086 How many cycles per instruction?

Binary translation: VMWare

VMWare Workstation

Address space during the world switch

The world switch First, save the old processor state: general-purpose registers, privileged registers, and segment registers; Then, restore the new address space by assigning %cr3. All page table mappings immediately change, except the one of the cross page. Restore the global segment descriptor table register (%gdtr). With the %gdtr now pointing to the new descriptor table, restore %ds. From that point on, all data references to the cross page must use a different virtual address to access the same data structure. However, because %cs is unchanged, instruction addresses remain the same. Restore the other segment registers, %idtr, and the generalpurpose registers. Finally, restore %cs and %eip through a longjump instruction.

Protecting the VMM

Translator continuations

Interpreted execution revisited: Bochs

Instruction trace cache 50% of time in the main loop Trace cache (Bochs v2.3.6) Fetch, decode, dispatch Hardware idea (Pentium 4) Trace of up to 16 instructions (32K entries) 20% speedup

Improve branch prediction 20 cycles penalty on Core 2 Duo

Improve branch prediction Split handlers to avoid conditional logic Decide the handler at decode time (15% speedup)

Resolve memory references without misprediction Bochs v2.3.5 has 30 possible branch targets for the effective address computation Effective Addr = (Base + Index*Scale + Displacement) mod(2^addrsize) e.g. Effective Addr = Base, Effective Addr = Displacement 100% chance of misprediction Two techniques to improve prediction: Reduce the number of targets: leave only 2 forms Replicate indirect branch point 40% speedup

Time to boot Windows

Cycle costs

References A Comparison of Software and Hardware Techniques for x86 Virtualization. Keith Adams, Ole Agesen, ASPLOS'06 Bringing Virtualization to the x86 Architecture with the Original VMware Workstation. Edouard Bugnion, Scott Devine, Mendel Rosenblum, Jeremy Sugerman, Edward Y. Wang, ACM TCS'12. Virtualization Without Direct Execution or Jitting: Designing a Portable Virtual Machine Infrastructure. Darek Mihocka, Stanislav Shwartsman.