Docsity

Virtual Machines: Understanding Resource Virtualization in EECS 700 - Prof. Prasad Kulkarn, Assignments of Deductive Database Systems

Partial preview of the text

Download Virtual Machines: Understanding Resource Virtualization in EECS 700 - Prof. Prasad Kulkarn and more Assignments Deductive Database Systems in PDF only on Docsity!

System Virtual Machines

  • Introduction
  • Key concepts
  • Resource virtualization
    • processors
    • memory
    • I/O devices
  • Performance issues
  • Applications

Introduction

  • System virtual machine
    • capable of supporting multiple system images
    • each guest OS manages a set of virtualized hardware resources
    • VMM owns the real system resources
    • VMM allocates resources to guest OS by partitioning or time-sharing
    • guest OS allocates resources to its user programs
    • each virtual resource may not have physical resource
    • see Figure 8.

Key Concepts

  • Outward appearance
  • State management
  • Resource control
  • Native and hosted virtual machines
  • Several concepts are simplified
    • same guest and host ISA
    • uniprocessor systems

Outward Appearance

  • Create an illusion of multiple machines.
  • Illusion in software
    • no replication of hardware resources
    • switch to move devices from one VM to the other
  • Replication of hardware resources
    • devices used directly by each user are replicated
    • rest of the hardware is shared
  • Hosted VM
    • one OS more important than the other
    • UI of host OS provides way to display UI of the second

State Management (2)

Processor VMM Memory Register values for VM 1 Register values for VM 2 Register values for VM 3 Register Block Pointer VMM Memory Processor Processor Registers Register values for VM 1 Register values for VM 2 Register values for VM 3

Resource Control

  • Refers to how the VMM maintains overall control of all hardware resources.
  • Scheme similar to time-sharing OS
    • VMM intercept accesses to privileged resources
    • get control on all privileged instructions
    • VMM handles the timer interrupt (Figure 8.4)
    • similar tradeoffs between fair scheduling and large switching overhead

Native and Hosted VM

  • Refers to the runtime privilege level of the VMM (and OS). - for efficiency, some part of VMM should have higher privileges
  • Figure 8.
    • analogous relationship to OS and user programs
    • native VM system: only the VMM operates in privilege mode
    • hosted VM: VMM installed on top of existing OS
      • some or no part of VMM in privilege mode

Native and Hosted VM (2)

Non-privileged modes Privileged Mode Applications OS Traditional uniprocessor system Hardware Virtual Machine VMM Hardware Virtual Machine Host OS Hardware VMM Virtual Machine Host OS Hardware VMM Native VM system User-mode Hosted VM system Dual-mode Hosted VM system

Conditions for ISA Virtualizability

  • Conditions laid out by Popek and Goldberg.
  • Assume native system VMs
    • VMM runs in system mode
    • all other software runs in user mode
  • Other assumptions
    • hardware consists of processor and uniformly addressable memory
    • processor can operate in two modes, user and system
    • some subset of instructions only available in system mode
    • relocation register available for memory addressing

Privileged Instructions

  • Instructions that trap if the machine is in user mode, and does not trap if the machine is in system mode.
  • LPSW (Load Processor Status Word)
  • PSW can change the state of the CPU
  • can also change the instruction address (PC)
  • SPT (Set CPU Timer)
  • can change the CPU interval timer

Sensitive Instructions

  • These specify instructions that interact with hardware.
  • Control-sensitive instructions
    • can change the configuration of system resources
    • e.g., physical memory assigned to a program
    • e.g., LPSW – change mode of operation
    • e.g., SPT – change CPU timer value

Sensitive Instructions (cont…)

  • Behavior-sensitive instructions
    • behavior or results depend on configuration of resources
    • e.g., LRA – depends on mapping (state) of real memory resource
    • e.g., POPF – depends on mode of operation
  • Innocuous instructions
    • neither context-sensitive nor behavior-sensitive
  • see Figure 8.

Components of a VMM

Instruction trap occurs Dispatcher Allocator Interpreter Routine 2 Interpreter Routine 1 Interpreter Routine n These instructions desire to change machine resources, e.g. Load Relocation Bounds Register These instructions do not change machine resources, but access privileged resources, e.g. IN, OUT, Write TLB Privileged Instruction Privileged Instruction Privileged Instruction Privileged Instruction

Components of a VMM (2)

  • Dispatcher
    • control module, called on hardware traps
    • decides the next module to be invoked
  • Allocator
    • decides allocation of system resources
    • invoked by dispatcher to change machine resource allocation for VMs
  • Interpreter routines
    • emulates trap functionality for each user VM
    • all traps except resource re-assignment traps