diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_para.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 16 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 16 | ||||
-rw-r--r-- | arch/powerpc/kvm/emulate.c | 24 |
5 files changed, 36 insertions, 28 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 5255d754f9a9..221cf85e9a6e 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -217,10 +217,6 @@ struct kvm_vcpu_arch { | |||
217 | ulong guest_owned_ext; | 217 | ulong guest_owned_ext; |
218 | #endif | 218 | #endif |
219 | u32 mmucr; | 219 | u32 mmucr; |
220 | ulong sprg0; | ||
221 | ulong sprg1; | ||
222 | ulong sprg2; | ||
223 | ulong sprg3; | ||
224 | ulong sprg4; | 220 | ulong sprg4; |
225 | ulong sprg5; | 221 | ulong sprg5; |
226 | ulong sprg6; | 222 | ulong sprg6; |
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index d7fc6c2c9730..e402999ba193 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h | |||
@@ -23,6 +23,10 @@ | |||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | 24 | ||
25 | struct kvm_vcpu_arch_shared { | 25 | struct kvm_vcpu_arch_shared { |
26 | __u64 sprg0; | ||
27 | __u64 sprg1; | ||
28 | __u64 sprg2; | ||
29 | __u64 sprg3; | ||
26 | __u64 srr0; | 30 | __u64 srr0; |
27 | __u64 srr1; | 31 | __u64 srr1; |
28 | __u64 dar; | 32 | __u64 dar; |
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index afa0dd4a27f4..cfd7fe5c3a62 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -1062,10 +1062,10 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) | |||
1062 | regs->srr0 = vcpu->arch.shared->srr0; | 1062 | regs->srr0 = vcpu->arch.shared->srr0; |
1063 | regs->srr1 = vcpu->arch.shared->srr1; | 1063 | regs->srr1 = vcpu->arch.shared->srr1; |
1064 | regs->pid = vcpu->arch.pid; | 1064 | regs->pid = vcpu->arch.pid; |
1065 | regs->sprg0 = vcpu->arch.sprg0; | 1065 | regs->sprg0 = vcpu->arch.shared->sprg0; |
1066 | regs->sprg1 = vcpu->arch.sprg1; | 1066 | regs->sprg1 = vcpu->arch.shared->sprg1; |
1067 | regs->sprg2 = vcpu->arch.sprg2; | 1067 | regs->sprg2 = vcpu->arch.shared->sprg2; |
1068 | regs->sprg3 = vcpu->arch.sprg3; | 1068 | regs->sprg3 = vcpu->arch.shared->sprg3; |
1069 | regs->sprg5 = vcpu->arch.sprg4; | 1069 | regs->sprg5 = vcpu->arch.sprg4; |
1070 | regs->sprg6 = vcpu->arch.sprg5; | 1070 | regs->sprg6 = vcpu->arch.sprg5; |
1071 | regs->sprg7 = vcpu->arch.sprg6; | 1071 | regs->sprg7 = vcpu->arch.sprg6; |
@@ -1088,10 +1088,10 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) | |||
1088 | kvmppc_set_msr(vcpu, regs->msr); | 1088 | kvmppc_set_msr(vcpu, regs->msr); |
1089 | vcpu->arch.shared->srr0 = regs->srr0; | 1089 | vcpu->arch.shared->srr0 = regs->srr0; |
1090 | vcpu->arch.shared->srr1 = regs->srr1; | 1090 | vcpu->arch.shared->srr1 = regs->srr1; |
1091 | vcpu->arch.sprg0 = regs->sprg0; | 1091 | vcpu->arch.shared->sprg0 = regs->sprg0; |
1092 | vcpu->arch.sprg1 = regs->sprg1; | 1092 | vcpu->arch.shared->sprg1 = regs->sprg1; |
1093 | vcpu->arch.sprg2 = regs->sprg2; | 1093 | vcpu->arch.shared->sprg2 = regs->sprg2; |
1094 | vcpu->arch.sprg3 = regs->sprg3; | 1094 | vcpu->arch.shared->sprg3 = regs->sprg3; |
1095 | vcpu->arch.sprg5 = regs->sprg4; | 1095 | vcpu->arch.sprg5 = regs->sprg4; |
1096 | vcpu->arch.sprg6 = regs->sprg5; | 1096 | vcpu->arch.sprg6 = regs->sprg5; |
1097 | vcpu->arch.sprg7 = regs->sprg6; | 1097 | vcpu->arch.sprg7 = regs->sprg6; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 793df28b628d..b2c8c423c4d5 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -495,10 +495,10 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) | |||
495 | regs->srr0 = vcpu->arch.shared->srr0; | 495 | regs->srr0 = vcpu->arch.shared->srr0; |
496 | regs->srr1 = vcpu->arch.shared->srr1; | 496 | regs->srr1 = vcpu->arch.shared->srr1; |
497 | regs->pid = vcpu->arch.pid; | 497 | regs->pid = vcpu->arch.pid; |
498 | regs->sprg0 = vcpu->arch.sprg0; | 498 | regs->sprg0 = vcpu->arch.shared->sprg0; |
499 | regs->sprg1 = vcpu->arch.sprg1; | 499 | regs->sprg1 = vcpu->arch.shared->sprg1; |
500 | regs->sprg2 = vcpu->arch.sprg2; | 500 | regs->sprg2 = vcpu->arch.shared->sprg2; |
501 | regs->sprg3 = vcpu->arch.sprg3; | 501 | regs->sprg3 = vcpu->arch.shared->sprg3; |
502 | regs->sprg5 = vcpu->arch.sprg4; | 502 | regs->sprg5 = vcpu->arch.sprg4; |
503 | regs->sprg6 = vcpu->arch.sprg5; | 503 | regs->sprg6 = vcpu->arch.sprg5; |
504 | regs->sprg7 = vcpu->arch.sprg6; | 504 | regs->sprg7 = vcpu->arch.sprg6; |
@@ -521,10 +521,10 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) | |||
521 | kvmppc_set_msr(vcpu, regs->msr); | 521 | kvmppc_set_msr(vcpu, regs->msr); |
522 | vcpu->arch.shared->srr0 = regs->srr0; | 522 | vcpu->arch.shared->srr0 = regs->srr0; |
523 | vcpu->arch.shared->srr1 = regs->srr1; | 523 | vcpu->arch.shared->srr1 = regs->srr1; |
524 | vcpu->arch.sprg0 = regs->sprg0; | 524 | vcpu->arch.shared->sprg0 = regs->sprg0; |
525 | vcpu->arch.sprg1 = regs->sprg1; | 525 | vcpu->arch.shared->sprg1 = regs->sprg1; |
526 | vcpu->arch.sprg2 = regs->sprg2; | 526 | vcpu->arch.shared->sprg2 = regs->sprg2; |
527 | vcpu->arch.sprg3 = regs->sprg3; | 527 | vcpu->arch.shared->sprg3 = regs->sprg3; |
528 | vcpu->arch.sprg5 = regs->sprg4; | 528 | vcpu->arch.sprg5 = regs->sprg4; |
529 | vcpu->arch.sprg6 = regs->sprg5; | 529 | vcpu->arch.sprg6 = regs->sprg5; |
530 | vcpu->arch.sprg7 = regs->sprg6; | 530 | vcpu->arch.sprg7 = regs->sprg6; |
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c index ad0fa4ff4ea0..454869b5e91e 100644 --- a/arch/powerpc/kvm/emulate.c +++ b/arch/powerpc/kvm/emulate.c | |||
@@ -263,13 +263,17 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) | |||
263 | kvmppc_set_gpr(vcpu, rt, get_tb()); break; | 263 | kvmppc_set_gpr(vcpu, rt, get_tb()); break; |
264 | 264 | ||
265 | case SPRN_SPRG0: | 265 | case SPRN_SPRG0: |
266 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.sprg0); break; | 266 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->sprg0); |
267 | break; | ||
267 | case SPRN_SPRG1: | 268 | case SPRN_SPRG1: |
268 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.sprg1); break; | 269 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->sprg1); |
270 | break; | ||
269 | case SPRN_SPRG2: | 271 | case SPRN_SPRG2: |
270 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.sprg2); break; | 272 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->sprg2); |
273 | break; | ||
271 | case SPRN_SPRG3: | 274 | case SPRN_SPRG3: |
272 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.sprg3); break; | 275 | kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->sprg3); |
276 | break; | ||
273 | /* Note: SPRG4-7 are user-readable, so we don't get | 277 | /* Note: SPRG4-7 are user-readable, so we don't get |
274 | * a trap. */ | 278 | * a trap. */ |
275 | 279 | ||
@@ -341,13 +345,17 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) | |||
341 | break; | 345 | break; |
342 | 346 | ||
343 | case SPRN_SPRG0: | 347 | case SPRN_SPRG0: |
344 | vcpu->arch.sprg0 = kvmppc_get_gpr(vcpu, rs); break; | 348 | vcpu->arch.shared->sprg0 = kvmppc_get_gpr(vcpu, rs); |
349 | break; | ||
345 | case SPRN_SPRG1: | 350 | case SPRN_SPRG1: |
346 | vcpu->arch.sprg1 = kvmppc_get_gpr(vcpu, rs); break; | 351 | vcpu->arch.shared->sprg1 = kvmppc_get_gpr(vcpu, rs); |
352 | break; | ||
347 | case SPRN_SPRG2: | 353 | case SPRN_SPRG2: |
348 | vcpu->arch.sprg2 = kvmppc_get_gpr(vcpu, rs); break; | 354 | vcpu->arch.shared->sprg2 = kvmppc_get_gpr(vcpu, rs); |
355 | break; | ||
349 | case SPRN_SPRG3: | 356 | case SPRN_SPRG3: |
350 | vcpu->arch.sprg3 = kvmppc_get_gpr(vcpu, rs); break; | 357 | vcpu->arch.shared->sprg3 = kvmppc_get_gpr(vcpu, rs); |
358 | break; | ||
351 | 359 | ||
352 | default: | 360 | default: |
353 | emulated = kvmppc_core_emulate_mtspr(vcpu, sprn, rs); | 361 | emulated = kvmppc_core_emulate_mtspr(vcpu, sprn, rs); |