All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: booke: Added DECAR support
@ 2012-05-15  7:45 Bharat Bhushan
  2012-05-15 14:28 ` Alexander Graf
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Bharat Bhushan @ 2012-05-15  7:45 UTC (permalink / raw)
  To: kvm-ppc

Added the decrementer auto-reload support.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
 arch/powerpc/include/asm/kvm_host.h |    2 ++
 arch/powerpc/kvm/booke.c            |    5 +++++
 arch/powerpc/kvm/booke_emulate.c    |    7 ++++++-
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index d848cdc..1d6f89e 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -414,7 +414,9 @@ struct kvm_vcpu_arch {
 	ulong mcsrr1;
 	ulong mcsr;
 	u32 dec;
+#ifdef CONFIG_BOOKE
 	u32 decar;
+#endif
 	u32 tbl;
 	u32 tbu;
 	u32 tcr;
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 72f13f4..86681ee 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -1267,6 +1267,11 @@ void kvmppc_decrementer_func(unsigned long data)
 {
 	struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
 
+	if (vcpu->arch.tcr & TCR_ARE) {
+		vcpu->arch.dec = vcpu->arch.decar;
+		kvmppc_emulate_dec(vcpu);
+	}
+
 	kvmppc_set_tsr_bits(vcpu, TSR_DIS);
 }
 
diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm/booke_emulate.c
index 6c76397..83c3796 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)
 		kvmppc_set_tcr(vcpu, spr_val);
 		break;
 
+	case SPRN_DECAR:
+		vcpu->arch.decar = spr_val;
+		break;
 	/*
 	 * Note: SPRG4-7 are user-readable.
 	 * These values are loaded into the real SPRGs when resuming the
@@ -244,7 +247,9 @@ int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)
 	case SPRN_TCR:
 		*spr_val = vcpu->arch.tcr;
 		break;
-
+	case SPRN_DECAR:
+		*spr_val = vcpu->arch.decar;
+		break;
 	case SPRN_IVOR0:
 		*spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL];
 		break;
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-21  6:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15  7:45 [PATCH] KVM: PPC: booke: Added DECAR support Bharat Bhushan
2012-05-15 14:28 ` Alexander Graf
2012-05-16  6:57 ` Bhushan Bharat-R65777
2012-05-16  9:06 ` Alexander Graf
2012-05-16  9:21 ` Bhushan Bharat-R65777
2012-05-16  9:23 ` Alexander Graf
2012-05-21  4:28 ` Bhushan Bharat-R65777
2012-05-21  6:18 ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.