KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.

Slides:



Advertisements
Similar presentations
Virtualization Dr. Michael L. Collard
Advertisements

Virtualization Technology
User-Mode Linux Ken C.K. Lee
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Bart Miller. Outline Definition and goals Paravirtualization System Architecture The Virtual Machine Interface Memory Management CPU Device I/O Network,
Chapter 6 Limited Direct Execution
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
1 Disco: Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine, and Mendel Rosenblum, Stanford University, 1997.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #29-1 Chapter 33: Virtual Machines Virtual Machine Structure Virtual Machine.
Operating System Support for Virtual Machines Samuel King, George Dunlap, Peter Chen Univ of Michigan Ashish Gupta.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Virtualization for Cloud Computing
Virtual Machine Monitors CSE451 Andrew Whitaker. Hardware Virtualization Running multiple operating systems on a single physical machine Examples:  VMWare,
虛擬化技術 Virtualization and Virtual Machines
CSE598C Virtual Machines and Their Applications Operating System Support for Virtual Machines Coauthored by Samuel T. King, George W. Dunlap and Peter.
CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines Mark Zbikowski and Gary Kimura.
E Virtual Machines Lecture 4 Device Virtualization
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Tanenbaum 8.3 See references
Zen and the Art of Virtualization Paul Barham, et al. University of Cambridge, Microsoft Research Cambridge Published by ACM SOSP’03 Presented by Tina.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Protection and the Kernel: Mode, Space, and Context.
1 Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield.
Operating System Support for Virtual Machines Samuel T. King, George W. Dunlap,Peter M.Chen Presented By, Rajesh 1 References [1] Virtual Machines: Supporting.
Virtualization Concepts Presented by: Mariano Diaz.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Christoffer Dall Department of Computer Science Columbia University
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Christoffer Dall Department of Computer Science Columbia University
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
CS533 Concepts of Operating Systems Jonathan Walpole.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Virtual Memory Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
ELI: Bare-Metal Performance for I/O Virtualization 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C.
Introduction to virtualization
Full and Para Virtualization
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
Virtualization Neependra Khare
CS 695 Topics in Virtualization and Cloud Computing, Autumn 2012 CS 695 Topics in Virtualization and Cloud Computing More Introduction + Processor Virtualization.
Introduction to Virtualization
Virtualization.
Virtual Machine Monitors
Virtualization Technology
Presented by Yoon-Soo Lee
Virtualization Dr. Michael L. Collard
Operating Systems CMPSC 473
CS352H: Computer Systems Architecture
Mechanism: Limited Direct Execution
Lecture 24 Virtual Machine Monitors
Virtualization overview
Disco: Running Commodity Operating Systems on Scalable Multiprocessors
Running other code under LINUX
OS Virtualization.
Computer-System Architecture
Architectural Support for OS
Operating Systems Lecture 3.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
CS295: Modern Systems Virtualization
Presentation transcript:

KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy

Virtualization & Hypervisor

Virtualization & Hypervisor (cont.) m Xen, VMWare ESX Bare Metal / Native Hypervisor VMWare Workstation Hosted Hypervisor Which type of Hypervisor is better?

KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor ARM Linux KernelHypervisor (KVM) QEMU Guest OS Apps QEMU Guest OS Apps QEMU Guest OS Apps QEMU Guest OS Apps Full Virtualization

Prior ARMV7 Cannot Emulate Trap & Emulate Not Classically Virtualizable

ARM V7 Virtualization Extension Trap & Emulate

CPU Virtualization From Hyp Mode, hardware Configurable to trap sensitive instructions and interrupt to Hyp Mode Hardware Configurable to trap sensitive instructions and interrupt directly to VM's Kernel mode Trap Why trapping at Kernel Mode is useful?

CPU Virtualization Hypervisor should be lightweight and simple to program Reduced Number of Control Registers Page tables entries is protected from user mode, as they should not be shared with user mode Hyp mode has its own separate address space

Memory Virtualization Hardware support to virtualize physical memory: Stage 2 Page Tables Enabled/Disabled from Hyp Mode

Interrupt Virtualization Generic Interrupt Controller / Configures GIC Send ACK & EOI(End-of- interrupt)

Interrupt Virtualization Generic Interrupt Controller / Cumbersome & Expensive Trapping Interrupt in Hyp Mode Hardware Hypervisor 1) Interrupt 2) Trap VM 3) Emulate Virtual Interrupt By signal

Interrupt Virtualization Generic Interrupt Controller (V2.0) / Virtual GIC Virtual CPU Interfaces But No Virtual Distributor Why Virtual Distributor is required?

Interrupt Virtualization Generic Interrupt Controller (V2.0) / Virtual GIC Trapping Interrupt in Kernel Mode Virtual Hardware Hypervisor 1) Interrupt 2) Trap VM

Timer Virtualization Generic Timer support / ARM introduces Virtual Timer and Counter But requires Timer operations to be performed by Hyp CPU 0 Counter Timer 0 CPU 1Timer 1 CPU 2Timer 2 CPU 3Timer 3 Can be configured from Hyp Mode

Timer Virtualization Generic and Virtualized Timer support CPU 0 Counter Timer 0 Virtual CPU 0 Virtual Timer 0 CPU 1Timer 1 Virtual CPU 1 Virtual Timer 1 CPU 2Timer 2 Virtual CPU 2 Virtual Timer 2 CPU 3Timer 3 Virtual CPU 3 Virtual Timer 3 Virtual Counter Accessible from Hyp mode Accessible from VMs Why Virtual Timer support is required?

Hypervisor Architecture Linux Kernel KVM Firstly, Linux is written to work in kernel mode and would not run unmodified in Hyp Mode Secondly, Running entire kernel in Hyp Mode would adversely affect native performance Hyp mode has its own separate address space. This requires explicitly map user space data while accessing user space memory Some registers and table formats are different in Hyp mode than in kernel mode

Hypervisor Architecture Split-Mode Virtualization Linux Kernel KVM

Hypervisor Architecture Split-Mode Virtualization Handles High level Functionality Handles Low Level Functionality

Hypervisor Architecture Split-Mode Virtualization

Hypervisor Architecture Split-Mode Virtualization Store GP regs, host config Configure VGIC, Virtual Timer, Traps, stage2 pagetable regs Restore Guest GP regs, VM config

Hypervisor Architecture Split-Mode Virtualization Lowvisor creates correct execution context by configuring hardware

Hypervisor Architecture Split-Mode Virtualization

Hypervisor Architecture Split-Mode Virtualization Lowvisor: Handles Interrupts and Exceptions

Hypervisor Architecture Split-Mode Virtualization

Hypervisor Architecture What are the Functionalities of LowVisor? Trap handler: Handles Interrupt and Exception Set Correct Execution context by configuring hardware Perform Context Switch between Host and VM execution context

Hypervisor Architecture Perform Context Switch between Host and VM execution context Host Execution Context Virtual Execution Context

CPU Virtualization Perform Context Switch between Host and VM execution context

CPU Virtualization Perform Context Switch between Host and VM execution context

Memory Virtualization Configuring page tables is a high level Functionality

Memory Virtualization But LowVisor has hardware access as it runs in Hyp Mode

Memory Virtualization Page Fault get_user_pages()

Interrupt Virtualization

Interrupt Virtualization

Interrupt Virtualization KVM/ARM implements virtual GIC Distributor in software What happens when a virtual interrupt occurs?

Timer Virtualization

Timer Virtualization

Timer Virtualization Virtual timers cannot directly raise virtual interrupts, but always raise hardware interrupts

Implementation & Experimental Setup

Implementation & Experimental Setup

Performance on Micro Benchmark Two world switches Cost of saving and restoring VGIC states hardware support to save and restore state

Performance on Micro Benchmark Switching the hardware mode Manipulate two registers to trap hardware supported save and restore state

Performance on Micro Benchmark cost of an I/O operation from the VM to a device saving and restoring VGIC hardware supported save and restore state x86 KVM saves and restores additional state lazily

Performance on Micro Benchmark cost of Inter-processor Interrupt Hardware supported VGIC EOI/ACK must be handled in Root mode in x86

Recommendation to Hardware Designers Share Kernel Mode Memory Model in Hyp Mode - Current implementation is different and require extra effort for memory management Make VGIC state access fast, or at least infrequent - Cause overhead because of slow MMIO access. Summary registers describing virtual interrupt state could be an improvement Completely avoid IPI traps - As Virtual Distributors are implemented in software, this cause some overhead.

Summary KVM/ARM was the first system to run unmodified guests on hardware Facilitated by split-mode virtualization Comparison with KVM

Questions?