kvm_vm_ioctl_get_dirty_log(9)
π
kvm_vm_ioctl_get_dirty_log(9) π
okay so bestie, this is a page from the Kernel API Manual, section 9, and it's literally about getting and clearing the log of dirty pages in a slot. no cap, that's the whole NAME vibe. π«Ά
β¨ NAME β¨
kvm_vm_ioctl_get_dirty_log β get and clear the log of dirty pages in a slot. periodt. π
πΈ SYNOPSIS πΈ
int kvm_vm_ioctl_get_dirty_log (struct kvm *kvm , struct kvm_dirty_log
*log );
π ARGUMENTS π
kvmβ a kvm instance. that's the main character right there. πlogβ slot id and address to which we copy the log. yes, both of those things. π
π¦ DESCRIPTION π¦
Steps 1-4 below provide the general overview of dirty page logging. See the kvm_get_dirty_log_protect function description for additional details. β¨
We call kvm_get_dirty_log_protect to handle steps 1-3. Upon return, we always flush the TLB (step 4) even if the previous step failed and the dirty bitmap may be corrupt. Regardless of the previous outcome, the KVM logging API does not preclude user space subsequent dirty log read. Flushing the TLB ensures writes will be marked dirty for the next log read. π₯
β οΈ heads up: the TLB flush still happens even if the previous step failed, and the dirty bitmap may be corrupt. that's the described behavior, bestie β not me being dramatic. π
- Take a snapshot of the bit and clear it if needed. π
- Write protect the corresponding page. π‘οΈ
- Copy the snapshot to the userspace. π€
- Flush TLB's if needed. π
π SEE ALSO π
Kernel file ./virt/kvm/kvm_main.c; and the related crew: kvm_get_dirty_log(9), kvm_get_dirty_log_protect(9), kvm_clear_dirty_log_protect(9), kvm_get_running_vcpu(9), kvm_get_running_vcpus(9). π
that's the whole page, bestie! source/version: ./virt/kvm; date: October 2026; page: kvm_vm_ioctl_get_dirty_log(9) πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms