kern.timecounter.smp_tsc_adjust

Chris Torek torek at torek.net
Tue Jun 3 20:59:32 UTC 2014


In x86/x86/tsc.c we have several routines for checking the
TSCs across multiple CPUs in an SMP system, and then optionally
adjusting them.

We tried turning on the adjustment option and the system promptly
crashed.  This appears to be the culprit:

	static int
	test_tsc(void)
	{
		uint32_t *data, *tsc;

(note the type of "*data")

	static void
	comp_smp_tsc(void *arg)
	{
		uint32_t *tsc;

(again, uint32_t), but:

	static void
	adj_smp_tsc(void *arg)
	{
		uint64_t *tsc;

The TSC_READ code uses rdtsc32(), so the types are more or less
correct there, but maybe everyone should just use 64 bits
throughout, and rdtsc()?

In any case, at least one, and maybe two, routines need their
types changed (and maybe the TSC_READ macro as well).  Is it OK
to just assume the upper 32 bits are in sync?

Chris


More information about the freebsd-hackers mailing list