P3 L6 Virtualisation Flashcards

1
Q

What is a problem with trap-and-emulate virtualization?

A

Some privileged operations silently fail -> do not cause a trap.
Guest VM or OS thinks all worked fine though Hypervisor never received any trap, thus did not emulate jack shit.

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

Name the classic definition of a VM

A

A virtual machine is an efficient, isolated, duplicate of the real machine

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

Name goals of the VMM

A
  • fidelty (trust): the hardware (CPU, I/O devices) matches the real hardware
  • Performance similar to native
  • Safety & Isolation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Characteristics of a VMM

A
  • Provides an environment essentially identical to the original machine
  • VMM is in complete control of system resources
    • VMM determines whether a VM gets direct hardware access
  • VMM provides Isolation between VMs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantage of VMS

A
  • consolidation ==> decrease cost
  • Migration between physical hosts
    • increased reliability - can migrate my VM away from failing host
  • Availability (Spin up clones)
  • Security (Isolation)
  • Support for legacy OS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe the two models for Virtualisation

A
  1. VMM (hypervizor) based / Hypervisor Type 1
    - Not a software application that is installed on an operating system
    - Kommunizieren über eigene Hardwaretreiber direkt mit dem Hostsystem und benötigen kein anderes Betriebssystem zwischen Hardware und Hypervisor
    - Hypervisor could have a privileged VM with a common OS that includes the necessary standard device driver
  2. Hypervisor Type 2 / Hosted Model
    - Ein Hypervisor vom Typ 2 ist oberhalb eines Betriebssystems installiert und greift über die Treiber des Betriebssystems auf die Hardware des Hosts z
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name a downside of the Hypervisor type 1

A

Hardware providers need to create device drivers not only for a certain OS but also for different hypervisors.

Solution

  • Privileged service VM with common OS
    • This service OS runs all the device drivers (privileged)
    • Common OS: No need to write extra device drivers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you separate privilege levels in a host with a hypervisor of type 1?

A

4 Rings = protection levels
Some also additional distinction between root & non-root

non-root: Guest VMS
- ring 3: apps
- ring 0: OS
root: Hypervisor

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

What is trap-and-emulate

A

The technique used in mainframes for efficient virtualization. All non-privileged instructions from guest VMS run WITHOUT interference of the hypervisor (native speed).
Only priv. instructions trap to the hypervisor and need to be evaluated.

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

What is full virtualization and how is it achieved?

A

Guest OS does not need to be modified. Achieved using binary translation! At VM runtime, Translate 17 silently failing priv. operations to other non-failing statements.

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

What is paravirtualization and how does it differ from full virtualisation?

A

paravirtualization gives up on goal of full virtualisation to increase performance.

  • Guest knows it runs virtualized.
  • Guest makes explicit calls to hypervisor to perform hardware manipulations (hypercalls)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Memory virtualization - what is the difference between the virtual vs physical vs machine addresses?

A

Application on VM -> virtual addresses -> pysical addresses (PoV VM)
VMs address space is then mapped to the machines real address space.

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

What is a shadow page table and why is it required?

A

Why is the Shadow page table required?

  • Because GuestOS does not know it is virtualised and will create it’s own page table.
  • However this page table only maps to memory addresses that the VMM artificially mapped to start from 0 => expected by OS which thinks it runs on native hardware!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is special about paravirtualisation for memory?

A
  • Guest OS does NOT expect physical address space starting from address 0
  • No Need for a duplicate shadow page table!!
    • > Guest OS can just explicitly register its virtual page table with the hypervisor => REMEMBER: it knows it virtualised, therefore can just make a call to VMM to use its special features.

Another nice feature: Guest OS Hypercall to VMM to batch update new page table entries

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

What is a Hypercall / VM Exit

A

Only exist in paravirtualization!
A direct message from a Guest OS to the VMM to take advantage of Hypervisor special functionality.
Can be expensive.

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

What are the three modes of Virtualisation of Hardware?

A
  • Passthrough
  • Hypervisor Direct
  • Split Device Driver Model
17
Q

What is the advantage & disadvantage of the Passthrough Hardware virtualisation mode?

A

A:

  • VM has excusive acces
  • Bypass the VMM (Speed!)

D:

  • Device sharing not possible often
  • VMM must have EXACT device type that VM expects (e.g SSD device driver type)
  • VM migration tricky (no abstraction layer in between, dependent on specific hardware, state in the hardware itself)
18
Q

What is the advantage & disadvantage of the Hypervisor Direct - Hardware virtualisation mode?

A

A:
- VM decoupled from hardware (easy migration!, no hardware device specifics)

D:

  • Emulation overhead: SLOW / Latency due to all device operations intercepted
  • Hypervisor needs to include device drivers (often custom to VMM)
  • Adds complexity to Hypervisor itself
19
Q

What is the advantage & disadvantage of the Split Device Driver Model - Hardware virtualisation mode?

A

A:
- Eliminate Emulation overhead

  • Allow for better management of shared devices

Detailed:

Vs Direct access: Centrals decision for device requests (policy, device sharing amongst VMS) within the service VM => better decision compared to having to rely on physical device capabilities to manage sharing it amongst VMs