SlideShare uma empresa Scribd logo
1 de 85
Baixar para ler offline
Embedded Hypervisor for ARM




Jim Huang ( 黃敬群 )
Developer, 0xlab
                     jserv@0xlab.org

                         Dec 6, 2011
Rights to copy
                                                                    © Copyright 2011 0xlab
                                                                           http://0xlab.org/
                                                                            contact@0xlab.org
Attribution – ShareAlike 3.0
You are free                                                  Corrections, suggestions, contributions and
                                                                               translations are welcome!
   to copy, distribute, display, and perform the work
   to make derivative works                                                   Latest update:Feb 6, 2012
   to make commercial use of the work
Under the following conditions
      Attribution. You must give the original author credit.
      Share Alike. If you alter, transform, or build upon this work, you may distribute the
      resulting work only under a license identical to this one.
   For any reuse or distribution, you must make clear to others the license terms of this
   work.
   Any of these conditions can be waived if you get permission from the copyright holder.
Your fair use and other rights are in no way affected by the above.
License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
Agenda   (1) Virtualization from The Past
         (2) Hypervisor Design
         (3) Embedded Hypervisors for
             ARM
         (4) Toward ARM Cortex-A15
Virtualization from The Past
Definition

"virtualization is "a technique for hiding the physical
characteristics of computing resources from the way in
which other systems, applications, or end users
interact with those resources. "
– Wikipedia
Future Computing Trends
 Changes in
 Computing




                                                                                                                                       Open
  Closed                Keyboard/Mouse            Multitouch                      Augmented Reality  Gesture Interactive 3D UI
                                                                                                                                    Distributed
                        Voice Call, SMS           Video Call, MMS                 Eye-Tracking Manytouch  Realtime Web
Centralized                                                                                                                        Correct+Timely
Correct Info.            Centeralized/Concentrated                                  Distributed/Scattered
                                                                                                                                        Info.
                         Known Comm. Entities                                       Unknown/Utrusted Comm. Entities
 Stationary                                                                                                                            Mobile
                                                            Collaboration                                                              Sensor
            Keyboard/                                                                                                                 Network
             Mouse                                                                                    Every Node
                                                                                                       as Both of
                                               Multitouch                                            Client/Server
                        Local
                                    Personal                                        Cloud
                        Store
                                   Computer

 Embedded                             Single-core                                           Multi-core                           Many-core

    IT            Single-core                           Multi-core                                                   Many-core
              UC Berkeley                     [2009]                                        [2012]                      [2017]
              Sensornet Chip                    Tiger 1GHz Single-Core                       ARM 2GHz 4-core            ARM 3GHz 8-core
             (TI MSP430 8MHz core,              Dunnington 3GHz 6-core                       Intel 4GHz 32-core         Intel 6GHz 128-core
             10KB RAM)                                                                                                    SensorNet Chip
                                                                                                                         (128MHz core, 160KB RAM)




                                Privacy                                                                   Realtime
Source: Xen ARM Virtualization, Xen Summit Asia 2011
           by Dr. Sang-bum Suh, Samsung
Server Virtualization::Benefits

• Workload consolidation
  – Increase server utilization
  – Reduce capital, hardware, power, space, heat costs
• Legacy OS support
  – Especially with large 3rd-party software products
• Instant provisioning
  – Easily create new virtual machines
  – Easily reallocate resources (memory, processor, IO)
    between running virtual machines
• Migration
  – Predicted hardware downtime
  – Workload balancing
Embedded Virtualization::Benefits

•   Workload consolidation
•   Flexible resource provisioning
•   License barrier
•   Legacy software support
    – Especially important with dozens or hundreds of embedded
      operating systems, commercial and even home-brew
• Reliability
• Security
• (1) Hardware Consolidation
             – Application Processor and Baseband Processor can                                                                                                     Why?
                share multicore ARM CPU SoC to run both Linux and
              - RTOS efficiently.                                                             • (2) OS Isolation
                                                                                                 – important call services can be effectively separated
                                                                                                   from downloaded third party applications by virtualized
                                                                                                   ARM combined with access control.
                                                                                     1                                                 2                                      3


                                                       를




                                                                                                                                                                                   Nu




                                                                                                                                            Secure Kernel
                                                                                                                                                                         Android
  General Purpose OS                                              RTOS
             Virtualization SW                     ( Realtime Hypervisor)




                                                                                                                                                            Linux
  V - Core   V - Core   V - Core     V - Core   V - Core     V - Core   V - Core   V - Core


             Core                  Core               Core                 Core
                                                                                                              Linux 1        Linux 2
             Memory
                                                                                                  Important         Hypervisor                              Hypervisor
                                     Multi-core            Peripherals                            services            H/W
                                                                                                                                                            Hardware
                                                                                                              Secure Smartphone
AP SoC + BP SoC → Consolidated Multicore SoC                                                                                               Rich Applications from Multiple OS
                                                                                                   • (3) Rich User Experience
                                  – multiple OS domains can run
                                     concurrently on a single smartphone.
Source: Xen ARM Virtualization, Xen Summit Asia 2011
           by Dr. Sang-bum Suh, Samsung
Use Case: Nirvana:
                      The Convergence of Mobile and Desktop
                                  Virtualization in One Device
                                            by OKLabs + Citrix


                            Branch              Access
     Receiver              Repeater             Gateway         XenDesktop
                                                                  XenApp
                                                                 XenServer
                                                                 NetScaler




                                                                           Data                       Cloud

                                                                           Center           
SSL 001000111010101 SSL 001000111010101 SSL 001000111010101 SSL 001000111010101 SSL 001000111010101
                                                                                                      Services
Nirvana phone = Smartphone
+ Full-sized display
                                             Nirvana Phone
+ Keyboard & mouse
+ Virtual desktop
+ OKL4 mobile virtualization   Mobile Device
                               Device’s Native Screen
                                                         Native
                                OKL4                     Device
                                Display                  Applications
      External Monitor
                                Drivers                  Receiver
                                                         Start
                                                         Native OS
                                OKL4 BT                  Device
                                Mouse &                  Drivers
                                Keyboard
                                Driver        Citrix     Native
                                              Receiver   Device OS
                                                                        De-privileged
                                                                        Privileged
                                          OKL4 Microvisor




                Demo video:
http://www.youtube.com/user/OpenKernelLabs
Use Case: Low-cost 3G Handset

• Mobile Handsets
   – Major applications runs on Linux
    – 3G Modem software stack runs on
      RTOS domain

• Virtualization in multimedia Devices
   – Reduces BOM (bill of materials)
    – Enables the Reusability of legacy
      code/applications
                                            Hypervisor
    – Reduces the system development time

• Instrumentation, Automation
   – Run RTOS for Measurement and
      analysis
    – Run a GPOS for Graphical Interface
Virtualization Tradeoff
• Performance tradeoff
  – Applications that used to own the whole processor must now share
  – Hypervisor adds some runtime overhead as well
  – Full virtualization without hardware support means software emulation

• Increase in management complexity
  – Old scenario: two software stacks + two hardware systems
  – New scenario: two software stacks + one hardware system + one host kernel

• More abstraction, more software layers, more complexity...
  – More bugs

• Increases size of TCB (Trusted Computing Base)
• Increases impact of unpredicted hardware failure
Hypervisor Design
"All problems in computer science
can be solved by another level of
            indirection."

      -- David Wheeler --
Virtual Machine

• Add Virtualizing Software to a Host platform and
  support Guest process or system on a Virtual
  Machine (VM)
Virtual Machine for Portability
                               (in the past)
PowerPC          x86             x86-32                HP –PA
programs         programs        programs              programs



       Rosetta           FX!32               IA-32EL          Aries
       (Apple)           (DEC)               (Intel)          (HP)


x86-32           DEC             IA-64                 IA-64
or x86-64        Alpha           (Itanium)             (Itanium)
Virtual Machine for Portability
        NOTE: we don't discuss such topic in this presentation
                             x86
                             programs




             C               LLVM IR     Bytecode




DEC              IA-64         PowerPC   SUN
Alpha            (Itanium)               Sparc         ARM
System Virtual Machine
• Provide a system environment
• Constructed at ISA level
• Allow multiple OS environments,
  or support time sharing.
• virtualizing software that
  implements system VM is called
  as VMM (virtual machine monitor)
• Examples:
    – IBM VM/360, VMware, VLX,
      WindRiver Hypervisor, ENEA
      Hypervisor
    – Xtratum, Lguest, BhyVe (BSD
      Hypervisor)
    – Xen, KVM, OKL4, Xvisor,                         Virtual network communication
      Codezero

NOTE: We only focus on system virtual machine here.
Therefore, this presentation ignores Linux vserver, FreeBSD jail, etc.
Virtualization is Common Technique

• Example: In the past, Linux is far from being real-
  time, but RTLinux/RTAI/Xenomai/Xtratum attempted
  to "improve" Linux by introducing new virtualization
  layer.
• real-time capable virtualization
• Dual kernel approach

                          Bare metal (RT) Hypervisor




                                                       Hardware
                                             RTOS
                             Linux
Example: Xenomai (Linux Realtime Extension)
Linux application            VxWorks application        POSIX application

      glibc                    glibc    Xenomai          glibc        Xenomai
                                        libvxworks                   libpthread_rt
              System calls

          VFS          Network            Xenomai RTOS                       Pieces added
                                            (nucleus)                         by Xenomai
        Memory               ...
                                                Linux kernel space
                                                                                Xenomai
                             Adeos I-Pipe                                        skins

                                              • From Adeos point of view, guest OSes
                                                are prioritized domains.
                                              • For each event (interrupts, exceptions,
                                                syscalls, etc...), the various domains may
                                                handle the event or pass it down the
                                                pipeline.


                                       Source: Real-time in embedded
                                       Linux systems, Free Electrons (2011)
Windows Apps        Linux Apps

  • Type I
                                MS-                      Linux
  • Bare metal system VM      Windows

                                  VMM or Hypervisor
                                 IA-32 Physical Machine
  General Classification
             of
Virtualization technologies
                                 Windows Apps       Linux Apps
   • Type 2                               MS-
                                        Windows
   • Hosted System VM
                                             VM
                                                      Linux

                                  IA-32 Physical Machine
Source: Operating Systems Design – Lecture 21 Virtualization,
Roy Campbell (Fall 2010)
Myth of Type I and Type II Hypervisor
source: http://gala4th.blogspot.com/2011/10/myth-of-type-i-and-type-ii-hypervisors.html

   • Myth: Type-2 is "lesser" than a true "type-1" hypervisor.
   • Virtualization theory really started with a paper from
     Gerald Popek and Robert Goldberg called Formal
     Requirements for Virtualizable Third Generation
     Architectures. (1974)
      – Sensitive Instructions
          might change the state of system resources
        – Privileged Instructions
          must be executed with sufficient privilege
   • The terms "type-1" and "type-2" originate from a paper
     by John Robin called Analyzing the Intel Pentium's
     Capability to Support a Secure Virtual Machine Monitor.
     (USENIX 2000)
      ● Popek/Goldberg proof does not eliminate the

        possibility of using dynamic translation
System Virtualization Implementations
     Full             Para        Hardware Assisted
Virtualization   Virtualization     Virtualization
Full Virtualization

●
    Everything is virtualized
●
    Full hardware emulation
●
    Emulation = latency
Definitions
• Sensitive Instructions as defined by "Formal Requirements for
  Virtualizable Third Generation Architectures” (1974):
  – Mode Referencing Instructions
  – Sensitive Register/Memory Access Instructions
  – Storage Protection System Referencing Instructions
  – All I/O Instructions
• Theorem about strict virtualizability by "Analyzing the Intel
  Pentium's Capability to Support a Secure Virtual Machine
  Monitor" (2000):
  – 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.
Privileged Instructions
●   Privileged instructions: OS kernel and device
    driver access to system hardware
●   Trapped and emulated by VMM
    –   Let VM execute most of its instructions directly on hardware
    –   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
          ●   Correct functioning of the VMM
0x1C                    FIQ
                                                        0x18                    IRQ
                                                        0x14                (Reserved)
                                                        0x10                Data Abort
    Current Visible Registers                           0x0C              Prefetch Abort
                r0                                      0x08              Software Interrupt
Undef Mode
 Abort Mode
SVC Mode
IRQ Mode
FIQ Mode
User Mode
                r1
                                                        0x04            Undefined Instruction
                r2
                r3                                     0x00         Reset
                                                  Banked out Registers
                r4
                                                                Vector Table
                r5
                r6              User     FIQ         IRQ        SVC           Undef       Abort
                r7
                r8               r8      r8
                r9               r9      r9                     Banked out Registers
                r10             r10      r10
                r11             r11      r11
                r12             r12      r12
              r13 (sp)      r13 (sp)   r13 (sp)    r13 (sp)    r13 (sp)      r13 (sp)     r13 (sp)
              r14 (lr)      r14 (lr)   r14 (lr)    r14 (lr)    r14 (lr)      r14 (lr)     r14 (lr)
              r15 (pc)

               cpsr
               spsr                     spsr        spsr         spsr          spsr            spsr
r0                  r8
                r1                  r9           31              0
                r2                 r10
                r3                 r11                    CPSR
                r4                 r12
                r5                 r13
                                                  NZCV
                r6                 r14
                r7              r15 (PC)
                                                 Link register
         unbanked registers   banked registers


Every arithmetic, logical, or shifting operation may set CPSR
(current program statues register) bits:
 ●
   N (negative), Z (zero), C (carry), V (overflow).
Examples:
 ●
   -1 + 1 = 0:    NZCV = 0110.
 ●
   231-1+1 = -231: NZCV = 0101.
ARM Architecture (armv4)

• 6 basic operating modes (1 user, 5 privileged)
• 37 registers, all 32 bits wide
   – 1 program counter
   – 5 dedicated saved program status registers
   – 1 Current program status register (PSR)
   – 30 general purpose registers
• Special usage
   – r13 (stack pointer)
   – r14 (link register)
   – r15 (program counter, PC)

                                                   31
Typical ARM instructions (armv4)
•   branch and branch with Link (B, BL)
•   data processing instructions (AND, TST, MOV, …)
•   shifts: logical (LSR), arithmetic (ASR), rotate (ROR)
•   test (TEQ, TST, CMP, CMN)
•   processor status register transfer (MSR, MRS)
•   memory load/store words (LDR, STR)
•   push/pop Stack Operations (STM, LDM)
•   software Interrupt (SWI; operating mode switch)
•   co-processor (CDP, LDC, STC, MRC, MCR)




                                                            32
Problematic Instructions             (1)


    • Type 1
      Instructions which executed in user mode will cause
      undefined instruction exception
    • Example
      MCR p15, 0, r0, c2, c0, 0
      Move r0 to c2 and c0 in coprocessor specified by p15
      (co-processor) for operation according to option 0
      and 0
       – MRC: from coproc to register
       – MCR: from register to coproc
    • Problem:
      – Operand-dependent operation

Source: 前瞻資訊科技 – 虛擬化 , 薛智文 , 台大資訊所 (2011)
Problematic Instructions                                  (2)


 • Type 2
   Instructions which executed in user mode will have
   no effect
 • Example
   MSR cpsr_c, #0xD3
   Switch to privileged mode and disable interrupt

31                          Program Status Register (PSR)                        0

 N Z C V Q   --   J   --      GE[3:0]           --          E A I F T   M[4:0]


Execution                                                   Exception Execution
  Flags                                                       Mask      Mode
Problematic Instructions             (3)


• Type 3
  Instructions which executed in user mode will cause
  unpredictable behaviors.
• Example
  MOVS       PC, LR
  The return instruction
  changes the program counter and switches to user
  mode.
• This instruction causes unpredictable behavior when
  executed in user mode.
ARM Sensitive Instructions
• 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 (conditional execution) / DPSPC
• Indirect CPSR Access Instructions
    LDRT / STRT – Load/Store Unprivileged (“As User”)
• Banked Register Access Instructions
    LDM/STM (User mode registers)
Solutions to Problematic Instructions
                 [ Hardware Techniques ]
• Privileged Instruction Semantics dictated/translated
  by instruction set architecture
• MMU-enforced traps
   – Example: page fault
• Tracing/debug support
   – Example: bkpt (breakpoint)
• Hardware-assisted Virtualization
  – Example: extra privileged mode, HYP, in ARM
    Cortex-A15
Solutions to Problematic Instructions
                           [ Software Techniques ]
                                 Binary
          Complexity                              Hypercall
                              translation
            Design                High               Low
        Implementation          Medium               High
           Runtime                High             Medium
          Mapped to
         programming         Virtual function   Normal function
          languages




Method: trap and emulate
Dynamic Binary Translation

Translation Basic Block
                                                  BL    TLB_FLUSH_DENTRY_NEW
                                                                …
                                             TLB_FLUSH_DENTRY:
     BL    TLB_FLUSH_DENTRY                      MCR    p15, 0, R0, C8, C6, 1
                   …                             MOV    PC, LR
 TLB_FLUSH_DENTRY:                                              …
     MCR    p15, 0, R0, C8, C6, 1            TLB_FLUSH_DENTRY_NEW:
     MOV    PC, LR                               MOV    R1, R0
                   …                             MOV    R0, #CMD_FLUSH_DENTRY
                                                 SWI    #HYPER_CALL_TLB


• ARM has a fixed instruction size
   – 32-bit in ARM mode and 16-bit in Thumb mode
• Perform binary translation
   – Follow control-flow
   – Translate basic block (if not already translated) at the current PC
   – Ensure interposition at end of translated sequence
   – All writes (but not reads) to PC now become problematic instructions
   – Replace problematic instructions 1-1 with hypercalls to trap and
     emulate
Virtualization APIs – hypercalls
                                                         /* In Hypervisor */

           /* In Guest OS */
                                                            SWI Handler
      BL     TLB_FLUSH_DENTRY
                     …
  TLB_FLUSH_DENTRY:                                     Hypercall Handler
      MOV    R1, R0
                                                                 ……
      MOV    R0, #CMD_FLUSH_DENTRY
      SWI    #HYPER_CALL_TLB
                     …                            LDR R1, [SP, #4]
                                                  MCR p15, 0, R1, C8, C6, 1




                                                      Restore User Context & PC


• Use trap instruction to issue hypercall
• Encode hypercall type and original instruction bits in hypercall hint
• Upon trapping into the VMM, decode the hypercall type and the original
  instruction bits, and emulate instruction semantics
      mrs Rd, R <cpsr/spsr>


    mrs r8, cpsr                   swi 0x088000
Hypercall

 Guest OS

                    Hypercalls




                                    Software Interrupt
                      No
              Yes   reschedule
                        ?
context switch
 Hypervisor
                    Hyper Call
                     Handler


                    SWI Handler
Hypercall in xen-i386

                                                                         System Call    int 0x80
                                                       01   // linux/include/asm/unistd.h
                                                       02
                                                       03   #define   __NR_restart_syscall          0
 Guest OS                    Hypervisor                04   #define   __NR_exit                     1
                                                       05   #define   __NR_fork                     2
                                                       06   #define   __NR_read                     3
                                                       07   …
HYPERVOSIR_sched_op




                int 82h           hypercall


                               Hypercall_table   do_sched_op

                      iret                                               Hyper Call     int 0x82
                                                      01    // xen/include/public/xen.h
            resume Guest OS
                                                      02
                                                      03    #define   __HYPERVISOR_set_trap_table   0
                                                      04    #define   __HYPERVISOR_mmu_update       1
                                                      05    #define   __HYPERVISOR_set_gdt          2
                                                      06    #define   __HYPERVISOR_stack_switch     3
                                                      07    …
Case study: Xvisor-ARM
                               https://github.com/xvisor

• File: arch/arm/cpu/arm32/elf2cpatch.py
   – Script to generate cpatch script from guest OS ELF
• Functionality before generating the final ELF image
   – Each sensitive non-priviledged ARM instruction is
     converted to a hypercall.
   – Hypercall in ARM instruction set is SVC <imm24>
     instruction.
   – Encode sensitive non-priviledged instructions in <imm24>
     operand of SVC instruction. (software interrupt)
   – Each encoded instruction will have its own unique inst_id.
   – The inst_field for each encoded sensitive non-priviledged
     instruction will be diffrent.
How does Xvisor handle problematic
             instructions like MSR?
  • Type 2
    Instructions which executed in user mode will have
    no effect
  • Example
    MSR cpsr_c, #0xD3
    Switch to privileged mode and disable interrupt

 31                         Program Status Register (PSR)                        0

  N Z C V Q   --   J   --     GE[3:0]           --          E A I F T   M[4:0]


 Execution                                                  Exception Execution
   Flags                                                      Mask      Mode
First, cpatch (ELF patching tool) looks
                   up the instructions...
 MSR cpsr_c, #0xD3
 Switch to privileged mode and disable interrupt


# MSR (immediate)
#       Syntax:
#               msr<c> <spec_reg>, #<const>
#       Fields:
#               cond = bits[31:28]
#               R = bits[22:22]
#               mask = bits[19:16]
#               imm12 = bits[11:0]
#       Hypercall Fields:
#               inst_cond[31:28] = cond
#               inst_op[27:24] = 0xf
#               inst_id[23:20] = 0
#               inst_subid[19:17] = 2
#               inst_fields[16:13] = mask
#               inst_fields[12:1] = imm12
#               inst_fields[0:0] = R
# MSR (immediate)
                                      #       Syntax:
                                      #               msr<c> <spec_reg>, #<const>
                                      #       Fields:
                                      #               cond = bits[31:28]
                                      #               R = bits[22:22]
                                      #               mask = bits[19:16]
                                      #               imm12 = bits[11:0]
                                      #       Hypercall Fields:
                                      #               inst_cond[31:28] = cond
                                      #               inst_op[27:24] = 0xf
                                      #               inst_id[23:20] = 0
def convert_msr_i_inst(hxstr):        #               inst_subid[19:17] = 2
                                      #               inst_fields[16:13] = mask
        hx = int(hxstr, 16)           #               inst_fields[12:1] = imm12
        inst_id = 0                   #               inst_fields[0:0] = R
        inst_subid = 2
        cond = (hx >> 28) & 0xF      Xvisor utilizes cpatch to convert
        R = (hx >> 22) & 0x1
        mask = (hx >> 16) & 0xF
                                     all problematic instructions for OS
        imm12 = (hx >> 0) & 0xFFF    image files (ELF format).
        rethx = 0x0F000000
        rethx = rethx | (cond << 28)
        rethx = rethx | (inst_id << 20)
        rethx = rethx | (inst_subid << 17)
        rethx = rethx | (mask << 13)
        rethx = rethx | (imm12 << 1)
        rethx = rethx | (R << 0)
        return rethx
Requirements of real Hypervisor

• VMM at higher privilege level than VMs
  – CPU Virtualization
  – Memory Virtualization
  – Device & I/O Virtualization

• User and System modes
• Privileged instructions only available in system mode
   – Trap to system if executed in user mode
• All physical resources only accessible using
  privileged instructions
  – Including page tables, interrupt controls, I/O
    registers
Memory Virtualization

• Deal with allocation of Physical memory among
  Guest OS
• RAM space shares among Guest OS
• Processors with Memory Virtualization support is
  expecting in 2nd generation processors (Intel VT and
  ARM Cortex-A15)
Device and I/O Virtualization

• Deal with routing of I/O requests between virtual
  devices and the shared physical hardware
• Similar to the single I/O device shared concurrently
  among different applications.
• Hypervisor virtualizes the physical hardware and
  present each virtual machine with a standard set of
  virtual devices
Paravirtualization

• OS or system devices are virtualization aware
• Requirements:
  – OS level – translated/modified kernel
  – Device level – paravirtualized or “enlightened”
    device drivers
Hardware-assisted Virtualization

●   Hardware is virtualization aware
●   Hypervisor and VMM load at
    Ring -1
●   Remove CPU emulation bottleneck
●   Provides address bus isolation
Hardware-assisted Virtualization

●   VMM coordinates direct hardware
    access
●   Memory virtualization solved in
    2nd generation hardware assisted
    platforms
●   Passthrough I/O has limited use
    cases without IOV (I/O Virtualization)
    http://www.pcisig.com/specifications/iov/
Hardware-assisted Virtualization in x86
• VT technology enables new execution mode (VMX-Root Mode in
  x86 by Intel) in the processors to support virtualization
• Hypervisor runs in a root mode below Ring0
• OS requests trap VMM without binary translation or PV
• Specialized Hardware support is required
• A special CPU privileged mode is to be selected to support
Hardware-assisted Virtualization in ARM

       •   Enable new execution mode Hypervisor (HYP)
       •   Hypervisor runs in a Hypervisor (HYP) mode
       •   Guest OS Runs in Supervisory Control (SVC) mode
       •   Applications runs in User (USR) mode




Details will be discussed in section
"Toward ARM Cortex-A15"
What does Hypervisor looks like
                              • Thin layer of software running on the hardware
                              • Supports creation of partitions
                                   • Each partition is a virtual machine
                                   • Each partition has one or more virtual processors
                                   • Partitions can own or share hardware resources
                                   • Software running in partition is called a guest
                              • Enforces memory access rules
                              • Enforces policy for CPU usage
                                   • Virtual processors are scheduled on real processors
                              • Enforces ownership of other devices
                              • Provides simple inter-partition messaging
Parent Partition                   • Messages appear as interrupts
                              • Exposes simple programmatic interface called
(Minimum Footprint              “hypercalls”
Operating System)


                                        Hypervisor

                   Ethernet
  Hard Disk                           CPU       RAM
                     NIC
Monolithic vs. Microkernel
Monolithic hypervisor                 Microkernel based
●    Simpler than a modern            hypervisor
     kernel, but still complex        ●     Simple partitioning
●    Contains its own drivers               functionality
     model                            ●     Increase reliability and
                                            minimize TCB
                                      ●     No third-party code
                                      ●     Drivers run within guests
       VM 1                                  VM 1
                  VM 2       VM 3         (“Parent”)
    (“Admin”)
                                            Virtual-     VM 2         VM 3
                                            ization    (“Child”)    (“Child”)
                                             Stack
                                           Drivers
                                            Drivers    Drivers
                                                        Drivers     Drivers
                                                                     Drivers
                Hypervisor                   Drivers     Drivers      Drivers

                 Drivers
                  Drivers
                   Drivers                             Hypervisor

                Hardware                               Hardware
Virtualization Stack
                                      • Collection of user-mode and kernel-mode components
        WMI                                • Runs within a partition on top of a (minimal) OS
      Provider                             • Contains all VM support not in the hypervisor
                     VM Worker
                      VM Worker       • Interacts with hypervisor
    VM Service         VM Worker
                      Process
                        Process            • Calls the hypervisor to perform certain actions
                        Process
                                           • Responds to messages from the hypervisor or from
                                             other partitions
                                      • Creates and manages a group of “child partitions”
                                           • Manages memory for child partitions
                                           • Virtualizes devices for child partitions
    Virtualization                    • Exposes a management interface
    Infrastructure        VMBus
        Driver           Bus Driver


 Parent     Hypervisor API &
Partition   Message Library                Child Partition 1          Child Partition 2

                                       Hypervisor
Device Virtualization

• Standard VSP (Virtualization service providers)
   – Storage: support difference drive chains
  – Network: provide virtualized network mechanism
  – Video: 2D/3D graphics w/ or w/o HW acceleration
  – USB: allow a USB device to be assigned to a
    partition
  – Input: keyboard, mouse, touchscreen
  – Time: virtualization for RTC hardware
Device Virtualization
                                      • Physical devices
                                            • Managed by traditional driver stacks
                                      • Virtualization service providers
                                            • Virtualize a specific class of device
                                            • Expose an abstract device interface
            Storage
            Storage
             VSP                            • Run within the partition that owns the
              VSP
                                              corresponding physical device
                                      • Virtualization service clients
    Storage
    Storage              Storage
                         Storage            • Consume virtualized hardware service
     Stack
     Stack                Stack
                          Stack       • VMBus
                                            • Software “bus” (enumeration, hot plug, etc.)
                          Storage
                          Storage           • Enables VSPs and VSCs to communicate
        Port
        Port               VSC
                            VSC               efficiently
       Driver
       Driver
                                            • Uses memory sharing and hypervisor IPC
 Parent
                 VMBus
                 VMBus       VMBus
                             VMBus            messages
Partition

                               Hypervisor
                               Hypervisor

        Disk
        Disk
Embedded Virtualization Use Case

•   Workload consolidation
•   Legacy software
•   Multicore enablement
•   Improve reliability
•   Secure monitoring
Use Case: Workload Consolidation

   Consolidate legacy systems




                                 legacy legacy legacy
         legacy SW                 SW     SW     SW

                                      host kernel
         legacy HW
                                       new HW
Use Case: Legacy Software
   Run legacy software on new core/chip/board with full
    virtualization
                                            legacy new
                      legacy                  SW      SW
                        SW
                                              host kernel
                    legacy HW
                                               new HW
   Consolidate legacy software
                                               visualization
             visualization                         app
    RT app
                 app                 RT app
                                                proprietary
    Linux     proprietary                         kernel
    core        kernel                   Linux/KVM
                 core                 core         core
Use Case: Multicore Enablement

    Legacy uniprocessor applications
                         legacy app      app      app      app
     legacy app
                        legacy kernel       multicore kernel
    legacy kernel
                                          host kernel
     legacy app
                                core     core    core      core
        core


   Flexible resource management
                               data

                     control             data    data
                      plane              plane   plane
                               control

                                  host kernel
                      core       core    core     core
Use Case: Improved Reliability

    Hot standby without additional hardware


                                              app   backup
       app                                           app
                                              HW
                                                     HW
       HW

                             backup
                       app
                              app

                       host kernel
                       HW
Use Case: Secure Monitoring

   Protect monitoring software

                                  network
    network                                  app
               app                                  monitor
                                            kernel
              kernel
                                             host kernel
               HW
                                                   HW
Embedded Virtualization Issues

• Memory footprint
• Security
   – Increases size of Trusted Computing Base
•   Direct IO Access
•   Emulate IO
•   Virtual IO
•   Real-time support
Direct I/O Access
• Guest can directly access physical IO without host
  involvement
   – Native speed
• IOMMU provides isolation and physical address translation
  (DMA)
   – Translation could be done with guest modifications
• Issues:
   – IOMMU required for DMA isolation
   – Limited by number of physical IO devices
   – Guests must have device drivers
   – What about legacy guests on new hardware?
   – Breaks migration
   – IRQ delivery and routing
Emulated I/O

• Host software emulates guest IO accesses
• Issues:
   – Must write software to (perfectly?) emulate
     hardware
  – Dramatic increase in IO latency
  – Host OS must have physical device drivers
     • Device driver availability, licensing concerns
Virtual I/O

• No hardware at all, just inter-guest data transfer
• New guest device drivers co-operate with host
• Issues:
   – Requires guest modification (at least new
     device drivers)
   – Host OS still needs physical IO drivers
Embedded Hypervisors for ARM
Embedded Hypervisors for ARM
                                                      (open source part)
• Xen
   – Xen-arm
     contributed by Samsung
     ARM9, ARM11, ARM Cortex-A9 MP
   – Xen-arm-cortext-a15
   – contributed by Citrix - https://lkml.org/lkml/2011/11/29/265
     ARM Cortex-A15
• OKL4 (from open to close source), OKLabs
• KVM ARM porting
   – Columbia University
   – NTHU, Taiwan
• Xvisor
• Codezero
Xen-ARM (Samsung)
  Goals
Lightweight virtualization for secure 3G/4G mobile devices
     High performance hypervisor based on ARM processor
    Fine-grained access control fitted to mobile devices

  Architecture of Xen ARM
                              VM 0                                            VM n

                       Application          Lightweight Xen-                Application
                      Application                Tools                     Application

       Guest                     Backend Drivers                         Frontend Drivers
      Domain
                                  Native Drivers

                                     VM Interface                         VM Interface
     Secure
    Xen ARM                 Domain                  Resource                 Access
    Hypervisor              Manager                 Allocator                Control


    Hardware                Peripheral          CPU             System          UART
                             Devices                            Memory
Overview
                                                     Xen-ARM (Samsung)
                                                                                 Logical
                                                                                  mode
 CPU virtualization                                                              split
 Virtualization requires 3 privilege CPU levels, but ARM supports 2 levels
                                                                                   Xen ARM mode
   Xen ARM mode: supervisor mode ( most privileged level)
                                                                                virtual kernel mode
   Virtual kernel mode: User mode ( least privileged level)                     virtual user mode
   Virtual user mode: User mode ( least privileged level)

                                                                                    VM 2             Xen ARM
 Memory virtualization                           VM 0    VM 1    VM 2
                                                 Address Address Address            VM 1
 VM’s local memory should be                    Spaces Spaces Spaces                                 Kernel
                                                                                     VM 0
 protected from other VMs                                                                         User Process
                                                                                                         Process
                                                                                                   User Process
                                                                                                   User Process
                                                                                                    User
                                                                                   Xen ARM
 Xen ARM switches VM’s virtual address space              MMU
                                                                                  Physical        Virtual
   using MMU                                             Xen ARM               Address Space Address Space
   VM is not allowed to manipulate MMU directly
                                                                    VM0 (Linux)       VM1 (Linux )

 I/O virtualization                                              Application
                                                                  Application
                                                                  Application              Application
                                                                                           Application
                                                                                           Application
 Split driver model of Xen ARM                                  Native Back-end             Front-end
   Client & Server architecture for shared I/O devices          driver driver                 driver
     Client: frontend driver
                                                                    Interrupt        I/O event
     Server: native/backend driver                                             Xen ARM
                                                                 Device
Toward ARM Cortex-A15
New capabilities in ARM Cortex-A15

• Full compatibility with the Cortex-A9
  – Supporting the ARMv7 Architecture

• Virtualization Extension (VE)
  – Run multiple OS binary instances simultaneously
  – Isolates multiple work environments and data

• Supporting Large Physical Addressing
  Extensions (LPAE)
  – Ability to use up to 1TB of physical memory

• With AMBA 4 System Coherency
  – Other cached devices can be coherent with
    processor
  – Many core multiprocessor scalability
Large Physical Addressing
• Cortex-A15 introduces 40-bit physical addressing
  – Virtual memory (applications and OS) still has 32-bit
    address space
• Offering up to 1 TB of physical address space
  – Traditional 32-bit ARM devices limited to 4GB

• What does this mean for ARM based systems?
  – Reduced address-map congestion
  – More applications at the same time
  – Multiple resident virtualized operating systems
  – Common global physical address in many-core
Virtualization Extensions: The Basics
• New Non-secure level of privilege to hold Hypervisor
   – Hyp mode

• New mechanisms avoid the need Hypervisor intervention for:
   – Guest OS Interrupt masking bits
   – Guest OS page table management
   – Guest OS Device Drivers due to Hypervisor memory relocation
   – Guest OS communication with the interrupt controller (GIC)

• New traps into Hyp mode for:
   – ID register accesses and idling (WFI/WFE)
   – Miscellaneous “difficult” System Control Register cases

• New mechanisms to improve:
   – Guest OS Load/Store emulation by the Hypervisor
   – Emulation of trapped instructions through syndromes
Virtualization: Third Privilege
       •   Guest OS same kernel/user privilege structure
       •   HYP mode higher privilege than OS kernel level
       •   VMM controls wide range of OS accesses
       •   Hardware maintains TZ security (4th privilege)

                   Non-secure State           User Mode                   Secure State
                                              (Non-privileged)        1
App1        App2         App1         App2                                  Secure
                                                                             Apps




                                                                                                      Exception Returns
                                             Supervisor Mode                Secure
   Guest OS #1               Guest OS #2     (Privileged)             2




                                                                                         Exceptions
                                                                             OS



                                             Hyp Mode                 3
   Virtual Machine Monitor / Hypervisor      (More Privileged)


TrustZone Secure Monitor                        (Highest Privilege)
Memory – the Classic Resource
• Before virtualization: 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




                                     Translations




                                                    Physical Address Map
                                    from
           each application




                                    translation
                                    table (owned
                                    by the OS)
Virtual Memory in Two Stages
   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




                                                                 Physical Address (PA) Map
Virtual address (VA) map of    “Intermediate Physical” address
each App on each Guest OS      map of each Guest OS (IPA)
Classic Issue: Interrupts
   • An Interrupt might need to be routed to one of
      – Current or different Guest OS
       – Hypervisor
       – OS/RTOS running in the secure TrustZone environment
   • Basic model of the ARM virtualization extensions
      – Physical interrupts are taken initially in the Hypervisor
      – If the Interrupt should go to a Guest OS, Hypervisor maps a
        “virtual” interrupt for that Guest OS
                                                   App1
                                                  App1     App2
                                                          App2            App1
                                                                         App1     App2
                                                                                 App2
                                       Virtual
    App1
   App1          App2
                App2                  Interrupt
                                                  Guest OS 11
                                                   Guest OS          Guest OS 22
                                                                      Guest OS

   Operating System
  Operating System                                      VMM
                                                       VMM
                         Physical         Physical
                        Interrupt        Interrupt
System without virtualization               System with virtualization
Virtual interrupt example
     • 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
                           Virtual
                                       Virtual IRQ
External
                            CPU                       Guest OS
Interrupt
 source                   Interface
            Distributor
                           Physical                     CPU
                             CPU                      Hypervisor
                                       Physical IRQ
                           Interface
Spanning Hypervisor Framework
    ARM Non-Secure Execution Environment                        ARM Secure Execution Environment
                                                                                               Platform Resources

                                                                                 SoC                    NoC
  User                A         A       A            A        Secured             SoC
                                                                             Management                  sMMU
  Exception Level     P         P       P            P        Services        Management
                                                                               Domains
  (Application        P         P       P            P        Domain         Domain (ST/TEI)            Coherence
 Layer)              API                               API                       Resource API



 Kernel/Supervisor                                                  RTOS/uKernel
                       Open OS         Open OS
 Exception Level                                                  Para-virtualization
                       & Drivers        (Linux)
                                                              with platform service API’s           Secured
                        Driver
                     (OpenMP RT)            Resource Driver                   Virtualized TZ Call   hardware timer
                                       Virtualized TZ Call                                          (tick)
  HYP(ervisor)
  Exception Level
                       Open Platform Hypervisor
                         Full Virtualization (KVM)
Accelerators            Virtualized
                      Heterogeneous
(DSP / GPU)

  TZ Monitor
  Exception Level                           TrustZone Monitor



Source: Hardware accelerated Virtualization in the
ARM Cortex™ Processors, John Goodacre, ARM Ltd. (2011)
Reference

• 前瞻資訊科技 – 虛擬化 , 薛智文 , 台大資訊所 (2011)
• ARM Virtualization: CPU & MMU Issues, Prashanth Bungale,
  vmware
• Hardware accelerated Virtualization in the
  ARM Cortex™ Processors, John Goodacre, ARM
  Ltd. (2011)
• Hypervisors and the Power Architecture
  http://www.techdesignforums.com/embedded/embedded-topics/embedded-development-
  platforms/hypervisors-and-the-power-architecture/
• Philippe Gerum, State of Real-Time Linux: Don't Stop Until
  History Follows, ELC Europe 2009
http://0xlab.org

Mais conteúdo relacionado

Mais procurados

Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Stefano Stabellini
 
脆弱性スキャナVuls(応用編)
脆弱性スキャナVuls(応用編)脆弱性スキャナVuls(応用編)
脆弱性スキャナVuls(応用編)Takayuki Ushida
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)Kuniyasu Suzaki
 
ARM CPUにおけるSIMDを用いた高速計算入門
ARM CPUにおけるSIMDを用いた高速計算入門ARM CPUにおけるSIMDを用いた高速計算入門
ARM CPUにおけるSIMDを用いた高速計算入門Fixstars Corporation
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...OpenStack Korea Community
 
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線Motonori Shindo
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformSZ Lin
 
[Container Runtime Meetup] runc & User Namespaces
[Container Runtime Meetup] runc & User Namespaces[Container Runtime Meetup] runc & User Namespaces
[Container Runtime Meetup] runc & User NamespacesAkihiro Suda
 
C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールC/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールMITSUNARI Shigeo
 

Mais procurados (20)

Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
脆弱性スキャナVuls(応用編)
脆弱性スキャナVuls(応用編)脆弱性スキャナVuls(応用編)
脆弱性スキャナVuls(応用編)
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
ゼロからはじめるKVM超入門
ゼロからはじめるKVM超入門ゼロからはじめるKVM超入門
ゼロからはじめるKVM超入門
 
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
 
Embedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile DevicesEmbedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile Devices
 
ARM CPUにおけるSIMDを用いた高速計算入門
ARM CPUにおけるSIMDを用いた高速計算入門ARM CPUにおけるSIMDを用いた高速計算入門
ARM CPUにおけるSIMDを用いた高速計算入門
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
 
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Namespaces in Linux
Namespaces in LinuxNamespaces in Linux
Namespaces in Linux
 
