Skip to content

Commit e2788c4

Browse files
committed
Documentation: kvm: clarify KVM_SET_USER_MEMORY_REGION
The documentation does not mention how to delete a slot, add the information. Reported-by: Nathaniel McCallum <npmccallum@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 919f6cd commit e2788c4

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Documentation/virtual/kvm/api.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,14 +1114,12 @@ struct kvm_userspace_memory_region {
11141114
#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
11151115
#define KVM_MEM_READONLY (1UL << 1)
11161116

1117-
This ioctl allows the user to create or modify a guest physical memory
1118-
slot. When changing an existing slot, it may be moved in the guest
1119-
physical memory space, or its flags may be modified. It may not be
1120-
resized. Slots may not overlap in guest physical address space.
1121-
Bits 0-15 of "slot" specifies the slot id and this value should be
1122-
less than the maximum number of user memory slots supported per VM.
1123-
The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
1124-
if this capability is supported by the architecture.
1117+
This ioctl allows the user to create, modify or delete a guest physical
1118+
memory slot. Bits 0-15 of "slot" specify the slot id and this value
1119+
should be less than the maximum number of user memory slots supported per
1120+
VM. The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
1121+
if this capability is supported by the architecture. Slots may not
1122+
overlap in guest physical address space.
11251123

11261124
If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
11271125
specifies the address space which is being modified. They must be
@@ -1130,6 +1128,10 @@ KVM_CAP_MULTI_ADDRESS_SPACE capability. Slots in separate address spaces
11301128
are unrelated; the restriction on overlapping slots only applies within
11311129
each address space.
11321130

1131+
Deleting a slot is done by passing zero for memory_size. When changing
1132+
an existing slot, it may be moved in the guest physical memory space,
1133+
or its flags may be modified, but it may not be resized.
1134+
11331135
Memory for the region is taken starting at the address denoted by the
11341136
field userspace_addr, which must point at user addressable memory for
11351137
the entire memory slot size. Any object may back this memory, including

0 commit comments

Comments
 (0)