Date: Mon, 27 Jan 2020 13:12:41 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357171 - stable/12/sys/x86/x86 Message-ID: <202001271312.00RDCfk1027397@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jan 27 13:12:40 2020 New Revision: 357171 URL: https://svnweb.freebsd.org/changeset/base/357171 Log: MFC r356919,r357054: x86: Wait for curpcb to be set up as an indicator that the boot stack is no longer used. Modified: stable/12/sys/x86/x86/mp_x86.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/mp_x86.c ============================================================================== --- stable/12/sys/x86/x86/mp_x86.c Mon Jan 27 12:02:47 2020 (r357170) +++ stable/12/sys/x86/x86/mp_x86.c Mon Jan 27 13:12:40 2020 (r357171) @@ -1074,6 +1074,11 @@ init_secondary_tail(void) cpu_initclocks_ap(); #endif + /* + * Assert that smp_after_idle_runnable condition is reasonable. + */ + MPASS(PCPU_GET(curpcb) == NULL); + sched_throw(NULL); panic("scheduler returned us to %s", __func__); @@ -1083,13 +1088,12 @@ init_secondary_tail(void) static void smp_after_idle_runnable(void *arg __unused) { - struct thread *idle_td; + struct pcpu *pc; int cpu; for (cpu = 1; cpu < mp_ncpus; cpu++) { - idle_td = pcpu_find(cpu)->pc_idlethread; - while (idle_td->td_lastcpu == NOCPU && - idle_td->td_oncpu == NOCPU) + pc = pcpu_find(cpu); + while (atomic_load_ptr(&pc->pc_curpcb) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001271312.00RDCfk1027397>