資工系網媒所 NEWS 實驗室 /450 What is Virtualization ? etc Virtualization Running Applications (x-platform) Running Applications (x-platform) Security Sharing Hardware Resource Sharing Hardware Resource Virtual Machine ! Fully Utilizing Hardware Fully Utilizing Hardware
資工系網媒所 NEWS 實驗室 1 Why Virtualization is Difficult ? (1/2) OS is moved to ring1/3 On x86 Some instructions Sensitive Instructions Cannot be trapped 0/1/3 Ring, e.g. x86_32 0/3/3 Ring, e.g. x86_64, ARM OS Critical Instructions Instructions Sensitive Register Instructions SGDT, SIDT, SLDT SMSW PUSHF(D), POPF(D) Protection System Instructions LAR, LSL, VERR, VERW PUSH, POP CALL, JMP, INT, RET STR MOV
資工系網媒所 NEWS 實驗室 2 Why Virtualization is Difficult ? (2/2) - Examples SGDT, SIDT and SLDT SGDT m // save gdtr to memory SIDT m // save idtr to memory SLDT r/m16 // save ldtr to memory Only one gdtr, idtr and ldtr on a cpu ! POP POP ss // need to satisfy RPL=CPL=DPL CPL changes to 1 or 3 !
資工系網媒所 NEWS 實驗室 3 Binary translation Hypercall How to Virtualize ? (1/2) Full VirtualizationPara VirtualizationHardware Assisted Virtualization Intel VT-x & AMD SVM
資工系網媒所 NEWS 實驗室
資工系網媒所 NEWS 實驗室 5 How to Virtualize ? (2/2) Hypervisor (VMM) Type Type I + Microkernel Xen (open source, citrix), Microsoft Hyper-V Type I + Integrated kernel VMware ESX, KVM (kernel-base VM) Type II (Host OS + Guest OS) VMware GSX, workstation, Microsoft virtual PC, Microsoft virtual server, Sun Virtual Box Type I Type II
資工系網媒所 NEWS 實驗室 6 Xen Architecture (1/2)
資工系網媒所 NEWS 實驗室 7 Xen Architecture (2/2) LinuxXen System CallsHyper Calls SignalsEvents InterruptsPhysical + Virtual Interrupts CPUPCPU + VCPU FilesystemXenStore POSIX Shared MemoryGrant Tables/Shared Pages Compare to common Linux
資工系網媒所 NEWS 實驗室 KVM Architecture