* Entry/exit counters that make sure that both CPUs
* run the measurement code at once:
*/
+static atomic_t tsc_sync_cpu = ATOMIC_INIT(-1);
static atomic_t start_count;
static atomic_t stop_count;
static atomic_t skip_test;
atomic_set(&test_runs, 1);
else
atomic_set(&test_runs, 3);
+
+ atomic_set(&tsc_sync_cpu, cpu);
retry:
/*
* Wait for the target to start or to skip the test:
if (unsynchronized_tsc())
return;
+ /* Wait for this CPU's turn */
+ while (atomic_read(&tsc_sync_cpu) != cpu)
+ cpu_relax();
+
/*
* Store, verify and sanitize the TSC adjust register. If
* successful skip the test.