Re: [PATCH 0/2] Fix build on i386 due to the latest tsc changes

2012-02-18 Thread Marcelo Tosatti
On Thu, Feb 16, 2012 at 03:53:40PM +0200, Avi Kivity wrote: On 02/16/2012 03:48 PM, Avi Kivity wrote: The code fixed by the second patch looks suspect though: nsdiff = data - kvm-arch.last_tsc_write; nsdiff = (nsdiff * 1000) / vcpu-arch.virtual_tsc_khz; before the division, nsdiff

[PATCH 0/2] Fix build on i386 due to the latest tsc changes

2012-02-16 Thread Avi Kivity
The code fixed by the second patch looks suspect though: nsdiff = data - kvm-arch.last_tsc_write; nsdiff = (nsdiff * 1000) / vcpu-arch.virtual_tsc_khz; before the division, nsdiff is in tsc units. Dividing it by tsc_khz/1000 is equivalent to multiplying it by 100 and dividing it by

Re: [PATCH 0/2] Fix build on i386 due to the latest tsc changes

2012-02-16 Thread Avi Kivity
On 02/16/2012 03:48 PM, Avi Kivity wrote: The code fixed by the second patch looks suspect though: nsdiff = data - kvm-arch.last_tsc_write; nsdiff = (nsdiff * 1000) / vcpu-arch.virtual_tsc_khz; before the division, nsdiff is in tsc units. Dividing it by tsc_khz/1000 is equivalent to