mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
KVM: Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS
It's easy to confuse KVM_MEMORY_SLOTS and KVM_MEM_SLOTS_NUM. One is the user accessible slots and the other is user + private. Make this more obvious. Reviewed-by: Gleb Natapov <[email protected]> Signed-off-by: Alex Williamson <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
This commit is contained in:
parent
b7f69c555c
commit
bbacc0c111
10 changed files with 19 additions and 19 deletions
|
|
@ -771,7 +771,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
|
|||
/* Check for overlaps */
|
||||
r = -EEXIST;
|
||||
kvm_for_each_memslot(slot, kvm->memslots) {
|
||||
if (slot->id >= KVM_MEMORY_SLOTS || slot == memslot)
|
||||
if (slot->id >= KVM_USER_MEM_SLOTS || slot == memslot)
|
||||
continue;
|
||||
if (!((base_gfn + npages <= slot->base_gfn) ||
|
||||
(base_gfn >= slot->base_gfn + slot->npages)))
|
||||
|
|
@ -905,7 +905,7 @@ int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
|
|||
kvm_userspace_memory_region *mem,
|
||||
int user_alloc)
|
||||
{
|
||||
if (mem->slot >= KVM_MEMORY_SLOTS)
|
||||
if (mem->slot >= KVM_USER_MEM_SLOTS)
|
||||
return -EINVAL;
|
||||
return kvm_set_memory_region(kvm, mem, user_alloc);
|
||||
}
|
||||
|
|
@ -919,7 +919,7 @@ int kvm_get_dirty_log(struct kvm *kvm,
|
|||
unsigned long any = 0;
|
||||
|
||||
r = -EINVAL;
|
||||
if (log->slot >= KVM_MEMORY_SLOTS)
|
||||
if (log->slot >= KVM_USER_MEM_SLOTS)
|
||||
goto out;
|
||||
|
||||
memslot = id_to_memslot(kvm->memslots, log->slot);
|
||||
|
|
@ -965,7 +965,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn)
|
|||
{
|
||||
struct kvm_memory_slot *memslot = gfn_to_memslot(kvm, gfn);
|
||||
|
||||
if (!memslot || memslot->id >= KVM_MEMORY_SLOTS ||
|
||||
if (!memslot || memslot->id >= KVM_USER_MEM_SLOTS ||
|
||||
memslot->flags & KVM_MEMSLOT_INVALID)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue