Virtualization Flashcards

1
Q

What are the two kinds of hypervisors?

A
  • Bare metal/Native: hypervisor between shared hardware and guest OS
  • Hosted: hypervisor runs on top of OS, then hosts other OSes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the characteristics of full virtualization?

A
  • Guest metal has no idea they are running on hypervisor
  • Binaries do not change
  • Only hypervisor keeps mapping between physical and machine pages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is “trap and emulate”?

A
  • OS tries to run something in the kernel from user mode

- Hypervisor traps this and executes it for the guest OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the characteristics of paravirtualization?

A
  • Must modify binaries to have hypervisor code in order to let it access the hypervisor more easily
  • Guest OS or hypervisor keeps mapping between physical and machine pages (normally guest OS)
  • More room for innovation
  • Guest OS is aware of the hypervisor
  • Guest OS is aware that physical memory may not be contiguous
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the goals of virtualization?

A
  • Virtualize hardware

- Effect data and control between guests and hypervisor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does a hypervisor handle memory hierarchy?

A
  • Normally handled by OS (each process has its own memory space)
  • In hypervisor, each process is in its own protection domain (distinct page table in their OS)
  • OS will have its own page table
  • OS viewed as a process in the hypervisor
  • Hypervisor takes care of virtual to physical page table translation via Shadow Page Table
  • CPU uses page table for address translation (hardware PT is really the S-PT)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the order of page table mappings on a hypervisor? ( Full Virtualization)

A
  • Virtual Page
  • Page Table (on guest OS)
  • Physical Page
  • Shadow Page Table (on hypervisor)
  • Machine Page
  • TLB Hardware Page Table store mapping of Virtual Page to Machine Page (privileged instruction)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How is virtual/physical memory viewed by the different parties in a virtualized system? ( Full Virtualization)

A
  • Virtual memory is an illusion of the user
  • Physical memory is an illusion of the guest OS
  • Memory allocated to each VM is not contiguous
  • Physical memory page is mapped to machine page through S-PT by hypervisor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How big is the shadow page table? ( Full Virtualization)

A
  • As big as the number of processors instantiated by the guest OS
  • One S-PT per guest OS running
  • On context switches, pointer of entry point into the S-PT changes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is memory mapping handled in a paravirtualized system?

A
  • Burden is shifted to the guest OS
  • Guest OS maintains contiguous physical memory
  • Guest OS maps physical memory to discontiguous hardware pages
  • Guest OS hypercalls to hypervisor to switch/create/switch page table
  • Dynamically increase memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is ballooning?

A

When an OS needs more memory, hypervisor can dynamically adjust the amount of memory a guest OS has

Needs device driver installed in OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is inflating? (Ballooning)

A

Hypervisor/house increases memory → pages out to disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is deflating? (Ballooning)

A

Hypervisor/house decreases memory → page in from disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How are pages shared across VMs? (Oblivious Page Sharing)

A
  • Works on both full and paravirtualized systems
  • Hash contents of page on hypervisor
  • On new page read, hash and see if it matches a hash already stored
  • If hashes match, do a full comparison to see if there are any changes
  • If page matches, update page table to remove duplicate values
  • If changes are made, mark page as copy on write to update
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are memory allocation policies?

A
  • Pure share based approach
  • Working set based approach
  • Dynamic idle-adjusted shares approach
  • Reclaim most idle memory (tax idle pages more than active pages)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How are CPUs virtualized?

A
  • Illusion of ownership of CPU for each VM
  • Hypervisor can do either proportional share or fair share
  • Address translation done on every memory address
  • Events delivered as software interrupts
  • For paravirtualization: guest OS has API to communication
17
Q

What are the two parts to device virtualization?

A
  • Data transfer: write to disk

- Control transfer: transfer between guest OS and hypervisor

18
Q

How is device virtualization handled in full virtualization?

A
  • “Trap and emulate”

Control Transfer:

  • Implicit control transfer via traps (guest to hypervisor)
  • Software interrupts via events (hypervisor to guest)

Data Transfer: Implicit

19
Q

How is device virtualization handled in paravirtualization?

A
  • Shared data structures through shared buffers accessible via API
  • Room for innovation here

Control Transfer:

  • Explicit control transfer via hypercalls (guest to hypervisor)
  • Software interrupts (hypervisor to guest)

Data Transfer: Explicit

20
Q

What are the characteristics of Xen’s Async I/O Rings?

A
  • For each guest OS
  • Contains all requests to hypervisor
  • Hypervisor returns results to ring spot of request
  • No mutual exclusion issues due to restrictions on pointers in the rings
21
Q

What are the different types of Xen’s Async I/O Rings?

A
  • Request producer: shared, updated by guest
  • Request consumer: private to Xen
  • Response producer: shared, updated by Xen
  • Response consumer: private to guest
22
Q

What is the difference between virtualization and extensible OSes?

A

Focus on protection and flexibility

23
Q

What is the shadow page table?

A
  • Data structure that maps physical page table and machine pages
  • Maintained by hypervisor or virtual machine monitor
  • Used by architecture for address translation
  • Hypervisor stores VPN to MPN mapping as entries
24
Q

How are page faults handled in virtualization?

A
  • CPU provides faulting virtual address to hypervisor
  • Hypervisor identifies guest OS that faulting process belongs to
  • Hypervisor delivers a software interrupt to guest OS
  • Guest OS handles page fault
  • Once virtual to physical page mapping established, mapping recorded in page table of faulting process
  • Mapping is then recorded in hardware PT/TLB
  • Faulting process resumes
25
Q

How is memory shared across VMs?

A
  • Share pages across virtual machines

- VMs and hypervisor cooperate to allow processes to point to same machine page