]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Amd64 init_secondary() calls initializecpu() while curthread is still
authorkib <kib@FreeBSD.org>
Fri, 13 Nov 2009 13:07:01 +0000 (13:07 +0000)
committerkib <kib@FreeBSD.org>
Fri, 13 Nov 2009 13:07:01 +0000 (13:07 +0000)
commit4266fed8b75e8b7d04914e377aa667d50b5d056d
tree99fbcbdd7a55a5a1d8c22d1f314fb792180ea62e
parent155d1871ea98bf7f1f3ec787fcdcdb8eedbbfd55
Amd64 init_secondary() calls initializecpu() while curthread is still
not properly set up. r199067 added the call to TUNABLE_INT_FETCH() to
initializecpu() that results in hang because AP are started when kernel
environment is already dynamic and thus needs to acquire mutex, that is
too early in AP start sequence to work.

Extract the code that should be executed only once, because it sets
up global variables, from initializecpu() to initializecpucache(),
and call the later only from hammer_time() executed on BSP. Now,
TUNABLE_INT_FETCH() is done only once at BSP at the early boot stage.

In collaboration with: Mykola Dzham <freebsd levsha org ua>
Reviewed by: jhb
Tested by: ed, battlez
sys/amd64/amd64/initcpu.c
sys/amd64/amd64/machdep.c
sys/amd64/include/md_var.h