Virtual machine systems: simulators for multiple copies of a ...
-
Upload
cameroon45 -
Category
Technology
-
view
333 -
download
2
Transcript of Virtual machine systems: simulators for multiple copies of a ...
Virtual machine systems: simulators for multiple Virtual machine systems: simulators for multiple copies of a machine on itself. copies of a machine on itself.
Virtual machine (VM): the simulated machine. Virtual machine (VM): the simulated machine. Virtual machine monitor (VMM): the simulator Virtual machine monitor (VMM): the simulator
software. software. Pure software simulator is too slow; Direct Pure software simulator is too slow; Direct
hardware execution is necessary hardware execution is necessary Complicated when OS involved; especially with Complicated when OS involved; especially with
multiple OS; build separate VMM layer multiple OS; build separate VMM layer
Virtual Machine - Introduction
CDA6159fa07 peir
Principal characteristics of the original (IBM 360) Principal characteristics of the original (IBM 360) architectures for which virtual machine systems architectures for which virtual machine systems were developed was the dual-state hardware were developed was the dual-state hardware organization with a privileged and non-privileged organization with a privileged and non-privileged mode. mode.
Privileged software nucleus (kernel) Privileged software nucleus (kernel) Extended machine: set of non-privileged Extended machine: set of non-privileged
instructions together with the supervisory calls. instructions together with the supervisory calls. VMM runs on privileged mode, while guest OS VMM runs on privileged mode, while guest OS
runs on non-privileged moderuns on non-privileged mode
Virtual Machine - Introduction
CDA6159fa07 peir
Survey of Virtual Machine ResearchIEEE Computer, 1974
Conventional and Virtual Machine Organizations
Flexible Virtual Machine Model
The Renaissance of Virtualization- X86 Prospective from VMware
CDA6159fa07 peir
1970s: Virtual machines first used
1990s: x86 becomes prominent server platform, not
design for virtualization No vertical integration in x86 Lack of enterprise features in commodity OSs
1999: VMWare first product to virtualize x86
2006: AMD and Intel offer hardware support
Extra resources needed: main memory, Extra resources needed: main memory, processor cycles. processor cycles.
Sources of overhead: Sources of overhead: Maintaining the status of the virtual processor. Maintaining the status of the virtual processor. Support of privileged instructions. Support of privileged instructions. Support of paging within virtual machines. Support of paging within virtual machines. Console functions. Console functions.
A problem: resource allocation algorithms in A problem: resource allocation algorithms in operating system (these are meant for operating system (these are meant for managing real resources, but the virtual managing real resources, but the virtual resources may not correspond precisely to resources may not correspond precisely to real resources). real resources).
Virtual Machine - Performance
CDA6159fa07 peir
Privileged software development, test and Privileged software development, test and diagnostic functions, multiple operating system diagnostic functions, multiple operating system execution concurrently with production uses of execution concurrently with production uses of the system. the system.
Retrofit old operating systems with new Retrofit old operating systems with new features. features.
Improved testing of privileged software. Improved testing of privileged software. Testing of computer network software on a Testing of computer network software on a
single physical machine. single physical machine. Debugging and performance monitoring tools. Debugging and performance monitoring tools. Software reliability through isolation. Software reliability through isolation. Data security. Data security.
Virtual Machine - Applications
CDA6159fa07 peir
Basic Computer Systems
Hardware / Software Interface
3: “system” ISA: I/O, memory mgmt, CPU intercept & emulate4: “user” ISA: ALU, branch, load/store direct execution
Basic VM Architecture
CDA6159fa07 peir
Classic VMs are enabled by “Virtual Machine Monitor” (VMM) software– VMM may be in total control of the underline
physical machine • No O/S below the VMM– Or, VMM may share the physical machine with
a “host” operating system • VMM runs on top of host O/S (with user-level
processes, as well as with kernel code, e.g. modules)
Classic VMM
VMM Integrated with Host OS
Advantages: Simple to install VMM, hosted OS accommodate rich I/O devices, take
advantage hosted OS’ resource management Disadvantages:
Performance overhead, no performance isolation
Present a “replica” of the interfaces to Hardware provided by physical machine to each VM
– Interface to processor (i.e. instruction set)– Interface to memory (i.e. use physical memory
addresses)– Interface to I/O devices (e.g. memory mapped
I/O, interruptions)* Different views of physical I/O device
possible; e.g. a SCSI physical disk may be viewed as many virtual IDE disks
Fundamental task of VM monitor
CDA6159fa07 peir
Analogy with operating systems:– Most application instructions execute directly on
processor (O/S does not see them)– Those that require access to shared resources are
handled indirectly by calling the O/S via system calls VMM:
– Most application instructions execute directly on processor (VMM does not see them)
– Those that require privileged processor access are handled indirectly – they are trapped and emulated by the VMM
VMM – Processor Virtualization
CDA6159fa07 peir
Challenges and Techniques
X86 architecture is not designed for virtualization POPF (pop CPU flags from stack) set / clear interrupt-
disable flag; does not trap in user mode in guest OS Paravirtualization
Replace nonvirtualizable instructions with virtualized equivalent
OS must be ported in order to run in a virtual machine Disco (for MIPS) changes MIPS interrupt flag from a
privileged register to a special memory location
Aided by processor’s ability to support virtual memory
One more level of indirection is implemented– O/S: application loads/stores virtual address; map to
physical addresses of physical machine– Classic VM: application loads/stores virtual address;
map to physical address of the VM; then map to physical address of physical machine
VMM - Memory Virtualization
CDA6159fa07 peir
Page Replication and Page Sharing in Disco
VMM - I/O Virtualization
Hosted versus non-hosted
– Non-hosted: VMM must implement drivers for each device Since it interfaces directly with hardware; must go through VMM, incur overhead
– Hosted: VMM may build on top of existing device drivers of host O/S • E.g. VMware: low-level I/O accesses to virtual disk are mapped into accesses to a regular file of the host via system calls
• Host O/S drivers, in turn, maps to I/O accesses to physical disk