ARM Virtualization: CPU & MMU Issues



Similar documents
Virtualization. Jia Rao Assistant Professor in CS

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

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

Full and Para Virtualization

Virtualization. Pradipta De

Virtual Machines. COMP 3361: Operating Systems I Winter

COS 318: Operating Systems. Virtual Machine Monitors

Cloud Computing #6 - Virtualization

Platform Virtualization: Model, Challenges and Approaches

Virtual machines and operating systems

Virtualization Technology. Zhiming Shen

A Choices Hypervisor on the ARM architecture

Introduction to Virtual Machines

Virtualization. ! Physical Hardware. ! Software. ! Isolation. ! Software Abstraction. ! Encapsulation. ! Virtualization Layer. !

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

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

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

Clouds, Virtualization and Security or Look Out Below

x86 Virtualization Hardware Support Pla$orm Virtualiza.on

Virtualization. Types of Interfaces

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

Virtual Machines. Virtualization

System Virtual Machines

Distributed Systems. Virtualization. Paul Krzyzanowski

Hardware accelerated Virtualization in the ARM Cortex Processors

Hypervisors and Virtual Machines

ARM VIRTUALIZATION FOR THE MASSES. Christoffer Dall

Virtualization. Explain how today s virtualization movement is actually a reinvention

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

COS 318: Operating Systems. Virtual Machine Monitors

Virtualization. Jukka K. Nurminen

kvm: Kernel-based Virtual Machine for Linux

Virtualization VMware Inc. All rights reserved

Chapter 5 Cloud Resource Virtualization

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

Hybrid Virtualization The Next Generation of XenLinux

ARM Microprocessor and ARM-Based Microcontrollers

Intel Virtualization Technology and Extensions

Virtualization. Dr. Yingwu Zhu

Knut Omang Ifi/Oracle 19 Oct, 2015

FRONT FLYLEAF PAGE. This page has been intentionally left blank

Analysis of the Intel Pentium s Ability to Support a Secure Virtual Machine Monitor

Formal virtualization requirements for the ARM architecture

Implementation of a Purely Hardware-assisted VMM for x86 Architecture

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtualization. Mike Kasick Glenn Willen Mike Cui. April 16, : Operating System Design & Implementation

OS Virtualization Frank Hofmann

A Unified View of Virtual Machines

Cloud Computing. Up until now

VMkit A lightweight hypervisor library for Barrelfish

Cloud Computing CS

OS Virtualization. CSC 456 Final Presentation Brandon D. Shroyer

Xen and the Art of. Virtualization. Ian Pratt

Virtualization in Linux KVM + QEMU

The MIPS architecture and virtualization

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

x86 ISA Modifications to support Virtual Machines

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

Cloud Computing. Dipl.-Wirt.-Inform. Robert Neumann

Detecting the Presence of Virtual Machines Using the Local Data Table

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Jukka Ylitalo Tik TKK, April 24, 2006

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

Research on System Virtualization using Xen Hypervisor for ARM based secure mobile phones

Sierraware Overview. Simply Secure

Xen and the Art of Virtualization

Nested Virtualization

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

Intel Virtualization Technology Overview Yu Ke

New Virtualization Techniques. Lic. Matías Zabaljáuregui

Clouds Under the Covers. Elgazzar - CISC Fall

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

An Introduction to Virtual Machines Implementation and Applications

Virtualization Technology. Zhonghong Ou Data Communications Software Lab, Aalto University

Networked I/O for Virtual Machines

COS 318: Operating Systems

Virtualization Concepts And Applications. Yash Jain DA-IICT (DCOM Research Group)

Brian Walters VMware Virtual Platform. Linux J. 1999, 63es, Article 6 (July 1999).

UEFI Hypervisors Winning the Race to Bare Metal

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

Development of Type-2 Hypervisor for MIPS64 Based Systems

COM 444 Cloud Computing

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

Hardware Assisted Virtualization

Basics of Virtualisation

The Xen of Virtualization

PROCESSOR VIRTUALIZATION ON EMBEDDED LINUX SYSTEMS

Porting Linux to a Hypervisor Based Embedded System

The Microsoft Windows Hypervisor High Level Architecture

Distributed and Cloud Computing

Kernel Virtual Machine

Machine Virtualization: Efficient Hypervisors, Stealthy Malware

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

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

Transcription:

ARM Virtualization: CPU & MMU Issues Prashanth Bungale, Sr. Member of Technical Staff 2010 VMware Inc. All rights reserved

Overview Virtualizability and Sensitive Instructions ARM CPU State Sensitive Instructions in ARM Dealing with Sensitive Instructions In place binary translation MMU Virtualization: Why & How? Comparison of ARM & x86 Virtualization 2

Virtualizability and Sensitive Instructions Defined in the context of a particular virtualization technique Example: Trap and Emulate Model Let VM execute most of its instructions directly on the h/w Except for some sensitive instructions that trap into the VMM and are emulated Sensitive instructions are those that interfere with: Correct emulation of the VM, or Correct functioning of the VMM E.g. Halt Machine instruction VM1 VM2 VMM Hardware 3

