diff options
author | Paul Mackerras <paulus@samba.org> | 2011-06-28 20:19:22 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:50 -0400 |
commit | f9e0554deca54a42fb2cf7f68c05a4a37461c205 (patch) | |
tree | e81771fec16fe3d4466e51f902ccf8ccd3e85c14 /arch | |
parent | 3cf658b605393d793ea52416c2306b86fbde9d9a (diff) |
KVM: PPC: Pass init/destroy vm and prepare/commit memory region ops down
This arranges for the top-level arch/powerpc/kvm/powerpc.c file to
pass down some of the calls it gets to the lower-level subarchitecture
specific code. The lower-level implementations (in booke.c and book3s.c)
are no-ops. The coming book3s_hv.c will need this.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 7 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 20 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 20 | ||||
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 9 |
4 files changed, 53 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index c662f140283a..9b6f3f99c5eb 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -111,6 +111,13 @@ extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); | |||
111 | extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu); | 111 | extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu); |
112 | extern void kvmppc_map_magic(struct kvm_vcpu *vcpu); | 112 | extern void kvmppc_map_magic(struct kvm_vcpu *vcpu); |
113 | 113 | ||
114 | extern int kvmppc_core_init_vm(struct kvm *kvm); | ||
115 | extern void kvmppc_core_destroy_vm(struct kvm *kvm); | ||
116 | extern int kvmppc_core_prepare_memory_region(struct kvm *kvm, | ||
117 | struct kvm_userspace_memory_region *mem); | ||
118 | extern void kvmppc_core_commit_memory_region(struct kvm *kvm, | ||
119 | struct kvm_userspace_memory_region *mem); | ||
120 | |||
114 | /* | 121 | /* |
115 | * Cuts out inst bits with ordering according to spec. | 122 | * Cuts out inst bits with ordering according to spec. |
116 | * That means the leftmost bit is zero. All given bits are included. | 123 | * That means the leftmost bit is zero. All given bits are included. |
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index fcdc97eb9411..72b20b8749fa 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
@@ -984,6 +984,26 @@ int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | |||
984 | return ret; | 984 | return ret; |
985 | } | 985 | } |
986 | 986 | ||
987 | int kvmppc_core_prepare_memory_region(struct kvm *kvm, | ||
988 | struct kvm_userspace_memory_region *mem) | ||
989 | { | ||
990 | return 0; | ||
991 | } | ||
992 | |||
993 | void kvmppc_core_commit_memory_region(struct kvm *kvm, | ||
994 | struct kvm_userspace_memory_region *mem) | ||
995 | { | ||
996 | } | ||
997 | |||
998 | int kvmppc_core_init_vm(struct kvm *kvm) | ||
999 | { | ||
1000 | return 0; | ||
1001 | } | ||
1002 | |||
1003 | void kvmppc_core_destroy_vm(struct kvm *kvm) | ||
1004 | { | ||
1005 | } | ||
1006 | |||
987 | static int kvmppc_book3s_init(void) | 1007 | static int kvmppc_book3s_init(void) |
988 | { | 1008 | { |
989 | int r; | 1009 | int r; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 9f2e4a5e1c4d..9066325b23b2 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -865,6 +865,26 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log) | |||
865 | return -ENOTSUPP; | 865 | return -ENOTSUPP; |
866 | } | 866 | } |
867 | 867 | ||
868 | int kvmppc_core_prepare_memory_region(struct kvm *kvm, | ||
869 | struct kvm_userspace_memory_region *mem) | ||
870 | { | ||
871 | return 0; | ||
872 | } | ||
873 | |||
874 | void kvmppc_core_commit_memory_region(struct kvm *kvm, | ||
875 | struct kvm_userspace_memory_region *mem) | ||
876 | { | ||
877 | } | ||
878 | |||
879 | int kvmppc_core_init_vm(struct kvm *kvm) | ||
880 | { | ||
881 | return 0; | ||
882 | } | ||
883 | |||
884 | void kvmppc_core_destroy_vm(struct kvm *kvm) | ||
885 | { | ||
886 | } | ||
887 | |||
868 | int __init kvmppc_booke_init(void) | 888 | int __init kvmppc_booke_init(void) |
869 | { | 889 | { |
870 | unsigned long ivor[16]; | 890 | unsigned long ivor[16]; |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 24e2b64b6a48..0c80e159c138 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -148,7 +148,7 @@ void kvm_arch_check_processor_compat(void *rtn) | |||
148 | 148 | ||
149 | int kvm_arch_init_vm(struct kvm *kvm) | 149 | int kvm_arch_init_vm(struct kvm *kvm) |
150 | { | 150 | { |
151 | return 0; | 151 | return kvmppc_core_init_vm(kvm); |
152 | } | 152 | } |
153 | 153 | ||
154 | void kvm_arch_destroy_vm(struct kvm *kvm) | 154 | void kvm_arch_destroy_vm(struct kvm *kvm) |
@@ -164,6 +164,9 @@ void kvm_arch_destroy_vm(struct kvm *kvm) | |||
164 | kvm->vcpus[i] = NULL; | 164 | kvm->vcpus[i] = NULL; |
165 | 165 | ||
166 | atomic_set(&kvm->online_vcpus, 0); | 166 | atomic_set(&kvm->online_vcpus, 0); |
167 | |||
168 | kvmppc_core_destroy_vm(kvm); | ||
169 | |||
167 | mutex_unlock(&kvm->lock); | 170 | mutex_unlock(&kvm->lock); |
168 | } | 171 | } |
169 | 172 | ||
@@ -212,7 +215,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
212 | struct kvm_userspace_memory_region *mem, | 215 | struct kvm_userspace_memory_region *mem, |
213 | int user_alloc) | 216 | int user_alloc) |
214 | { | 217 | { |
215 | return 0; | 218 | return kvmppc_core_prepare_memory_region(kvm, mem); |
216 | } | 219 | } |
217 | 220 | ||
218 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 221 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
@@ -220,7 +223,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
220 | struct kvm_memory_slot old, | 223 | struct kvm_memory_slot old, |
221 | int user_alloc) | 224 | int user_alloc) |
222 | { | 225 | { |
223 | return; | 226 | kvmppc_core_commit_memory_region(kvm, mem); |
224 | } | 227 | } |
225 | 228 | ||
226 | 229 | ||