Index: head/sys/dev/hyperv/vmbus/hv_hv.c =================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c +++ head/sys/dev/hyperv/vmbus/hv_hv.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -207,8 +208,6 @@ hv_vmbus_g_context.hypercall_page = virt_addr; - tc_init(&hv_timecounter); /* register virtual timecount */ - hv_et_init(); return (0); @@ -437,3 +436,14 @@ wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } +static void +hv_tc_init(void) +{ + if (vm_guest != VM_GUEST_HV) + return; + + /* register virtual timecounter */ + tc_init(&hv_timecounter); +} + +SYSINIT(hv_tc_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hv_tc_init, NULL);