A virtual Smartphone Architecture Jeremy Andrus Christoffer Dall Alexander Van t Hof Oren Laadan Jason Nieh Columbia University in the city of new york 1 23rd ACM Symposium on Operating Systems Principles, Cascais, Portugal, October 2011
Motivation Architecture Overview Graphics Cell Radio Evaluation Demo Personal Phone Business Phone Developer Phone Children s Phone 2
Motivation Overview Architecture Graphics Cell Radio Evaluation Virtualization 3 Demo
Server Virtualization Bare-Metal Hypervisor poor device support / sharing OS Kernel OS Kernel OS Kernel Hypervisor / VMM Hardware 4
Desktop Virtualization poor device performance host user space Hosted Hypervisor OS OS OS Hypervisor / VMM Host OS Kernel kernel module emulated devices 5 Hardware
Non-Virtualization User Space SDK no standard apps less secure custom user space API for isolated apps OS Kernel Hardware 6
Key Challenges device diversity microphone headset Power Touchscreen Buttons GPS Cell Radio WiFi GPU Framebuffer h.264 accel. pmem Binder IPC Compass camera(s) speakers Accelerometer RTC / Alarms mobile usage model graphics-accelerated UI 7
Cells 8
Motivation Overview Architecture Graphics Cell Radio Evaluation Demo Cells Key Observation small: one app at a time large: lots of windows/apps 9
Cells Key Observation screen real-estate is limited, and mobile phone users are accustomed to interacting with one thing at time 10
Cells Usage Model foreground / background 11
Cells Complete Virtualization multiple, isolated virtual phones (VPs) on a single mobile device 100% device support in each VP unique phone numbers - single SIM! accelerated 3D graphics! 12
Cells Efficient Virtualization less than 2% overhead in runtime tests imperceptible switch time among VPs 13
Cells Transparent Virtualization each VP sees / uses all devices user can run any unmodified apps foreground VP switches like an app 14
Single Kernel: Multiple VPs isolated collection VP 1 VP 2 VP 3 of processes virtualize at OS interface Linux Kernel 15
Single Kernel: Device Support VP 1 VP 2 VP 3 all VPs access the same device simultaneously Power Touchscreen microphone Buttons headset GPS Cell Radio WiFi GPU Framebuffer hw codec pmem Binder IPC Compass camera(s) Linux Kernel speakers Accelerometer RTC / Alarms Input Sensors Audio/Video Android... 16
Device Namespaces VP 1 VP 2 VP 3 safely, correctly multiplex access to devices Linux Kernel device namespaces WiFi Cell Radio Framebuffer GPU Power Input Sensors Audio/Video RTC / Alarms Android... 17
Cells VP 1 VP 2 VP 3 device namespaces + foreground / background Linux Kernel WiFi Cell Radio Framebuffer = device namespaces Complete, Efficient, Transparent Mobile Virtualization GPU Power Input Sensors Audio/Video RTC / Alarms Android... 18
efficient basic graphics virtualization hardware accelerated graphics proprietary/closed interface Linux Kernel device namespaces WiFi Cell Radio Framebuffer GPU Power Input Sensors Audio/Video RTC / Alarms Android... 19
Approach 1: Single Assignment screen memory Framebuffer virtual addresses physical addresses GPU 20
Approach 2: Emulated Hardware emulated framebuffer screen memory Framebuffer virtual state 21
Motivation Overview Architecture Graphics Cell Radio Evaluation Demo Cells: Device Namespaces mux_fb presents VP 1 VP 2 VP 3 foreground background background identical device interface to all VPs using device namespaces swap virt addr mappings: point to different phys addr screen memory 22 Framebuffer mux_fb virtual addresses physical addresses
Accelerated Graphics VP: just a set of processes! VP 1 VP 2 VP 3 OpenGL context OpenGL context OpenGL context screen memory Framebuffer process isolation MMU GPU graphics virtual addresses physical addresses 23
Motivation Overview Architecture Graphics Cell Radio Evaluation Demo Device Namespace + Graphics Context VP 1 VP 2 VP 3 foreground background background OpenGL OpenGL OpenGL context context context screen memory 24 MMU graphics virtual addresses GPU physical addresses
VoIP? RilD Vendor RIL VoIP VoIP Drivers Linux Kernel Baseband: GSM / CDMA 25
Dual-SIM? RilD Vendor RIL RilD Vendor RIL Drivers Drivers Linux Kernel 26 GSM/CDMA GSM / CDMA
Cells: User-Level Namespace Proxy VP 1 VP 2 VP 3 foreground background background vendor API RilD Vendor Cells RIL proprietary RilD hardware/software RilD requires a well-defined interface. Cells RIL Cells RIL CellD Root Namespace Drivers Baseband: GSM / CDMA Linux Kernel 27
Experimental Results Setup Nexus S five virtual phones overhead vs. stock Android 2.3 28
Experimental Results Setup CPU Linpack graphics Neocore storage Quadrant web browsing Sun Spider networking Custom WiFi Test 29
Experimental Results Runtime Overhead 1.40! 1.20! 1.00! 0.80! 0.60! 0.40! 0.20! Negligible Overhead In 3D Measurements! 1-VP! 2-VP! 3-VP! 4-VP! 5-VP! 0.00! Linpack NeoCore Quadrant I/O Sun Spider Network 30
Demo 31
Cells Complete, Efficient, Transparent Mobile Virtualization device namespaces safely and efficiently share devices foreground / background designed specifically for mobile devices implemented on Android less than 2% overhead on Nexus S 32
More Info cells.cs.columbia.edu cellrox.com 33