diff options
author | Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> | 2013-02-27 05:41:56 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-03-04 18:21:08 -0500 |
commit | 462fce46065ec4b200c08619c047b9e5a8fd154a (patch) | |
tree | c36cb39e0a8377da88b87ca5b99344357a6c31be /arch | |
parent | ee2c25efdd46d7ed5605d6fe877bdf4b47a4ab2e (diff) |
KVM: set_memory_region: Drop user_alloc from prepare/commit_memory_region()
X86 does not use this any more. The remaining user, s390's !user_alloc
check, can be simply removed since KVM_SET_MEMORY_REGION ioctl is no
longer supported.
Note: fixed powerpc's indentations with spaces to suppress checkpatch
errors.
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kvm/arm.c | 6 | ||||
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 12 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 9 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
5 files changed, 13 insertions, 26 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 5a936988eb24..24cb5f66787d 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -231,16 +231,14 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
231 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 231 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
232 | struct kvm_memory_slot *memslot, | 232 | struct kvm_memory_slot *memslot, |
233 | struct kvm_memory_slot old, | 233 | struct kvm_memory_slot old, |
234 | struct kvm_userspace_memory_region *mem, | 234 | struct kvm_userspace_memory_region *mem) |
235 | bool user_alloc) | ||
236 | { | 235 | { |
237 | return 0; | 236 | return 0; |
238 | } | 237 | } |
239 | 238 | ||
240 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 239 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
241 | struct kvm_userspace_memory_region *mem, | 240 | struct kvm_userspace_memory_region *mem, |
242 | struct kvm_memory_slot old, | 241 | struct kvm_memory_slot old) |
243 | bool user_alloc) | ||
244 | { | 242 | { |
245 | } | 243 | } |
246 | 244 | ||
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index ad3126a58644..cbc5b0417dab 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1579,8 +1579,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages) | |||
1579 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 1579 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
1580 | struct kvm_memory_slot *memslot, | 1580 | struct kvm_memory_slot *memslot, |
1581 | struct kvm_memory_slot old, | 1581 | struct kvm_memory_slot old, |
1582 | struct kvm_userspace_memory_region *mem, | 1582 | struct kvm_userspace_memory_region *mem) |
1583 | bool user_alloc) | ||
1584 | { | 1583 | { |
1585 | unsigned long i; | 1584 | unsigned long i; |
1586 | unsigned long pfn; | 1585 | unsigned long pfn; |
@@ -1610,8 +1609,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
1610 | 1609 | ||
1611 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 1610 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
1612 | struct kvm_userspace_memory_region *mem, | 1611 | struct kvm_userspace_memory_region *mem, |
1613 | struct kvm_memory_slot old, | 1612 | struct kvm_memory_slot old) |
1614 | bool user_alloc) | ||
1615 | { | 1613 | { |
1616 | return; | 1614 | return; |
1617 | } | 1615 | } |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 934413cd3a1b..22b33159fbc4 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -411,18 +411,16 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 413 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
414 | struct kvm_memory_slot *memslot, | 414 | struct kvm_memory_slot *memslot, |
415 | struct kvm_memory_slot old, | 415 | struct kvm_memory_slot old, |
416 | struct kvm_userspace_memory_region *mem, | 416 | struct kvm_userspace_memory_region *mem) |
417 | bool user_alloc) | ||
418 | { | 417 | { |
419 | return kvmppc_core_prepare_memory_region(kvm, memslot, mem); | 418 | return kvmppc_core_prepare_memory_region(kvm, memslot, mem); |
420 | } | 419 | } |
421 | 420 | ||
422 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 421 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
423 | struct kvm_userspace_memory_region *mem, | 422 | struct kvm_userspace_memory_region *mem, |
424 | struct kvm_memory_slot old, | 423 | struct kvm_memory_slot old) |
425 | bool user_alloc) | ||
426 | { | 424 | { |
427 | kvmppc_core_commit_memory_region(kvm, mem, old); | 425 | kvmppc_core_commit_memory_region(kvm, mem, old); |
428 | } | 426 | } |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 4cf35a0a79e7..07ac302ce246 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -975,8 +975,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages) | |||
975 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 975 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
976 | struct kvm_memory_slot *memslot, | 976 | struct kvm_memory_slot *memslot, |
977 | struct kvm_memory_slot old, | 977 | struct kvm_memory_slot old, |
978 | struct kvm_userspace_memory_region *mem, | 978 | struct kvm_userspace_memory_region *mem) |
979 | bool user_alloc) | ||
980 | { | 979 | { |
981 | /* A few sanity checks. We can have exactly one memory slot which has | 980 | /* A few sanity checks. We can have exactly one memory slot which has |
982 | to start at guest virtual zero and which has to be located at a | 981 | to start at guest virtual zero and which has to be located at a |
@@ -997,16 +996,12 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
997 | if (mem->memory_size & 0xffffful) | 996 | if (mem->memory_size & 0xffffful) |
998 | return -EINVAL; | 997 | return -EINVAL; |
999 | 998 | ||
1000 | if (!user_alloc) | ||
1001 | return -EINVAL; | ||
1002 | |||
1003 | return 0; | 999 | return 0; |
1004 | } | 1000 | } |
1005 | 1001 | ||
1006 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 1002 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
1007 | struct kvm_userspace_memory_region *mem, | 1003 | struct kvm_userspace_memory_region *mem, |
1008 | struct kvm_memory_slot old, | 1004 | struct kvm_memory_slot old) |
1009 | bool user_alloc) | ||
1010 | { | 1005 | { |
1011 | int rc; | 1006 | int rc; |
1012 | 1007 | ||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 811c5c9c8880..26216bb4403f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6907,8 +6907,7 @@ out_free: | |||
6907 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 6907 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
6908 | struct kvm_memory_slot *memslot, | 6908 | struct kvm_memory_slot *memslot, |
6909 | struct kvm_memory_slot old, | 6909 | struct kvm_memory_slot old, |
6910 | struct kvm_userspace_memory_region *mem, | 6910 | struct kvm_userspace_memory_region *mem) |
6911 | bool user_alloc) | ||
6912 | { | 6911 | { |
6913 | int npages = memslot->npages; | 6912 | int npages = memslot->npages; |
6914 | 6913 | ||
@@ -6938,8 +6937,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
6938 | 6937 | ||
6939 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 6938 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
6940 | struct kvm_userspace_memory_region *mem, | 6939 | struct kvm_userspace_memory_region *mem, |
6941 | struct kvm_memory_slot old, | 6940 | struct kvm_memory_slot old) |
6942 | bool user_alloc) | ||
6943 | { | 6941 | { |
6944 | 6942 | ||
6945 | int nr_mmu_pages = 0, npages = mem->memory_size >> PAGE_SHIFT; | 6943 | int nr_mmu_pages = 0, npages = mem->memory_size >> PAGE_SHIFT; |