diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2012-08-01 05:01:10 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-08-06 05:47:02 -0400 |
commit | aab2eb7a38e0e510874acca01838f5badbca6c7e (patch) | |
tree | b2a8b7850cb04169e0efbf9efdff1b3254d98396 /arch/x86/kvm/x86.c | |
parent | fe56097b23b1303b894eefd91582e4a64247d03f (diff) |
KVM: Stop checking rmap to see if slot is being created
Instead, check npages consistently. This helps to make rmap
architecture specific in a later patch.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3ca90d74711d..abc039d78428 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6385,7 +6385,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
6385 | *x86 needs to handle !user_alloc case. | 6385 | *x86 needs to handle !user_alloc case. |
6386 | */ | 6386 | */ |
6387 | if (!user_alloc) { | 6387 | if (!user_alloc) { |
6388 | if (npages && !old.rmap) { | 6388 | if (npages && !old.npages) { |
6389 | unsigned long userspace_addr; | 6389 | unsigned long userspace_addr; |
6390 | 6390 | ||
6391 | userspace_addr = vm_mmap(NULL, 0, | 6391 | userspace_addr = vm_mmap(NULL, 0, |
@@ -6413,7 +6413,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
6413 | 6413 | ||
6414 | int nr_mmu_pages = 0, npages = mem->memory_size >> PAGE_SHIFT; | 6414 | int nr_mmu_pages = 0, npages = mem->memory_size >> PAGE_SHIFT; |
6415 | 6415 | ||
6416 | if (!user_alloc && !old.user_alloc && old.rmap && !npages) { | 6416 | if (!user_alloc && !old.user_alloc && old.npages && !npages) { |
6417 | int ret; | 6417 | int ret; |
6418 | 6418 | ||
6419 | ret = vm_munmap(old.userspace_addr, | 6419 | ret = vm_munmap(old.userspace_addr, |