freebsd-dev/sys/x86
Konstantin Belousov e1a18e46e1 Do a trivial reformatting of the comment, to record the proper commit
message for r238973:

Rdtsc instruction is not synchronized, it seems on some Intel cores it
can bypass even the locked instructions.  As a result, rdtsc executed
on different cores may return unordered TSC values even when the rdtsc
appearance in the instruction sequences is provably ordered.

Similarly to what has been done in r238755 for TSC synchronization
test, add explicit fences right before rdtsc in the timecounters 'get'
functions.  Intel recommends to use LFENCE, while AMD refers to
MFENCE. For VIA follow what Linux does and use LFENCE.  With this
change, I see no reordered reads of TSC on Nehalem.

Change the rmb() to inlined CPUID in the SMP TSC synchronization test.
On i386, locked instruction is used for rmb(), and as noted earlier,
it is not enough. Since i386 machine may not support SSE2, do simplest
possible synchronization with CPUID.

MFC after:	  1 week
Discussed with:	  avg, bde, jkim
2012-08-01 17:34:43 +00:00
..
acpica - Remove unused code for CR3 and CR4. 2012-06-13 22:53:56 +00:00
bios Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
cpufreq Fix apparent logic reversal in setting the 'auto_mode' flag. 2012-02-26 21:24:27 +00:00
include Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage 2012-07-14 15:48:30 +00:00
isa Restore proper use of bounce buffers for ISA DMA. When locking was 2012-03-29 18:58:02 +00:00
pci Trim stray blank line. 2012-04-11 21:00:33 +00:00
x86 Do a trivial reformatting of the comment, to record the proper commit 2012-08-01 17:34:43 +00:00