Cells: A Virtual Mobile Smartphone Architecture (SOSP 2011) Lunch TimeReading Group 11/11/2011 Minsung Jang
Summary Novel Architecture for a Virtual Phone How to do away with overhead New way to virtualize devices Foreground Background dusage Model How to contribute a low overhead
Motivation For everyday computing, Mobile > Desktop (+Laptop) Many virtual phones that are isolated on a physical phone Eiti Existing (system) virtualizations it ti High overhead Hardware devices Cells: new, LWT virtulization Sensors (accessible by APIs) Tap sensor Orientation Sensor Accelerometer Ambient Light Sensor Proximity Sensor Compass Rotation Sensor 800MPixel camera on back
Virtual Phones Overview of Cells MultipleAndroid insteadofmultipleosinstances instances Low overhead UnionFS, KSM, Form factor (Small lldisplay) New usage model Device support Per VPPhone Phone number Prototype using Real commercial Android phones Nexus 1, Nexus S withgingerbread Scalability
Usage Model Display the contents only from the foreground VP Frame buffer GPU Foreground VP When? Background VPs Android Kernel
Access Right Three different access right for each device on a phone hardware No access, shared access, or exclusive access Assigned dstatically ti when a VPis configured Foreground VP Background VPs No Access Exclusive Access Frame GPU buffer Android Kernel Shared Access Audio
User level virtualization Architecture Android/Java (Dalvik VM) VP ID: 1 VP ID: 2 Single OS Instance
A virtual phone has Architecture ID, Kernel I/F, andvirtualizedhardwareresources resources Private virtual namespace Filesystem Path Virtualized {PIDs, network names, user names} Eg E.g., The same PIDs can exists if VP ids are different Linux provides the PID virtualization
Virtualization Why virtualized resources? Guarantee Isolation among VPs How? Kernel level, User level Root Namespace State of VP 1 Virtual Phone (VP 1) Proprietary Device Driver State of State of VP 1 VP 2 Device Driver
Devices List of Devices that Android must have
Scalability Scalability & Security How many VPs can be built on a physical phone Removing overhead per VM Security UnionFS (aufs), KSM, LMK How Cells isolate a VP from others Kernel/user level level namespace Separate FS view for each VP No creation of device nodes in a VP
UnionFS (aufs) Stacking file systems Join the read only fs with a writeable files Read only: /data, /system Aufs Writable layer for /data, /system For VP 1 /data /system Read only For ALL VPs
Device Virtualization
Graphics Multiplexing FB device driver: mux_fb How FB works : mmaps, standard IOCTLs, custom IOCTLs
Graphics in Android (Linux) Device File Application kernel address space kernel FB driver Buffer control device type Major # Minor # mmap() control Buffer process address space dma_alloc_writecombine() LCD device physical memory Buffer DMA DMAC
Graphics Virtual Phone 1 Virtual Phone2 process address space s Buffer process address space s Buffer remap Device Namespace Mangement Frame buffer for Foreground VP Frame buffer for Background VP Backing memory LCD Device
GPU GPU is already isolated by underlying Linux Pass through access in each VP context Switching the foreground VP, remap memory buffers Need to access a GPU driver at a somewhat level Requirements for proprietary GPU driver Remap the GPU driver s linear addresses Re initialize On/Off Ignore power management request For GPUs without MMU, the backing memoryis For GPUs without MMU, the backing memory is contiguous
Telephony in Android Telephony Binder Solicited Binder Unsolicited Call application (Dialer) Radio Interface layer Daemon (RilD) from Google Vendor RIL (proprietary) Kernel Driver (proprietary) Closed source codes
Virtual Phone Telephony
Incoming/Outgoing calls Telephony Multiple Numbers: Phone number assigned to each VP Challenge: One SIM allows just one phone number, Caller ID
Telephony/Outgoing Calls VP1 (VoIP Number:1) VP2 (VoIP number:2) Original phone number: 404 433 1112 DTMF VoIP Server VoIP Number Original number 1 404 433 2 404 433
Telephony/Incoming Calls VP1 (VoIP Number:1) VP2 (VoIP number:2) VoIP number :2 VIP VoIP Server Original phone number: 404 433 1112 VoIP Number Original number 1 404 433 2 404 433
Network Best Practice in desktop/server virtualization Virtual wired network adapter for each virtual machine Configuration in a host VM vnic VM vnic Hypervisor NAT/Bridged WiFi
Requirements Network Each VP Should be able to independently select its wireless connection, andconfigure it e.g, Security method, WLAN or 3G Some application should be able to access WLAN directly e.g., Location based services, AppStore, System Updater Each VP should be able to Each VP should be able to see such selection
Similar with telephony Network Android uses wpa_supplicant for wireless setup Virtual Phone 1 Apps Connection information for VP1 Network Proxy wpa_supplicant NAT Driver 802.11 Device
Experiment Measuring overhead/power consumption for 5 VP VPs configuration for UI test VP1: Angry Bird VP2: Reckless Racing (3D game) VP3: Office Suite Pro VP4: Android Music Player
Experiment
Conclusion Problems in existing device virtualization Pass though: h other VMs cannot access Bypass: requires special hardware support In particular, GPU Vmware MVP not good for games Xen backend frontend: vendor support needed
Pros Conclusion Lightweight, No hypervisor Leveraging existing device drivers Cons Large TCB Different mobile OS on a phone (e.g., Android + ios)