<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Message</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This has nothing to do with AMD or intel.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>For AMD four ways single core system, or
two way dual core system.  If you need to set SERIAL_CPU_INIT = 0 , you may
need to set loglevel to 7 instead of 8.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>For 8 ways Opteron system, if you set
SERIAL_CPU_INIT=0, the mem on node1-node7, will be init_ecc at the same time to
reduce init time from 7x to 1.1x.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If intel has NUMA support, there will be
the same.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>But if you need debug info or better
output message format, you need to set SERIAL_CPU_INIT = 1.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>YH<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
linuxbios-bounces@openbios.org [mailto:linuxbios-bounces@openbios.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Steven J. Magnani<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, September 09, 2005
9:51 AM<br>
<b><span style='font-weight:bold'>To:</span></b> yinghailu@gmail.com<br>
<b><span style='font-weight:bold'>Cc:</span></b> linuxbios@openbios.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [LinuxBIOS] PATCH:
nested spinlock hang when initializing x86 sibling CPUs</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 color=blue face=Arial><span style='font-size:
12.0pt;font-family:Arial;color:blue'>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?</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 color=blue face=Arial><span style='font-size:
12.0pt;font-family:Arial;color:blue'>Steve</span></font><o:p></o:p></p>

</div>

<blockquote style='margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> yhlu
[mailto:yinghailu@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, September 09, 2005
10:01 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Steven J. Magnani<br>
<b><span style='font-weight:bold'>Cc:</span></b> linuxbios@openbios.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [LinuxBIOS] PATCH:
nested spinlock hang when initializing x86 sibling CPUs</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>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>
<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 9/9/05, <b><span style='font-weight:bold'>Steven J.
Magnani</span></b> <<a href="mailto:steve@digidescorp.com">steve@digidescorp.com</a>>
wrote:</span></font></span> <o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</blockquote>

</div>

</body>

</html>