SlideShare ist ein Scribd-Unternehmen logo
1 von 88
Downloaden Sie, um offline zu lesen
Embedded Virtualization
   applied in Mobile Devices



Jim Huang ( 黃敬群 ) <jserv@0xlab.org>
Developer, 0xlab – http://0xlab.org/

                            June 20, 2012 / Acadamia Sinica
Rights to copy
                                                                 © Copyright 2012 0xlab
                                                                        http://0xlab.org/
                                                                        contact@0xlab.org
Attribution – ShareAlike 3.0
                                           Corrections, suggestions, contributions and translations
You are free                                                                         are welcome!
✔  to copy, distribute, display, and perform the work
✔  to make derivative works                                            Latest update: May 2, 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
Goals of This Presentation

• Give you an overview about
  – device virtualization on ARM
  – Benefit and real products
  – Android specific virtualization consideration
  – doing virtualization in several approaches
• We will not discuss
  – language runtimes
  – In-place multi-environment runtime
Agenda   (1) Motivations
         (2) ARM Virtualization
         (3) Embedded Virtualization
            Implementations
         (4) Guest OS specific issues
Motivations
to enable virtualization for
   embedded devices
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
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
               share multicore ARM CPU SoC to run both Linux and
                                                                                                                                                                Why?
               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




                                                                                                          Linux 1        Linux 2
             Memory                Multi-core            Peripherals
                                                                                              Important         Hypervisor                              Hypervisor
                                                                                              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: 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
    – Reduces the system development time

• Instrumentation, Automation
   – Run RTOS for Measurement and
      analysis
    – Run a GPOS for Graphical Interface
• Real cases: Motorola Evoke QA4
original mobile phone:               with Virtualization: single chip
           two CPUs required




•   Evoke’s UI functionalities including the
    touch screen is owned by the Linux
    apps while video rendering uses a
    rendering engine running on BREW.
•   When a user requests a BREW app,
    Linux communciates with BREW in the
    other VM to start up the app. The
    BREW obtains access to the screen by
    using a frame buffer from a shared-
    memory mapping.
Example: Ubuntu for Android
Mobile (Android) and Desktop (Ubuntu) Virtualization
         in One Device by VMware and Canonical
                         http://www.ubuntu.com/devices/android
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: ARM big.LITTLE
 http://www.arm.com/products/processors/technologies/bigLITTLEprocessing.php

• Connects the performance of the ARM
  Cortex-A15 MPCore™ processor with the
  energy efficiency of the Cortex-A7
  processor, enabling the same application
  software to switch seamlessly between
  them.
• By selecting the optimum processor for
  each task, big.LITTLE can extend battery
  life by up to 70%.
    – For both server and mobile!
• ARM has proposed two usage models, task
  migration and MP.
• Hardware Supported Virtualization




Video: http://www.youtube.com/watch?v=DZbKrGYGnT0
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
legacy app       app         app       app
 legacy app
                           legacy kernel        multicore kernel
legacy kernel
                                              host kernel
 legacy app
                                  core       core        core      core
    core


                      VM#1 VM#2          …               VM#1 VM#2         …

                                              migrate
                           hypervisor                       hypervisor
                            hardware                           hardware



                           Full computing                   Power saving

                  2                                1
                             VM                                  VM
                                               migrate
                shutdown
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
ARM Virtualization
"All problems in computer science
can be solved by another level of
            indirection."

      -- David Wheeler --
Virtual Machine

       • Gerald Popek and Robert Goldberg defined it as
         “efficient, isolated duplicate of a real machine”

           – Add Virtualizing Software to a Host platform and support
             Guest process or system on a Virtual Machine (VM)




The software that provides this illusion is the Virtual Machine Monitor
         (VMM, mostly used synonymous with Hypervisor)
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
                                    Physical Machine
  General Classification
             of
Virtualization technologies
                                 Windows Apps         Linux Apps
   • Type 2                                 MS-
                                          Windows
   • Hosted System VM
                                              VM
                                              Linux

                                        Physical Machine
Source: Operating Systems Design – Lecture 21 Virtualization,
Roy Campbell (Fall 2010)
Virtualizable
                  is a property of the Instruction Set Architecture (ISA)
• A sensitive instruction            • A privileged instruction
  – changes the                        – must be executed with
    configuration or mode of             sufficient privilege
    the processor,                     – causes a trap in user
  or                                     mode
   – depends on its behavior
     of the processor’s state

      If all sensitive instructions are privileged, a VMM can be written.
System Virtualization Implementations
     Full             Para        Hardware Assisted
Virtualization   Virtualization     Virtualization
Full Virtualization

●
    Everything is virtualized
●
    Full hardware emulation
●
    Emulation = latency
Privileged Instructions
●   Privileged instructions: OS kernel and device
    driver access to system hardware
●   Trapped and Emulated by VMM
    –   execute guest in separate address space in
        unprivileged mode
    –   emulate all instructions that cause traps
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)

                                                   35
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
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)




                                                            37
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 → self-modifying code
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
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
Paravirtualization

• Why all the trouble? Just “port” a guest operating
  system to the interface of your choice.
• Paravirtualization can
   – provide better performance
   – simplify VMM
• but at a maintainance cost and you need the source
  code
   – Compromise: Use paravirtualized drivers for I/O
     performance (KVM virtio, VMware).
• Examples: MkLinux, L4Linux, Xen, . . .
Paravirtualization

• Paravirtualization can also be semi-automated:
   – Sensitive instructions are automatically identified
     (in compiler output).
   – Sensitive memory access needs to manually
     identified.
   – Leave markers in binary.
   – On VM load-time, VMM replaces instructions with
     emulation code.
   – In-Place VMM translates to hypervisor calls.
• Benefits:
   – less effort than plain paravirtualization
   – comparable speed
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
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)
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
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
Hardware based 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)
Embedded Virtualization
   Implementations
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
• L4Linux, TU Desden
• ARM Virtualizer (big.LITTLE switcher), Linaro
• KVM ARM
   – Columbia University, Linaro
   – NTHU, Taiwan
• Xvisor: supports ARMv5, ARMv7, ARMv7+VE
• 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
• Xen without assisted hardware VM
• Xen with assisted hardware VM
ARM Virtualizer for big.LITTLE

• big.LITTLE Task Migration model
   – software can seamlessly migrate
     from one processor to the other,
     depending on the use context and
     resulting performance
     requirements.
  – To lower even further the power, each core has
    its own Level 2 cache memory.
  – While sharing an L2 cache would be a more
    area optimized design, integration of an L2
    cache on each processor, yields better power
    results.

• Achieved by having the software run
  not on the hardware, but on-top of a
  new layer operating in HYP mode
  and performing the task-migration.
big.LITTLE: Hypervisors and Interrupts
 • Why is hypervisor needed? Interrupts as an example
   – When we run multiple guest OSes on a system,
     interrupts coming from the hardware could be for
     either of the OSes.
   – A hypervisor needs to first intercept the interrupt
     from the system, and then decide to which guest OS
     it was addressed.
 • For big.LITTLE processing, multiple processor clusters
   sharing the same interrupt controller. The hypervisor
   ensures the transparency of the clusters for the OS and
   does the task migration.
    – hypervisor needs its own interrupts and should not
      interfere with the OS.
Hardware Supported Interrupts
                                     Virtualization
• In HYP mode, a higher privileged exception vector allows
  trapping interrupts even before the OS can react
• when an interrupt come in, hypervisor handles first.
  – If it is for OS, then it will configure a virtualized interrupt controller
  – OS will then handle the interrupt as if there was no hypervisor in
    between.
Codezero hypervisor

•   Optimized for latest ARM cores (Cortex-A9/A15)
•   L4 microkernel based design, written from scratch
•   Capability based dynamic resource management
•   Container oriented driver model: no modifications
    required for Linux
Micro-hypervisor

     • Microvisor – OKL4 4.0
     • Research projects such as NOVA, Coyotos, and
       seL4
     • Aided by virtualizable ISA
• Microhypervisor                • VMM
  – the “kernel” part               – the “userland” part
  – provides isolation              – CPU emulation
  – mechanisms, no policies         – device emulation
  – enables safe access to
    virtualization features to
    userspace
Source: VIRTUALIZATION, Julian Stecklina, TU Dresden
Advantage of NOA architecture:
               Reduce TCB of each VM
• Micro-hypervisor provides low-level protection
  domains
   – address spaces
   – virtual machines
• VM exits are relayed to VMM as IPC with selective
  guest state
• one VMM per guest in (root mode) userspace:
   – possibly specialized VMMs to reduce attack surface
   – only one generic VMM implemented
Guest OS specific issues
Known Issues when deploying
Virtualization into Android based Devices
  • Performance
     – system call, which needs a single hypercall to virtualize, is
       acceptable
     – Driver separation might be the problem: tradeoff
  • Both Type I and Type II virtualization are deployed in
    real products
     – eventually becomes "hybrid" approaches.
     – being complex (best practice: GPU virtualization)
  • LoC of Linux kernel modifications
  • Power consumption
    – Enforced as critical resouce in mind
  • Duplicated implementation in difference area
LmBench shows near native
  performance with OKL4 3.0
  on ARMv7 target




 Source: The OKL4 Microvisor:
 Convergence Point of
 Microkernels and Hypervisors,
 Gernot Heiser & Ben Leslie,
 Open Kernel Labs and NICTA (2010)




NetPerf
fully-loaded CPU and the
throughput degradation of the
virtualized is only 3% and 4%.
Enhancements for Android virtualization

•   Firmware OTA
•   Policy based runtime security enhancemet
•   Adaptive resource managemet
•   Fast path IPC based on microkernel/hypervisor
•   Faster device boot time for better user experience
Reference

• 前瞻資訊科技–虛擬化 , 薛智文 , 台大資訊所 (2011)
• Making Sense Of Virtualization, Achim Nohl, Synopsys
• ARM Virtualization: CPU & MMU Issues, Prashanth
  Bungale, vmware
• An Overview of Microkernel, Hypervisor and Microvisor
  Virtualization Approaches for Embedded Systems, Asif
  Iqbal, Nayeema Sadeque and Rafika Ida Mutia, Lund
  University, Sweden
• Virtualization for embedded systems, M. Tim Jones
• Hardware accelerated Virtualization in the
  ARM Cortex™ Processors, John Goodacre, ARM Ltd.
  (2011)
• Philippe Gerum, State of Real-Time Linux: Don't Stop
  Until History Follows, ELC Europe 2009
http://0xlab.org

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to gdb
Introduction to gdbIntroduction to gdb
Introduction to gdbOwen Hsu
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Hyper-V ネットワークの基本
Hyper-V ネットワークの基本Hyper-V ネットワークの基本
Hyper-V ネットワークの基本Syuichi Murashima
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDBLinaro
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいwata2ki
 
Verilator勉強会 2021/05/29
Verilator勉強会 2021/05/29Verilator勉強会 2021/05/29
Verilator勉強会 2021/05/29ryuz88
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...Adrian Huang
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!Mr. Vengineer
 
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)Mr. Vengineer
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダTakuya ASADA
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in LinuxAdrian Huang
 
Address/Thread/Memory Sanitizer
Address/Thread/Memory SanitizerAddress/Thread/Memory Sanitizer
Address/Thread/Memory SanitizerPlatonov Sergey
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 

Was ist angesagt? (20)

Introduction to gdb
Introduction to gdbIntroduction to gdb
Introduction to gdb
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
Hyper-V ネットワークの基本
Hyper-V ネットワークの基本Hyper-V ネットワークの基本
Hyper-V ネットワークの基本
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
GDB Rocks!
GDB Rocks!GDB Rocks!
GDB Rocks!
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくい
 
Verilator勉強会 2021/05/29
Verilator勉強会 2021/05/29Verilator勉強会 2021/05/29
Verilator勉強会 2021/05/29
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!
 
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)
ZynqMPのブートとパワーマネージメント : (ZynqMP Boot and Power Management)
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダ
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in Linux
 
Address/Thread/Memory Sanitizer
Address/Thread/Memory SanitizerAddress/Thread/Memory Sanitizer
Address/Thread/Memory Sanitizer
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
VerilatorとSystemC
VerilatorとSystemCVerilatorとSystemC
VerilatorとSystemC
 

