Skip to content
Snippets Groups Projects
Commit 208d325d authored by Florent Gluck's avatar Florent Gluck
Browse files

updated 02-KVM.md

parent 670af459
No related branches found
No related tags found
No related merge requests found
......@@ -856,16 +856,6 @@ if (!run->mmio.is_write) { // See struct kvm_run
[//]: # ----------------------------------------------------------------
# Device emulation
[//]: # ----------------------------------------------------------------
## Reminder: MMIO registers
When the VM is created:
- The VMM constructs the VM address space by:
- mapping the RAM into the VM address space
- if the VM exposes some device programmed through MMIO registers, it must ensure there is no memory mapping (RAM) where device registers are located:
- ensure `VMexits` (`KVM_EXIT_MMIO`) will be triggered when OS driver code read/write to these addresses (registers)
[//]: # ----------------------------------------------------------------
## Reminder: VMexits
......@@ -914,8 +904,8 @@ outb(0x3C5, 0x0F);
\footnotesize
- The code above would typically be part of the VGA driver in the guest OS
- How can the VMM emulate the behavior of a real PC running this code?
- \footnotesize by analyzing the code ran by the guest OS
- if the VMM detects the exact code above, it then emulates the behavior on the host
- \footnotesize by analyzing the sequence of VMExits triggered by the guest OS
- if the VMM detects the exact sequence of I/O registers reads/writes above, it then emulates the behavior on the host
- for instance by opening a 400x300 pixels window in which pixels will be rendered
[//]: # ----------------------------------------------------------------
......@@ -947,10 +937,10 @@ outb(0x3C5, 0x0F);
[//]: # ----------------------------------------------------------------
## Generic state machine representation (1/2)
Represent each state by a structure that defines:
**\textcolor{myblue}{Idea}**: to represent each state by a structure that defines:
- the operation to perform
- the written/read address
- the address written to/read from
- the expected written value or value to inject
- the size of the operation (8, 16, or 32 bits)
- possibly a custom user function that would be executed at the beginning or end of the state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment