Skip to content

Instantly share code, notes, and snippets.

View tan-yue's full-sized avatar

Yue Tan tan-yue

View GitHub Profile
@tan-yue
tan-yue / kvm_mmu_note.md
Last active November 13, 2023 06:00
kvm_mmu

KVM MMU Note

TL;DR

The note first lists KVM data structures related to mmu and then writes about what happens to these data structures at each step of creating and running a virtual machine. The goal of the note is to help implement prefilling EPT. The plan is to reuse the page fault handler to cause pre-faults to the pages in the memory dump. For purpose of prototyping, I plan to first use hardcode values instead of changing the KVM api. I imagine to prefill EPT requires userspace to pass in the list of guest physical addresses that should be pre-faulted.

Why prefill EPT?

Data Structures

  1. mmu page header struct kvm_mmu_page
struct kvm_mmu_page {