Andere mochten auch

Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsNational 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
 
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
 
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
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明National Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明National Cheng Kung University
 
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明National Cheng Kung University
 

Andere mochten auch (20)

Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
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
 
Hints for L4 Microkernel
Hints for L4 MicrokernelHints for L4 Microkernel
Hints for L4 Microkernel
 
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
 
olibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linuxolibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linux
 
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
 
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
 
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
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
 
Faults inside System Software
Faults inside System SoftwareFaults inside System Software
Faults inside System Software
 
Develop Your Own Operating System
Develop Your Own Operating SystemDevelop Your Own Operating System
Develop Your Own Operating System
 
Open Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to EcosystemOpen Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to Ecosystem
 
Android Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and OrganizationAndroid Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and Organization
 

Ähnlich wie Embedded Virtualization applied in Mobile Devices

Google Android Naver 1212
Google Android Naver 1212Google Android Naver 1212
Google Android Naver 1212Yoojoo Jang
 
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
 
Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM cloudresearcher
 
ARM Architecture-based System Virtualization: Xen ARM open source software pr...
ARM Architecture-based System Virtualization: Xen ARM open source software pr...ARM Architecture-based System Virtualization: Xen ARM open source software pr...
ARM Architecture-based System Virtualization: Xen ARM open source software pr...The Linux Foundation
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTThe Linux Foundation
 
Cloud computing by prabhunath sharma
Cloud computing by prabhunath sharmaCloud computing by prabhunath sharma
Cloud computing by prabhunath sharmaPrabhunath Sharma
 
Jonas On Windows Azure OW2con11, Nov 24-25, Paris
Jonas On Windows Azure OW2con11, Nov 24-25, ParisJonas On Windows Azure OW2con11, Nov 24-25, Paris
Jonas On Windows Azure OW2con11, Nov 24-25, ParisOW2
 
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
 
Xen summit 2010 extending xen into embedded
Xen summit 2010 extending xen into embeddedXen summit 2010 extending xen into embedded
Xen summit 2010 extending xen into embeddedThe Linux Foundation
 
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)IRJET Journal
 
Rover technology ppt
Rover technology pptRover technology ppt
Rover technology pptsindhupriya97
 
Virtualization Everywhere
Virtualization EverywhereVirtualization Everywhere
Virtualization Everywherewebhostingguy
 
A Survey Embedded Systems Supporting By Different Operating Systems.pdf
A Survey   Embedded Systems Supporting By Different Operating Systems.pdfA Survey   Embedded Systems Supporting By Different Operating Systems.pdf
A Survey Embedded Systems Supporting By Different Operating Systems.pdfFiona Phillips
 

Ähnlich wie Embedded Virtualization applied in Mobile Devices (20)

Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
Embedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile DevicesEmbedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile Devices
 
Google Android Naver 1212
Google Android Naver 1212Google Android Naver 1212
Google Android Naver 1212
 
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
 
Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM Cloud Computing Hypervisors and Comparison Xen KVM
Cloud Computing Hypervisors and Comparison Xen KVM
 
ARM Architecture-based System Virtualization: Xen ARM open source software pr...
ARM Architecture-based System Virtualization: Xen ARM open source software pr...ARM Architecture-based System Virtualization: Xen ARM open source software pr...
ARM Architecture-based System Virtualization: Xen ARM open source software pr...
 
Parth virt
Parth virtParth virt
Parth virt
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XT
 
Cloud computing by prabhunath sharma
Cloud computing by prabhunath sharmaCloud computing by prabhunath sharma
Cloud computing by prabhunath sharma
 
Jonas On Windows Azure OW2con11, Nov 24-25, Paris
Jonas On Windows Azure OW2con11, Nov 24-25, ParisJonas On Windows Azure OW2con11, Nov 24-25, Paris
Jonas On Windows Azure OW2con11, Nov 24-25, Paris
 
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
 
Xen summit 2010 extending xen into embedded
Xen summit 2010 extending xen into embeddedXen summit 2010 extending xen into embedded
Xen summit 2010 extending xen into embedded
 
Dz25764770
Dz25764770Dz25764770
Dz25764770
 
Dz25764770
Dz25764770Dz25764770
Dz25764770
 
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)
IRJET- A Survey on Virtualization and Attacks on Virtual Machine Monitor (VMM)
 
Xen Community Update 2011
Xen Community Update 2011Xen Community Update 2011
Xen Community Update 2011
 
Rover technology ppt
Rover technology pptRover technology ppt
Rover technology ppt
 
Virtualization Everywhere
Virtualization EverywhereVirtualization Everywhere
Virtualization Everywhere
 
A Survey Embedded Systems Supporting By Different Operating Systems.pdf
A Survey   Embedded Systems Supporting By Different Operating Systems.pdfA Survey   Embedded Systems Supporting By Different Operating Systems.pdf
A Survey Embedded Systems Supporting By Different Operating Systems.pdf
 

Mehr von National Cheng Kung University

Mehr von National Cheng Kung University (7)

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 年春季嵌入式作業系統課程說明
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Embedded Virtualization applied in Mobile Devices

  • 1. Embedded Virtualization applied in Mobile Devices Jim Huang ( 黃敬群 ) <jserv@0xlab.org> Developer, 0xlab – http://0xlab.org/ June 20, 2012 / Acadamia Sinica
  • 2. Rights to copy © Copyright 2012 0xlab http://0xlab.org/ contact@0xlab.org Attribution – ShareAlike 3.0 Corrections, suggestions, contributions and translations You are free are welcome! ✔ to copy, distribute, display, and perform the work ✔ to make derivative works Latest update: May 2, 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. Goals of This Presentation • Give you an overview about – device virtualization on ARM – Benefit and real products – Android specific virtualization consideration – doing virtualization in several approaches • We will not discuss – language runtimes – In-place multi-environment runtime
  • 4. Agenda (1) Motivations (2) ARM Virtualization (3) Embedded Virtualization Implementations (4) Guest OS specific issues
  • 6. 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
  • 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 share multicore ARM CPU SoC to run both Linux and Why? 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 Linux 1 Linux 2 Memory Multi-core Peripherals Important Hypervisor Hypervisor 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: 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 – Reduces the system development time • Instrumentation, Automation – Run RTOS for Measurement and analysis – Run a GPOS for Graphical Interface • Real cases: Motorola Evoke QA4
  • 11. original mobile phone: with Virtualization: single chip two CPUs required • Evoke’s UI functionalities including the touch screen is owned by the Linux apps while video rendering uses a rendering engine running on BREW. • When a user requests a BREW app, Linux communciates with BREW in the other VM to start up the app. The BREW obtains access to the screen by using a frame buffer from a shared- memory mapping.
  • 12. Example: Ubuntu for Android Mobile (Android) and Desktop (Ubuntu) Virtualization in One Device by VMware and Canonical http://www.ubuntu.com/devices/android
  • 13. 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
  • 14. 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
  • 15. Use Case: ARM big.LITTLE http://www.arm.com/products/processors/technologies/bigLITTLEprocessing.php • Connects the performance of the ARM Cortex-A15 MPCore™ processor with the energy efficiency of the Cortex-A7 processor, enabling the same application software to switch seamlessly between them. • By selecting the optimum processor for each task, big.LITTLE can extend battery life by up to 70%. – For both server and mobile! • ARM has proposed two usage models, task migration and MP. • Hardware Supported Virtualization Video: http://www.youtube.com/watch?v=DZbKrGYGnT0
  • 16. Embedded Virtualization Use Case • Workload consolidation • Legacy software • Multicore enablement • Improve reliability • Secure monitoring
  • 17. Use Case: Workload Consolidation  Consolidate legacy systems legacy legacy legacy legacy SW SW SW SW host kernel legacy HW new HW
  • 18. 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
  • 19. 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
  • 20. legacy app app app app legacy app legacy kernel multicore kernel legacy kernel host kernel legacy app core core core core core VM#1 VM#2 … VM#1 VM#2 … migrate hypervisor hypervisor hardware hardware Full computing Power saving 2 1 VM VM migrate shutdown
  • 21. Use Case: Improved Reliability  Hot standby without additional hardware app backup app app HW HW HW backup app app host kernel HW
  • 22. Use Case: Secure Monitoring  Protect monitoring software network network app app monitor kernel kernel host kernel HW HW
  • 24. "All problems in computer science can be solved by another level of indirection." -- David Wheeler --
  • 25. Virtual Machine • Gerald Popek and Robert Goldberg defined it as “efficient, isolated duplicate of a real machine” – Add Virtualizing Software to a Host platform and support Guest process or system on a Virtual Machine (VM) The software that provides this illusion is the Virtual Machine Monitor (VMM, mostly used synonymous with Hypervisor)
  • 26. 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.
  • 27. 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
  • 28. 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)
  • 29. Windows Apps Linux Apps • Type I MS- Linux • Bare metal system VM Windows VMM or Hypervisor Physical Machine General Classification of Virtualization technologies Windows Apps Linux Apps • Type 2 MS- Windows • Hosted System VM VM Linux Physical Machine
  • 30. Source: Operating Systems Design – Lecture 21 Virtualization, Roy Campbell (Fall 2010)
  • 31. Virtualizable is a property of the Instruction Set Architecture (ISA) • A sensitive instruction • A privileged instruction – changes the – must be executed with configuration or mode of sufficient privilege the processor, – causes a trap in user or mode – depends on its behavior of the processor’s state If all sensitive instructions are privileged, a VMM can be written.
  • 32. System Virtualization Implementations Full Para Hardware Assisted Virtualization Virtualization Virtualization
  • 33. Full Virtualization ● Everything is virtualized ● Full hardware emulation ● Emulation = latency
  • 34. Privileged Instructions ● Privileged instructions: OS kernel and device driver access to system hardware ● Trapped and Emulated by VMM – execute guest in separate address space in unprivileged mode – emulate all instructions that cause traps
  • 35. 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) 35
  • 36. 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
  • 37. 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) 37
  • 38. 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)
  • 39. 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
  • 40. 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.
  • 41. 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)
  • 42. 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
  • 43. 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
  • 44. 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 → self-modifying code
  • 45. 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
  • 46. Hypercall Guest OS Hypercalls Software Interrupt No Yes Reschedule ? context switch Hypervisor Hyper Call Handler SWI Handler
  • 47. 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.
  • 48. 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
  • 49. 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
  • 50. # 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
  • 51. 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
  • 52. 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)
  • 53. 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
  • 54. Paravirtualization • OS or system devices are virtualization aware • Requirements: – OS level – translated/modified kernel – Device level – paravirtualized or “enlightened” device drivers
  • 55. Paravirtualization • Why all the trouble? Just “port” a guest operating system to the interface of your choice. • Paravirtualization can – provide better performance – simplify VMM • but at a maintainance cost and you need the source code – Compromise: Use paravirtualized drivers for I/O performance (KVM virtio, VMware). • Examples: MkLinux, L4Linux, Xen, . . .
  • 56. Paravirtualization • Paravirtualization can also be semi-automated: – Sensitive instructions are automatically identified (in compiler output). – Sensitive memory access needs to manually identified. – Leave markers in binary. – On VM load-time, VMM replaces instructions with emulation code. – In-Place VMM translates to hypervisor calls. • Benefits: – less effort than plain paravirtualization – comparable speed
  • 57. Hardware-assisted Virtualization ● Hardware is virtualization aware ● Hypervisor and VMM load at Ring -1 ● Remove CPU emulation bottleneck ● Provides address bus isolation
  • 58. 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/
  • 59. 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
  • 60. 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
  • 61. 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)
  • 62. 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
  • 63. 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)
  • 64. 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)
  • 65. 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
  • 66. 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
  • 67. Hardware based 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)
  • 68. Embedded Virtualization Implementations
  • 69. 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 • L4Linux, TU Desden • ARM Virtualizer (big.LITTLE switcher), Linaro • KVM ARM – Columbia University, Linaro – NTHU, Taiwan • Xvisor: supports ARMv5, ARMv7, ARMv7+VE • Codezero
  • 70. 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
  • 71. 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
  • 72. • Xen without assisted hardware VM
  • 73. • Xen with assisted hardware VM
  • 74. ARM Virtualizer for big.LITTLE • big.LITTLE Task Migration model – software can seamlessly migrate from one processor to the other, depending on the use context and resulting performance requirements. – To lower even further the power, each core has its own Level 2 cache memory. – While sharing an L2 cache would be a more area optimized design, integration of an L2 cache on each processor, yields better power results. • Achieved by having the software run not on the hardware, but on-top of a new layer operating in HYP mode and performing the task-migration.
  • 75. big.LITTLE: Hypervisors and Interrupts • Why is hypervisor needed? Interrupts as an example – When we run multiple guest OSes on a system, interrupts coming from the hardware could be for either of the OSes. – A hypervisor needs to first intercept the interrupt from the system, and then decide to which guest OS it was addressed. • For big.LITTLE processing, multiple processor clusters sharing the same interrupt controller. The hypervisor ensures the transparency of the clusters for the OS and does the task migration. – hypervisor needs its own interrupts and should not interfere with the OS.
  • 76. Hardware Supported Interrupts Virtualization • In HYP mode, a higher privileged exception vector allows trapping interrupts even before the OS can react • when an interrupt come in, hypervisor handles first. – If it is for OS, then it will configure a virtualized interrupt controller – OS will then handle the interrupt as if there was no hypervisor in between.
  • 77. Codezero hypervisor • Optimized for latest ARM cores (Cortex-A9/A15) • L4 microkernel based design, written from scratch • Capability based dynamic resource management • Container oriented driver model: no modifications required for Linux
  • 78.
  • 79. Micro-hypervisor • Microvisor – OKL4 4.0 • Research projects such as NOVA, Coyotos, and seL4 • Aided by virtualizable ISA • Microhypervisor • VMM – the “kernel” part – the “userland” part – provides isolation – CPU emulation – mechanisms, no policies – device emulation – enables safe access to virtualization features to userspace
  • 80.
  • 81. Source: VIRTUALIZATION, Julian Stecklina, TU Dresden
  • 82. Advantage of NOA architecture: Reduce TCB of each VM • Micro-hypervisor provides low-level protection domains – address spaces – virtual machines • VM exits are relayed to VMM as IPC with selective guest state • one VMM per guest in (root mode) userspace: – possibly specialized VMMs to reduce attack surface – only one generic VMM implemented
  • 84. Known Issues when deploying Virtualization into Android based Devices • Performance – system call, which needs a single hypercall to virtualize, is acceptable – Driver separation might be the problem: tradeoff • Both Type I and Type II virtualization are deployed in real products – eventually becomes "hybrid" approaches. – being complex (best practice: GPU virtualization) • LoC of Linux kernel modifications • Power consumption – Enforced as critical resouce in mind • Duplicated implementation in difference area
  • 85. LmBench shows near native performance with OKL4 3.0 on ARMv7 target Source: The OKL4 Microvisor: Convergence Point of Microkernels and Hypervisors, Gernot Heiser & Ben Leslie, Open Kernel Labs and NICTA (2010) NetPerf fully-loaded CPU and the throughput degradation of the virtualized is only 3% and 4%.
  • 86. Enhancements for Android virtualization • Firmware OTA • Policy based runtime security enhancemet • Adaptive resource managemet • Fast path IPC based on microkernel/hypervisor • Faster device boot time for better user experience
  • 87. Reference • 前瞻資訊科技–虛擬化 , 薛智文 , 台大資訊所 (2011) • Making Sense Of Virtualization, Achim Nohl, Synopsys • ARM Virtualization: CPU & MMU Issues, Prashanth Bungale, vmware • An Overview of Microkernel, Hypervisor and Microvisor Virtualization Approaches for Embedded Systems, Asif Iqbal, Nayeema Sadeque and Rafika Ida Mutia, Lund University, Sweden • Virtualization for embedded systems, M. Tim Jones • Hardware accelerated Virtualization in the ARM Cortex™ Processors, John Goodacre, ARM Ltd. (2011) • Philippe Gerum, State of Real-Time Linux: Don't Stop Until History Follows, ELC Europe 2009