]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Fix DEC truncation for greater than 0xffff_ffff/1000
authorBharat Bhushan <r65777@freescale.com>
Wed, 19 Oct 2011 04:16:06 +0000 (09:46 +0530)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:25 +0000 (14:52 +0200)
commitfbaea7c05565b55535e1318c5875115dccba772b
tree7c125d33df2a5de4b433b4a7c635fa13096f4d90
parentffdd68266397fa3376d7ad6ad66e43210b6cb7b0
KVM: PPC: Fix DEC truncation for greater than 0xffff_ffff/1000

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@freescale.com>
Acked-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/emulate.c