@Kijewski  Did you check whether all implementations of cpu_switch_context_exit change stacks before calling sched_run?