summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/emulate.c
diff options
context:
space:
mode:
authorBharat Bhushan <r65777@freescale.com>2011-10-31 14:22:08 +0530
committerAvi Kivity <avi@redhat.com>2012-03-05 14:52:25 +0200
commit7401f6266de021990efc7bc212289219ba8f9a7a (patch)
tree829d48eedaa872ffa1b3d39e1cac0be0497788b5 /arch/powerpc/kvm/emulate.c
parentdc2babfea592e633cf3890294af6545609b466be (diff)
downloadlinux-7401f6266de021990efc7bc212289219ba8f9a7a.tar.bz2
KVM: PPC: booke: Do Not start decrementer when SPRN_DEC set 0
As per specification the decrementer interrupt not happen when DEC is written with 0. Also when DEC is zero, no decrementer running. So we should not start hrtimer for decrementer when DEC = 0. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 4337f99fa0fa..b6df56dd93ba 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -77,7 +77,8 @@ static int kvmppc_dec_enabled(struct kvm_vcpu *vcpu)
#else
static int kvmppc_dec_enabled(struct kvm_vcpu *vcpu)
{
- return vcpu->arch.tcr & TCR_DIE;
+ /* On BOOKE, DEC = 0 is as good as decrementer not enabled */
+ return (vcpu->arch.tcr & TCR_DIE) && vcpu->arch.dec;
}
#endif