Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/tsc.c
Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | if ((!smp_tsc && !tsc_is_invariant) || vm_guest) | ||||
return (-100); | return (-100); | ||||
size = (mp_maxid + 1) * 3; | size = (mp_maxid + 1) * 3; | ||||
data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); | data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); | ||||
adj = 0; | adj = 0; | ||||
retry: | retry: | ||||
for (i = 0, tsc = data; i < N; i++, tsc += size) | for (i = 0, tsc = data; i < N; i++, tsc += size) | ||||
smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); | smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); | ||||
smp_tsc = 1; /* XXX */ | smp_tsc = 1; /* XXX */ | ||||
smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, | smp_rendezvous(smp_no_rendezvous_barrier, comp_smp_tsc, | ||||
smp_no_rendevous_barrier, data); | smp_no_rendezvous_barrier, data); | ||||
if (!smp_tsc && adj < smp_tsc_adjust) { | if (!smp_tsc && adj < smp_tsc_adjust) { | ||||
adj++; | adj++; | ||||
smp_rendezvous(smp_no_rendevous_barrier, adj_smp_tsc, | smp_rendezvous(smp_no_rendezvous_barrier, adj_smp_tsc, | ||||
smp_no_rendevous_barrier, data); | smp_no_rendezvous_barrier, data); | ||||
goto retry; | goto retry; | ||||
} | } | ||||
free(data, M_TEMP); | free(data, M_TEMP); | ||||
if (bootverbose) | if (bootverbose) | ||||
printf("SMP: %sed TSC synchronization test%s\n", | printf("SMP: %sed TSC synchronization test%s\n", | ||||
smp_tsc ? "pass" : "fail", | smp_tsc ? "pass" : "fail", | ||||
adj > 0 ? " after adjustment" : ""); | adj > 0 ? " after adjustment" : ""); | ||||
if (smp_tsc && tsc_is_invariant) { | if (smp_tsc && tsc_is_invariant) { | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |