os virtual machine

After taking a glance at QEMU, I decide to review this lecture to gain more understandings of virtual machine.

what and why

  1. Virtual machine: simulation of a computer
  2. Why: we want run lots of guest service in one physical machine

Trap and emulate

procedure

Page table

Shadow page table in VMM

Problem: It can’t be allowed that guest pgtbl satp escapes and modifies host pgtbl

To prevent guest escaping from VMM, guest can’t run in host supervisor mode. VMM will modify virtual state to provide illusions for guests.

device

  1. emulation: trap and emulate
  2. Virtual device: device interface is designed to decrease trap times, which saves houndreds of CPU cycles
  3. Pass-through: NIC

hardware support