> -----Original Message----- > From: Alexander Graf [mailto:agraf@xxxxxxx] > Sent: Thursday, October 20, 2011 11:15 PM > To: Bhushan Bharat-R65777 > Cc: kvm-ppc@xxxxxxxxxxxxxxx; bharatb.yadav@xxxxxxxxx > Subject: Re: [PATCH] KVM: booke: Do Not start decrementer when SPRN_DEC > set 0 > > > On 20.10.2011, at 10:43, Bhushan Bharat-R65777 wrote: > > > > > > >> -----Original Message----- > >> From: kvm-ppc-owner@xxxxxxxxxxxxxxx [mailto:kvm-ppc- > >> owner@xxxxxxxxxxxxxxx] On Behalf Of Alexander Graf > >> Sent: Thursday, October 20, 2011 10:40 PM > >> To: Bhushan Bharat-R65777 > >> Cc: kvm-ppc@xxxxxxxxxxxxxxx; bharatb.yadav@xxxxxxxxx; Bhushan Bharat- > >> R65777 > >> Subject: Re: [PATCH] KVM: booke: Do Not start decrementer when > >> SPRN_DEC set 0 > >> > >> > >> On 17.10.2011, at 20:37, Bharat Bhushan wrote: > >> > >>> As per specification the decrementer interrupt not happen when DEC > >>> is > >> written with 0. So we should not start hrtimer with timeout = 0 as > well. > >>> > >>> Signed-off-by: Bharat Bhushan <bharat.bhushan@xxxxxxxxxxxxx> > >>> --- > >>> arch/powerpc/kvm/emulate.c | 8 ++++---- > >>> 1 files changed, 4 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c > >>> index 141dce3..8af3bad 100644 > >>> --- a/arch/powerpc/kvm/emulate.c > >>> +++ b/arch/powerpc/kvm/emulate.c > >>> @@ -70,14 +70,14 @@ > >>> #define OP_STHU 45 > >>> > >>> #ifdef CONFIG_PPC_BOOK3S > >>> -static int kvmppc_dec_enabled(struct kvm_vcpu *vcpu) > >>> +static bool kvmppc_dec_enabled(struct kvm_vcpu *vcpu) > >>> { > >>> - return 1; > >>> + return true; > >> > >> It's not necessary to change it to bool. The function will be inlined > >> anyways. > >> > >>> } > >>> #else > >>> -static int kvmppc_dec_enabled(struct kvm_vcpu *vcpu) > >>> +static bool kvmppc_dec_enabled(struct kvm_vcpu *vcpu) > >>> { > >>> - return vcpu->arch.tcr & TCR_DIE; > >>> + return (vcpu->arch.tcr & TCR_DIE) && !vcpu->arch.dec; > >> > >> This means we declare the dec as enabled only when dec==0, no? > > > > I think we can change the name of this function as > kvmppc_dec_runnable() ? > > It'd still be wrong. You're declaring the DEC as running when dec == 0, > not when dec != 0. That I have to anyway fix, I mean like this: bool kvmppc_dec_runnable(struct kvm_vcpu *vcpu) { return (vcpu->arch.tcr & TCR_DIE) && vcpu->arch.dec; } Thanks -Bharat -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html