260 likes | 446 Views
Looking Inside the Virtualization Layer for Performance, Security and Software Fault-Tolerance. Sorav Bansal IIT Delhi. Virtualization Software. VMware Workstation/ESX Server Citrix XenServer Microsoft Hyper-V Virtual Iron Parallels Desktop …. Classification of Virtual Machine Monitors.
E N D
Looking Inside the Virtualization Layer for Performance, Security and Software Fault-Tolerance SoravBansal IIT Delhi
Virtualization Software • VMware Workstation/ESX Server • Citrix XenServer • Microsoft Hyper-V • Virtual Iron • Parallels Desktop • …
Classification of Virtual Machine Monitors • Binary Translation • VMware (1998) • Hardware-Assisted Virtualization • VMware, Hyper-V, XenServer, Virtual Iron, … • Para-virtualization • XenServer
Missing Features • Optimize code • Security • Bug-tolerance
What are we doing • A virtualization layer for x86 from grounds-up • Runs unmodified OS • Can dynamically optimize code (binary translation) • Can specify security policies enforceable at instruction-level granularity • Can record and replay an execution • Can install on an existing OS • Transparent to user • Simple
Traditional Picture Application 1 Application 2 OS Hardware
Virtualized Picture Application 1 Application 2 OS Optimizing VMM
Translation Blocks • Divide code into “translation blocks” • A translation block ends if • Reach a control-flow instruction • Or, MAX_INSNS instructions have been translated
A Simple Scheme x: tx: Original code fragment Translated code fragment Binary Translator
Use a Cache x: tx: Original code fragment Translated code fragment Binary Translator save Lookup using x found Translation Cache not-found
Direct Jump Chaining Ta a lookup(b) lookup(c) b c Tb Tc d lookup(d) lookup(d) Td
Indirect Jumps push b jmp Tf call Ta Tf f a b tmp JTABLE[retaddr & MASK] if (tmp.src == retaddr) goto tmp.dst ret pop retaddr lookup(retaddr) Tb
logarithmic scale printf Overheads
Effect of Maximum Size of Translation Block Overhead Max Size of Translation Block
clock Effect of Translation Cache Size random Overhead Number of 4k pages in Translation Cache
Optimizations • Peephole Optimizations • Trace Optimizations • Cross-layer optimizations
An Example ld M, r1 ld M, r0 ld M, r0 mov r0, r1
Interrupts ld M, r1 ld M, r0 ld M, r0 mov r0, r1 Delay Interrupt delivery till end of current translation
Precise Exceptions ret ld (sp),t0 add $4, sp … jmp t0 Page fault rollback code sub $4, sp restore t0 page fault handler
Security: A Simple Scheme to PreventStack-Overflows … push ra, shadow … call … ra pop ra1pop shadow if (ra != ra1) error … ret
Record-Replay • Record • Direct I/O (in instructions) • Interrupts • Memory-mapped I/O • Can use this to tolerate certain classes of bugs
Conclusions • The virtualization layer is a good place to do many interesting things • Can we make the virtual machine appear __________________ than the real machine? faster more secure more reliable