The NetBSD Project

CVS log for src/sys/arch/x86/x86/tsc.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / x86 / x86

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.7.6.1: download - view: text, markup, annotated - select for diffs
Thu Jun 17 04:46:26 2021 UTC (3 years, 5 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.7: preferred, colored; next MAIN 1.8: preferred, colored
Changes since revision 1.7: +7 -1 lines
Sync w/ HEAD.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Jun 1 21:29:24 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +7 -1 lines
x86: Reset cached tsc in every lwp to 0 on suspend/resume.

This avoids spuriously warning about tsc going backwards, which is to
be expected after a suspend/resume cycle.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Jun 15 09:09:24 2020 UTC (4 years, 5 months ago) by msaitoh
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -1 lines
Serialize rdtsc using with lfence, mfence or cpuid to read TSC more precisely.

 x86/x86/tsc.c rev. 1.67 reduced cache problem and got big improvement, but it
 still has room. I measured the effect of lfence, mfence, cpuid and rdtscp.
The impact to TSC skew and/or drift is:

	AMD:   mfence > rdtscp > cpuid > lfence-serialize > lfence = nomodify
	Intel: lfence > rdtscp > cpuid > nomodify

So, mfence is the best on AMD and lfence is the best on Intel. If it has no
SSE2, we can use cpuid.

NOTE:
  - An AMD's document says DE_CFG_LFENCE_SERIALIZE bit can be used for
    serializing, but it's not so good.
  - On Intel i386(not amd64), it seems the improvement is very little.
  - rdtscp instruct can be used as serializing instruction + rdtsc, but
    it's not good as [lm]fence. Both Intel and AMD's document say that
    the latency of rdtscp is bigger than rdtsc, so I suspect the difference
    of the result comes from it.

Revision 1.4.42.2: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:36:51 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.4.42.1: preferred, colored; branchpoint 1.4: preferred, colored; next MAIN 1.5: preferred, colored
Changes since revision 1.4.42.1: +2 -0 lines
update from HEAD

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Oct 2 19:23:16 2017 UTC (7 years, 2 months ago) by maxv
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +3 -1 lines
Add a machdep.tsc_user_enable sysctl, to enable/disable the rdtsc
instruction in usermode. It defaults to enabled.

Revision 1.4.42.1: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:03:29 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -1 lines
Rebase to HEAD as of a few days ago.

Revision 1.4.32.1: download - view: text, markup, annotated - select for diffs
Thu May 22 11:40:14 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.4: preferred, colored; next MAIN 1.5: preferred, colored
Changes since revision 1.4: +2 -1 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.4.48.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:45:30 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.4: preferred, colored; next MAIN 1.5: preferred, colored
Changes since revision 1.4: +2 -1 lines
sync with head

Revision 1.5: download - view: text, markup, annotated - select for diffs
Wed Dec 11 02:14:08 2013 UTC (11 years ago) by msaitoh
Branches: MAIN
CVS tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-8-base, netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -1 lines
 Make new function named tsc_is_invariant() to avoid code duplication.
The behavior of acpicpu_md_flags() will change on some CPUs because
the detecting code of invariant TSC is replaced with newer code.

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:30:51 2008 UTC (16 years, 5 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3: +6 -7 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.2.68.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:22:52 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2: +6 -14 lines
Sync with HEAD.

Revision 1.2.70.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:33:04 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2: +6 -14 lines
sync with head.

Revision 1.2.72.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:23:29 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2: +6 -14 lines
sync with head.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat May 10 16:12:32 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, yamt-nfs-mp-base2, yamt-nfs-mp-base11, yamt-nfs-mp-base10, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, khorben-n900, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, hpcarm-cleanup-nbase, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, ad-audiomp2-base, ad-audiomp2
Branch point for: yamt-pagecache, tls-maxphys, rmind-smpnet
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +6 -7 lines
Improve x86 tsc handling:

- Ditch the cross-CPU calibration stuff. It didn't work properly, and it's
  near impossible to synchronize the CPUs in a running system, because bus
  traffic will interfere with any calibration attempt, messing up the
  timings.

- Only enable the TSC on CPUs where we are sure it does not drift. If we are
  On a known good CPU, give the TSC high timecounter quality, making it the
  default.

- When booting CPUs, detect TSC skew and account for it. Most Intel MP
  systems have synchronized counters, but that need not be true if the
  system has a complicated bus structure. As far as I know, AMD systems
  do not have synchronized TSCs and so we need to handle skew.

- While an AP is waiting to be set running, try and make the TSC drift by
  entering a reduced power state. If we detect drift, ensure that the TSC
  does not get a high timecounter quality. This should not happen and is
  only for safety.

- Make cpu_counter() stuff LKM safe.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Apr 28 20:23:40 2008 UTC (16 years, 7 months ago) by martin
Branches: MAIN
Branch point for: wrstuden-revivesa
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -8 lines
Remove clause 3 and 4 from TNF licenses

Revision 1.2.14.2: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:44:49 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.2.14.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.14.1: +40 -0 lines
sync with head

Revision 1.2.8.2: download - view: text, markup, annotated - select for diffs
Mon Jun 26 12:45:40 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.2.8.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.8.1: +40 -0 lines
sync with head.

Revision 1.2.6.2: download - view: text, markup, annotated - select for diffs
Wed Jun 21 14:58:06 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.2.6.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.6.1: +40 -0 lines
sync with head.

Revision 1.2.4.2: download - view: text, markup, annotated - select for diffs
Mon Jun 19 03:45:15 2006 UTC (18 years, 5 months ago) by chap
Branches: chap-midi
Diff to: previous 1.2.4.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.4.1: +40 -0 lines
Sync with head.

Revision 1.2.14.1
Wed Jun 7 22:41:09 2006 UTC (18 years, 6 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
FILE REMOVED
Changes since revision 1.2: +0 -40 lines
file tsc.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:44:49 +0000

Revision 1.2.8.1
Wed Jun 7 22:41:09 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
FILE REMOVED
Changes since revision 1.2: +0 -40 lines
file tsc.h was added on branch yamt-pdpolicy on 2006-06-26 12:45:40 +0000

Revision 1.2.6.1
Wed Jun 7 22:41:09 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-lazymbuf
FILE REMOVED
Changes since revision 1.2: +0 -40 lines
file tsc.h was added on branch yamt-lazymbuf on 2006-06-21 14:58:06 +0000

Revision 1.2.4.1
Wed Jun 7 22:41:09 2006 UTC (18 years, 6 months ago) by chap
Branches: chap-midi
FILE REMOVED
Changes since revision 1.2: +0 -40 lines
file tsc.h was added on branch chap-midi on 2006-06-19 03:45:15 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Jun 7 22:41:09 2006 UTC (18 years, 6 months ago) by kardel
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-splraiseipl, yamt-pf42-baseX, yamt-pf42-base, yamt-pf42-X, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, yamt-idlelwp-base8, yamt-idlelwp, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, vmlocking, thorpej-atomic-base, thorpej-atomic, rpaulo-netinet-merge-pcb-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, reinoud-bufcleanup, ppcoea-renovation-base, ppcoea-renovation, post-newlock2-merge, nick-net80211-sync-base, nick-net80211-sync, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, newlock2-nbase, newlock2-base, newlock2, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, mjf-ufs-trans-base, mjf-ufs-trans, mjf-devfs-base, mjf-devfs, matt-nb4-arm-base, matt-nb4-arm, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup-base, hpcarm-cleanup, gdamore-uart-base, gdamore-uart, cube-autoconf-base, cube-autoconf, chap-midi-nbase, chap-midi-base, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64, ad-socklock-base1, ad-audiomp-base, ad-audiomp, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-pf42, yamt-pdpolicy, yamt-nfs-mp, yamt-lazymbuf, rpaulo-netinet-merge-pcb, mjf-devfs2, chap-midi
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +40 -0 lines
add timecounter support (from branch simonb-timecounters)

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Apr 30 17:56:44 2006 UTC (18 years, 7 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1: +40 -0 lines
- provide TSC for UNI and MP systems
  (shared between i386 and amd64)

Revision 1.1
Sun Apr 30 17:56:44 2006 UTC (18 years, 7 months ago) by kardel
Branches: MAIN
CVS tags: yamt-pdpolicy-base5, simonb-timecounters-base, elad-kernelauth-nbase
Branch point for: simonb-timecounters
FILE REMOVED
file tsc.h was initially added on branch simonb-timecounters.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>