+ * Past this point, kernel subsystems that expect to operate with
+ * interrupts or preemption enabled may begin enforcement.
+ */
+ early_boot_complete = TRUE;
+
+#if INTERRUPT_MASKED_DEBUG
+ // Reset interrupts masked timeout before we enable interrupts
+ ml_spin_debug_clear_self();
+#endif
+ (void) spllo(); /* Allow interruptions */
+
+#if (defined(__i386__) || defined(__x86_64__)) && NCOPY_WINDOWS > 0
+ /*
+ * Create and initialize the copy window for processor 0
+ * This also allocates window space for all other processors.
+ * However, this is dependent on the number of processors - so this call
+ * must be after IOKit has been started because IOKit performs processor
+ * discovery.
+ */
+ cpu_userwindow_init(0);
+#endif
+
+ /*
+ * Initialize the shared region module.
+ */
+ vm_shared_region_init();
+ vm_commpage_init();
+ vm_commpage_text_init();
+
+#if CONFIG_MACF
+ kernel_bootstrap_log("mac_policy_initmach");
+ mac_policy_initmach();
+#if CONFIG_VNGUARD
+ vnguard_policy_init();
+#endif
+#endif
+
+#if CONFIG_DTRACE
+ dtrace_early_init();
+ sdt_early_init();
+#endif
+
+
+ /*
+ * Get rid of segments used to bootstrap kext loading. This removes
+ * the KLD, PRELINK symtab, LINKEDIT, and symtab segments/load commands.
+ * Must be done prior to lockdown so that we can free (and possibly relocate)
+ * the static KVA mappings used for the jettisoned bootstrap segments.
+ */
+ OSKextRemoveKextBootstrap();
+#if defined(__arm__) || defined(__arm64__)
+#if CONFIG_KERNEL_INTEGRITY
+ machine_lockdown_preflight();
+#endif
+ /*
+ * Finalize protections on statically mapped pages now that comm page mapping is established.
+ */
+ arm_vm_prot_finalize(PE_state.bootArgs);
+#endif
+
+ /*
+ * Initialize the globals used for permuting kernel
+ * addresses that may be exported to userland as tokens
+ * using VM_KERNEL_ADDRPERM()/VM_KERNEL_ADDRPERM_EXTERNAL().
+ * Force the random number to be odd to avoid mapping a non-zero
+ * word-aligned address to zero via addition.
+ * Note: at this stage we can use the cryptographically secure PRNG
+ * rather than early_random().