diff options
author | Bharat Bhushan <r65777@freescale.com> | 2012-05-20 19:21:23 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-05-30 05:43:11 -0400 |
commit | 21bd000abff7d587229dbbee6f8c17f3aad9f9d8 (patch) | |
tree | 23bc78396196e5253e3330f03cf2eecb41a067b3 /arch/powerpc | |
parent | 32fad281c0680ed0ccade7dda85a2121cf9b1d06 (diff) |
KVM: PPC: booke: Added DECAR support
Added the decrementer auto-reload support. DECAR is readable
on e500v2/e500mc and later cpus.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke_emulate.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kvm/e500_emulate.c | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index dd783beb88b3..50ea12fd7bf5 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -418,7 +418,9 @@ struct kvm_vcpu_arch { | |||
418 | ulong mcsrr1; | 418 | ulong mcsrr1; |
419 | ulong mcsr; | 419 | ulong mcsr; |
420 | u32 dec; | 420 | u32 dec; |
421 | #ifdef CONFIG_BOOKE | ||
421 | u32 decar; | 422 | u32 decar; |
423 | #endif | ||
422 | u32 tbl; | 424 | u32 tbl; |
423 | u32 tbu; | 425 | u32 tbu; |
424 | u32 tcr; | 426 | u32 tcr; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 72f13f4a06e0..86681eec60b1 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -1267,6 +1267,11 @@ void kvmppc_decrementer_func(unsigned long data) | |||
1267 | { | 1267 | { |
1268 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; | 1268 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; |
1269 | 1269 | ||
1270 | if (vcpu->arch.tcr & TCR_ARE) { | ||
1271 | vcpu->arch.dec = vcpu->arch.decar; | ||
1272 | kvmppc_emulate_dec(vcpu); | ||
1273 | } | ||
1274 | |||
1270 | kvmppc_set_tsr_bits(vcpu, TSR_DIS); | 1275 | kvmppc_set_tsr_bits(vcpu, TSR_DIS); |
1271 | } | 1276 | } |
1272 | 1277 | ||
diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm/booke_emulate.c index 6c76397f2af4..9eb9809eb13e 100644 --- a/arch/powerpc/kvm/booke_emulate.c +++ b/arch/powerpc/kvm/booke_emulate.c | |||
@@ -129,6 +129,9 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val) | |||
129 | kvmppc_set_tcr(vcpu, spr_val); | 129 | kvmppc_set_tcr(vcpu, spr_val); |
130 | break; | 130 | break; |
131 | 131 | ||
132 | case SPRN_DECAR: | ||
133 | vcpu->arch.decar = spr_val; | ||
134 | break; | ||
132 | /* | 135 | /* |
133 | * Note: SPRG4-7 are user-readable. | 136 | * Note: SPRG4-7 are user-readable. |
134 | * These values are loaded into the real SPRGs when resuming the | 137 | * These values are loaded into the real SPRGs when resuming the |
diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c index 8b99e076dc81..e04b0ef55ce0 100644 --- a/arch/powerpc/kvm/e500_emulate.c +++ b/arch/powerpc/kvm/e500_emulate.c | |||
@@ -269,6 +269,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val) | |||
269 | *spr_val = vcpu->arch.shared->mas7_3 >> 32; | 269 | *spr_val = vcpu->arch.shared->mas7_3 >> 32; |
270 | break; | 270 | break; |
271 | #endif | 271 | #endif |
272 | case SPRN_DECAR: | ||
273 | *spr_val = vcpu->arch.decar; | ||
274 | break; | ||
272 | case SPRN_TLB0CFG: | 275 | case SPRN_TLB0CFG: |
273 | *spr_val = vcpu->arch.tlbcfg[0]; | 276 | *spr_val = vcpu->arch.tlbcfg[0]; |
274 | break; | 277 | break; |