KVM in Embedded Requirements, Experiences, Open Challenges



Similar documents
Architecture of the Kernel-based Virtual Machine (KVM)

Real-Time Virtualization How Crazy Are We?

Real-time KVM from the ground up

Real-Time KVM for the Masses Unrestricted Siemens AG All rights reserved

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Enhancing Hypervisor and Cloud Solutions Using Embedded Linux Iisko Lappalainen MontaVista

2972 Linux Options and Best Practices for Scaleup Virtualization

KVM Architecture Overview

The QEMU/KVM Hypervisor

Full and Para Virtualization

Nested Virtualization

Developing a dynamic, real-time IT infrastructure with Red Hat integrated virtualization

Virtualization. Dr. Yingwu Zhu

Virtualization. Types of Interfaces

Introduction to Virtualization & KVM

Virtualization. Pradipta De

evm Virtualization Platform for Windows

Real- Time Mul,- Core Virtual Machine Scheduling in Xen

Developing Linux inside QEMU/KVM Virtual Machines

BHyVe. BSD Hypervisor. Neel Natu Peter Grehan

Nested Virtualization

Virtualization benefits Introduction to XenSource How Xen is changing virtualization The Xen hypervisor architecture Xen paravirtualization

Compromise-as-a-Service

Virtualization for Hard Real-Time Applications Partition where you can Virtualize where you have to

Chapter 14 Virtual Machines

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

The Art of Virtualization with Free Software

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

I/O Virtualization Using Mellanox InfiniBand And Channel I/O Virtualization (CIOV) Technology

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

Virtualization in Linux KVM + QEMU

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

Deeply Embedded Real-Time Hypervisors for the Automotive Domain Dr. Gary Morgan, ETAS/ESC

Database Virtualization

Enterprise-Class Virtualization with Open Source Technologies

Using Linux as Hypervisor with KVM

PROCESSOR VIRTUALIZATION ON EMBEDDED LINUX SYSTEMS

RED HAT ENTERPRISE VIRTUALIZATION

A hypervisor approach with real-time support to the MIPS M5150 processor

A quantitative comparison between xen and kvm

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Satish Mohan. Head Engineering. AMD Developer Conference, Bangalore

VirtualclientTechnology 2011 July

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Operating Systems Virtualization mechanisms

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

Hardware accelerated Virtualization in the ARM Cortex Processors

Xen Project 4.4: Features and Futures. Russell Pavlicek Xen Project Evangelist Citrix Systems

Virtualization. Michael Tsai 2015/06/08

Applying Multi-core and Virtualization to Industrial and Safety-Related Applications

Cloud Operating Systems for Servers

Virtualization: Hypervisors for Embedded and Safe Systems. Hanspeter Vogel Triadem Solutions AG

Virtualization. Jukka K. Nurminen

Dynamic Load Balancing of Virtual Machines using QEMU-KVM

RED HAT ENTERPRISE VIRTUALIZATION FOR SERVERS: COMPETITIVE FEATURES

Virtualization is set to become a key requirement

IOS110. Virtualization 5/27/2014 1

Developing tests for the KVM autotest framework

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

COS 318: Operating Systems. Virtual Machine Monitors

Exploiting The Latest KVM Features For Optimized Virtualized Enterprise Storage Performance

Parallels Virtuozzo Containers

The Future of Virtualization Technology. Stephen Alan Herrod VP of Technology VMware

CS 695 Topics in Virtualization and Cloud Computing. More Introduction + Processor Virtualization

Virtualization and Other Tricks.

HRG Assessment: Stratus everrun Enterprise

Enabling Technologies for Distributed and Cloud Computing

KVM Virtualized I/O Performance

KVM, OpenStack, and the Open Cloud

Virtualization in the ARMv7 Architecture Lecture for the Embedded Systems Course CSD, University of Crete (May 20, 2014)

SUSE Linux Enterprise 10 SP2: Virtualization Technology Support

Multi-core Programming System Overview

CPET 581 Cloud Computing: Technologies and Enterprise IT Strategies. Virtualization of Clusters and Data Centers

XtratuM hypervisor redesign for LEON4 multicore processor

FOR SERVERS 2.2: FEATURE matrix

Cloud Computing CS

KVM KERNEL BASED VIRTUAL MACHINE

Anh Quach, Matthew Rajman, Bienvenido Rodriguez, Brian Rodriguez, Michael Roefs, Ahmed Shaikh

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

Virtualization Technologies

Cloud Computing #6 - Virtualization

Servervirualisierung mit Citrix XenServer

Intro to Virtualization

Distributed Systems. Virtualization. Paul Krzyzanowski

VMware Server 2.0 Essentials. Virtualization Deployment and Management

VIRTUALIZATION 101. Brainstorm Conference 2013 PRESENTER INTRODUCTIONS

KVM Security Comparison

Hybrid Virtualization The Next Generation of XenLinux

COS 318: Operating Systems. Virtual Machine Monitors

Leveraging Thin Hypervisors for Security on Embedded Systems

9/26/2011. What is Virtualization? What are the different types of virtualization.

Transcription:

Corporate Technology KVM in Embedded Requirements, Experiences, Open Challenges Jan Kiszka, Siemens AG Corporate Competence Center Embedded Linux jan.kiszka@siemens.com Copyright Siemens AG 2009. All rights reserved.

Agenda Embedded virtualization What does it mean? Why using KVM? Use case: KVM-hosted enterprise communication Setup & requirements Virtualization stack experiences KVM and real-time Host & guest-side RT Possible enhancements Conclusion Slide 2 2010-08-10 Jan Kiszka

Embedded Systems, Embedded Virtualization Embedded means Small? Limited resources? No display? Hard real-time?...? More generic definition Designed to perform specific, dedicated tasks Integrated part of a larger device Not recognizable as individual computer system Embedded Virtualization System uses virtualization transparently May involve adaptions to system's task Slide 3 2010-08-10 Jan Kiszka

Embedded Virtualization Benefits Legacy system migration Avoid divorce of application and legacy OS Single-core software stacks on multicore hosts Emulation of discontinued hardware Consolidation (keeping isolation) RTOS aside standard OS Multiple virtual boards (or root filesystems) on single silicon Development environment Hardware/software co-development Debugging environment Virtualization allows speed-up (compared to pure emulation) Slide 4 2010-08-10 Jan Kiszka

Top Requirements on Embedded Hypervisors Hardware support CPU architecture Board Virtualization extensions (CPU, I/O) Guest OS support Isolation Spatial (license barrier, IPR protection, rarely data security) Temporal (provide real-time guarantees) Customizability Footprint (volume markets) Slide 5 2010-08-10 Jan Kiszka

From Enterprise to Embedded Virtualization Why using KVM? We just need a tiny hypervisor to fully exploit this multicore CPU A few thousand lines of hypervisor code Minimal hardware emulation A bit paravirtualization Devices are passed through But it would be nice to... share some devices run upstream Linux and latest Windows over-commit resources manage power backup / migrate guests use advanced HA features... RTOS Linux Windows $OS Hypervisor Hypervisor Hypervisor Core 1 Core 2 Core 3 Core n Slide 6 2010-08-10 Jan Kiszka

Requirements Match Requirement KVM support Architecture support x86 PowerPC (Book E&S, no ISA 2.06 yet) ARM early stage Others? Board support (Linux...) Guest OS support (broad test bed, virtio drivers,...) Customizability Footprint depends on use case Isolation Spatial (for most use cases) Temporal improvable Future requirements well prepared Slide 7 2010-08-10 Jan Kiszka

Use Case Example KVM-hosted Enterprise Communication Slide 8 2010-08-10 Jan Kiszka

Use Case: KVM-hosted Enterprise Communication The user Siemens Enterprise Communication (SEN) The mission Move proprietary RTOS and application stack from custom hardware to standard x86 Requirements Low impact on guest Preserve (soft) real-time qualities Prefer mainline open source technology Evaluation ruled out Invasive paravirtualization (e.g. Xen's PV mode) Pure emulation Projects with too small communities Slide 9 2010-08-10 Jan Kiszka

Use Case: KVM-hosted Enterprise Communication (2) The choice: QEMU/KVM Early proof of concept using QEMU ~2500 LoC for custom hardware bits KVM acceleration nicely integrates on top Upstreamed generic fixes/enhancements since day 1 The new platform: QEMU/KVM hosts... proprietary RTOS (multiple instances) formerly stand-alone application stacks (virtual Linux appliances) libvirt as hypervisor interface Includes high availability stack Two possible deployments Pre-installed on rack system => virtualization is embedded On customer server => virtual appliances Slide 10 2010-08-10 Jan Kiszka

SEN Project Experiences Segmented x86 guests 16-bit mode works quite well (despite uncommon use case) Task switching required most patching (few issues may remain) Soft real-time is achievable mlockall() + renice -20 Most latencies were I/O-related Decoupled logging and chardev outputs Board model maintenance Out-of-tree enables flexible customizations...but requires custom qemu-kvm package Upstream merge appears unrealistic 3rd way? Open-Source-only machine plug-ins? Stable API per stable series? Slide 11 2010-08-10 Jan Kiszka

SEN Project Experiences (2) Libvirt Feature gap required latest & greatest Faced few stability issues (resource management...) Suboptimal: QEMU wrapper script workaround All in all: benefits outweigh current drawbacks Current open topic: live backup / snapshot Block live migration (yet?) too slow QEMU snapshots: longer downtime, qcow2-only libvirt-managed file-system / block layer snapshots? Slide 12 2010-08-10 Jan Kiszka

Improving KVM KVM and Real-Time Slide 13 2010-08-10 Jan Kiszka

KVM and Real-Time Meeting Host Requirements Requirement: Guests must not defer host RT applications Preemptible KVM Problem mostly solved The key: preemption notifiers (arch-agnostic concept) Keep an eye on preempt/irq-disabled paths! Known pitfall: wbinvd latencies (x86) KVM on PREEMPT_RT Long supported, but quality varying Current 2.6.33.x-rt is fine Adoption of raw spinlocks reduced maintenance Risk of regressions remain => include in autotest? Slide 14 2010-08-10 Jan Kiszka

KVM and Real-Time Meeting Guest Requirements Requirement: Fulfill guest tasks in a timely manner Precondition Sufficient host real-time qualities (PREEMPT_NONE PREEMPT PREEMPT_RT) Already achievable Soft real-time Moderate guest reaction times Example for <1 ms peak latency: Host timer IRQ in-kernel APIC model guest RTOS guest task Feasible goals Standard KVM architecture: < 200 µs (x86) Dedicated KVM mode: close to hardware limits (<< 50 µs on x86) Slide 15 2010-08-10 Jan Kiszka

What Kills Guest Real-Time? KVM's MMU emulation Can contribute several milliseconds guest latency EPT/NPT resolves the issue Legacy RTOSes may also run MMU-less I/O-related priority inversions Threaded AIO completions can accumulate long work queues => use Linux AIO or lower AIO thread priority QCOW2 (contains synchronous write calls) SDL graphic output Heavy traffic on chardev backends (e.g. virtual serial port) RT-aware device emulation required We already heard about threading it... ( Anthony's talk) No costly synchronous host services in VCPU context! Per-device locking will help to avoid priority inversions Also relevant for SMP scalability Slide 16 2010-08-10 Jan Kiszka

Managing Priorities Priority RT task Time-sharing task Guest A RT task Time-sharing task Guest B Time-sharing task Guest A Time-sharing task Guest B Black-Box VM Scheduling Paravirtual Scheduling Slide 17 2010-08-10 Jan Kiszka

Towards Minimal-Latency KVM KVM as fixed partition hypervisor Enable migration Legacy RTOS Windows Legacy RTOS Linux Appl. Full KVM nano KVM Linux nano KVM Linux Core 1 Core n Core 1 Core n Slide 18 2010-08-10 Jan Kiszka

Conclusion Embedded Virtualization is a broad domain, today focused on multi-core partitioning KVM already meets many of its key requirements Well set up for bringing enterprise features to embedded More work required Reduce prio-inversions in hypervisor Temporal isolation of guests Paravirtualized scheduling Non-x86 architectures KVM may never fit all embedded use case, but a significant share Slide 19 2010-08-10 Jan Kiszka

Thank You! Any Questions? Slide 20 2010-08-10 Jan Kiszka

Paravirtualized Scheduling Execution model Use POSIX scheduling policies Per-VCPU policy/priority Map guest on VCPU thread priorities: Boost to maximum priority during interrupt Nested boosts for NMI support Host-guest Interface Two hypercalls Set Scheduling Parameters (CPU-ID, policy, priority) Interrupt Done KVM prototype just requires rebase and upstream posting Slide 21 2010-08-10 Jan Kiszka

Towards Minimal-Latency KVM (2) Step 1: Advanced CPU isolation Single task shall dominate CPU Many proposals brought up, none mainline compatible Requires iterative approach Migrate timers, disable sched tick Move housekeeping work Reduce RT-unrelated noise Exclude CPU from RCU Reduce IPI reasons Many folks interested, but no one working on it ATM Step 2: Run KVM VCPUs on isolated CPUs Goals (guest in operation mode): Zero user space VMM exits Zero host task switches In-kernel non-threaded IRQ (re-)injection Adopt guest to avoid user space device emulations Slide 22 2010-08-10 Jan Kiszka