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



Similar documents
Hardware accelerated Virtualization in the ARM Cortex Processors

Full and Para Virtualization

ARM VIRTUALIZATION FOR THE MASSES. Christoffer Dall

Virtualization. Pradipta De

Leveraging Thin Hypervisors for Security on Embedded Systems

Virtualization. Dr. Yingwu Zhu

Prototype of Light-weight Hypervisor for ARM Server Virtualization

Virtual Machines. COMP 3361: Operating Systems I Winter

The Microsoft Windows Hypervisor High Level Architecture

Virtualization. Jia Rao Assistant Professor in CS

COS 318: Operating Systems. Virtual Machine Monitors

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

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

ARM Virtualization: CPU & MMU Issues

KVM/ARM: Experiences Building the Linux ARM Hypervisor

Virtualization. Types of Interfaces

Nested Virtualization

Jukka Ylitalo Tik TKK, April 24, 2006

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Multi-core Programming System Overview

Sierraware Overview. Simply Secure

Virtualization. Jukka K. Nurminen

Introduction to the NI Real-Time Hypervisor

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

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

KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor

Basics of Virtualisation

x86 ISA Modifications to support Virtual Machines

PROCESSOR VIRTUALIZATION ON EMBEDDED LINUX SYSTEMS

IOMMU: A Detailed view

Chapter 5 Cloud Resource Virtualization

Virtualization Technology. Zhiming Shen

Virtualization. Michael Tsai 2015/06/08

Operating Systems. Lecture 03. February 11, 2013

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Distributed Systems. Virtualization. Paul Krzyzanowski

Cortex-A9 MPCore Software Development

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

Virtualization for Cloud Computing

Parallels Virtuozzo Containers

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

ARMv8 Technology Preview. By Richard Grisenthwaite Lead Architect and Fellow. ARM

Exploring the Design of the Cortex-A15 Processor ARM s next generation mobile applications processor. Travis Lanier Senior Product Manager

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

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

Intel Virtualization Technology (VT) in Converged Application Platforms

The MIPS architecture and virtualization

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

Cloud Computing #6 - Virtualization

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

System Virtual Machines

Chapter 14 Virtual Machines

Virtual machines and operating systems

Virtualization: Concepts, Applications, and Performance Modeling

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

COS 318: Operating Systems. Virtual Machine Monitors

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

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

VxWorks Guest OS Programmer's Guide for Hypervisor 1.1, 6.8. VxWorks GUEST OS PROGRAMMER'S GUIDE FOR HYPERVISOR

Advanced Computer Networks. Network I/O Virtualization

Operating System Organization. Purpose of an OS

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

Hardware Virtualization on. ARM Cortex-A Low-Cost Building automation

VtRES Towards Hardware Embedded Virtualization Technology: Architectural Enhancements to an ARM SoC. ESRG Embedded Systems Research Group

Real-Time Virtualization How Crazy Are We?

Hypervisors and Virtual Machines

Cloud Computing CS

Secure Containers. Jan Imagination Technologies HGI Dec, 2014 p1

Development of Type-2 Hypervisor for MIPS64 Based Systems

Performance tuning Xen

The QEMU/KVM Hypervisor

Comprehensive Security for Internet-of-Things Devices With ARM TrustZone

ARM Cortex-R Architecture

Virtual Machine Security

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

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

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

NoHype: Virtualized Cloud Infrastructure without the Virtualization

Secure data processing: Blind Hypervision

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Distributed and Cloud Computing

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

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

Architecture of the Kernel-based Virtual Machine (KVM)

KVM Security Comparison

Rackspace Cloud Databases and Container-based Virtualization

Hybrid Virtualization The Next Generation of XenLinux

CSE597a - Cell Phone OS Security. Cellphone Hardware. William Enck Prof. Patrick McDaniel

Proteus, a hybrid Virtualization Platform for Embedded Systems

Security Overview of the Integrity Virtual Machines Architecture

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

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

FRONT FLYLEAF PAGE. This page has been intentionally left blank

Transcription:

Virtualization in the ARMv7 Architecture Lecture for the Embedded Systems Course CSD, University of Crete (May 20, 2014) ManolisMarazakis (maraz@ics.forth.gr) Institute of Computer Science (ICS) Foundation for Research and Technology Hellas (FORTH)

Virtualization Benefits in Embedded Systems Workload consolidation E.g. Applications + Baseband sharing a multicore SoC Flexible resource provisioning License barrier Legacy software support important with the multitude and variety of embedded operating systems (commercial and even home-brew) Reliability Security 2 Virtualization in the ARMv7 Architecture

Virtualization trade-off Performance: Applications that used to own the whole processor must now share Hypervisor adds runtime overhead & increases memory footprint Real-time properties? Full virtualization without hardware support means software emulation Complexity: Old scenario: two software stacks + two hardware systems New scenario: two software stacks + one hardware system + one host kernel More abstraction layers more bugs Security & reliability: Increased size of Trusted Computing Base (TCB) Increased impact of hardware failure I/O: emulation vs (para)virtual vs direct access 3 Virtualization in the ARMv7 Architecture

Essentials of a hypervisor Parent partition (minimum-footprint OS) + Hypervisor Hypervisor: Thin layer of software running on the hardware Supports creation of partitions (virtual machines) Each partition has one or more virtual processors Partitions can own or share hardware resources Enforces memory access rules Enforces policy for CPU usage Virtual processors are scheduled on real processors Enforces ownership of other devices Provides inter-partition messaging Messages appear as interrupts Exposes simple programmatic interface: hypercalls 4 Virtualization in the ARMv7 Architecture

Virtualization extensions to the ARMv7-A architecture Virtualization extensions to the ARMv7-A architecture: Available in Cortex A-15 / A-7 CPUs Hyp-New privilege level (for hypervisor) GuestOS: SVC privilege level, Applications: USR privilege level 2-stage address translation (for OS and hypervisor levels) Complementary to TrustZonesecurity extensions Mechanisms to minimize hypervisor intervention for routine GuestOStasks: Page table management Interrupt masking & Communication with the interrupt controller (GIC) Device drivers (hypervisor memory relocation) Emulation of Load/Store accesses and trapped instructions Hypervisor Syndrome Register: Hype mode entry reason (syndrome) Traps into Hypmode for ID register accesses & idling (WFI/WFE) System instructions to read/write key registers 5 Virtualization in the ARMv7 Architecture

Privilege levels Guest OS: same kernel/user privilege structure HYP mode: higher privilege than OS kernel level hvcinstruction (hypercall) VMM controls wide range of OS accesses Hardware maintains TZ security (4 th privilege level) App1 App2 Non-secure State App1 App2 User Mode (Non-privileged) 1 Secure State Secure Apps Guest Operating System1 Virtual Machine Monitor / Hypervisor Guest Operating System2 Supervisor Mode (Privileged) Hyp Mode (More Privileged) TrustZone Secure Monitor (Highest Privilege) 2 3 Secure Operating System Exceptions Exception Returns 6 Virtualization in the ARMv7 Architecture

Virtual Memory (1-stage translation) Without virtualisation, the OS owns the memory Allocates areas of memory to the different applications Virtual Memory commonly used in rich operating systems Virtual address map of each application Translations from translation table (owned by the OS) Physical Address Map 7 Virtualization in the ARMv7 Architecture

Virtual Memory (2-stage translation) Stage 1 translation owned by each Guest OS Stage 2 translation owned by the VMM Hardware has 2-stage memory translation Tables from Guest OS translate VA to IPA Second set of tables from VMM translate IPA to PA Allows aborts to be routed to appropriate software layer Virtual address (VA) map of each App on each Guest OS Intermediate Physical address map of each Guest OS (IPA) 8 Virtualization in the ARMv7 Architecture Physical Address (PA) Map

Virtualization of interrupts An interrupt might need to be routed to one of: Current or different GuestOS Hypervisor OS/RTOS running in the secure TrustZoneenvironment Physical interrupts are taken initially in the Hypervisor If the Interrupt should go to a GuestOS: Hypervisor maps a virtual interrupt for that GuestOS

Virtual Interrupt Controller ISR of GuestOSinteracts with the virtual controller Pending and Active interrupt lists for each GuestOS Interact with the physical GIC in hardware Creates Virtual Interrupts only when priority indicates it is necessary GuestOSISRs therefore do not need calls for: Determining interrupt to take [Read of Interrupt Acknowledge] Marking the end of an interrupt [Sending EOI] Changing CPU Interrupt Priority Mask [Current Priority] GIC has separate sets of internal registers: Physical registers and virtual registers Non-virtualized system and hypervisor access the physical registers Virtual machines access the virtual registers Guest OS functionality does not change when accessing the vgic Hypervisor remaps virtual registers for use by GuestOS es Interrupts generate a hypervisor trap 10 Virtualization in the ARMv7 Architecture

Virtual interrupt sequence External IRQ (configured as virtual by the hypervisor) arrives at the GIC GIC Distributor signals a Physical IRQ to the CPU CPU takes HYP trap, and Hypervisor reads the interrupt status from the Physical CPU Interface Hypervisor makes an entry in register list in the GIC GIC Distributor signals a Virtual IRQ to the CPU CPU takes an IRQ exception, and Guest OS running on the virtual machine reads the interrupt status from the Virtual CPU Interface External Interrupt source Distributor Virtual CPU Interface Physical Virtual IRQ Guest OS CPU CPU Interface Physical IRQ Hypervisor 11 Virtualization in the ARMv7 Architecture

Virtual I/O devices Memory-mapped devices Read/write accesses to device registers have specific side-effects Virtual devices emulation Typically, read/write accesses have to trap to Hypervisor Fetch & interpretation of emulated load/stores is performance-intensive Syndrome: key information about an instruction Source/destination register, Size of data transfer, Available for some loads/stores (on abort) If not available, then it is required to fetch the instruction for full emulation System MMU: 2 nd -stage address translation for devices Allows devices to be programmed into Guest s VA space 12 Virtualization in the ARMv7 Architecture

System MMU 13 Virtualization in the ARMv7 Architecture

ARM TrustZone(Secure System Partitioning) 14 Virtualization for Embedded Systems

Propagation of System Security Mode NS : Not Secure - treated like an address line 15 Virtualization in the ARMv7 Architecture

Boot sequence with Hypervisor 16 Virtualization in the ARMv7 Architecture

Sources David Brash, Extensions to the ARMv7-A Architecture, HotChips 2010 John Goodacre, Hardware accelerated Virtualization in the ARM Cortex Processors, XenSummit Asia 2011 Roberto Mijatand Andy Nightingale, Virtualization is Coming to a Platform Near You: The ARM Architecture Virtualization Extensions and the importance of System MMU for virtualized solutions and beyond, ARM White paper, 2011 17 Virtualization in the ARMv7 Architecture