Skip to content

Commit

Permalink
KVM: PPC: booke: Do Not start decrementer when SPRN_DEC set 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bharat Bhushan authored and Avi Kivity committed Mar 5, 2012
1 parent dc2babf commit 7401f62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7401f62

Please sign in to comment.