Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167206446
D33014.id98601.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33014.id98601.diff
View Options
Index: sys/dev/hyperv/vmbus/hyperv.c
===================================================================
--- sys/dev/hyperv/vmbus/hyperv.c
+++ sys/dev/hyperv/vmbus/hyperv.c
@@ -247,15 +247,12 @@
/* Set guest id */
wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD);
-}
-SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init,
- NULL);
-
-static void
-hyperv_tc_init(void *arg __unused)
-{
if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) {
- /* Register Hyper-V timecounter */
+ /*
+ * Register Hyper-V timecounter. This should be done as early
+ * as possible to let DELAY() work, since the 8254 PIT is not
+ * reliably emulated or even available.
+ */
tc_init(&hyperv_timecounter);
/*
@@ -265,7 +262,8 @@
hyperv_tc64 = hyperv_tc64_rdmsr;
}
}
-SYSINIT(hyperv_tc_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, hyperv_tc_init, NULL);
+SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init,
+ NULL);
static void
hypercall_memfree(void)
Index: sys/kern/kern_tc.c
===================================================================
--- sys/kern/kern_tc.c
+++ sys/kern/kern_tc.c
@@ -99,7 +99,6 @@
/* Mutex to protect the timecounter list. */
static struct mtx tc_lock;
-MTX_SYSINIT(tc_lock, &tc_lock, "tc", MTX_DEF);
int tc_min_ticktock_freq = 1;
@@ -1989,6 +1988,8 @@
TUNABLE_STR_FETCH("kern.timecounter.hardware", tc_from_tunable,
sizeof(tc_from_tunable));
+
+ mtx_init(&tc_lock, "tc", NULL, MTX_DEF);
}
SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 20, 10:51 PM (4 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37011693
Default Alt Text
D33014.id98601.diff (1 KB)
Attached To
Mode
D33014: timecounter: Initialize tc_lock earlier
Attached
Detach File
Event Timeline
Log In to Comment