Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6311
-gerrit
commit 43673dd4b9c87cd5d44af7caa29e9d3cf06c82f2
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Jul 21 20:58:18 2014 +0200
x86/smm: Initialize SMM on CPUs one-by-one
We currently race in SMM init on Atom 230 (and potentially
other CPUs). At least on the 230, this leads to a hang on
RSM, likely because both hyperthreads mess around with
SMBASE and other SMM state variables in parallel without
coordination.
Change it so first APs are spun up and sent to sleep, then
BSP initializes SMM, then every CPU, one after another.
Change-Id: I1ae864e37546298ea222e81349c27cf774ed251f
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
src/cpu/x86/lapic/lapic_cpu_init.c | 48 ++++++++++++++++++++++++++++++++++----
1 file changed, 44 insertions(+), 4 deletions(-)
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c
index 09b6b9e..8846470 100644
--- a/src/cpu/x86/lapic/lapic_cpu_init.c
+++ b/src/cpu/x86/lapic/lapic_cpu_init.c
@@ -463,6 +463,41 @@ static void start_other_cpus(struct bus *cpu_bus, device_t bsp_cpu)
}
+#if CONFIG_HAVE_SMI_HANDLER && CONFIG_SMP && CONFIG_MAX_CPUS > 1
+static void smm_other_cpus(struct bus *cpu_bus, device_t bsp_cpu)
+{
+ device_t cpu;
+ int pre_count = atomic_read(&active_cpus);
+
+ /* Loop through the cpus once to let them run through SMM relocator */
+
+ for(cpu = cpu_bus->children; cpu ; cpu = cpu->sibling) {
+ if (cpu->path.type != DEVICE_PATH_APIC) {
+ continue;
+ }
+
+ printk(BIOS_ERR, "considering CPU 0x%02x for SMM init\n",
+ cpu->path.apic.apic_id);
+
+ if (cpu==bsp_cpu)
+ continue;
+
+ if (!cpu->enabled) {
+ continue;
+ }
+
+ if (!start_cpu(cpu)) {
+ /* Record the error in cpu? */
+ printk(BIOS_ERR, "CPU 0x%02x would not start!\n",
+ cpu->path.apic.apic_id);
+ }
+
+ /* FIXME: endless loop */
+ while (atomic_read(&active_cpus) != pre_count) ;
+ }
+}
+#endif
+
static void wait_other_cpus_stop(struct bus *cpu_bus)
{
device_t cpu;
@@ -531,10 +566,6 @@ void initialize_cpus(struct bus *cpu_bus)
copy_secondary_start_to_lowest_1M();
#endif
-#if CONFIG_HAVE_SMI_HANDLER
- smm_init();
-#endif
-
#if CONFIG_SMP && CONFIG_MAX_CPUS > 1
/* start all aps at first, so we can init ECC all together */
if (IS_ENABLED(CONFIG_PARALLEL_CPU_INIT))
@@ -551,4 +582,13 @@ void initialize_cpus(struct bus *cpu_bus)
/* Now wait the rest of the cpus stop*/
wait_other_cpus_stop(cpu_bus);
#endif
+
+#if CONFIG_HAVE_SMI_HANDLER
+ /* BSP only, all APs are sleeping */
+ smm_init();
+#if CONFIG_SMP && CONFIG_MAX_CPUS > 1
+ last_cpu_index = 0;
+ smm_other_cpus(cpu_bus, info->cpu);
+#endif
+#endif
}
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6311
-gerrit
commit c9abb1df5bc6082cef59a0d116df13622f6cba92
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Mon Jul 21 20:58:18 2014 +0200
x86/smm: Initialize SMM on CPUs one-by-one
We currently race in SMM init on Atom 230 (and potentially
other CPUs). At least on the 230, this leads to a hang on
RSM, likely because both hyperthreads mess around with
SMBASE and other SMM state variables in parallel without
coordination.
Change it so first APs are spun up and sent to sleep, then
BSP initializes SMM, then every CPU, one after another.
Change-Id: I1ae864e37546298ea222e81349c27cf774ed251f
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
src/cpu/x86/lapic/lapic_cpu_init.c | 46 ++++++++++++++++++++++++++++++++++----
1 file changed, 42 insertions(+), 4 deletions(-)
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c
index 09b6b9e..35863a1 100644
--- a/src/cpu/x86/lapic/lapic_cpu_init.c
+++ b/src/cpu/x86/lapic/lapic_cpu_init.c
@@ -463,6 +463,39 @@ static void start_other_cpus(struct bus *cpu_bus, device_t bsp_cpu)
}
+static void smm_other_cpus(struct bus *cpu_bus, device_t bsp_cpu)
+{
+ device_t cpu;
+ int pre_count = atomic_read(&active_cpus);
+
+ /* Loop through the cpus once to let them run through SMM relocator */
+
+ for(cpu = cpu_bus->children; cpu ; cpu = cpu->sibling) {
+ if (cpu->path.type != DEVICE_PATH_APIC) {
+ continue;
+ }
+
+ printk(BIOS_ERR, "considering CPU 0x%02x for SMM init\n",
+ cpu->path.apic.apic_id);
+
+ if (cpu==bsp_cpu)
+ continue;
+
+ if (!cpu->enabled) {
+ continue;
+ }
+
+ if (!start_cpu(cpu)) {
+ /* Record the error in cpu? */
+ printk(BIOS_ERR, "CPU 0x%02x would not start!\n",
+ cpu->path.apic.apic_id);
+ }
+
+ /* FIXME: endless loop */
+ while (atomic_read(&active_cpus) != pre_count) ;
+ }
+}
+
static void wait_other_cpus_stop(struct bus *cpu_bus)
{
device_t cpu;
@@ -531,10 +564,6 @@ void initialize_cpus(struct bus *cpu_bus)
copy_secondary_start_to_lowest_1M();
#endif
-#if CONFIG_HAVE_SMI_HANDLER
- smm_init();
-#endif
-
#if CONFIG_SMP && CONFIG_MAX_CPUS > 1
/* start all aps at first, so we can init ECC all together */
if (IS_ENABLED(CONFIG_PARALLEL_CPU_INIT))
@@ -551,4 +580,13 @@ void initialize_cpus(struct bus *cpu_bus)
/* Now wait the rest of the cpus stop*/
wait_other_cpus_stop(cpu_bus);
#endif
+
+#if CONFIG_HAVE_SMI_HANDLER
+ /* BSP only, all APs are sleeping */
+ smm_init();
+#if CONFIG_SMP && CONFIG_MAX_CPUS > 1
+ last_cpu_index = 0;
+ smm_other_cpus(cpu_bus, info->cpu);
+#endif
+#endif
}
the following patch was just integrated into master:
commit bcd09930d8ff78704cb98ad18805788d02687a31
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Thu Jul 10 15:02:19 2014 -0600
board_status.sh minor fixes - no functional changes
- Update some comments
- Whitespace fixes
- change from backticks to $() format for getting command data.
Change-Id: Iaf424224abfd30a3581d0e43a1689cc7c887beec
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/6261
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
See http://review.coreboot.org/6261 for details.
-gerrit
the following patch was just integrated into master:
commit 8e0071b7982f5f72cc8e182f8eb5d77248f0b720
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Thu Jul 10 15:00:35 2014 -0600
board_status.sh: Read coreboot boot log from a serial device
- Read the boot log from a serial device.
Change-Id: I9daf97fd9b7fc55d0d56d815b185f9b4e3ef9f5a
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/6260
Reviewed-by: Mike Loptien <mike.loptien(a)se-eng.com>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/6260 for details.
-gerrit
Martin Roth (gaumless(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6260
-gerrit
commit af8c0d86e2f4a5aec1f535e3e0f068c103e41770
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Thu Jul 10 15:00:35 2014 -0600
board_status.sh: Read coreboot boot log from a serial device
- Read the boot log from a serial device.
Change-Id: I9daf97fd9b7fc55d0d56d815b185f9b4e3ef9f5a
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
---
util/board_status/board_status.sh | 68 ++++++++++++++++++++++++++++++++++++---
1 file changed, 64 insertions(+), 4 deletions(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 65576f4..6032c8c 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -3,6 +3,7 @@
# This file is part of the coreboot project.
#
# Copyright (C) 2013 Google Inc.
+# Copyright (C) 2014 Sage Electronic Engineering, LLC.
#
EXIT_SUCCESS=0
@@ -12,6 +13,7 @@ EXIT_FAILURE=1
REMOTE_HOST=""
CLOBBER_OUTPUT=0
UPLOAD_RESULTS=0
+SERIAL_PORT_SPEED=115200
# Used to specify whether a command should always be run locally or
# if command should be run remoteley when a remote host is specified.
@@ -96,6 +98,50 @@ cmd_nonfatal()
rm -f "$3" # don't leave an empty file
}
+# read from a serial port device
+#
+# $1: serial device to read from
+# $2: serial port speed
+# $3: filename to direct output of command into
+get_serial_bootlog () {
+
+ if [ ! -c "$1" ]; then
+ echo "$1 is not a valid serial device"
+ exit $EXIT_FAILURE
+ fi
+
+ # make the text more noticible
+ test_cmd $LOCAL "tput" $NONFATAL
+ tput_not_available=$?
+ if [ $tput_not_available -eq 0 ]; then
+ tput bold
+ tput setaf 10 # set bright green
+ fi
+
+ echo
+ echo "Waiting to receive boot log from $1"
+ echo "Press [Enter] when the boot is complete and the"
+ echo "system is ready for ssh to get the dmesg log."
+
+ if [ $tput_not_available -eq 0 ]; then
+ tput sgr0
+ fi
+
+ # set up the serial port
+ cmd $LOCAL "stty -F $1 $2 cs8 -cstopb"
+
+ # read from the serial port - user must press enter when complete
+ test_cmd $LOCAL "tee"
+ cat "$SERIAL_DEVICE" | tee "$3" &
+ PID=$!
+
+ read
+ kill "$PID" 2>/dev/null &
+
+ # remove the binary zero value that gets inserted into the file.
+ sed -i 's/\x00//' "$3"
+}
+
show_help() {
echo "Usage:
${0} <option>
@@ -107,12 +153,16 @@ Options
Clobber temporary output when finished. Useful for debugging.
-r <host>
Obtain machine information from remote host (using ssh).
+ -s </dev/xxx>
+ Obtain boot log via serial device.
+ -S <speed>
+ Set the port speed for the serial device (Default is 115200).
-u
Upload results to coreboot.org.
"
}
-while getopts "Chr:u" opt; do
+while getopts "Chr:s:S:u" opt; do
case "$opt" in
h)
show_help
@@ -124,6 +174,12 @@ while getopts "Chr:u" opt; do
r)
REMOTE_HOST="$OPTARG"
;;
+ s)
+ SERIAL_DEVICE="$OPTARG"
+ ;;
+ S)
+ SERIAL_PORT_SPEED="$OPTARG"
+ ;;
u)
UPLOAD_RESULTS=1
;;
@@ -170,9 +226,13 @@ printf "Upstream revision: %s\n" $($getrevision -u) >> ${tmpdir}/${results}/revi
printf "Upstream URL: %s\n" $($getrevision -U)>> ${tmpdir}/${results}/revision.txt
printf "Timestamp: %s\n" "$timestamp" >> ${tmpdir}/${results}/revision.txt
-test_cmd $REMOTE "cbmem"
-cmd $REMOTE "cbmem -c" "${tmpdir}/${results}/coreboot_console.txt"
-cmd_nonfatal $REMOTE "cbmem -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
+if [ -z "$SERIAL_DEVICE" ]; then
+ test_cmd $REMOTE "cbmem"
+ cmd $REMOTE "cbmem -c" "${tmpdir}/${results}/coreboot_console.txt"
+ cmd_nonfatal $REMOTE "cbmem -t" "${tmpdir}/${results}/coreboot_timestamps.txt"
+else
+ get_serial_bootlog "$SERIAL_DEVICE" "$SERIAL_PORT_SPEED" "${tmpdir}/${results}/coreboot_console.txt"
+fi
cmd $REMOTE dmesg "${tmpdir}/${results}/kernel_log.txt"
the following patch was just integrated into master:
commit 13c7db8fe805e5b535356a7d86df17b81dff5d2a
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Thu Jul 10 14:59:11 2014 -0600
board_status.sh: name temp dir and print the name
- give a template to the temp dir so they're recognizable.
- show the location of the temp files again at the end of the script.
Change-Id: Ieb031ee249043697f6a75e42284c23d0b9bad1b3
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/6259
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/6259 for details.
-gerrit
the following patch was just integrated into master:
commit 224617752b7457c3eb086cb3ad52b468a94a0eb7
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Thu Jul 10 14:57:34 2014 -0600
board_status.sh allow cmd() to not save output
- allow for cmd() to be run, but not pipe to a file.
Change-Id: I3e1650e421a49a06218e082ceb5a60b7b4808ce8
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/6258
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
See http://review.coreboot.org/6258 for details.
-gerrit