+ } while (!swap_success && ((current_mabs_time = mach_absolute_time()) < max_mabs_time));
+
+ /*
+ * If we time out while waiting for the target CPU to respond, it's possible that no
+ * other CPU is available to handle the watchdog interrupt that would eventually trigger
+ * a panic. To prevent this from happening, we just panic here to flag this condition.
+ */
+ if (__improbable(current_mabs_time >= max_mabs_time)) {
+ uint64_t end_time_ns, xcall_ack_timeout_ns;
+ absolutetime_to_nanoseconds(current_mabs_time - start_mabs_time, &end_time_ns);
+ absolutetime_to_nanoseconds(xcall_ack_timeout_abstime, &xcall_ack_timeout_ns);
+ panic("CPU%u has failed to respond to cross-call after %llu nanoseconds (timeout = %llu ns)",
+ target_proc->cpu_number, end_time_ns, xcall_ack_timeout_ns);
+ }