kvm_vm_ioctl_get_dirty_log(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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. πŸ’€
  1. Take a snapshot of the bit and clear it if needed. πŸŽ€
  2. Write protect the corresponding page. πŸ›‘οΈ
  3. Copy the snapshot to the userspace. πŸ“€
  4. 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