diff options
author | Alexander Graf <agraf@suse.de> | 2010-01-07 20:58:02 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:47 -0500 |
commit | 992b5b29b5ae254c416c62faf98d59a6cf970027 (patch) | |
tree | 52b4e5a8226261cc936225636d58d9b7e8c46976 /arch/powerpc/kvm/44x_tlb.c | |
parent | 8e5b26b55a8b6aee2c789b1d20ec715f9e4bea5c (diff) |
KVM: PPC: Add helpers for CR, XER
We now have helpers for the GPRs, so let's also add some for CR and XER.
Having them in the PACA simplifies code a lot, as we don't need to care
about where to store CC or not to overflow any integers.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c index 8b3773669c97..2570fcc7665d 100644 --- a/arch/powerpc/kvm/44x_tlb.c +++ b/arch/powerpc/kvm/44x_tlb.c | |||
@@ -506,10 +506,12 @@ int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb, u8 rc) | |||
506 | 506 | ||
507 | gtlb_index = kvmppc_44x_tlb_index(vcpu, ea, pid, as); | 507 | gtlb_index = kvmppc_44x_tlb_index(vcpu, ea, pid, as); |
508 | if (rc) { | 508 | if (rc) { |
509 | u32 cr = kvmppc_get_cr(vcpu); | ||
510 | |||
509 | if (gtlb_index < 0) | 511 | if (gtlb_index < 0) |
510 | vcpu->arch.cr &= ~0x20000000; | 512 | kvmppc_set_cr(vcpu, cr & ~0x20000000); |
511 | else | 513 | else |
512 | vcpu->arch.cr |= 0x20000000; | 514 | kvmppc_set_cr(vcpu, cr | 0x20000000); |
513 | } | 515 | } |
514 | kvmppc_set_gpr(vcpu, rt, gtlb_index); | 516 | kvmppc_set_gpr(vcpu, rt, gtlb_index); |
515 | 517 | ||