<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=625064416-09092005><FONT face=Arial color=#0000ff size=2>Based
on the mainboard config files I see, it looks like the only purpose of
SERIAL_CPU_INIT is to work around the nested spinlock issue with Intel
hyperthreaded CPUs. I don't think this is the best solution to the problem. To
me, 'SERIAL_CPU_INIT' implies a free choice - I can choose whether my CPUs are
initialized serially or concurrently, and either choice is acceptable. But
that's not the way it works; making the wrong choice on Intel systems causes the
system to hang.</FONT></SPAN></DIV>
<DIV><SPAN class=625064416-09092005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=625064416-09092005><FONT face=Arial color=#0000ff>I think a
better solution will do away with SERIAL_CPU_INIT, but might keep the spinlock
bracket around cpu_initialize(). The question is how to reconcile the
differences between AMD and Intel SMP startup. Can you provide any suggestions
from the AMD viewpoint?</FONT></SPAN></DIV>
<DIV><SPAN class=625064416-09092005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=625064416-09092005><FONT face=Arial
color=#0000ff>Steve</FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> yhlu
[mailto:yinghailu@gmail.com] <BR><B>Sent:</B> Friday, September 09, 2005 10:01
AM<BR><B>To:</B> Steven J. Magnani<BR><B>Cc:</B>
linuxbios@openbios.org<BR><B>Subject:</B> Re: [LinuxBIOS] PATCH: nested
spinlock hang when initializing x86 sibling CPUs<BR><BR></FONT></DIV>You need
to keep SERIAL_CPU_INIT.<BR><BR>reason is for AMD K8 cpu_init regarding
init_ecc there maybe some conflict on console.<BR><BR>You can disable it by
set it to 0.<BR><BR>YH<BR><BR><BR>
<DIV><SPAN class=gmail_quote>On 9/9/05, <B class=gmail_sendername>Steven J.
Magnani</B> <<A
href="mailto:steve@digidescorp.com">steve@digidescorp.com</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">This
patch resolves the issue identified in<BR><A
href="http://openbios.org/pipermail/linuxbios/2005-July/011903.html">http://openbios.org/pipermail/linuxbios/2005-July/011903.html</A>.<BR><BR>Changes:<BR>*
Remove spinlock bracketing of cpu_initialize() call <BR>* Drop
SERIAL_CPU_INIT option<BR>* (Unrelated) Attempt more descriptive comments
for various config<BR>options<BR><BR>PATCH:<BR><BR>---
src/cpu/x86/lapic/lapic_cpu_init.c.orig
2005-09-09<BR>09:29:25.156250000 -0500 <BR>+++
src/cpu/x86/lapic/lapic_cpu_init.c 2005-09-09
09:31:59.109375000<BR>-0500<BR>@@ -230,17 +230,16 @@<BR>void
secondary_cpu_init(void)<BR>{<BR> atomic_inc(&active_cpus);<BR>-#if
SERIAL_CPU_INIT == 1<BR>- #if
CONFIG_MAX_CPUS>2<BR>-
spin_lock(&start_cpu_lock);<BR>- #endif<BR>-#endif<BR>+<BR>+
// NOTE: The call to cpu_initialize() used to be bracketed
by<BR>+
// calls to lock and unlock the
start_cpu_lock spin lock.<BR>+
// These were removed to resolve a hang
due to nested spin<BR>locking<BR>+
// when secondary CPUs go to initialize
their siblings.<BR>+
// See<BR><A
href="http://openbios.org/pipermail/linuxbios/2005-July/011903.html">http://openbios.org/pipermail/linuxbios/2005-July/011903.html</A>.<BR>+
// It's possible that some other form of
concurrency <BR>control<BR>+
// is needed at this
level.<BR> cpu_initialize();<BR>-#if
SERIAL_CPU_INIT == 1<BR>- #if
CONFIG_MAX_CPUS>2<BR>-
spin_unlock(&start_cpu_lock);<BR>- #endif<BR>-#endif<BR>+<BR> atomic_dec(&active_cpus);<BR> stop_this_cpu();<BR>}<BR>@@
-265,11 +264,9
@@<BR> printk_err("CPU %u
would not
start!\n",<BR> cpu->path.u.apic.apic_id);<BR> }<BR>-#if
SERIAL_CPU_INIT == 1<BR> #if
CONFIG_MAX_CPUS>2<BR> udelay(10);<BR>
#endif<BR>-#endif
<BR> }<BR><BR> /*
Now loop until the other cpus have finished initializing */<BR>---
src/config/Options.lb.orig 2005-09-09 09:36:27.562500000
-0500<BR>+++ src/config/Options.lb
2005-09-09 09:35:17.125000000 -0500<BR>@@ -188,37 +188,37
@@<BR> default
65536<BR> format
"0x%x"<BR> export
used<BR>- comment "Default fallback
image size"<BR>+ comment
"ROM_SECTION_SIZE to use for the fallback build." <BR>end<BR>define
ROM_SIZE<BR> default
none<BR> format
"0x%x"<BR> export
used<BR>- comment "Size of your
ROM"<BR>+ comment "Total number of bytes
allocated for normal and fallback <BR>LinuxBIOS images and payloads. Note
that the fallback image goes at the<BR>end of the ROM, and the normal image
at the beginning."<BR>end<BR>define
ROM_IMAGE_SIZE<BR> default
65535<BR> format "0x%x"
<BR> export
always<BR>- comment "Default image
size"<BR>+ comment "Maximum number of
bytes allowed for a LinuxBIOS image.<BR>Does not include the
payload."<BR>end<BR>define ROM_SECTION_SIZE
<BR> default
{FALLBACK_SIZE}<BR> format
"0x%x"<BR> export
used<BR>- comment "Default rom section
size"<BR>+ comment "Default rom section
size. Normally, this is calculated <BR>in mainboard <A
href="http://Config.lb">Config.lb</A> and varies between the normal and
fallback<BR>builds."<BR>end<BR>define
ROM_SECTION_OFFSET<BR> default
{ROM_SIZE -
FALLBACK_SIZE}<BR> format
"0x%x" <BR> export
used<BR>- comment "Default rom section
offset"<BR>+ comment "Number of bytes
from the beginning of the ROM to the<BR>start of the section containing this
build (normal or fallback). <BR>Normally, this is calculated in mainboard <A
href="http://Config.lb">Config.lb</A>."<BR>end<BR>define
PAYLOAD_SIZE<BR> default
{ROM_SECTION_SIZE -
ROM_IMAGE_SIZE}<BR> format
"0x%x"<BR> export always
<BR>- comment "Default payload
size"<BR>+ comment "Maximum number of
bytes allowed for a payload.<BR>Normally, this is calculated as
above."<BR>end<BR>define
_ROMBASE<BR> default
{PAYLOAD_SIZE} <BR>@@ -479,7 +479,7
@@<BR> export
used<BR> comment "System
clock frequency in
MHz"<BR>end<BR>-<BR>+<BR>###############################################<BR>#
SMP options<BR>############################################### <BR>@@
-509,11 +509,6 @@<BR> export
used<BR> comment "Define to
build an MP table"<BR>end<BR>-define
SERIAL_CPU_INIT<BR>- default
1<BR>- export
always<BR>- comment
"Serialize CPU init"
<BR>-end<BR><BR>###############################################<BR># Boot
options<BR>@@ -533,7 +528,7
@@<BR> default {0xffffffff -
ROM_SIZE + ROM_SECTION_OFFSET +
1}<BR> format
"0x%x"<BR> export always
<BR>- comment "ROM stream start
location"<BR>+ comment "Memory address
of this (normal or fallback) build's<BR>payload in ROM. Normally, this is
calculated as above."<BR>end<BR>define CONFIG_FS_STREAM
<BR> default 0<BR><BR><BR>---
src/mainboard/tyan/s2735/Options.lb.orig 2005-09-08<BR>13:35:22.453125000
-0500<BR>+++ src/mainboard/tyan/s2735/Options.lb 2005-09-09
09:21:21.531250000<BR>-0500<BR>@@ -8,7 +8,6 @@<BR>uses
CONFIG_MAX_CPUS<BR>uses CONFIG_MAX_PHYSICAL_CPUS<BR>uses
CONFIG_LOGICAL_CPUS<BR>-uses SERIAL_CPU_INIT<BR>uses CONFIG_IOAPIC<BR>uses
CONFIG_SMP<BR>uses FALLBACK_SIZE<BR>@@ -127,8 +126,6 @@<BR>default
CONFIG_MAX_PHYSICAL_CPUS=2 <BR>default CONFIG_LOGICAL_CPUS=1<BR><BR>-default
SERIAL_CPU_INIT=0<BR>-<BR>#BTEXT Console<BR>#default
CONFIG_CONSOLE_BTEXT=1<BR><BR>------------------------------------------------------------------------<BR>Steven
J.
Magnani
"I claim this network for MARS!<BR><A
href="http://www.digidescorp.com">www.digidescorp.com</A> Earthling,
return my space modulator!"<BR><BR>#include
<standard.disclaimer><BR><BR><BR><BR><BR><BR><BR>--<BR>LinuxBIOS
mailing list<BR><A
href="mailto:LinuxBIOS@openbios.org">LinuxBIOS@openbios.org</A><BR><A
href="http://www.openbios.org/mailman/listinfo/linuxbios">http://www.openbios.org/mailman/listinfo/linuxbios</A><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>