aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-09-06 13:04:39 +0200
committerAlexander Potapenko <glider@google.com>2024-09-06 14:02:35 +0000
commit32ecc48bf9fe9bb0c29894d3745bcfa9e04c14d4 (patch)
tree83b189f819c87a41734256874a3cb44eb983ae21 /sys
parenta16d0c77f3afa6e3d1bc0ead44848f51f9cfd4cc (diff)
sys/linux/dev_kvm.txt: declare KVM_CLEAR_DIRTY_LOG
Diffstat (limited to 'sys')
-rw-r--r--sys/linux/dev_kvm.txt11
-rw-r--r--sys/linux/dev_kvm.txt.const1
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/linux/dev_kvm.txt b/sys/linux/dev_kvm.txt
index 81fbda5f3..29217685b 100644
--- a/sys/linux/dev_kvm.txt
+++ b/sys/linux/dev_kvm.txt
@@ -31,6 +31,7 @@ ioctl$KVM_GET_API_VERSION(fd fd_kvm, cmd const[KVM_GET_API_VERSION], type const[
ioctl$KVM_CREATE_VCPU(fd fd_kvmvm, cmd const[KVM_CREATE_VCPU], id intptr[0:2]) fd_kvmcpu
ioctl$KVM_CHECK_EXTENSION_VM(fd fd_kvmvm, cmd const[KVM_CHECK_EXTENSION], arg intptr)
ioctl$KVM_GET_DIRTY_LOG(fd fd_kvmvm, cmd const[KVM_GET_DIRTY_LOG], arg ptr[in, kvm_dirty_log])
+ioctl$KVM_CLEAR_DIRTY_LOG(fd fd_kvmvm, cmd const[KVM_CLEAR_DIRTY_LOG], arg ptr[in, kvm_clear_dirty_log])
ioctl$KVM_CREATE_IRQCHIP(fd fd_kvmvm, cmd const[KVM_CREATE_IRQCHIP])
ioctl$KVM_IRQ_LINE(fd fd_kvmvm, cmd const[KVM_IRQ_LINE], arg ptr[in, kvm_irq_level])
ioctl$KVM_IRQ_LINE_STATUS(fd fd_kvmvm, cmd const[KVM_IRQ_LINE_STATUS], arg ptr[in, kvm_irq_level])
@@ -870,6 +871,16 @@ kvm_dirty_log {
bitmap vma64
}
+# num_pages and first_page must be multiples of 64,
+# see https://docs.kernel.org/virt/kvm/api.html#kvm-clear-dirty-log-vm-ioctl
+kvm_clear_dirty_log {
+ slot flags[kvm_mem_slots, int32]
+ num_pages int32[0:1024, 64]
+ first_page int32[0:1024, 64]
+# Allocate 1024 bits regardless of num_pages.
+ bitmap ptr[in, array[int64, 128]]
+}
+
kvm_msr_list {
n len[indices, int32]
indices array[const[0, int32]]
diff --git a/sys/linux/dev_kvm.txt.const b/sys/linux/dev_kvm.txt.const
index 377db5990..1b4f89525 100644
--- a/sys/linux/dev_kvm.txt.const
+++ b/sys/linux/dev_kvm.txt.const
@@ -54,6 +54,7 @@ KVM_CAP_X86_BUS_LOCK_EXIT = 193
KVM_CAP_X86_DISABLE_EXITS = 143
KVM_CAP_X86_USER_SPACE_MSR = 188
KVM_CHECK_EXTENSION = 44547, mips64le:ppc64le:536915459
+KVM_CLEAR_DIRTY_LOG = 3222843072
KVM_CPUID_FEATURES = 1073741825, arm64:mips64le:ppc64le:s390x:???
KVM_CPUID_FLAG_SIGNIFCANT_INDEX = 1, arm64:mips64le:ppc64le:s390x:???
KVM_CPUID_FLAG_STATEFUL_FUNC = 2, arm64:mips64le:ppc64le:s390x:???