[Container Runtime Meetup] runc & User Namespaces
[Container Runtime Meetup] runc & User Namespaces[Container Runtime Meetup] runc & User Namespaces
[Container Runtime Meetup] runc & User Namespaces
 
C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールC/C++プログラマのための開発ツール
C/C++プログラマのための開発ツール
 

Semelhante a Embedded Hypervisor for ARM

Keynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationKeynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationThe Linux Foundation
 
Mobile Showcase Moblin2
Mobile Showcase Moblin2Mobile Showcase Moblin2
Mobile Showcase Moblin2Tomas Bennich
 
Mikehall FutureWorld 2010 - enabling connectivity
Mikehall FutureWorld 2010 - enabling connectivityMikehall FutureWorld 2010 - enabling connectivity
Mikehall FutureWorld 2010 - enabling connectivityMicrosoft Windows Embedded
 
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migrationDidier Durand
 
Distributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson LabsDistributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson LabsEricsson Labs
 
KAIST 전산학과 iDBLab 소개 20130319-발표용
KAIST 전산학과 iDBLab 소개 20130319-발표용KAIST 전산학과 iDBLab 소개 20130319-발표용
KAIST 전산학과 iDBLab 소개 20130319-발표용Taehun Kim, Ph.D
 
Telecom trends 261112
Telecom trends 261112Telecom trends 261112
Telecom trends 261112Sharon Rozov
 
OMG Data-Distribution Service (DDS) Tutorial - 2009
OMG Data-Distribution Service (DDS) Tutorial - 2009OMG Data-Distribution Service (DDS) Tutorial - 2009
OMG Data-Distribution Service (DDS) Tutorial - 2009Gerardo Pardo-Castellote
 
Presentación Novedades vSphere 5.1
Presentación Novedades vSphere 5.1Presentación Novedades vSphere 5.1
Presentación Novedades vSphere 5.1Omega Peripherals
 
Integration Platform For JMPS Using DDS
Integration Platform For JMPS Using DDSIntegration Platform For JMPS Using DDS
Integration Platform For JMPS Using DDSSupreet Oberoi
 
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...Ubiquisys Small Cells
 
The Ever Changing Cloud, CloudExpo 2012
The Ever Changing Cloud, CloudExpo 2012The Ever Changing Cloud, CloudExpo 2012
The Ever Changing Cloud, CloudExpo 2012Lew Tucker
 
Cassandra framework a service oriented distributed multimedia
Cassandra framework  a service oriented distributed multimediaCassandra framework  a service oriented distributed multimedia
Cassandra framework a service oriented distributed multimediaJoão Gabriel Lima
 
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdf
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdfIntel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdf
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdfOpenStack Foundation
 
SystemCenter webinar 12 6 12
SystemCenter webinar 12 6 12SystemCenter webinar 12 6 12
SystemCenter webinar 12 6 12Sentri
 
Cloud white paper v3.0
Cloud white paper v3.0Cloud white paper v3.0
Cloud white paper v3.0CK Toh
 

Semelhante a Embedded Hypervisor for ARM (20)

Android Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and OrganizationAndroid Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and Organization
 
Embedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile DevicesEmbedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile Devices
 
Keynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM VirtualizationKeynote Speech: Xen ARM Virtualization
Keynote Speech: Xen ARM Virtualization
 
Mobile Showcase Moblin2
Mobile Showcase Moblin2Mobile Showcase Moblin2
Mobile Showcase Moblin2
 
Mikehall FutureWorld 2010 - enabling connectivity
Mikehall FutureWorld 2010 - enabling connectivityMikehall FutureWorld 2010 - enabling connectivity
Mikehall FutureWorld 2010 - enabling connectivity
 
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
 
Distributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson LabsDistributed Shared Memory on Ericsson Labs
Distributed Shared Memory on Ericsson Labs
 
Ethos Dms Consultancy
Ethos Dms ConsultancyEthos Dms Consultancy
Ethos Dms Consultancy
 
KAIST 전산학과 iDBLab 소개 20130319-발표용
KAIST 전산학과 iDBLab 소개 20130319-발표용KAIST 전산학과 iDBLab 소개 20130319-발표용
KAIST 전산학과 iDBLab 소개 20130319-발표용
 
Telecom trends 261112
Telecom trends 261112Telecom trends 261112
Telecom trends 261112
 
OMG Data-Distribution Service (DDS) Tutorial - 2009
OMG Data-Distribution Service (DDS) Tutorial - 2009OMG Data-Distribution Service (DDS) Tutorial - 2009
OMG Data-Distribution Service (DDS) Tutorial - 2009
 
Presentación Novedades vSphere 5.1
Presentación Novedades vSphere 5.1Presentación Novedades vSphere 5.1
Presentación Novedades vSphere 5.1
 
Integration Platform For JMPS Using DDS
Integration Platform For JMPS Using DDSIntegration Platform For JMPS Using DDS
Integration Platform For JMPS Using DDS
 
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...
Will Franks, Ubiquisys CTO and Co-founder, "Smart tech that needs to step up ...
 
Data centers presentation
Data centers presentationData centers presentation
Data centers presentation
 
The Ever Changing Cloud, CloudExpo 2012
The Ever Changing Cloud, CloudExpo 2012The Ever Changing Cloud, CloudExpo 2012
The Ever Changing Cloud, CloudExpo 2012
 
Cassandra framework a service oriented distributed multimedia
Cassandra framework  a service oriented distributed multimediaCassandra framework  a service oriented distributed multimedia
Cassandra framework a service oriented distributed multimedia
 
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdf
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdfIntel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdf
Intel IT OpenStack Journey - OpenStack Fall 2012 Summit.pdf
 
SystemCenter webinar 12 6 12
SystemCenter webinar 12 6 12SystemCenter webinar 12 6 12
SystemCenter webinar 12 6 12
 
Cloud white paper v3.0
Cloud white paper v3.0Cloud white paper v3.0
Cloud white paper v3.0
 

Mais de National Cheng Kung University

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimeNational Cheng Kung University
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明National Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明National Cheng Kung University
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明National Cheng Kung University
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsNational Cheng Kung University
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationNational Cheng Kung University
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學National Cheng Kung University
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 

Mais de National Cheng Kung University (20)

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Embedded Hypervisor for ARM

  • 1. Embedded Hypervisor for ARM Jim Huang ( 黃敬群 ) Developer, 0xlab jserv@0xlab.org Dec 6, 2011
  • 2. Rights to copy © Copyright 2011 0xlab http://0xlab.org/ contact@0xlab.org Attribution – ShareAlike 3.0 You are free Corrections, suggestions, contributions and translations are welcome! to copy, distribute, display, and perform the work to make derivative works Latest update:Feb 6, 2012 to make commercial use of the work Under the following conditions Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
  • 3. Agenda (1) Virtualization from The Past (2) Hypervisor Design (3) Embedded Hypervisors for ARM (4) Toward ARM Cortex-A15
  • 5. Definition "virtualization is "a technique for hiding the physical characteristics of computing resources from the way in which other systems, applications, or end users interact with those resources. " – Wikipedia
  • 6. Future Computing Trends Changes in Computing Open Closed  Keyboard/Mouse  Multitouch  Augmented Reality  Gesture Interactive 3D UI Distributed  Voice Call, SMS  Video Call, MMS  Eye-Tracking Manytouch  Realtime Web Centralized Correct+Timely Correct Info.  Centeralized/Concentrated  Distributed/Scattered Info.  Known Comm. Entities  Unknown/Utrusted Comm. Entities Stationary Mobile Collaboration Sensor Keyboard/ Network Mouse Every Node as Both of Multitouch Client/Server Local Personal Cloud Store Computer Embedded Single-core Multi-core Many-core IT Single-core Multi-core Many-core  UC Berkeley [2009] [2012] [2017] Sensornet Chip  Tiger 1GHz Single-Core  ARM 2GHz 4-core  ARM 3GHz 8-core (TI MSP430 8MHz core,  Dunnington 3GHz 6-core  Intel 4GHz 32-core  Intel 6GHz 128-core 10KB RAM)  SensorNet Chip (128MHz core, 160KB RAM) Privacy Realtime Source: Xen ARM Virtualization, Xen Summit Asia 2011 by Dr. Sang-bum Suh, Samsung
  • 7. Server Virtualization::Benefits • Workload consolidation – Increase server utilization – Reduce capital, hardware, power, space, heat costs • Legacy OS support – Especially with large 3rd-party software products • Instant provisioning – Easily create new virtual machines – Easily reallocate resources (memory, processor, IO) between running virtual machines • Migration – Predicted hardware downtime – Workload balancing
  • 8. Embedded Virtualization::Benefits • Workload consolidation • Flexible resource provisioning • License barrier • Legacy software support – Especially important with dozens or hundreds of embedded operating systems, commercial and even home-brew • Reliability • Security
  • 9. • (1) Hardware Consolidation – Application Processor and Baseband Processor can Why? share multicore ARM CPU SoC to run both Linux and - RTOS efficiently. • (2) OS Isolation – important call services can be effectively separated from downloaded third party applications by virtualized ARM combined with access control. 1 2 3 를 Nu Secure Kernel Android General Purpose OS RTOS Virtualization SW ( Realtime Hypervisor) Linux V - Core V - Core V - Core V - Core V - Core V - Core V - Core V - Core Core Core Core Core Linux 1 Linux 2 Memory Important Hypervisor Hypervisor Multi-core Peripherals services H/W Hardware Secure Smartphone AP SoC + BP SoC → Consolidated Multicore SoC Rich Applications from Multiple OS • (3) Rich User Experience – multiple OS domains can run concurrently on a single smartphone. Source: Xen ARM Virtualization, Xen Summit Asia 2011 by Dr. Sang-bum Suh, Samsung
  • 10. Use Case: Nirvana: The Convergence of Mobile and Desktop Virtualization in One Device by OKLabs + Citrix Branch Access Receiver Repeater Gateway XenDesktop XenApp XenServer NetScaler Data  Cloud Center  SSL 001000111010101 SSL 001000111010101 SSL 001000111010101 SSL 001000111010101 SSL 001000111010101 Services
  • 11. Nirvana phone = Smartphone + Full-sized display Nirvana Phone + Keyboard & mouse + Virtual desktop + OKL4 mobile virtualization Mobile Device Device’s Native Screen Native OKL4 Device Display Applications External Monitor Drivers Receiver Start Native OS OKL4 BT Device Mouse & Drivers Keyboard Driver Citrix Native Receiver Device OS De-privileged Privileged OKL4 Microvisor Demo video: http://www.youtube.com/user/OpenKernelLabs
  • 12. Use Case: Low-cost 3G Handset • Mobile Handsets – Major applications runs on Linux – 3G Modem software stack runs on RTOS domain • Virtualization in multimedia Devices – Reduces BOM (bill of materials) – Enables the Reusability of legacy code/applications Hypervisor – Reduces the system development time • Instrumentation, Automation – Run RTOS for Measurement and analysis – Run a GPOS for Graphical Interface
  • 13. Virtualization Tradeoff • Performance tradeoff – Applications that used to own the whole processor must now share – Hypervisor adds some runtime overhead as well – Full virtualization without hardware support means software emulation • Increase in management complexity – Old scenario: two software stacks + two hardware systems – New scenario: two software stacks + one hardware system + one host kernel • More abstraction, more software layers, more complexity... – More bugs • Increases size of TCB (Trusted Computing Base) • Increases impact of unpredicted hardware failure
  • 15. "All problems in computer science can be solved by another level of indirection." -- David Wheeler --
  • 16. Virtual Machine • Add Virtualizing Software to a Host platform and support Guest process or system on a Virtual Machine (VM)
  • 17. Virtual Machine for Portability (in the past) PowerPC x86 x86-32 HP –PA programs programs programs programs Rosetta FX!32 IA-32EL Aries (Apple) (DEC) (Intel) (HP) x86-32 DEC IA-64 IA-64 or x86-64 Alpha (Itanium) (Itanium)
  • 18. Virtual Machine for Portability NOTE: we don't discuss such topic in this presentation x86 programs C LLVM IR Bytecode DEC IA-64 PowerPC SUN Alpha (Itanium) Sparc ARM
  • 19. System Virtual Machine • Provide a system environment • Constructed at ISA level • Allow multiple OS environments, or support time sharing. • virtualizing software that implements system VM is called as VMM (virtual machine monitor) • Examples: – IBM VM/360, VMware, VLX, WindRiver Hypervisor, ENEA Hypervisor – Xtratum, Lguest, BhyVe (BSD Hypervisor) – Xen, KVM, OKL4, Xvisor, Virtual network communication Codezero NOTE: We only focus on system virtual machine here. Therefore, this presentation ignores Linux vserver, FreeBSD jail, etc.
  • 20. Virtualization is Common Technique • Example: In the past, Linux is far from being real- time, but RTLinux/RTAI/Xenomai/Xtratum attempted to "improve" Linux by introducing new virtualization layer. • real-time capable virtualization • Dual kernel approach Bare metal (RT) Hypervisor Hardware RTOS Linux
  • 21. Example: Xenomai (Linux Realtime Extension) Linux application VxWorks application POSIX application glibc glibc Xenomai glibc Xenomai libvxworks libpthread_rt System calls VFS Network Xenomai RTOS Pieces added (nucleus) by Xenomai Memory ... Linux kernel space Xenomai Adeos I-Pipe skins • From Adeos point of view, guest OSes are prioritized domains. • For each event (interrupts, exceptions, syscalls, etc...), the various domains may handle the event or pass it down the pipeline. Source: Real-time in embedded Linux systems, Free Electrons (2011)
  • 22. Windows Apps Linux Apps • Type I MS- Linux • Bare metal system VM Windows VMM or Hypervisor IA-32 Physical Machine General Classification of Virtualization technologies Windows Apps Linux Apps • Type 2 MS- Windows • Hosted System VM VM Linux IA-32 Physical Machine
  • 23. Source: Operating Systems Design – Lecture 21 Virtualization, Roy Campbell (Fall 2010)
  • 24. Myth of Type I and Type II Hypervisor source: http://gala4th.blogspot.com/2011/10/myth-of-type-i-and-type-ii-hypervisors.html • Myth: Type-2 is "lesser" than a true "type-1" hypervisor. • Virtualization theory really started with a paper from Gerald Popek and Robert Goldberg called Formal Requirements for Virtualizable Third Generation Architectures. (1974) – Sensitive Instructions might change the state of system resources – Privileged Instructions must be executed with sufficient privilege • The terms "type-1" and "type-2" originate from a paper by John Robin called Analyzing the Intel Pentium's Capability to Support a Secure Virtual Machine Monitor. (USENIX 2000) ● Popek/Goldberg proof does not eliminate the possibility of using dynamic translation
  • 25. System Virtualization Implementations Full Para Hardware Assisted Virtualization Virtualization Virtualization
  • 26. Full Virtualization ● Everything is virtualized ● Full hardware emulation ● Emulation = latency
  • 27. Definitions • Sensitive Instructions as defined by "Formal Requirements for Virtualizable Third Generation Architectures” (1974): – Mode Referencing Instructions – Sensitive Register/Memory Access Instructions – Storage Protection System Referencing Instructions – All I/O Instructions • Theorem about strict virtualizability by "Analyzing the Intel Pentium's Capability to Support a Secure Virtual Machine Monitor" (2000): – 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.
  • 28. Privileged Instructions ● Privileged instructions: OS kernel and device driver access to system hardware ● Trapped and emulated by VMM – Let VM execute most of its instructions directly on hardware – 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 ● Correct functioning of the VMM
  • 29. 0x1C FIQ 0x18 IRQ 0x14 (Reserved) 0x10 Data Abort Current Visible Registers 0x0C Prefetch Abort r0 0x08 Software Interrupt Undef Mode Abort Mode SVC Mode IRQ Mode FIQ Mode User Mode r1 0x04 Undefined Instruction r2 r3 0x00 Reset Banked out Registers r4 Vector Table r5 r6 User FIQ IRQ SVC Undef Abort r7 r8 r8 r8 r9 r9 r9 Banked out Registers r10 r10 r10 r11 r11 r11 r12 r12 r12 r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r13 (sp) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r14 (lr) r15 (pc) cpsr spsr spsr spsr spsr spsr spsr
  • 30. r0 r8 r1 r9 31 0 r2 r10 r3 r11 CPSR r4 r12 r5 r13 NZCV r6 r14 r7 r15 (PC) Link register unbanked registers banked registers Every arithmetic, logical, or shifting operation may set CPSR (current program statues register) bits: ● N (negative), Z (zero), C (carry), V (overflow). Examples: ● -1 + 1 = 0: NZCV = 0110. ● 231-1+1 = -231: NZCV = 0101.
  • 31. ARM Architecture (armv4) • 6 basic operating modes (1 user, 5 privileged) • 37 registers, all 32 bits wide – 1 program counter – 5 dedicated saved program status registers – 1 Current program status register (PSR) – 30 general purpose registers • Special usage – r13 (stack pointer) – r14 (link register) – r15 (program counter, PC) 31
  • 32. Typical ARM instructions (armv4) • branch and branch with Link (B, BL) • data processing instructions (AND, TST, MOV, …) • shifts: logical (LSR), arithmetic (ASR), rotate (ROR) • test (TEQ, TST, CMP, CMN) • processor status register transfer (MSR, MRS) • memory load/store words (LDR, STR) • push/pop Stack Operations (STM, LDM) • software Interrupt (SWI; operating mode switch) • co-processor (CDP, LDC, STC, MRC, MCR) 32
  • 33. Problematic Instructions (1) • Type 1 Instructions which executed in user mode will cause undefined instruction exception • Example MCR p15, 0, r0, c2, c0, 0 Move r0 to c2 and c0 in coprocessor specified by p15 (co-processor) for operation according to option 0 and 0 – MRC: from coproc to register – MCR: from register to coproc • Problem: – Operand-dependent operation Source: 前瞻資訊科技 – 虛擬化 , 薛智文 , 台大資訊所 (2011)
  • 34. Problematic Instructions (2) • Type 2 Instructions which executed in user mode will have no effect • Example MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt 31 Program Status Register (PSR) 0 N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0] Execution Exception Execution Flags Mask Mode
  • 35. Problematic Instructions (3) • Type 3 Instructions which executed in user mode will cause unpredictable behaviors. • Example MOVS PC, LR The return instruction changes the program counter and switches to user mode. • This instruction causes unpredictable behavior when executed in user mode.
  • 36. ARM Sensitive Instructions • 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 (conditional execution) / DPSPC • Indirect CPSR Access Instructions LDRT / STRT – Load/Store Unprivileged (“As User”) • Banked Register Access Instructions LDM/STM (User mode registers)
  • 37. Solutions to Problematic Instructions [ Hardware Techniques ] • Privileged Instruction Semantics dictated/translated by instruction set architecture • MMU-enforced traps – Example: page fault • Tracing/debug support – Example: bkpt (breakpoint) • Hardware-assisted Virtualization – Example: extra privileged mode, HYP, in ARM Cortex-A15
  • 38. Solutions to Problematic Instructions [ Software Techniques ] Binary Complexity Hypercall translation Design High Low Implementation Medium High Runtime High Medium Mapped to programming Virtual function Normal function languages Method: trap and emulate
  • 39. Dynamic Binary Translation Translation Basic Block BL TLB_FLUSH_DENTRY_NEW … TLB_FLUSH_DENTRY: BL TLB_FLUSH_DENTRY MCR p15, 0, R0, C8, C6, 1 … MOV PC, LR TLB_FLUSH_DENTRY: … MCR p15, 0, R0, C8, C6, 1 TLB_FLUSH_DENTRY_NEW: MOV PC, LR MOV R1, R0 … MOV R0, #CMD_FLUSH_DENTRY SWI #HYPER_CALL_TLB • ARM has a fixed instruction size – 32-bit in ARM mode and 16-bit in Thumb mode • Perform binary translation – Follow control-flow – Translate basic block (if not already translated) at the current PC – Ensure interposition at end of translated sequence – All writes (but not reads) to PC now become problematic instructions – Replace problematic instructions 1-1 with hypercalls to trap and emulate
  • 40. Virtualization APIs – hypercalls /* In Hypervisor */ /* In Guest OS */ SWI Handler BL TLB_FLUSH_DENTRY … TLB_FLUSH_DENTRY: Hypercall Handler MOV R1, R0 …… MOV R0, #CMD_FLUSH_DENTRY SWI #HYPER_CALL_TLB … LDR R1, [SP, #4] MCR p15, 0, R1, C8, C6, 1 Restore User Context & PC • Use trap instruction to issue hypercall • Encode hypercall type and original instruction bits in hypercall hint • Upon trapping into the VMM, decode the hypercall type and the original instruction bits, and emulate instruction semantics mrs Rd, R <cpsr/spsr> mrs r8, cpsr swi 0x088000
  • 41. Hypercall Guest OS Hypercalls Software Interrupt No Yes reschedule ? context switch Hypervisor Hyper Call Handler SWI Handler
  • 42. Hypercall in xen-i386 System Call int 0x80 01 // linux/include/asm/unistd.h 02 03 #define __NR_restart_syscall 0 Guest OS Hypervisor 04 #define __NR_exit 1 05 #define __NR_fork 2 06 #define __NR_read 3 07 … HYPERVOSIR_sched_op int 82h hypercall Hypercall_table do_sched_op iret Hyper Call int 0x82 01 // xen/include/public/xen.h resume Guest OS 02 03 #define __HYPERVISOR_set_trap_table 0 04 #define __HYPERVISOR_mmu_update 1 05 #define __HYPERVISOR_set_gdt 2 06 #define __HYPERVISOR_stack_switch 3 07 …
  • 43. Case study: Xvisor-ARM https://github.com/xvisor • File: arch/arm/cpu/arm32/elf2cpatch.py – Script to generate cpatch script from guest OS ELF • Functionality before generating the final ELF image – Each sensitive non-priviledged ARM instruction is converted to a hypercall. – Hypercall in ARM instruction set is SVC <imm24> instruction. – Encode sensitive non-priviledged instructions in <imm24> operand of SVC instruction. (software interrupt) – Each encoded instruction will have its own unique inst_id. – The inst_field for each encoded sensitive non-priviledged instruction will be diffrent.
  • 44. How does Xvisor handle problematic instructions like MSR? • Type 2 Instructions which executed in user mode will have no effect • Example MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt 31 Program Status Register (PSR) 0 N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0] Execution Exception Execution Flags Mask Mode
  • 45. First, cpatch (ELF patching tool) looks up the instructions... MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt # MSR (immediate) # Syntax: # msr<c> <spec_reg>, #<const> # Fields: # cond = bits[31:28] # R = bits[22:22] # mask = bits[19:16] # imm12 = bits[11:0] # Hypercall Fields: # inst_cond[31:28] = cond # inst_op[27:24] = 0xf # inst_id[23:20] = 0 # inst_subid[19:17] = 2 # inst_fields[16:13] = mask # inst_fields[12:1] = imm12 # inst_fields[0:0] = R
  • 46. # MSR (immediate) # Syntax: # msr<c> <spec_reg>, #<const> # Fields: # cond = bits[31:28] # R = bits[22:22] # mask = bits[19:16] # imm12 = bits[11:0] # Hypercall Fields: # inst_cond[31:28] = cond # inst_op[27:24] = 0xf # inst_id[23:20] = 0 def convert_msr_i_inst(hxstr): # inst_subid[19:17] = 2 # inst_fields[16:13] = mask hx = int(hxstr, 16) # inst_fields[12:1] = imm12 inst_id = 0 # inst_fields[0:0] = R inst_subid = 2 cond = (hx >> 28) & 0xF Xvisor utilizes cpatch to convert R = (hx >> 22) & 0x1 mask = (hx >> 16) & 0xF all problematic instructions for OS imm12 = (hx >> 0) & 0xFFF image files (ELF format). rethx = 0x0F000000 rethx = rethx | (cond << 28) rethx = rethx | (inst_id << 20) rethx = rethx | (inst_subid << 17) rethx = rethx | (mask << 13) rethx = rethx | (imm12 << 1) rethx = rethx | (R << 0) return rethx
  • 47. Requirements of real Hypervisor • VMM at higher privilege level than VMs – CPU Virtualization – Memory Virtualization – Device & I/O Virtualization • User and System modes • Privileged instructions only available in system mode – Trap to system if executed in user mode • All physical resources only accessible using privileged instructions – Including page tables, interrupt controls, I/O registers
  • 48. Memory Virtualization • Deal with allocation of Physical memory among Guest OS • RAM space shares among Guest OS • Processors with Memory Virtualization support is expecting in 2nd generation processors (Intel VT and ARM Cortex-A15)
  • 49. Device and I/O Virtualization • Deal with routing of I/O requests between virtual devices and the shared physical hardware • Similar to the single I/O device shared concurrently among different applications. • Hypervisor virtualizes the physical hardware and present each virtual machine with a standard set of virtual devices
  • 50. Paravirtualization • OS or system devices are virtualization aware • Requirements: – OS level – translated/modified kernel – Device level – paravirtualized or “enlightened” device drivers
  • 51. Hardware-assisted Virtualization ● Hardware is virtualization aware ● Hypervisor and VMM load at Ring -1 ● Remove CPU emulation bottleneck ● Provides address bus isolation
  • 52. Hardware-assisted Virtualization ● VMM coordinates direct hardware access ● Memory virtualization solved in 2nd generation hardware assisted platforms ● Passthrough I/O has limited use cases without IOV (I/O Virtualization) http://www.pcisig.com/specifications/iov/
  • 53. Hardware-assisted Virtualization in x86 • VT technology enables new execution mode (VMX-Root Mode in x86 by Intel) in the processors to support virtualization • Hypervisor runs in a root mode below Ring0 • OS requests trap VMM without binary translation or PV • Specialized Hardware support is required • A special CPU privileged mode is to be selected to support
  • 54. Hardware-assisted Virtualization in ARM • Enable new execution mode Hypervisor (HYP) • Hypervisor runs in a Hypervisor (HYP) mode • Guest OS Runs in Supervisory Control (SVC) mode • Applications runs in User (USR) mode Details will be discussed in section "Toward ARM Cortex-A15"
  • 55. What does Hypervisor looks like • Thin layer of software running on the hardware • Supports creation of partitions • Each partition is a virtual machine • Each partition has one or more virtual processors • Partitions can own or share hardware resources • Software running in partition is called a guest • Enforces memory access rules • Enforces policy for CPU usage • Virtual processors are scheduled on real processors • Enforces ownership of other devices • Provides simple inter-partition messaging Parent Partition • Messages appear as interrupts • Exposes simple programmatic interface called (Minimum Footprint “hypercalls” Operating System) Hypervisor Ethernet Hard Disk CPU RAM NIC
  • 56. Monolithic vs. Microkernel Monolithic hypervisor Microkernel based ● Simpler than a modern hypervisor kernel, but still complex ● Simple partitioning ● Contains its own drivers functionality model ● Increase reliability and minimize TCB ● No third-party code ● Drivers run within guests VM 1 VM 1 VM 2 VM 3 (“Parent”) (“Admin”) Virtual- VM 2 VM 3 ization (“Child”) (“Child”) Stack Drivers Drivers Drivers Drivers Drivers Drivers Hypervisor Drivers Drivers Drivers Drivers Drivers Drivers Hypervisor Hardware Hardware
  • 57. Virtualization Stack • Collection of user-mode and kernel-mode components WMI • Runs within a partition on top of a (minimal) OS Provider • Contains all VM support not in the hypervisor VM Worker VM Worker • Interacts with hypervisor VM Service VM Worker Process Process • Calls the hypervisor to perform certain actions Process • Responds to messages from the hypervisor or from other partitions • Creates and manages a group of “child partitions” • Manages memory for child partitions • Virtualizes devices for child partitions Virtualization • Exposes a management interface Infrastructure VMBus Driver Bus Driver Parent Hypervisor API & Partition Message Library Child Partition 1 Child Partition 2 Hypervisor
  • 58. Device Virtualization • Standard VSP (Virtualization service providers) – Storage: support difference drive chains – Network: provide virtualized network mechanism – Video: 2D/3D graphics w/ or w/o HW acceleration – USB: allow a USB device to be assigned to a partition – Input: keyboard, mouse, touchscreen – Time: virtualization for RTC hardware
  • 59. Device Virtualization • Physical devices • Managed by traditional driver stacks • Virtualization service providers • Virtualize a specific class of device • Expose an abstract device interface Storage Storage VSP • Run within the partition that owns the VSP corresponding physical device • Virtualization service clients Storage Storage Storage Storage • Consume virtualized hardware service Stack Stack Stack Stack • VMBus • Software “bus” (enumeration, hot plug, etc.) Storage Storage • Enables VSPs and VSCs to communicate Port Port VSC VSC efficiently Driver Driver • Uses memory sharing and hypervisor IPC Parent VMBus VMBus VMBus VMBus messages Partition Hypervisor Hypervisor Disk Disk
  • 60. Embedded Virtualization Use Case • Workload consolidation • Legacy software • Multicore enablement • Improve reliability • Secure monitoring
  • 61. Use Case: Workload Consolidation  Consolidate legacy systems legacy legacy legacy legacy SW SW SW SW host kernel legacy HW new HW
  • 62. Use Case: Legacy Software  Run legacy software on new core/chip/board with full virtualization legacy new legacy SW SW SW host kernel legacy HW new HW  Consolidate legacy software visualization visualization app RT app app RT app proprietary Linux proprietary kernel core kernel Linux/KVM core core core
  • 63. Use Case: Multicore Enablement  Legacy uniprocessor applications legacy app app app app legacy app legacy kernel multicore kernel legacy kernel host kernel legacy app core core core core core  Flexible resource management data control data data plane plane plane control host kernel core core core core
  • 64. Use Case: Improved Reliability  Hot standby without additional hardware app backup app app HW HW HW backup app app host kernel HW
  • 65. Use Case: Secure Monitoring  Protect monitoring software network network app app monitor kernel kernel host kernel HW HW
  • 66. Embedded Virtualization Issues • Memory footprint • Security – Increases size of Trusted Computing Base • Direct IO Access • Emulate IO • Virtual IO • Real-time support
  • 67. Direct I/O Access • Guest can directly access physical IO without host involvement – Native speed • IOMMU provides isolation and physical address translation (DMA) – Translation could be done with guest modifications • Issues: – IOMMU required for DMA isolation – Limited by number of physical IO devices – Guests must have device drivers – What about legacy guests on new hardware? – Breaks migration – IRQ delivery and routing
  • 68. Emulated I/O • Host software emulates guest IO accesses • Issues: – Must write software to (perfectly?) emulate hardware – Dramatic increase in IO latency – Host OS must have physical device drivers • Device driver availability, licensing concerns
  • 69. Virtual I/O • No hardware at all, just inter-guest data transfer • New guest device drivers co-operate with host • Issues: – Requires guest modification (at least new device drivers) – Host OS still needs physical IO drivers
  • 71. Embedded Hypervisors for ARM (open source part) • Xen – Xen-arm contributed by Samsung ARM9, ARM11, ARM Cortex-A9 MP – Xen-arm-cortext-a15 – contributed by Citrix - https://lkml.org/lkml/2011/11/29/265 ARM Cortex-A15 • OKL4 (from open to close source), OKLabs • KVM ARM porting – Columbia University – NTHU, Taiwan • Xvisor • Codezero
  • 72. Xen-ARM (Samsung) Goals Lightweight virtualization for secure 3G/4G mobile devices  High performance hypervisor based on ARM processor  Fine-grained access control fitted to mobile devices Architecture of Xen ARM VM 0 VM n Application Lightweight Xen- Application Application Tools Application Guest Backend Drivers Frontend Drivers Domain Native Drivers VM Interface VM Interface Secure Xen ARM Domain Resource Access Hypervisor Manager Allocator Control Hardware Peripheral CPU System UART Devices Memory
  • 73. Overview Xen-ARM (Samsung) Logical mode  CPU virtualization split  Virtualization requires 3 privilege CPU levels, but ARM supports 2 levels Xen ARM mode  Xen ARM mode: supervisor mode ( most privileged level) virtual kernel mode  Virtual kernel mode: User mode ( least privileged level) virtual user mode  Virtual user mode: User mode ( least privileged level) VM 2 Xen ARM  Memory virtualization VM 0 VM 1 VM 2 Address Address Address VM 1  VM’s local memory should be Spaces Spaces Spaces Kernel VM 0  protected from other VMs User Process Process User Process User Process User Xen ARM  Xen ARM switches VM’s virtual address space MMU Physical Virtual  using MMU Xen ARM Address Space Address Space  VM is not allowed to manipulate MMU directly VM0 (Linux) VM1 (Linux )  I/O virtualization Application Application Application Application Application Application  Split driver model of Xen ARM Native Back-end Front-end  Client & Server architecture for shared I/O devices driver driver driver  Client: frontend driver Interrupt I/O event  Server: native/backend driver Xen ARM Device
  • 75. New capabilities in ARM Cortex-A15 • Full compatibility with the Cortex-A9 – Supporting the ARMv7 Architecture • Virtualization Extension (VE) – Run multiple OS binary instances simultaneously – Isolates multiple work environments and data • Supporting Large Physical Addressing Extensions (LPAE) – Ability to use up to 1TB of physical memory • With AMBA 4 System Coherency – Other cached devices can be coherent with processor – Many core multiprocessor scalability
  • 76. Large Physical Addressing • Cortex-A15 introduces 40-bit physical addressing – Virtual memory (applications and OS) still has 32-bit address space • Offering up to 1 TB of physical address space – Traditional 32-bit ARM devices limited to 4GB • What does this mean for ARM based systems? – Reduced address-map congestion – More applications at the same time – Multiple resident virtualized operating systems – Common global physical address in many-core
  • 77. Virtualization Extensions: The Basics • New Non-secure level of privilege to hold Hypervisor – Hyp mode • New mechanisms avoid the need Hypervisor intervention for: – Guest OS Interrupt masking bits – Guest OS page table management – Guest OS Device Drivers due to Hypervisor memory relocation – Guest OS communication with the interrupt controller (GIC) • New traps into Hyp mode for: – ID register accesses and idling (WFI/WFE) – Miscellaneous “difficult” System Control Register cases • New mechanisms to improve: – Guest OS Load/Store emulation by the Hypervisor – Emulation of trapped instructions through syndromes
  • 78. Virtualization: Third Privilege • Guest OS same kernel/user privilege structure • HYP mode higher privilege than OS kernel level • VMM controls wide range of OS accesses • Hardware maintains TZ security (4th privilege) Non-secure State User Mode Secure State (Non-privileged) 1 App1 App2 App1 App2 Secure Apps Exception Returns Supervisor Mode Secure Guest OS #1 Guest OS #2 (Privileged) 2 Exceptions OS Hyp Mode 3 Virtual Machine Monitor / Hypervisor (More Privileged) TrustZone Secure Monitor (Highest Privilege)
  • 79. Memory – the Classic Resource • Before virtualization: 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 Translations Physical Address Map from each application translation table (owned by the OS)
  • 80. Virtual Memory in Two Stages 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 Physical Address (PA) Map Virtual address (VA) map of “Intermediate Physical” address each App on each Guest OS map of each Guest OS (IPA)
  • 81. Classic Issue: Interrupts • An Interrupt might need to be routed to one of – Current or different Guest OS – Hypervisor – OS/RTOS running in the secure TrustZone environment • Basic model of the ARM virtualization extensions – Physical interrupts are taken initially in the Hypervisor – If the Interrupt should go to a Guest OS, Hypervisor maps a “virtual” interrupt for that Guest OS App1 App1 App2 App2 App1 App1 App2 App2 Virtual App1 App1 App2 App2 Interrupt Guest OS 11 Guest OS Guest OS 22 Guest OS Operating System Operating System VMM VMM Physical Physical Interrupt Interrupt System without virtualization System with virtualization
  • 82. Virtual interrupt example • 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 Virtual Virtual IRQ External CPU Guest OS Interrupt source Interface Distributor Physical CPU CPU Hypervisor Physical IRQ Interface
  • 83. Spanning Hypervisor Framework ARM Non-Secure Execution Environment ARM Secure Execution Environment Platform Resources SoC NoC User A A A A Secured SoC Management sMMU Exception Level P P P P Services Management Domains (Application P P P P Domain Domain (ST/TEI) Coherence Layer) API API Resource API Kernel/Supervisor RTOS/uKernel Open OS Open OS Exception Level Para-virtualization & Drivers (Linux) with platform service API’s Secured Driver (OpenMP RT) Resource Driver Virtualized TZ Call hardware timer Virtualized TZ Call (tick) HYP(ervisor) Exception Level Open Platform Hypervisor Full Virtualization (KVM) Accelerators Virtualized Heterogeneous (DSP / GPU) TZ Monitor Exception Level TrustZone Monitor Source: Hardware accelerated Virtualization in the ARM Cortex™ Processors, John Goodacre, ARM Ltd. (2011)
  • 84. Reference • 前瞻資訊科技 – 虛擬化 , 薛智文 , 台大資訊所 (2011) • ARM Virtualization: CPU & MMU Issues, Prashanth Bungale, vmware • Hardware accelerated Virtualization in the ARM Cortex™ Processors, John Goodacre, ARM Ltd. (2011) • Hypervisors and the Power Architecture http://www.techdesignforums.com/embedded/embedded-topics/embedded-development- platforms/hypervisors-and-the-power-architecture/ • Philippe Gerum, State of Real-Time Linux: Don't Stop Until History Follows, ELC Europe 2009