This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
To virtualize means to take something of one form and makeit appear to be another form.[1]
To make a computer appear to be multiple computers or adifferent computer entirely.To making many computers appear to be a single computer.(Server Aggregation/Grid Computing)
ISA Instruction Set Architecture.The ISA marks the division be-tween hardware and software,and consists of interfaces 3and 4. Interface 4 representsthe user ISA and includes thoseaspects visible to an applica-tion program. Interface 3, thesystem ISA, is a superset of theuser ISA and includes those as-pects visible only to operatingsystem software responsible formanaging hardware resources.
ABI Application Binary Interface.The ABI gives a program accessto the hardware resources andservices available in a sys-tem through the user ISA (in-terface 4) and the system callinterface (interface 2). TheABI does not include system in-structions; rather, all appli-cation programs interact withthe hardware resources indi-rectly by invoking the operat-ing system’s services via thesystem call interface.
API Application Programming Inter-face.The API gives a program accessto the hardware resources andservices available in a sys-tem through the user ISA (in-terface 4) supplemented withhigh-level language (HLL) li-brary calls (interface 1). Anysystem calls are usually per-formed through libraries. Us-ing an API enables applicationsoftware to be ported easily,through recompilation, to othersystems that support the sameAPI.陈志杰 [email protected] 蜜网项目组
A process VM is a virtual platform that executes an in-dividual process. This type of VM exists solely to supportthe process; it is created when the process is created andterminates when the process terminates. The virtualizingsoftware that implements a process VM is often termed theruntime, short for “runtime software.”
A system VM provides a complete, persistent system en-vironment that supports an operating system along with itsmany user processes. It provides the guest operating systemwith access to virtual hardware resources, including net-working, I/O, and perhaps a graphical user interface alongwith a processor and memory. The virtualizing software ina system VM is typically referred to as the virtual machinemonitor (VMM).
Multiprogrammed systems :The most common process VM.
Emulators and dynamic binary translators More challeng-ing problem for process-level VMs is that of supportingprogram binaries compiled to an instruction set differentfrom the one the host executes. eg: Intel IA32-EL whichallows Intel IA-32 application binaries to run on Itaniumhardware.
Same-ISA binary optimizers Dynamo system.
High-level-language VMs The Sun Microsystems Java VMarchitecture and the Microsoft Common Language Infrastruc-ture.注:HLL environment 仅指需要runtime的语言。
The classic approach places the VMM on bare hardware andthe VMs fit on top.
The VMM runs in the most highly privileged mode, whileall guest systems run with reduced privileges so that theVMM can intercept and emulate all guest operating systemactions that would normally access or manipulate criticalhardware resources.
An alternative system VM implementation builds virtualiz-ing software on top of an existing host operating system,resulting in a hosted VM.
Advantage:A user installs it just like a typical application program.Virtualizing software can rely on the host operating systemto provide device drivers and other lower-level servicesrather than on the VMM.Virtualizing software can rely on thehost operating system to provide device drivers and otherlower-level services rather than on the VMM.
Here, an important objective is to partition the large sys-tem into multiple smaller multiprocessor systems by dis-tributing the underlying hardware resources of the largesystem.
Codesigned VMs implement new, proprietary ISAs targeted atimproving performance, power efficiency, or both.
Perhaps the best-known example of a codesigned VM is theTransmeta Crusoe.11 In this processor, the underlying hard-ware uses a very-long instruction word architecture, andthe guest ISA is the Intel IA-32. The Transmeta design-ers focused on the power-saving advantages of simpler VLIWhardware.
Executing the virtual machine on the real machine, whileletting the VMM retain ultimate control of the CPU.
A CPU architecture is virtualizable only if it supports thebasic VMM technique of direct execution.
Requires running the virtual machine’s privileged (operating-system kernel) and unprivileged code in the CPU’s unpriv-ileged mode, while the VMM runs in privileged mode.Thus,when the virtual machine attempts to perform a privilegedoperation, the CPU traps into the VMM.
对于x86架构:”Certain privileged-mode instructions do nottrap, and can return different results based upon themode.”
如:An instruction that disables interruptsLetting a guest operating system disable interrupts wouldnot be safe since the VMM could not regain control of theCPU.Instead, the VMM would trap the operation to disableinterrupts and then record that interrupts were disabledfor that virtual machine.
Unprivileged instructions let the CPU access privilegedstate.
这样由于是虚拟的缘故(GuestOS运行在用户态),会得到“错误”的 当前运行级的信息。
Software running in the virtual machine can read the codesegment register to determine the processor’s currentprivilege level. But the x86 doesn’t trap the instruc-tion, so with direct execution, the software would see thewrong privilege level in the code segment register.
ParavirtualizationWith paravirtualization, the VMM builder defines the vir-tual machine interface by replacing nonvirtualizable por-tions of the original instruction set with easily virtual-ized and more efficient equivalents.缺点: Operating systems must be ported to run in a virtualmachine.
Direct execution + Fast binary translation (Vmware、QEMU)对 User Mode 的程序 direct execution , 对 kernel mode 的代码“打补 丁”.
Intel Vanderpool technology and AMD Pacifica technology.
Maintain a shadow of the virtual machine’s memory-managementdata structure.
When the operating system running in a virtual machineestablishes a mapping in its page table, the VMM detectsthe changes and establishes a mapping in the correspondingshadow page table entry that points to the actual pagelocation in the hardware memory.