aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/booke.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2012-09-11 09:27:46 -0400
committerAlexander Graf <agraf@suse.de>2012-10-05 17:38:51 -0400
commita66b48c3a39fa1c4223d4f847fdc7a04ed1618de (patch)
tree2ee5d3e474001b19053b9f905ad4f4fd26c74551 /arch/powerpc/kvm/booke.c
parent2c9097e4c1340208ef93371abd4b3bd7e989381b (diff)
KVM: PPC: Move kvm->arch.slot_phys into memslot.arch
Now that we have an architecture-specific field in the kvm_memory_slot structure, we can use it to store the array of page physical addresses that we need for Book3S HV KVM on PPC970 processors. This reduces the size of struct kvm_arch for Book3S HV, and also reduces the size of struct kvm_arch_memory_slot for other PPC KVM variants since the fields in it are now only compiled in for Book3S HV. This necessitates making the kvm_arch_create_memslot and kvm_arch_free_memslot operations specific to each PPC KVM variant. That in turn means that we now don't allocate the rmap arrays on Book3S PR and Book E. Since we now unpin pages and free the slot_phys array in kvmppc_core_free_memslot, we no longer need to do it in kvmppc_core_destroy_vm, since the generic code takes care to free all the memslots when destroying a VM. We now need the new memslot to be passed in to kvmppc_core_prepare_memory_region, since we need to initialize its arch.slot_phys member on Book3S HV. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r--arch/powerpc/kvm/booke.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 5f0476a602d8..514405752988 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -1438,7 +1438,19 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
1438 return -ENOTSUPP; 1438 return -ENOTSUPP;
1439} 1439}
1440 1440
1441void kvmppc_core_free_memslot(struct kvm_memory_slot *free,
1442 struct kvm_memory_slot *dont)
1443{
1444}
1445
1446int kvmppc_core_create_memslot(struct kvm_memory_slot *slot,
1447 unsigned long npages)
1448{
1449 return 0;
1450}
1451
1441int kvmppc_core_prepare_memory_region(struct kvm *kvm, 1452int kvmppc_core_prepare_memory_region(struct kvm *kvm,
1453 struct kvm_memory_slot *memslot,
1442 struct kvm_userspace_memory_region *mem) 1454 struct kvm_userspace_memory_region *mem)
1443{ 1455{
1444 return 0; 1456 return 0;