Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | hyperv_tsc_tcinit(void *dummy __unused) | ||||
if ((hyperv_features & | if ((hyperv_features & | ||||
(CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC)) != | (CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC)) != | ||||
(CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC) || | (CPUID_HV_MSR_TIME_REFCNT | CPUID_HV_MSR_REFERENCE_TSC) || | ||||
(cpu_feature & CPUID_SSE2) == 0) /* SSE2 for mfence/lfence */ | (cpu_feature & CPUID_SSE2) == 0) /* SSE2 for mfence/lfence */ | ||||
return; | return; | ||||
switch (cpu_vendor_id) { | switch (cpu_vendor_id) { | ||||
case CPU_VENDOR_AMD: | case CPU_VENDOR_AMD: | ||||
case CPU_VENDOR_HYGON: | |||||
hyperv_tsc_timecounter.tc_get_timecount = | hyperv_tsc_timecounter.tc_get_timecount = | ||||
hyperv_tsc_timecount_mfence; | hyperv_tsc_timecount_mfence; | ||||
tc64 = hyperv_tc64_tsc_mfence; | tc64 = hyperv_tc64_tsc_mfence; | ||||
break; | break; | ||||
case CPU_VENDOR_INTEL: | case CPU_VENDOR_INTEL: | ||||
hyperv_tsc_timecounter.tc_get_timecount = | hyperv_tsc_timecounter.tc_get_timecount = | ||||
hyperv_tsc_timecount_lfence; | hyperv_tsc_timecount_lfence; | ||||
Show All 35 Lines |