diff options
author | Alexander Graf <agraf@suse.de> | 2010-04-15 18:11:40 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:18:26 -0400 |
commit | c7f38f46f2a98d232147e47284cb4e7363296a3e (patch) | |
tree | ba1de6a9d8398d31807756789d015983c4610b21 /arch/powerpc/kvm/book3s_emulate.c | |
parent | 66bb170655799a0149df0844fb8232f27e54323c (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/book3s_emulate.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_emulate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index 8f50776a9a1d..daa829b8f1f1 100644 --- a/arch/powerpc/kvm/book3s_emulate.c +++ b/arch/powerpc/kvm/book3s_emulate.c | |||
@@ -69,7 +69,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
69 | switch (get_xop(inst)) { | 69 | switch (get_xop(inst)) { |
70 | case OP_19_XOP_RFID: | 70 | case OP_19_XOP_RFID: |
71 | case OP_19_XOP_RFI: | 71 | case OP_19_XOP_RFI: |
72 | vcpu->arch.pc = vcpu->arch.srr0; | 72 | kvmppc_set_pc(vcpu, vcpu->arch.srr0); |
73 | kvmppc_set_msr(vcpu, vcpu->arch.srr1); | 73 | kvmppc_set_msr(vcpu, vcpu->arch.srr1); |
74 | *advance = 0; | 74 | *advance = 0; |
75 | break; | 75 | break; |
@@ -208,7 +208,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
208 | if ((r == -ENOENT) || (r == -EPERM)) { | 208 | if ((r == -ENOENT) || (r == -EPERM)) { |
209 | *advance = 0; | 209 | *advance = 0; |
210 | vcpu->arch.dear = vaddr; | 210 | vcpu->arch.dear = vaddr; |
211 | vcpu->arch.fault_dear = vaddr; | 211 | to_svcpu(vcpu)->fault_dar = vaddr; |
212 | 212 | ||
213 | dsisr = DSISR_ISSTORE; | 213 | dsisr = DSISR_ISSTORE; |
214 | if (r == -ENOENT) | 214 | if (r == -ENOENT) |
@@ -217,7 +217,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
217 | dsisr |= DSISR_PROTFAULT; | 217 | dsisr |= DSISR_PROTFAULT; |
218 | 218 | ||
219 | to_book3s(vcpu)->dsisr = dsisr; | 219 | to_book3s(vcpu)->dsisr = dsisr; |
220 | vcpu->arch.fault_dsisr = dsisr; | 220 | to_svcpu(vcpu)->fault_dsisr = dsisr; |
221 | 221 | ||
222 | kvmppc_book3s_queue_irqprio(vcpu, | 222 | kvmppc_book3s_queue_irqprio(vcpu, |
223 | BOOK3S_INTERRUPT_DATA_STORAGE); | 223 | BOOK3S_INTERRUPT_DATA_STORAGE); |