+ All Categories
Home > Documents > kvm-japan

kvm-japan

Date post: 02-Apr-2018
Category:
Upload: saravanaraajaa
View: 215 times
Download: 0 times
Share this document with a friend

of 25

Transcript
  • 7/27/2019 kvm-japan

    1/25

    KVM: A Hypervisorfor All Seasons

    Avi Kivity

    [email protected]

    November 2007

  • 7/27/2019 kvm-japan

    2/25

    Copyright 2007 Qumranet, Inc. All rights reserved.2

    Virtualization

    Simulation of computer system in software

    Components

    Processor: register state, instructions, exceptions

    Memory Management: paging, protection, tlb

    I/O: Networking, storage, human interface

    Performance and fidelity are critical

  • 7/27/2019 kvm-japan

    3/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Uses

    Server consolidation

    Testing, R&D

    Virtual Desktops

  • 7/27/2019 kvm-japan

    4/25

    Copyright 2007 Qumranet, Inc. All rights reserved.4

    Virtualization basics

    Trap changes to privileged stateGuest cannot access hardware

    Hide privileged state

    Guest cannot detect that the host is changing things behind itsback

    Example: interrupt enable flag

  • 7/27/2019 kvm-japan

    5/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    A Look Back

    VMWare

    Just-in-time compilation of binaries

    Xen

    Paravirtualized guests

  • 7/27/2019 kvm-japan

    6/25

    Copyright 2007 Qumranet, Inc. All rights reserved.6

    Virtualization

    Simulation of computer system in software

    Components

    Processor Management

    Memory Management

    IO Management

    Difference from emulation is emphasis on near-nativeperformance

  • 7/27/2019 kvm-japan

    7/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    The KVM approach

    Reuse Linux code as much as possible

    Focus on virtualization, leave other things to respectivedevelopers

    Integrate well into existing infrastructure, codebase, andmindset

  • 7/27/2019 kvm-japan

    8/25

    Copyright 2007 Qumranet, Inc. All rights reserved.8

    kvm process model

    kernel

    task task guest task task guest

  • 7/27/2019 kvm-japan

    9/25

    Copyright 2007 Qumranet, Inc. All rights reserved.9

    KVM process model (cont'd)

    Guests are scheduled as regular processes

    Guests are processes that can execute in three modes:user mode, kernel mode, and guestmode

    kill(1), top(1) work as expected

    Guest physical memory is mapped into the task's virtualmemory space

    Virtual processors in a VM are threads in the hostprocess

  • 7/27/2019 kvm-japan

    10/25

    Copyright 2007 Qumranet, Inc. All rights reserved.10

    KVM Execution Model

    Native GuestExecution

    Kernelexit handler

    Userspaceexit handler

    Switch to

    Guest Mode

    LightweightExit

    ioctl()

    Userspace Kernel Guest

  • 7/27/2019 kvm-japan

    11/25

    Copyright 2007 Qumranet, Inc. All rights reserved.11

    What's handled in the kernel?

    CPU virtualization (special instructions)

    MMU virtualization

    Local APIC, PIC, and IOAPIC

    (planned) paravirtualized network and block device

    (planned) paravirtualized guest kernel support code

  • 7/27/2019 kvm-japan

    12/25

    Copyright 2007 Qumranet, Inc. All rights reserved.12

    KVM Initial Design Parameters

    x86 only

    Focus on full virtualization

    Zero modifications to host kernels

  • 7/27/2019 kvm-japan

    13/25

    Copyright 2007 Qumranet, Inc. All rights reserved.13

    We were wrong!

    Support for new architectures is underways390: the big daddy of virtualization

    PowerPC: for embedded/consumer electronics

    ia64: large machines

    Paravirtualization supportImproves performance, timing accuracy

    Modifications to host to improve scheduling, addswapping

  • 7/27/2019 kvm-japan

    14/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Oh yes, swapping

    KVM can swap guest memory

    Needed for untrusted guests

    Enables mmu games like page migration neededfor good NUMA support

  • 7/27/2019 kvm-japan

    15/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM is a full-spectrum hypervisor

    Servers

    Desktops/laptops

    Small/embedded boards

    Really large machines

  • 7/27/2019 kvm-japan

    16/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM on servers

    Same management tools and infrastructure as Linux

    Supports virtual machines and regular processesside-by-side

    Useful for real-time server processing workloads

    Uses the Linux scheduler and I/O stack

    Live migration

    Integrates with cluster filesystems

  • 7/27/2019 kvm-japan

    17/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM on desktops/laptops

    Will boot on anything Linux boots

    Normal desktop doesn't change

    Excellent power management

    Suspend/resume while virtual machines are running

    Swap idle VMs when not in use

    Passthrough devices

    USB

    PCI (planned)

  • 7/27/2019 kvm-japan

    18/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM for embedded

    Board support is in Linux already

    Can make footprint as small as needed

    Real-time scheduling support

  • 7/27/2019 kvm-japan

    19/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM and big iron

    Leverage many years of Linux scalability workNUMA

    Page migration

    Linux already supports 4096-processor machines

    Competitors can only dream of this

  • 7/27/2019 kvm-japan

    20/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Paravirtualized device drivers

    virtio

    Common drivers for all hypervisors

    Hypervisor-specific backend

    KVM backend is in progress

  • 7/27/2019 kvm-japan

    21/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Release philosophy

    Development snapshots every 1-2 weeksRelease early and often

    Features introduces quickly

    Bugs fixed quickly

    Bugs added quickly...Allows developers and users to track and test the latestand greatest

    Stable releases part of Linux 2.6.x

    With bugfixes going into Linux 2.6.x.y

  • 7/27/2019 kvm-japan

    22/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Differences between Xen and KVM

    No dom0Removes scaling bottleneck

    Removes priority inversion problem

    Interrupts handled directly by host

    Xen requires the scheduler to dispatch interrupts

    Uses the Linux bootstrap

    Bringing up KVM on a new machine is trivial

    Uses well-known Linux environment

    Rich kernel APIsLarge developer base

  • 7/27/2019 kvm-japan

    23/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    Status & plans

    StatusMany supported guests

    Good cpu/mmu performance

    Good host scaling

    PlansAdd more paravirtualization (both cpu and I/O)

    Improve guest scaling

    Add more hardware support (architectures, hardwarefeatures)

    Improve swapping

  • 7/27/2019 kvm-japan

    24/25

    Copyright 2007 Qumranet, Inc. All rights reserved.

    KVM pros

    Leverages Linux scheduler, memory management, I/O

    No scheduler involvement for I/O

    Uses existing Linux security model (can run VM asordinary user)

    Uses existing management tools

    Power management

    Guest memory swapping

    Real-time schedulingLeverages Linux development momentum

  • 7/27/2019 kvm-japan

    25/25

    Thank You


Recommended