summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/initcpu.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-11-13 13:07:01 +0000
committerkib <kib@FreeBSD.org>2009-11-13 13:07:01 +0000
commit4266fed8b75e8b7d04914e377aa667d50b5d056d (patch)
tree99fbcbdd7a55a5a1d8c22d1f314fb792180ea62e /sys/amd64/amd64/initcpu.c
parent155d1871ea98bf7f1f3ec787fcdcdb8eedbbfd55 (diff)
downloadFreeBSD-src-4266fed8b75e8b7d04914e377aa667d50b5d056d.zip
FreeBSD-src-4266fed8b75e8b7d04914e377aa667d50b5d056d.tar.gz
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
Diffstat (limited to 'sys/amd64/amd64/initcpu.c')
-rw-r--r--sys/amd64/amd64/initcpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 19b784c..c97ad3d 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -163,6 +163,11 @@ initializecpu(void)
CPUID_TO_FAMILY(cpu_id) == 0x6 &&
CPUID_TO_MODEL(cpu_id) >= 0xf)
init_via();
+}
+
+void
+initializecpucache()
+{
/*
* CPUID with %eax = 1, %ebx returns
OpenPOWER on IntegriCloud