Re: svn commit: r238755 - head/sys/x86/x86

2012-07-27 Thread Peter Grehan
CPUID causes an unconditional exit in VT-x/SVM so it would be best to avoid that if possible. The only place where the use of CPUID in tsc patch seems to be reasonable is at the SMP test, since it is too much burden to check SSE2/Intel/AMD nuances at the boot time, to be redone later anyway. W

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-27 Thread Konstantin Belousov
On Thu, Jul 26, 2012 at 12:44:43PM -0600, Peter Grehan wrote: > >Yes, CPUID or LFENCE is enough to fix the failure. > > CPUID causes an unconditional exit in VT-x/SVM so it would be best to > avoid that if possible. The only place where the use of CPUID in tsc patch seems to be reasonable is at

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Peter Grehan
Yes, CPUID or LFENCE is enough to fix the failure. CPUID causes an unconditional exit in VT-x/SVM so it would be best to avoid that if possible. later, Peter. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Konstantin Belousov
On Thu, Jul 26, 2012 at 10:30:51PM +1000, Bruce Evans wrote: > On Thu, 26 Jul 2012, Konstantin Belousov wrote: > > >On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: > >>In fact, there is always a full documented serialization instruction > >>for syscalls, except maybe in FreeBSD-1 comp

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Bruce Evans
On Thu, 26 Jul 2012, Konstantin Belousov wrote: On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: In fact, there is always a full documented serialization instruction for syscalls, except maybe in FreeBSD-1 compat code on i386, at least on Athlon64. i386 syscalls use int 0x80 (excep

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Konstantin Belousov
On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: > On Wed, 25 Jul 2012, Jung-uk Kim wrote: > >>For some unrelated reasons, we do have lfence;rdtsc sequence in > >>the userland already. Well, it is not exactly such sequence, there > >>are some instructions between, but the main fact is t

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Bruce Evans
On Wed, 25 Jul 2012, Konstantin Belousov wrote: On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: On Wed, 25 Jul 2012, Konstantin Belousov wrote: ... Most uses in FreeBSD are for timecounters. Timecounters deliver the current time. This is unrelated to whatever instructions haven't

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-26 Thread Bruce Evans
On Wed, 25 Jul 2012, Jung-uk Kim wrote: On 2012-07-25 14:05:37 -0400, Konstantin Belousov wrote: Since we have gettimeofday() in userland, the above Linux thread is more relevant now, I guess. Indeed. syscalls put squillions of instructions between. Maybe even a serialization instruction.

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Bruce Evans
On Wed, 25 Jul 2012, Konstantin Belousov wrote: On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov wrote: I also asked Jim to test whether the cause the TSC sync test failure is the lack of synchronization between gathering data a

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: > On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov > wrote: > > I also asked Jim to test whether the cause the TSC sync test failure > > is the lack of synchronization between gathering data and tasting it, > > but ut appeared that t

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2012-07-25 14:05:37 -0400, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 01:27:48PM -0400, Jung-uk Kim wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> >> On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: >>> On Wed, 25 Jul 2012, An

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Wed, Jul 25, 2012 at 01:27:48PM -0400, Jung-uk Kim wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: > > On Wed, 25 Jul 2012, Andriy Gapon wrote: > > > >> on 25/07/2012 13:21 Konstantin Belousov said the following: > >>> ... diff --gi

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Jim Harris
On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov wrote: > On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: >> On Wed, 25 Jul 2012, Konstantin Belousov wrote: >> >> >On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> >>on 25/07/2012 01:10 Jim Harris said the following

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: > On Wed, 25 Jul 2012, Konstantin Belousov wrote: > > >On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > >>on 25/07/2012 01:10 Jim Harris said the following: > >>>Author: jimharris > >>>Date: Tue Jul 24 22:10:11 2012 > >>>N

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: > On Wed, 25 Jul 2012, Andriy Gapon wrote: > >> on 25/07/2012 13:21 Konstantin Belousov said the following: >>> ... diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index >>> 085c339..229b351 100644 -

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Wed, Jul 25, 2012 at 08:29:57AM -0700, Jim Harris wrote: > On Wed, Jul 25, 2012 at 6:37 AM, Konstantin Belousov > wrote: > > -/* rmb is required here because rdtsc is not a serializing instruction. */ > > +/* > > + * RDTSC is not a serializing instruction, so we need to drain > > + * instructio

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Jim Harris
On Wed, Jul 25, 2012 at 6:37 AM, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 03:29:34PM +0300, Andriy Gapon wrote: >> on 25/07/2012 13:21 Konstantin Belousov said the following: >> > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> >> on 25/07/2012 01:10 Jim Harris said th

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Bruce Evans
On Wed, 25 Jul 2012, Andriy Gapon wrote: on 25/07/2012 13:21 Konstantin Belousov said the following: ... diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 085c339..229b351 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -594,6 +594,7 @@ static u_int tsc_get_timecount(struct ti

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Bruce Evans
On Wed, 25 Jul 2012, Konstantin Belousov wrote: On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: on 25/07/2012 01:10 Jim Harris said the following: Author: jimharris Date: Tue Jul 24 22:10:11 2012 New Revision: 238755 URL: http://svn.freebsd.org/changeset/base/238755 Log: Add r

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Wed, Jul 25, 2012 at 03:29:34PM +0300, Andriy Gapon wrote: > on 25/07/2012 13:21 Konstantin Belousov said the following: > > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > >> on 25/07/2012 01:10 Jim Harris said the following: > >>> Author: jimharris > >>> Date: Tue Jul 24 22:10:

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Andriy Gapon
on 25/07/2012 13:21 Konstantin Belousov said the following: > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> on 25/07/2012 01:10 Jim Harris said the following: >>> Author: jimharris >>> Date: Tue Jul 24 22:10:11 2012 >>> New Revision: 238755 >>> URL: http://svn.freebsd.org/changes

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Konstantin Belousov
On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > on 25/07/2012 01:10 Jim Harris said the following: > > Author: jimharris > > Date: Tue Jul 24 22:10:11 2012 > > New Revision: 238755 > > URL: http://svn.freebsd.org/changeset/base/238755 > > > > Log: > > Add rmb() to tsc_read_##x to

Re: svn commit: r238755 - head/sys/x86/x86

2012-07-25 Thread Andriy Gapon
on 25/07/2012 01:10 Jim Harris said the following: > Author: jimharris > Date: Tue Jul 24 22:10:11 2012 > New Revision: 238755 > URL: http://svn.freebsd.org/changeset/base/238755 > > Log: > Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. > > Intel Architecture Manual s