10. User space Kernel space Guest Mode
1. VM initialization
2. Return to QEMU
3. Run VM
4. Enter Guest
5. Exit Guest
Lightweight trap
Enter Guest
Heavyweight trap
Exit Guest
Return to QEMU
Run VM
Enter Guest
QEMU KVM Guest OS
20. Shadow Page Tables
Map guest virtual address to host physical
address
For each guest page table (GPT), ARMvisor
will allocate a shadow page table (SPT) to
map it.
20
21. Guest
PTB GVA
GPA
Host
HVA PTB
New SPTE !!!
HPA
21
23. Shadow Page Tables
Map guest virtual address to host physical
address
For each guest page table (GPT), ARMvisor
will allocate a shadow page table (SPT) to
map it.
How to keep coherence between SPT and
GPT?
23
24. Synchronization
Write protect page table page
Modification would cause a protection fault.
Reverse map (RMAP) : Record reverse mapping
form guest physical page to SPT entries
25
25. Permission Emulation (1)
Guest OS in non-privileged mode
Some instructions access kernel space with
user permission
LDRBT, LDRT, STRBT, STRT
Double shadow page table
26
29. Virtualization Overhead -CPU
CPU virtualization
Frequent lightweight traps result lots of context
switch
Try to reduce…
number of traps
Overhead of emulation
31
30. CPU Optimization
Shadow file register (SFR)
Map VCPU’s shadow state of the register file into
memory region that is both accessible for the
VMM and guest with RW permission.
33
32. CPU Optimization
Shadow file register (SFR)
Map VCPU’s shadow state of the register file into
memory region that is both accessible for the
VMM and guest with RW permission.
Para-virtualization: Fast instruction trap
Sets of pre-defined macros which is composed of
encoded information of the replaced instructions.
36