Class Note for EECS 750 with Professor Niehaus at KU
Class Note for EECS 750 with Professor Niehaus at KU
Popular in Course
Popular in Department
This 22 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at Kansas taught by a professor in Fall. Since its upload, it has received 18 views.
Reviews for Class Note for EECS 750 with Professor Niehaus at KU
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
A Comparison of Software and Hardware Techniques for x86 Virtualization Keith Adams VMware Ole Agesen VMware Jordan and Justin Ehrlich University of Kansas EECS750 Doug1as Niehaus I 1 Introduction that go beyond traditional trapandemulate Software VMM39s VMware Workstation and Virtual PC Use Binary Translation BT Xen 30 Software lt 30 uses Paravirtualization Recent HardwareAssisted VMM39s Supposedly rarely offer performance gains over Software Xen 30 Hardware Virtual PC VMWare and Parallels now all support native virtualization through hardware post paper I x86 OS virtualization has required methods I 2 Classical Virtualization Fidelity Software on the VMM executes identically to its execution on hardware barring timing effects Performance An overwhelming majority of guest instructions are executed by the hardware without the intervention of the VMM Safety The VMM manages all hardware resources In this sense x86 is classically virtualizable I 3 Requirements Popek and Goldberg I Classical Virtualization Paper39s definition Classically Virtualizable Can be virtualized purely by trapandemulate x86 in this sense NOT classically virtualizable Concepts used in Classical Virtualization Deprivileging Primary and Shadow structures Memory traces I 3 Software Virtualization Visibility of privileged state Lack of traps when privileged instructions run at userlevel Virtualization of Binaryonly OS39s like Windows disrupted Overcome by having Guest OS operate on interpreter rather than physical CPU Interpreter inefficient however Binary Translation can be used instead and can provide much better performance I x86 obstacles I Binary Translation Avoids costly Privileged Instruction traps Binary Dynamic On demand System Level Subsetting Adaptive I Simple binary translation Adaptive Binary Translation Eliminates nonprivileged instruction traps Loads stores that access sensitive data like page tables Still suffers some dynamic overhead Jumping to replace translation Static overhead code patching loss of icache contents Can be controlled with hysteresis to ensure low adaptation frequency Hardware Virtualization AMD AMDV svm flag proccpuinfo AMZ Athlon 64 F Family Opterons gt 2nOI generation Phenom Intel Intel VT vmx flag proccpuinfo Pentium 4 6X1 and 6x2 models and D Core and Core 2 with a few exceptions Xeon Core generation Both due the same thing but have different semantics Both now implement a virtual IOMMU which was added after the paper was published I X86 Architecture Extension guest mode A new instruction called vmrun enables the mode erun is executed Hardware loads guest state from the VMCS Execution proceeds until some condition located in the VMCS On exit host mode is loaded which is supplied by the VMM VMM is now running in order to emulate operation caused by the exit erun is executed system returns to guest mode exit reason has been serviced I A new run mode has been added called VMCS What paper calls the Virtual Machine Control Block VMCB Intel calls the Virtual Machine Control Structure VMCS Stores state information for each guest and information about the host Contains fields to aid the VMM in handling the exit describing the reasons for the exit and what to do next VMCS format is not a standard but is defined by the VMM VMWare programs the VMCS to exit on guest page faults TLB flushes addressspace switches lO instructions may be out of date Control bits allow flexibility in trust such as access to certain lO devices or interrupt handling VMWare can use the old software emulator code including MMU virtualization logging synchronization and device models Shadow Structures Derived from guestlevel primary structures such as page table pointer register processor status register page tables and the time stamp counter Read accesses from the primary structures will return shadow values and no exit Writes will cause exit allowing VMM to handle Tracing pageprotection through shadows of all page tables Every page table modification will cause an exit and modification to the shadow As untouched regions of guests virtual address space is accessed page faults will cause exit I Page Faults True Page Faults caused by violations of the I protection policy encoded in the guest PTEs These are forwarded to the guest Hidden page faults caused by misses in the shadow table These cause the VMM to construct an appropriate shadow PTE and resume guest execution It is hidden because it has no guest visible effect This allows full management of memory space by allowing VMM control of all page directories and tables Memory of guest is mapped to the virtual memory space of the VMM I Example fork CPL is changed from 3 to O The guest39s trap and system call vectors are already loaded so transition I happens without VMM intervention The guest uses copyonwrite Each guest page table write causes an exit VMM emulates effect on the traced page and reflects effect into the shadow page table Guest scheduler context switches to child loading child39s table pointer This causes an exit allowing the VMM to construct a new shadow page table and points the VMCS39s page table register at it I Example fork cont As child runs it touches pieces of its address I space that are not yet mapped by the shadow page tables This causes exit allowing the VMM to service the hidden page fault update the shadow page table and resume guest execution f memory accesses cause true page faults which are imposed by the guests the page faults are returned to the guest Guest Page Table Page Table Page Direcmry Pram When a load page mg directory pointer into V m CR3 is encountered cm Gueaniew an exit is performed The value of the virtual pointer is mammary given to the VMM mmquot which in turn load the real value into CR3 mm gt before handing control back to the guest E Page Table Xen Hyper snr gm Guest Page Frame Number m Machine Page Frame Number Software vs Hardware Hardware extensions allow classical virtualization on the x86 The overhead comes with exits it no exits then native speed Hardware Advantages Code density is preserved no translation Precise exceptions BT performs extra work to recover guest state for faults and interrupts in nonIDENT code System calls run without VMM intervention Software Advantages Trap elimination replaced with callouts which are usually faster Emulation speed callouts provide emulation routine whereas hardware must fetch and decode the trapping instruction then emulate Callout avoidance BT can avoid a lot of callouts by using in TC emulation 9quot 3f naive Ij hig h EF is better 128 1EE Bl 4D 2D User level results oftwar39e mm Hardware 39MM 2 gzip var r1cf crafty parser ennperlhmkgap warts Ejzip2 twolf specjlm 53 3f nati higher is better Macrobenchmarks IIO quotIUD I I I I I S Uftware MI Hardware MM I an EU 20 El mmpiIeLin mmpila quotquotin ApacheLin Apache39u quotin LargeFEAM EDEraphics I Paravirtualization vs Hardware 12 1 88 36 39 84 82 Xenu E222 UHKI Native KB SPECINT SPECFP CPUSIJHK SPECJBB BYTE SYSEENCH THREHDS HUTEX HEHDRY FILEII IJLTP CPU cm was smaHer s benev munun 10000 mun an 01 Nanobenchmarks News El Su ware vMM l Hardware VMM 1 syscaH m crEwr aHret pgiauh dwzem ptemud Overhead seconds Suitare VMM l Hardware VMM LL syscaH mom cr wr caum pgmu plemud Vans am Figure 4 thzslizanon uauobeuchumrks Figure 5 Somces of mmalizanon overhead m an XP bOOI39hak Future Microarchitecture Cydereduc on Hardware MMU support IOMMU 583Hz P4 672 266GHz Core 2 Duo VM emry 2409 937 Page fault VM 2x1 1931 1186 VMCB read 178 52 VMC39B vva 171 44 forkwait Hardware So ware P4 1 77 31 Core 148 F he 3 TLB TLE Fill Hardware 739 EVA hPA 1 gVA V PAX V Y Guest PT Ptr WA gt uPA 39 Guesr VMM Nested PTPtr 3 4 5 W s r gPA gt hFA gPAX 721144 Y I Conclusion hardware virtualization is currently slower then software Perhaps future will provide better solutions Hardware Virtualization now allows Classical Virtualization Hybrid VMMs are in the works with Betas available I Results were surprising to me in that
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'