summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-07-31 12:45:41 -0700
committerIngo Molnar <mingo@elte.hu>2009-08-10 19:56:57 +0200
commitb6e61eef4f9f94714ac3ee4a5c96862d9bcd1836 (patch)
tree4bd7d4677261b13f2dcd1656673f5b7daa1ff37c /lib
parentf4b9a988685da6386d7f9a72df3098bcc3270526 (diff)
downloadlinux-3.10-b6e61eef4f9f94714ac3ee4a5c96862d9bcd1836.tar.gz
linux-3.10-b6e61eef4f9f94714ac3ee4a5c96862d9bcd1836.tar.bz2
linux-3.10-b6e61eef4f9f94714ac3ee4a5c96862d9bcd1836.zip
x86: Fix serialization in pit_expect_msb()
Wei Chong Tan reported a fast-PIT-calibration corner-case: | pit_expect_msb() is vulnerable to SMI disturbance corner case | in some platforms which causes /proc/cpuinfo to show wrong | CPU MHz value when quick_pit_calibrate() jumps to success | section. I think that the real issue isn't even an SMI - but the fact that in the very last iteration of the loop, there's no serializing instruction _after_ the last 'rdtsc'. So even in the absense of SMI's, we do have a situation where the cycle counter was read without proper serialization. The last check should be done outside the outer loop, since _inside_ the outer loop, we'll be testing that the PIT has the right MSB value has the right value in the next iteration. So only the _last_ iteration is special, because that's the one that will not check the PIT MSB value any more, and because the final 'get_cycles()' isn't serialized. In other words: - I'd like to move the PIT MSB check to after the last iteration, rather than in every iteration - I think we should comment on the fact that it's also a serializing instruction and so 'fences in' the TSC read. Here's a suggested replacement. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: "Tan, Wei Chong" <wei.chong.tan@intel.com> Tested-by: "Tan, Wei Chong" <wei.chong.tan@intel.com> LKML-Reference: <B28277FD4E0F9247A3D55704C440A140D5D683F3@pgsmsx504.gar.corp.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions