RE: [PATCH]KVM: Fix DEC truncation for greater than 0xffff_ffff/1000

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Alexander Graf [mailto:agraf@xxxxxxx]
> Sent: Thursday, October 20, 2011 10:45 PM
> To: Bhushan Bharat-R65777
> Cc: kvm-ppc@xxxxxxxxxxxxxxx; bharatb.yadav@xxxxxxxxx; Bhushan Bharat-
> R65777
> Subject: Re: [PATCH]KVM: Fix DEC truncation for greater than
> 0xffff_ffff/1000
> 
> 
> On 18.10.2011, at 10:05, Bharat Bhushan wrote:
> 
> > kvmppc_emulate_dec() uses dec_nsec of type unsigned long and does below
> calculation:
> >
> >        dec_nsec = vcpu->arch.dec;
> >        dec_nsec *= 1000;
> > This will truncate if DEC value "vcpu->arch.dec" is greater than
> 0xffff_ffff/1000.
> > For example : For tb_ticks_per_usec = 4a, we can not set decrementer
> more than ~58ms.
> >
> > Signed-off-by: Bharat Bhushan <bharat.bhushan@xxxxxxxxxxxxx>
> > ---
> > arch/powerpc/kvm/emulate.c |    4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
> > index 8af3bad..37f41f9 100644
> > --- a/arch/powerpc/kvm/emulate.c
> > +++ b/arch/powerpc/kvm/emulate.c
> > @@ -83,7 +83,7 @@ static bool kvmppc_dec_enabled(struct kvm_vcpu
> > *vcpu)
> >
> > void kvmppc_emulate_dec(struct kvm_vcpu *vcpu) {
> > -	unsigned long dec_nsec;
> > +	unsigned long long dec_nsec;
> 
> u64 :)

I think I have sent v2 of this patch. Please review that .
That also have long long :). 

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


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux