Bari Ari wrote:
>
> Is workshop #9 "LinuxBIOS Summit (full day)" going to be on just Tuesday
> Oct 11?
Thank you, Bari, for asking this. The linuxbios summit as currently
planned is a 2.5 day affair. I will try to get the web page fixed.
ron
Trying to get myself up to date on the linuxbios offerings and have a very specific need to get the VIA MII 6000 to CF boot! I see the wiki page of:
http://linuxbios.org/index.php/Supported_Motherboards
that says, "Location in source tree: targets/via/epia-mii", but browsing the CVS tree ([LinuxBIOS] / trunk / LinuxBIOSv2 / targets / via) does NOT show "epia-m".
Did the mii stuff drop from the linuxbios?
HELP please
PJ
Please do not touch SERIAL_CPU_INIT. That doesn't hurt.
YH
-----Original Message-----
From: Steven J. Magnani [mailto:steve@digidescorp.com]
Sent: Friday, September 09, 2005 12:59 PM
To: Lu, Yinghai; yinghailu(a)gmail.com
Cc: linuxbios(a)openbios.org
Subject: RE: [LinuxBIOS] PATCH: nested spinlock hang when initializing
x86 sibling CPUs
Here is a revised patch which works in the Intel world. Let me know if
this causes any problems in the AMD world.
I'm still planning on making the comment changes to
src/config/Options.lb, unless someone thinks I've made things more
confusing.
PATCH:
--- src/cpu/x86/lapic/lapic_cpu_init.c.orig 2005-09-09
09:29:25.156250000 -0500
+++ src/cpu/x86/lapic/lapic_cpu_init.c 2005-09-09 14:54:51.218750000
-0500
@@ -227,20 +227,26 @@
}
/* C entry point of secondary cpus */
+
+// secondary_cpu_lock is used to serialize initialization of secondary
CPUs
+// This can be used to avoid interleaved debugging messages.
+
+static spinlock_t secondary_cpu_lock = SPIN_LOCK_UNLOCKED;
+
void secondary_cpu_init(void)
{
atomic_inc(&active_cpus);
+
#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_lock(&start_cpu_lock);
- #endif
+ spin_lock(&secondary_cpu_lock);
#endif
+
cpu_initialize();
+
#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_unlock(&start_cpu_lock);
- #endif
+ spin_unlock(&secondary_cpu_lock);
#endif
+
atomic_dec(&active_cpus);
stop_this_cpu();
}
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
Here is a revised patch which works in the Intel world. Let me know if
this causes any problems in the AMD world.
I'm still planning on making the comment changes to
src/config/Options.lb, unless someone thinks I've made things more
confusing.
PATCH:
--- src/cpu/x86/lapic/lapic_cpu_init.c.orig 2005-09-09
09:29:25.156250000 -0500
+++ src/cpu/x86/lapic/lapic_cpu_init.c 2005-09-09 14:54:51.218750000
-0500
@@ -227,20 +227,26 @@
}
/* C entry point of secondary cpus */
+
+// secondary_cpu_lock is used to serialize initialization of secondary
CPUs
+// This can be used to avoid interleaved debugging messages.
+
+static spinlock_t secondary_cpu_lock = SPIN_LOCK_UNLOCKED;
+
void secondary_cpu_init(void)
{
atomic_inc(&active_cpus);
+
#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_lock(&start_cpu_lock);
- #endif
+ spin_lock(&secondary_cpu_lock);
#endif
+
cpu_initialize();
+
#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_unlock(&start_cpu_lock);
- #endif
+ spin_unlock(&secondary_cpu_lock);
#endif
+
atomic_dec(&active_cpus);
stop_this_cpu();
}
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
This has nothing to do with AMD or intel.
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.
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.
If intel has NUMA support, there will be the same.
But if you need debug info or better output message format, you need to
set SERIAL_CPU_INIT = 1.
YH
________________________________
From: linuxbios-bounces(a)openbios.org
[mailto:linuxbios-bounces@openbios.org] On Behalf Of Steven J. Magnani
Sent: Friday, September 09, 2005 9:51 AM
To: yinghailu(a)gmail.com
Cc: linuxbios(a)openbios.org
Subject: RE: [LinuxBIOS] PATCH: nested spinlock hang when initializing
x86 sibling CPUs
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.
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?
Steve
-----Original Message-----
From: yhlu [mailto:yinghailu@gmail.com]
Sent: Friday, September 09, 2005 10:01 AM
To: Steven J. Magnani
Cc: linuxbios(a)openbios.org
Subject: Re: [LinuxBIOS] PATCH: nested spinlock hang when
initializing x86 sibling CPUs
You need to keep SERIAL_CPU_INIT.
reason is for AMD K8 cpu_init regarding init_ecc there maybe
some conflict on console.
You can disable it by set it to 0.
YH
On 9/9/05, Steven J. Magnani <steve(a)digidescorp.com> wrote:
This patch resolves the issue identified in
http://openbios.org/pipermail/linuxbios/2005-July/011903.html.
Changes:
* Remove spinlock bracketing of cpu_initialize() call
* Drop SERIAL_CPU_INIT option
* (Unrelated) Attempt more descriptive comments for various
config
options
PATCH:
--- src/cpu/x86/lapic/lapic_cpu_init.c.orig 2005-09-09
09:29:25.156250000 -0500
+++ src/cpu/x86/lapic/lapic_cpu_init.c 2005-09-09
09:31:59.109375000
-0500
@@ -230,17 +230,16 @@
void secondary_cpu_init(void)
{
atomic_inc(&active_cpus);
-#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_lock(&start_cpu_lock);
- #endif
-#endif
+
+ // NOTE: The call to cpu_initialize() used to be
bracketed by
+ // calls to lock and unlock the start_cpu_lock
spin lock.
+ // These were removed to resolve a hang due to
nested spin
locking
+ // when secondary CPUs go to initialize their
siblings.
+ // See
http://openbios.org/pipermail/linuxbios/2005-July/011903.html.
+ // It's possible that some other form of
concurrency
control
+ // is needed at this level.
cpu_initialize();
-#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_unlock(&start_cpu_lock);
- #endif
-#endif
+
atomic_dec(&active_cpus);
stop_this_cpu();
}
@@ -265,11 +264,9 @@
printk_err("CPU %u would not start!\n",
cpu->path.u.apic.apic_id);
}
-#if SERIAL_CPU_INIT == 1
#if CONFIG_MAX_CPUS>2
udelay(10);
#endif
-#endif
}
/* Now loop until the other cpus have finished
initializing */
--- src/config/Options.lb.orig 2005-09-09 09:36:27.562500000
-0500
+++ src/config/Options.lb 2005-09-09 09:35:17.125000000
-0500
@@ -188,37 +188,37 @@
default 65536
format "0x%x"
export used
- comment "Default fallback image size"
+ comment "ROM_SECTION_SIZE to use for the fallback
build."
end
define ROM_SIZE
default none
format "0x%x"
export used
- comment "Size of your ROM"
+ comment "Total number of bytes allocated for normal and
fallback
LinuxBIOS images and payloads. Note that the fallback image goes
at the
end of the ROM, and the normal image at the beginning."
end
define ROM_IMAGE_SIZE
default 65535
format "0x%x"
export always
- comment "Default image size"
+ comment "Maximum number of bytes allowed for a LinuxBIOS
image.
Does not include the payload."
end
define ROM_SECTION_SIZE
default {FALLBACK_SIZE}
format "0x%x"
export used
- comment "Default rom section size"
+ comment "Default rom section size. Normally, this is
calculated
in mainboard Config.lb and varies between the normal and
fallback
builds."
end
define ROM_SECTION_OFFSET
default {ROM_SIZE - FALLBACK_SIZE}
format "0x%x"
export used
- comment "Default rom section offset"
+ comment "Number of bytes from the beginning of the ROM
to the
start of the section containing this build (normal or fallback).
Normally, this is calculated in mainboard Config.lb."
end
define PAYLOAD_SIZE
default {ROM_SECTION_SIZE - ROM_IMAGE_SIZE}
format "0x%x"
export always
- comment "Default payload size"
+ comment "Maximum number of bytes allowed for a payload.
Normally, this is calculated as above."
end
define _ROMBASE
default {PAYLOAD_SIZE}
@@ -479,7 +479,7 @@
export used
comment "System clock frequency in MHz"
end
-
+
###############################################
# SMP options
###############################################
@@ -509,11 +509,6 @@
export used
comment "Define to build an MP table"
end
-define SERIAL_CPU_INIT
- default 1
- export always
- comment "Serialize CPU init"
-end
###############################################
# Boot options
@@ -533,7 +528,7 @@
default {0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1}
format "0x%x"
export always
- comment "ROM stream start location"
+ comment "Memory address of this (normal or fallback)
build's
payload in ROM. Normally, this is calculated as above."
end
define CONFIG_FS_STREAM
default 0
--- src/mainboard/tyan/s2735/Options.lb.orig 2005-09-08
13:35:22.453125000 -0500
+++ src/mainboard/tyan/s2735/Options.lb 2005-09-09
09:21:21.531250000
-0500
@@ -8,7 +8,6 @@
uses CONFIG_MAX_CPUS
uses CONFIG_MAX_PHYSICAL_CPUS
uses CONFIG_LOGICAL_CPUS
-uses SERIAL_CPU_INIT
uses CONFIG_IOAPIC
uses CONFIG_SMP
uses FALLBACK_SIZE
@@ -127,8 +126,6 @@
default CONFIG_MAX_PHYSICAL_CPUS=2
default CONFIG_LOGICAL_CPUS=1
-default SERIAL_CPU_INIT=0
-
#BTEXT Console
#default CONFIG_CONSOLE_BTEXT=1
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space
modulator!"
#include <standard.disclaimer>
--
LinuxBIOS mailing list
LinuxBIOS(a)openbios.org
http://www.openbios.org/mailman/listinfo/linuxbios
This patch resolves the issue identified in
http://openbios.org/pipermail/linuxbios/2005-July/011903.html.
Changes:
* Remove spinlock bracketing of cpu_initialize() call
* Drop SERIAL_CPU_INIT option
* (Unrelated) Attempt more descriptive comments for various config
options
PATCH:
--- src/cpu/x86/lapic/lapic_cpu_init.c.orig 2005-09-09
09:29:25.156250000 -0500
+++ src/cpu/x86/lapic/lapic_cpu_init.c 2005-09-09 09:31:59.109375000
-0500
@@ -230,17 +230,16 @@
void secondary_cpu_init(void)
{
atomic_inc(&active_cpus);
-#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_lock(&start_cpu_lock);
- #endif
-#endif
+
+ // NOTE: The call to cpu_initialize() used to be bracketed by
+ // calls to lock and unlock the start_cpu_lock spin lock.
+ // These were removed to resolve a hang due to nested spin
locking
+ // when secondary CPUs go to initialize their siblings.
+ // See
http://openbios.org/pipermail/linuxbios/2005-July/011903.html.
+ // It's possible that some other form of concurrency
control
+ // is needed at this level.
cpu_initialize();
-#if SERIAL_CPU_INIT == 1
- #if CONFIG_MAX_CPUS>2
- spin_unlock(&start_cpu_lock);
- #endif
-#endif
+
atomic_dec(&active_cpus);
stop_this_cpu();
}
@@ -265,11 +264,9 @@
printk_err("CPU %u would not start!\n",
cpu->path.u.apic.apic_id);
}
-#if SERIAL_CPU_INIT == 1
#if CONFIG_MAX_CPUS>2
udelay(10);
#endif
-#endif
}
/* Now loop until the other cpus have finished initializing */
--- src/config/Options.lb.orig 2005-09-09 09:36:27.562500000 -0500
+++ src/config/Options.lb 2005-09-09 09:35:17.125000000 -0500
@@ -188,37 +188,37 @@
default 65536
format "0x%x"
export used
- comment "Default fallback image size"
+ comment "ROM_SECTION_SIZE to use for the fallback build."
end
define ROM_SIZE
default none
format "0x%x"
export used
- comment "Size of your ROM"
+ comment "Total number of bytes allocated for normal and fallback
LinuxBIOS images and payloads. Note that the fallback image goes at the
end of the ROM, and the normal image at the beginning."
end
define ROM_IMAGE_SIZE
default 65535
format "0x%x"
export always
- comment "Default image size"
+ comment "Maximum number of bytes allowed for a LinuxBIOS image.
Does not include the payload."
end
define ROM_SECTION_SIZE
default {FALLBACK_SIZE}
format "0x%x"
export used
- comment "Default rom section size"
+ comment "Default rom section size. Normally, this is calculated
in mainboard Config.lb and varies between the normal and fallback
builds."
end
define ROM_SECTION_OFFSET
default {ROM_SIZE - FALLBACK_SIZE}
format "0x%x"
export used
- comment "Default rom section offset"
+ comment "Number of bytes from the beginning of the ROM to the
start of the section containing this build (normal or fallback).
Normally, this is calculated in mainboard Config.lb."
end
define PAYLOAD_SIZE
default {ROM_SECTION_SIZE - ROM_IMAGE_SIZE}
format "0x%x"
export always
- comment "Default payload size"
+ comment "Maximum number of bytes allowed for a payload.
Normally, this is calculated as above."
end
define _ROMBASE
default {PAYLOAD_SIZE}
@@ -479,7 +479,7 @@
export used
comment "System clock frequency in MHz"
end
-
+
###############################################
# SMP options
###############################################
@@ -509,11 +509,6 @@
export used
comment "Define to build an MP table"
end
-define SERIAL_CPU_INIT
- default 1
- export always
- comment "Serialize CPU init"
-end
###############################################
# Boot options
@@ -533,7 +528,7 @@
default {0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1}
format "0x%x"
export always
- comment "ROM stream start location"
+ comment "Memory address of this (normal or fallback) build's
payload in ROM. Normally, this is calculated as above."
end
define CONFIG_FS_STREAM
default 0
--- src/mainboard/tyan/s2735/Options.lb.orig 2005-09-08
13:35:22.453125000 -0500
+++ src/mainboard/tyan/s2735/Options.lb 2005-09-09 09:21:21.531250000
-0500
@@ -8,7 +8,6 @@
uses CONFIG_MAX_CPUS
uses CONFIG_MAX_PHYSICAL_CPUS
uses CONFIG_LOGICAL_CPUS
-uses SERIAL_CPU_INIT
uses CONFIG_IOAPIC
uses CONFIG_SMP
uses FALLBACK_SIZE
@@ -127,8 +126,6 @@
default CONFIG_MAX_PHYSICAL_CPUS=2
default CONFIG_LOGICAL_CPUS=1
-default SERIAL_CPU_INIT=0
-
#BTEXT Console
#default CONFIG_CONSOLE_BTEXT=1
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
I'm ok with this patch.
YH
________________________________
From: linuxbios-bounces(a)openbios.org
[mailto:linuxbios-bounces@openbios.org] On Behalf Of Steven J. Magnani
Sent: Friday, September 09, 2005 9:35 AM
To: yinghailu(a)gmail.com
Cc: linuxbios(a)openbios.org
Subject: RE: [LinuxBIOS] PATCH: relocate GDT before invoking payload
QNX Neutrino doesn't set up its own GDT right away. Its startup code has
some defensive logic that attempts to put the system into a known state.
This causes an exception when booted from LinuxBIOS, if its GDT got
trashed when elfboot() loaded the Neutrino image. See the hyperlink
below for more discussion.
The fix seems straightforward, and the increased amount of "table"
memory very modest. Do you object to this patch?
Steve
-----Original Message-----
From: yhlu [mailto:yinghailu@gmail.com]
Sent: Friday, September 09, 2005 10:03 AM
To: Steven J. Magnani
Cc: linuxbios(a)openbios.org
Subject: Re: [LinuxBIOS] PATCH: relocate GDT before invoking
payload
why?
The payload will have its own GDT.
YH
On 9/9/05, Steven J. Magnani <steve(a)digidescorp.com> wrote:
I posted this patch previously; see
http://openbios.org/pipermail/linuxbios/2005-August/012063.html
for the
original issue.
Here's another chance to comment before I commit it.
PATCH:
--- src/arch/i386/boot/tables.c.orig 2005-09-08
13:35:39.125000000
-0500
+++ src/arch/i386/boot/tables.c 2005-08-16 16:17:41.766000000
-0500
@@ -7,6 +7,32 @@
#include <arch/acpi.h>
#include "linuxbios_table.h"
+// Global Descriptor Table, defined in c_start.S
+extern uint8_t gdt;
+extern uint8_t gdt_end;
+
+/* i386 lgdt argument */
+struct gdtarg {
+ unsigned short limit;
+ unsigned int base;
+} __attribute__((packed));
+
+// Copy GDT to new location and reload it
+// 2003-07 by SONE Takeshi
+// Ported from Etherboot to LinuxBIOS 2005-08 by Steve Magnani
+void move_gdt(unsigned long newgdt)
+{
+ uint16_t num_gdt_bytes = &gdt_end - &gdt;
+ struct gdtarg gdtarg;
+
+ printk_debug("Moving GDT to %#lx...", newgdt);
+ memcpy((void*)newgdt, &gdt, num_gdt_bytes);
+ gdtarg.base = newgdt;
+ gdtarg.limit = num_gdt_bytes - 1;
+ __asm__ __volatile__ ("lgdt %0\n\t" : : "m" (gdtarg));
+ printk_debug("ok\n");
+}
+
struct lb_memory *write_tables(void)
{
unsigned long low_table_start, low_table_end;
@@ -45,6 +71,10 @@
low_table_end = 0x500;
}
+ // Relocate the GDT to reserved memory, so it won't get
clobbered
+ move_gdt(low_table_end);
+ low_table_end += &gdt_end - &gdt;
+
/* The linuxbios table must be in 0-4K or 960K-1M */
write_linuxbios_table(
low_table_start, low_table_end,
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space
modulator!"
#include <standard.disclaimer>
--
LinuxBIOS mailing list
LinuxBIOS(a)openbios.org
http://www.openbios.org/mailman/listinfo/linuxbios
I posted this patch previously; see
http://openbios.org/pipermail/linuxbios/2005-August/012063.html for the
original issue.
Here's another chance to comment before I commit it.
PATCH:
--- src/arch/i386/boot/tables.c.orig 2005-09-08 13:35:39.125000000
-0500
+++ src/arch/i386/boot/tables.c 2005-08-16 16:17:41.766000000 -0500
@@ -7,6 +7,32 @@
#include <arch/acpi.h>
#include "linuxbios_table.h"
+// Global Descriptor Table, defined in c_start.S
+extern uint8_t gdt;
+extern uint8_t gdt_end;
+
+/* i386 lgdt argument */
+struct gdtarg {
+ unsigned short limit;
+ unsigned int base;
+} __attribute__((packed));
+
+// Copy GDT to new location and reload it
+// 2003-07 by SONE Takeshi
+// Ported from Etherboot to LinuxBIOS 2005-08 by Steve Magnani
+void move_gdt(unsigned long newgdt)
+{
+ uint16_t num_gdt_bytes = &gdt_end - &gdt;
+ struct gdtarg gdtarg;
+
+ printk_debug("Moving GDT to %#lx...", newgdt);
+ memcpy((void*)newgdt, &gdt, num_gdt_bytes);
+ gdtarg.base = newgdt;
+ gdtarg.limit = num_gdt_bytes - 1;
+ __asm__ __volatile__ ("lgdt %0\n\t" : : "m" (gdtarg));
+ printk_debug("ok\n");
+}
+
struct lb_memory *write_tables(void)
{
unsigned long low_table_start, low_table_end;
@@ -45,6 +71,10 @@
low_table_end = 0x500;
}
+ // Relocate the GDT to reserved memory, so it won't get
clobbered
+ move_gdt(low_table_end);
+ low_table_end += &gdt_end - &gdt;
+
/* The linuxbios table must be in 0-4K or 960K-1M */
write_linuxbios_table(
low_table_start, low_table_end,
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
Good, maybe this is reason why floppy have problem in Kernel....
YH
-----Original Message-----
From: linuxbios-bounces(a)openbios.org
[mailto:linuxbios-bounces@openbios.org] On Behalf Of Steven J. Magnani
Sent: Thursday, September 08, 2005 1:16 PM
To: linuxbios(a)openbios.org
Subject: [LinuxBIOS] PATCH: correct arguments to pnp_set_drq
This patch corrects an apparent bug in the definition of pnp_set_drq().
See http://openbios.org/pipermail/linuxbios/2005-May/011605.html for a
description of the issue.
PATCH:
BUG FIX: arguments to pnp_set_drq are transposed
--- src/devices/pnp_device.c.orig 2005-09-08 13:34:52.859375000
-0500
+++ src/devices/pnp_device.c 2005-09-08 13:40:16.671875000 -0500
@@ -52,7 +52,7 @@
pnp_write_config(dev, index, irq);
}
-void pnp_set_drq(device_t dev, unsigned drq, unsigned index)
+void pnp_set_drq(device_t dev, unsigned index, unsigned drq)
{
/* Index == 0x74 */
pnp_write_config(dev, index, drq & 0xff);
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
--
LinuxBIOS mailing list
LinuxBIOS(a)openbios.org
http://www.openbios.org/mailman/listinfo/linuxbios
This patch corrects an apparent bug in the definition of pnp_set_drq().
See http://openbios.org/pipermail/linuxbios/2005-May/011605.html for a
description of the issue.
PATCH:
BUG FIX: arguments to pnp_set_drq are transposed
--- src/devices/pnp_device.c.orig 2005-09-08 13:34:52.859375000
-0500
+++ src/devices/pnp_device.c 2005-09-08 13:40:16.671875000 -0500
@@ -52,7 +52,7 @@
pnp_write_config(dev, index, irq);
}
-void pnp_set_drq(device_t dev, unsigned drq, unsigned index)
+void pnp_set_drq(device_t dev, unsigned index, unsigned drq)
{
/* Index == 0x74 */
pnp_write_config(dev, index, drq & 0xff);
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>