diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-06-04 00:06:47 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-06-04 00:06:47 -0500 |
commit | 95be4fb0378e88b4a64a2da93e8ef4611475a916 (patch) | |
tree | 9f0bc0e9ce71cd8f9cd188d05d222c270e1eb7a3 /sys/dev | |
parent | 86090dab28cac4f1f2e538992eebffe04fc5041f (diff) | |
download | FreeBSD-src-95be4fb0378e88b4a64a2da93e8ef4611475a916.zip FreeBSD-src-95be4fb0378e88b4a64a2da93e8ef4611475a916.tar.gz |
Import patch from FreeBSD D5778 to fix "runtime went backwards" in Hyper-V. Ticket #6446
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hyperv/vmbus/hv_hv.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c index ca5641f..5589895 100644 --- a/sys/dev/hyperv/vmbus/hv_hv.c +++ b/sys/dev/hyperv/vmbus/hv_hv.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/pcpu.h> #include <sys/timetc.h> +#include <sys/kernel.h> #include <machine/bus.h> #include <machine/md_var.h> #include <vm/vm.h> @@ -211,8 +212,6 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; - tc_init(&hv_timecounter); /* register virtual timecount */ - hv_et_init(); return (0); @@ -427,3 +426,14 @@ void hv_vmbus_synic_cleanup(void *arg) 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); |