Commit c1b8a01b authored by Bharat Bhushan's avatar Bharat Bhushan Committed by Alexander Graf

kvm: ppc: booke: Use the shared struct helpers for SPRN_SPRG0-7

Use kvmppc_set_sprg[0-7]() and kvmppc_get_sprg[0-7]() helper
functions
Signed-off-by: default avatarBharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent dc168549
...@@ -1227,14 +1227,14 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) ...@@ -1227,14 +1227,14 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
regs->srr0 = kvmppc_get_srr0(vcpu); regs->srr0 = kvmppc_get_srr0(vcpu);
regs->srr1 = kvmppc_get_srr1(vcpu); regs->srr1 = kvmppc_get_srr1(vcpu);
regs->pid = vcpu->arch.pid; regs->pid = vcpu->arch.pid;
regs->sprg0 = vcpu->arch.shared->sprg0; regs->sprg0 = kvmppc_get_sprg0(vcpu);
regs->sprg1 = vcpu->arch.shared->sprg1; regs->sprg1 = kvmppc_get_sprg1(vcpu);
regs->sprg2 = vcpu->arch.shared->sprg2; regs->sprg2 = kvmppc_get_sprg2(vcpu);
regs->sprg3 = vcpu->arch.shared->sprg3; regs->sprg3 = kvmppc_get_sprg3(vcpu);
regs->sprg4 = vcpu->arch.shared->sprg4; regs->sprg4 = kvmppc_get_sprg4(vcpu);
regs->sprg5 = vcpu->arch.shared->sprg5; regs->sprg5 = kvmppc_get_sprg5(vcpu);
regs->sprg6 = vcpu->arch.shared->sprg6; regs->sprg6 = kvmppc_get_sprg6(vcpu);
regs->sprg7 = vcpu->arch.shared->sprg7; regs->sprg7 = kvmppc_get_sprg7(vcpu);
for (i = 0; i < ARRAY_SIZE(regs->gpr); i++) for (i = 0; i < ARRAY_SIZE(regs->gpr); i++)
regs->gpr[i] = kvmppc_get_gpr(vcpu, i); regs->gpr[i] = kvmppc_get_gpr(vcpu, i);
...@@ -1255,14 +1255,14 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) ...@@ -1255,14 +1255,14 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
kvmppc_set_srr0(vcpu, regs->srr0); kvmppc_set_srr0(vcpu, regs->srr0);
kvmppc_set_srr1(vcpu, regs->srr1); kvmppc_set_srr1(vcpu, regs->srr1);
kvmppc_set_pid(vcpu, regs->pid); kvmppc_set_pid(vcpu, regs->pid);
vcpu->arch.shared->sprg0 = regs->sprg0; kvmppc_set_sprg0(vcpu, regs->sprg0);
vcpu->arch.shared->sprg1 = regs->sprg1; kvmppc_set_sprg1(vcpu, regs->sprg1);
vcpu->arch.shared->sprg2 = regs->sprg2; kvmppc_set_sprg2(vcpu, regs->sprg2);
vcpu->arch.shared->sprg3 = regs->sprg3; kvmppc_set_sprg3(vcpu, regs->sprg3);
vcpu->arch.shared->sprg4 = regs->sprg4; kvmppc_set_sprg4(vcpu, regs->sprg4);
vcpu->arch.shared->sprg5 = regs->sprg5; kvmppc_set_sprg5(vcpu, regs->sprg5);
vcpu->arch.shared->sprg6 = regs->sprg6; kvmppc_set_sprg6(vcpu, regs->sprg6);
vcpu->arch.shared->sprg7 = regs->sprg7; kvmppc_set_sprg7(vcpu, regs->sprg7);
for (i = 0; i < ARRAY_SIZE(regs->gpr); i++) for (i = 0; i < ARRAY_SIZE(regs->gpr); i++)
kvmppc_set_gpr(vcpu, i, regs->gpr[i]); kvmppc_set_gpr(vcpu, i, regs->gpr[i]);
......
...@@ -165,16 +165,16 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val) ...@@ -165,16 +165,16 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
* guest (PR-mode only). * guest (PR-mode only).
*/ */
case SPRN_SPRG4: case SPRN_SPRG4:
vcpu->arch.shared->sprg4 = spr_val; kvmppc_set_sprg4(vcpu, spr_val);
break; break;
case SPRN_SPRG5: case SPRN_SPRG5:
vcpu->arch.shared->sprg5 = spr_val; kvmppc_set_sprg5(vcpu, spr_val);
break; break;
case SPRN_SPRG6: case SPRN_SPRG6:
vcpu->arch.shared->sprg6 = spr_val; kvmppc_set_sprg6(vcpu, spr_val);
break; break;
case SPRN_SPRG7: case SPRN_SPRG7:
vcpu->arch.shared->sprg7 = spr_val; kvmppc_set_sprg7(vcpu, spr_val);
break; break;
case SPRN_IVPR: case SPRN_IVPR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment