Loading...
iokit/Kernel/IOStartIOKit.cpp xnu-10002.1.13 xnu-8019.80.24
--- xnu/xnu-10002.1.13/iokit/Kernel/IOStartIOKit.cpp
+++ xnu/xnu-8019.80.24/iokit/Kernel/IOStartIOKit.cpp
@@ -133,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);
 
@@ -188,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
 }