提交 e2788c4a 编写于 作者: P Paolo Bonzini

Documentation: kvm: clarify KVM_SET_USER_MEMORY_REGION

The documentation does not mention how to delete a slot, add the
information.
Reported-by: NNathaniel McCallum <npmccallum@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 919f6cd8
...@@ -1114,14 +1114,12 @@ struct kvm_userspace_memory_region { ...@@ -1114,14 +1114,12 @@ struct kvm_userspace_memory_region {
#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
#define KVM_MEM_READONLY (1UL << 1) #define KVM_MEM_READONLY (1UL << 1)
This ioctl allows the user to create or modify a guest physical memory This ioctl allows the user to create, modify or delete a guest physical
slot. When changing an existing slot, it may be moved in the guest memory slot. Bits 0-15 of "slot" specify the slot id and this value
physical memory space, or its flags may be modified. It may not be should be less than the maximum number of user memory slots supported per
resized. Slots may not overlap in guest physical address space. VM. The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
Bits 0-15 of "slot" specifies the slot id and this value should be if this capability is supported by the architecture. Slots may not
less than the maximum number of user memory slots supported per VM. overlap in guest physical address space.
The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS,
if this capability is supported by the architecture.
If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot" If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot"
specifies the address space which is being modified. They must be 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 ...@@ -1130,6 +1128,10 @@ KVM_CAP_MULTI_ADDRESS_SPACE capability. Slots in separate address spaces
are unrelated; the restriction on overlapping slots only applies within are unrelated; the restriction on overlapping slots only applies within
each address space. each address space.
Deleting a slot is done by passing zero for memory_size. When changing
an existing slot, it may be moved in the guest physical memory space,
or its flags may be modified, but it may not be resized.
Memory for the region is taken starting at the address denoted by the Memory for the region is taken starting at the address denoted by the
field userspace_addr, which must point at user addressable memory for field userspace_addr, which must point at user addressable memory for
the entire memory slot size. Any object may back this memory, including the entire memory slot size. Any object may back this memory, including
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册