Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-14 Thread Haozhong Zhang
On Wed, Oct 14, 2015 at 04:20:57AM -0600, Jan Beulich wrote: > >>> On 14.10.15 at 12:00, wrote: > > Sounds reasonable. A better patch 2 may look like > > > > - *gtsc_khz = cpu_khz; > > + if ( is_hvm_domain(d) && cpu_has_tsc_ratio ) > > + *gtsc_khz = d->arch.tsc_khz; > > + else > > + *gtsc

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-14 Thread Jan Beulich
>>> On 14.10.15 at 12:00, wrote: > Sounds reasonable. A better patch 2 may look like > > - *gtsc_khz = cpu_khz; > + if ( is_hvm_domain(d) && cpu_has_tsc_ratio ) > + *gtsc_khz = d->arch.tsc_khz; > + else > + *gtsc_khz = cpu_khz; > > which gets d->arch.tsc_khz only if TSC ratio is used, ot

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-14 Thread Haozhong Zhang
On Wed, Oct 14, 2015 at 03:40:01AM -0600, Jan Beulich wrote: > >>> On 14.10.15 at 04:45, wrote: > > However, patch 2 is still necessary. The existing tsc_get_info() uses > > the host TSC frequency as the guest TSC frequency for a domain in > > TSC_MODE_DEFAULT, which could cause errors in the foll

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-14 Thread Jan Beulich
>>> On 14.10.15 at 04:45, wrote: > However, patch 2 is still necessary. The existing tsc_get_info() uses > the host TSC frequency as the guest TSC frequency for a domain in > TSC_MODE_DEFAULT, which could cause errors in the following example: > - A domain d using TSC_MODE_DEFAULT is created on h

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-13 Thread Haozhong Zhang
On Fri, Oct 09, 2015 at 12:51:32AM -0600, Jan Beulich wrote: > >>> On 28.09.15 at 09:13, wrote: > > When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation > > is used, the existing tsc_get_info() calculates elapsed_nsec by scaling > > the host TSC with a ratio between guest TSC rat

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 12:51 PM, Haozhong Zhang wrote: On Fri, Oct 09, 2015 at 12:31:53PM -0400, Boris Ostrovsky wrote: On 10/09/2015 12:19 PM, Jan Beulich wrote: On 09.10.15 at 18:09, wrote: On 10/09/2015 11:11 AM, Jan Beulich wrote: On 09.10.15 at 16:00, wrote: On Fri, Oct 09, 2015 at 09:41:36AM

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Haozhong Zhang
On Fri, Oct 09, 2015 at 12:31:53PM -0400, Boris Ostrovsky wrote: > On 10/09/2015 12:19 PM, Jan Beulich wrote: > On 09.10.15 at 18:09, wrote: > >>On 10/09/2015 11:11 AM, Jan Beulich wrote: > >>On 09.10.15 at 16:00, wrote: > On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrot

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 12:39 PM, Haozhong Zhang wrote: On Fri, Oct 09, 2015 at 11:37:06AM -0400, Boris Ostrovsky wrote: On 10/09/2015 10:39 AM, Jan Beulich wrote: On 09.10.15 at 15:41, wrote: On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When the TSC mode of a domain is TS

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Haozhong Zhang
On Fri, Oct 09, 2015 at 11:37:06AM -0400, Boris Ostrovsky wrote: > On 10/09/2015 10:39 AM, Jan Beulich wrote: > On 09.10.15 at 15:41, wrote: > >>On 10/09/2015 02:51 AM, Jan Beulich wrote: > >>On 28.09.15 at 09:13, wrote: > When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC e

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 12:19 PM, Jan Beulich wrote: On 09.10.15 at 18:09, wrote: On 10/09/2015 11:11 AM, Jan Beulich wrote: On 09.10.15 at 16:00, wrote: On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrote: On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When th

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Jan Beulich
>>> On 09.10.15 at 18:09, wrote: > On 10/09/2015 11:11 AM, Jan Beulich wrote: > On 09.10.15 at 16:00, wrote: >>> On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrote: On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: >> When the TSC mode of

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 11:11 AM, Jan Beulich wrote: On 09.10.15 at 16:00, wrote: On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrote: On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation is used, th

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 10:43 AM, Jan Beulich wrote: On 09.10.15 at 16:35, wrote: On Fri, Oct 09, 2015 at 12:51:32AM -0600, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation is used, the existing tsc_get_info() calculates elapsed_nse

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 10:39 AM, Jan Beulich wrote: On 09.10.15 at 15:41, wrote: On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation is used, the existing tsc_get_info() calculates elapsed_nsec by scaling the h

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Jan Beulich
>>> On 09.10.15 at 16:00, wrote: > On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrote: >> On 10/09/2015 02:51 AM, Jan Beulich wrote: >> On 28.09.15 at 09:13, wrote: >> >>When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation >> >>is used, the existing tsc_get_info

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Jan Beulich
>>> On 09.10.15 at 16:35, wrote: > On Fri, Oct 09, 2015 at 12:51:32AM -0600, Jan Beulich wrote: >> >>> On 28.09.15 at 09:13, wrote: >> > When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation >> > is used, the existing tsc_get_info() calculates elapsed_nsec by scaling >> > the hos

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Jan Beulich
>>> On 09.10.15 at 15:41, wrote: > On 10/09/2015 02:51 AM, Jan Beulich wrote: > On 28.09.15 at 09:13, wrote: >>> When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation >>> is used, the existing tsc_get_info() calculates elapsed_nsec by scaling >>> the host TSC with a ratio bet

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Haozhong Zhang
On Fri, Oct 09, 2015 at 12:51:32AM -0600, Jan Beulich wrote: > >>> On 28.09.15 at 09:13, wrote: > > When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation > > is used, the existing tsc_get_info() calculates elapsed_nsec by scaling > > the host TSC with a ratio between guest TSC rat

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Haozhong Zhang
On Fri, Oct 09, 2015 at 09:41:36AM -0400, Boris Ostrovsky wrote: > On 10/09/2015 02:51 AM, Jan Beulich wrote: > On 28.09.15 at 09:13, wrote: > >>When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation > >>is used, the existing tsc_get_info() calculates elapsed_nsec by scaling >

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-09 Thread Boris Ostrovsky
On 10/09/2015 02:51 AM, Jan Beulich wrote: On 28.09.15 at 09:13, wrote: When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation is used, the existing tsc_get_info() calculates elapsed_nsec by scaling the host TSC with a ratio between guest TSC rate and nanoseconds. However, the r

Re: [Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-10-08 Thread Jan Beulich
>>> On 28.09.15 at 09:13, wrote: > When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation > is used, the existing tsc_get_info() calculates elapsed_nsec by scaling > the host TSC with a ratio between guest TSC rate and > nanoseconds. However, the result will be incorrect if the gue

[Xen-devel] [PATCH 01/13] x86/time.c: Use system time to calculate elapsed_nsec in tsc_get_info()

2015-09-28 Thread Haozhong Zhang
When the TSC mode of a domain is TSC_MODE_DEFAULT and no TSC emulation is used, the existing tsc_get_info() calculates elapsed_nsec by scaling the host TSC with a ratio between guest TSC rate and nanoseconds. However, the result will be incorrect if the guest TSC rate differs from the host TSC rate