aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/emulate.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-04-15 18:11:40 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:18:26 -0400
commitc7f38f46f2a98d232147e47284cb4e7363296a3e (patch)
treeba1de6a9d8398d31807756789d015983c4610b21 /arch/powerpc/kvm/emulate.c
parent66bb170655799a0149df0844fb8232f27e54323c (diff)
KVM: PPC: Improve indirect svcpu accessors
We already have some inline fuctions we use to access vcpu or svcpu structs, depending on whether we're on booke or book3s. Since we just put a few more registers into the svcpu, we also need to make sure the respective callbacks are available and get used. So this patch moves direct use of the now in the svcpu struct fields to inline function calls. While at it, it also moves the definition of those inline function calls to respective header files for booke and book3s, greatly improving readability. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/emulate.c')
-rw-r--r--arch/powerpc/kvm/emulate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index dbb5d6842a51..c6db28cdc594 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -132,7 +132,7 @@ void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
132 * from opcode tables in the future. */ 132 * from opcode tables in the future. */
133int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) 133int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
134{ 134{
135 u32 inst = vcpu->arch.last_inst; 135 u32 inst = kvmppc_get_last_inst(vcpu);
136 u32 ea; 136 u32 ea;
137 int ra; 137 int ra;
138 int rb; 138 int rb;
@@ -516,10 +516,11 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
516 } 516 }
517 } 517 }
518 518
519 trace_kvm_ppc_instr(inst, vcpu->arch.pc, emulated); 519 trace_kvm_ppc_instr(inst, kvmppc_get_pc(vcpu), emulated);
520 520
521 /* Advance past emulated instruction. */
521 if (advance) 522 if (advance)
522 vcpu->arch.pc += 4; /* Advance past emulated instruction. */ 523 kvmppc_set_pc(vcpu, kvmppc_get_pc(vcpu) + 4);
523 524
524 return emulated; 525 return emulated;
525} 526}