tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xcall while cold == 1



On 2017/12/25 20:26, Martin Husemann wrote:
On Mon, Dec 25, 2017 at 03:42:06PM +0900, Masanobu SAITOH wrote:
  Is this intended behavior? Is it possible to use xcall while
cold==1?

Cold is (as you noted) not the right condition (but pretty close).

Xcalls don't really make any sense before cpus have been spun up.
In your case it might be good to do the loop checking for SPCF_RUNNING
and if <= 1 is found, use the code path for single cpu systems (the
current else statatement).

In init_main.c::configure2():

        cold = 0;       /* clocks are running, we're warm now! */
        s = splsched();
        curcpu()->ci_schedstate.spc_flags |= SPCF_RUNNING;
        splx(s);

        /* Boot the secondary processors. */
        for (CPU_INFO_FOREACH(cii, ci)) {
                uvm_cpu_attach(ci);
        }
        mp_online = true;

so checking mp_online is the best, right?

Martin



--
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index