Loading...
iokit/Kernel/IOStartIOKit.cpp xnu-12377.101.15 xnu-8019.61.5
--- xnu/xnu-12377.101.15/iokit/Kernel/IOStartIOKit.cpp
+++ xnu/xnu-8019.61.5/iokit/Kernel/IOStartIOKit.cpp
@@ -77,8 +77,11 @@
 	t.tv_sec = 30;
 	t.tv_nsec = 0;
 
+// RTC is not present on this target
+#ifndef BCM2837
 	IOService::waitForService(
 		IOService::resourceMatching("IORTC"), &t );
+#endif
 #if defined(__i386__) || defined(__x86_64__)
 	IOService::waitForService(
 		IOService::resourceMatching("IONVRAM"), &t );
@@ -130,6 +133,15 @@
 void
 InitIOKit(void *dtTop)
 {
+	// Enable IOWaitQuiet panics on arm64 macOS except on KASAN.
+	// existing 3rd party KEXTs may hold the registry busy on x86 RELEASE kernels.
+	// Enabling this on other platforms is tracked in rdar://66364108
+#if XNU_TARGET_OS_OSX && defined(__arm64__) && !KASAN
+	if (gIOKitDebug == DEBUG_INIT_VALUE) {
+		gIOKitDebug |= kIOWaitQuietPanics;
+	}
+#endif
+
 	// Compat for boot-args
 	gIOKitTrace |= (gIOKitDebug & kIOTraceCompatBootArgs);
 
@@ -177,7 +189,7 @@
 void
 StartIOKitMatching(void)
 {
-	SOCD_TRACE_XNU(START_IOKIT, SOCD_TRACE_MODE_NONE);
+	SOCD_TRACE_XNU(START_IOKIT);
 	assert(gRootNub != NULL);
 	bool ok = gRootNub->startIOServiceMatching();
 	if (__improbable(!ok)) {
@@ -185,14 +197,12 @@
 	}
 
 #if !NO_KEXTD
-	if (OSKext::iokitDaemonAvailable()) {
-		/* Add a busy count to keep the registry busy until the IOKit daemon has
-		 * completely finished launching. This is decremented when the IOKit daemon
-		 * messages the kernel after the in-kernel linker has been
-		 * removed and personalities have been sent.
-		 */
-		IOService::getServiceRoot()->adjustBusy(1);
-	}
+	/* Add a busy count to keep the registry busy until kextd has
+	 * completely finished launching. This is decremented when kextd
+	 * messages the kernel after the in-kernel linker has been
+	 * removed and personalities have been sent.
+	 */
+	IOService::getServiceRoot()->adjustBusy(1);
 #endif
 }