Virtualizability and Sensitive Instructions Sensitive Instructions as defined by Goldberg [1] Mode Referencing Instructions Sensitive Register/Memory Access Instructions Storage Protection System Referencing Instructions All I/O Instructions Popek and Goldberg s Theorem about strict virtualizability [2] For any conventional third generation computer, a virtual machine monitor may be constructed if the set of sensitive instructions for that computer is a subset of the set of privileged instructions. [1] Goldberg. Architectural Principles for Virtual Computer Systems. Ph.D. thesis, Harvard University, 1972. [2] Popek and Goldberg, Formal requirements for virtualizable third generation architectures. In SOSP '73 4

ARM CPU State Coprocessor Registers 5

CPSR: Current Program Status Register N Z C V Q IT [1:0] J Reserved GE[3:0] IT[7:2] E A I F T M[4:0] Execution State Registers: Interrupt Masks Current Processor Mode E ISETSTATE ITSTATE ENDIANSTATE Privileged-only Access Registers Execution State Registers Condition Flags 6

Sensitive Instructions on ARM Coprocessor Access Instructions MRC / MCR / CDP / LDC / STC SIMD/VFP System Register Access Instructions VMRS / VMSR TrustZone Secure State Entry Instructions SMC Memory-Mapped I/O Access Instructions Load/Store instructions from/into memory-mapped I/O locations Direct (Explicit/Implicit) CPSR Access Instructions MRS / MSR / CPS / SRS / RFE / LDM(Exc. Return) / DPSPC Indirect CPSR Access Instructions LDRT / STRT Load/Store Unprivileged ( As User ) Banked Register Access Instructions LDM/STM(User mode registers) 7

Dealing with Sensitive Instructions Hardware Techniques Privileged Instruction Semantics dictated by ISA - 1, 2, 3 MMU-enforced traps (e.g., page fault) - 4 Tracing/debug support (e.g., bkpt) Hardware-assisted Virtualization (e.g., extra privileged mode) 8

Dealing with Sensitive Instructions Software Techniques Interpretation / Full Emulation Binary Translation Cached Translation In-Place Translation Para-Virtualization Shallow Para-Virtualization: replace sensitive instructions Deep Para-Virtualization: replace sensitive subsystems (e.g., process model, pagetable management, etc.) Binary Patching / Pre-Virtualization 9

In-place binary translation ARM has a fixed instruction size 32-bit in ARM mode and 16-bit in Thumb mode Perform binary translation in-place Instead of in a separate cache Guest OS Follow control-flow Translate basic block (if not already translated) at the current PC Ensure interposition at end of translated sequence Program Counter All writes (but not reads) to PC now become dangerous instructions Replace dangerous (i.e., sensitive but unprivileged) instructions 1-1 with hypercalls to force trap and emulate Guest transparency issues 10

1-1 Hypercalls Replace dangerous instructions with 1-1 Hypercalls Use trap instruction to issue hypercall Encode hypercall type & original instruction bits in hypercall hint Example: mrs Rd, R <cpsr/spsr> mrs r8, cpsr swi 0x088000 Trap and Emulate Semantics Upon trapping into the monitor, decode the hypercall type and the original instruction bits, and emulate instruction semantics 11

MMU Virtualization: Why? Translation Virtualization VA PA; PA MA Protection Virtualization Access permissions, domains Multiplex available hardware MMU protection support among: Protecting the hypervisor from the guests Protecting the guest kernel from guest user Cross-architectural versions (e.g., ARMv5 on ARMv6) Dealing with differences in cache, TLB architectures, page-table layout, etc. 12

MMU Virtualization: How? Shadow PT Intercept guest MMU events of interest Data/Prefetch Aborts, TTBR deltas, PT deltas, TLB ops Maintain (lazily) hypervisor-controlled, trusted shadow PT Options: TLB Coherency-based Shadow PTs / Cached Shadow PTs In-place Shadow PTs Para-Virtualized trusted guest PT Highly intrusive to guest MMU software Hardware virtualization support Nested / 2-stage Page Tables: VA->PA; PA->MA 13

Comparison of ARM vs. x86 Virtualizability Sensitive Instructions Type of Sensitive Instructions Sensitive Register Access Protection System References Violating Goldberg s Requirement # 3B 3C X86 [3] SGDT, SIDT, SLDT, SMSW, PUSHF/POPF LAR, LSL, VERR, VERW, PUSH/POP, CALL, JMP, INT n, RET, STR, MOVE ARM - LDM/STM (user regs), LDRT/STRT ( As User ) Both 3B & 3C - MRS, MSR, CPS, SRS, RFE, DPSPC, LDM (exc. return) [3] John Scott Robin and Cynthia Irvine, Analysis of the Intel Pentium s Ability to Support a Secure Virtual Machine Monitor, USENIX Security Symposium, 2000. 14

Comparison of ARM vs. x86 Virtualizability Ring compression protection mechanisms x86: Segmentation + Paging ARM: Paging (+ domains?) Instruction execution vs. Data Read/Write protection x86: CS for instruction fetch vs. DS/other for data access ARM: No explicit distinction b/w execute and read protection Cache architecture x86: Largely transparent; PIPT across all versions ARM: Exposes a lot of the cache architecture; VIVT/VIPT/PIPT 15

Comparison of ARM vs. x86 Virtualizability Instruction size x86: Variable ARM: Fixed -> enables more in-place patching mechanisms I/O x86: I/O instructions + memory-mapped I/O ARM: Only memory-mapped I/O 16