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