Attention is currently required from: Paul Menzel, Julius Werner, Kyösti Mälkki, Rob Barnes, Karthik Ramasubramanian.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59322 )
Change subject: console/printk: Disable threading before grabbing the spin lock
......................................................................
Patch Set 9:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/59322/comment/868595f6_71181cd5
PS8, Line 13: commit a98d302fe9dc ("x86/smp/spinlock: Disable thread coop when taking spinlock")
> IMO you should do a clean revert first, and not have printk() as a special case with spinlock, but u […]
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/59322
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I55d0cd2bcd82721098ca24ae2368bb6a16a07df4
Gerrit-Change-Number: 59322
Gerrit-PatchSet: 9
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Mon, 22 Nov 2021 18:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Paul Menzel, Julius Werner, Kyösti Mälkki, Rob Barnes, Karthik Ramasubramanian.
Hello build bot (Jenkins), Paul Menzel, Julius Werner, Rob Barnes, Kyösti Mälkki, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/59322
to look at the new patch set (#9).
Change subject: console/printk: Disable threading before grabbing the spin lock
......................................................................
console/printk: Disable threading before grabbing the spin lock
This is in preparation of reverting
commit a98d302fe9dc ("x86/smp/spinlock: Disable thread coop when taking spinlock")
BUG=b:179699789
TEST=Boot guybrush to OS with threading enabled
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: I55d0cd2bcd82721098ca24ae2368bb6a16a07df4
---
M src/console/printk.c
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/59322/9
--
To view, visit https://review.coreboot.org/c/coreboot/+/59322
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I55d0cd2bcd82721098ca24ae2368bb6a16a07df4
Gerrit-Change-Number: 59322
Gerrit-PatchSet: 9
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Julius Werner, Kyösti Mälkki, Rob Barnes, Patrick Rudolph, Karthik Ramasubramanian.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59321 )
Change subject: treewide: Replace spinlock calls with mutex
......................................................................
Patch Set 6:
(6 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/59321/comment/b4bce879_87484279
PS5, Line 22:
> I think printk() is exactly where you would want to yield in romstage for DMA performance, and that […]
I would really prefer to keep printk functional in the threading code. it makes debugging way easier.
I decided to replace all the spinlock usages because it's just a ticking timebomb. I tracked the code again and found a udelay in the smm relocation path. So instead of special casing that one and adding a coop_enable/disable I thought it cleaner to just replace them all.
File src/cpu/intel/microcode/microcode.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/f42da968_790c4c16
PS5, Line 14: struct mutex microcode_lock;
> static
Done
File src/cpu/x86/lapic/lapic_cpu_init.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/0d9f87af_cb16b781
PS5, Line 218: struct mutex start_cpu_lock;
> static
Done
File src/cpu/x86/mp_init.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/9bc52218_8652a342
PS5, Line 662: struct mutex smm_relocation_lock;
> static
Done
File src/device/device.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/ca4e5f48_b80fe090
PS5, Line 74: struct mutex dev_lock;
> static
Done
File src/drivers/pc80/rtc/post.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/3c4424b9_d7e9d6be
PS5, Line 38: struct mutex cmos_post_lock;
> static
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/59321
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibee331a9ccd491e819c7f2c9a19bca7dc4379d9d
Gerrit-Change-Number: 59321
Gerrit-PatchSet: 6
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Mon, 22 Nov 2021 18:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Julius Werner, Kyösti Mälkki, Rob Barnes, Patrick Rudolph, Karthik Ramasubramanian.
Hello build bot (Jenkins), Julius Werner, Rob Barnes, Kyösti Mälkki, Patrick Rudolph, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/59321
to look at the new patch set (#6).
Change subject: treewide: Replace spinlock calls with mutex
......................................................................
treewide: Replace spinlock calls with mutex
spinlock does not currently work nicely with coop-threads. If a `udelay`
is called while in a critical section, it will context switch. If that
second thread also tries to acquire the same lock then we deadlock
since we never yield again. There is currently a hack in x86/spinlock.h
where we disable coop threads when acquiring a spinlock. This hack only
works for ramstage because in romstage we use the noop spinlock
implementation. By replacing the spinlocks with mutex we no longer need
to rely on the hack in the x86/spinlock.h.
I didn't convert the printk spinlock into a mutex. Since printk is the
primary debugging tool, I wanted to keep it decoupled from threading
mutex. This continues to allow debugging the threading code with
printks.
BUG=b:179699789
TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: Ibee331a9ccd491e819c7f2c9a19bca7dc4379d9d
---
M src/console/printk.c
M src/cpu/intel/microcode/microcode.c
M src/cpu/x86/lapic/lapic_cpu_init.c
M src/cpu/x86/mp_init.c
M src/device/device.c
M src/drivers/pc80/rtc/post.c
6 files changed, 29 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/59321/6
--
To view, visit https://review.coreboot.org/c/coreboot/+/59321
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibee331a9ccd491e819c7f2c9a19bca7dc4379d9d
Gerrit-Change-Number: 59321
Gerrit-PatchSet: 6
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Julius Werner, Kyösti Mälkki, Rob Barnes, Karthik Ramasubramanian.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59320 )
Change subject: lib: Add a mutex
......................................................................
Patch Set 7:
(4 comments)
File src/include/mutex.h:
https://review.coreboot.org/c/coreboot/+/59320/comment/c6459c15_85ee0619
PS6, Line 32: }
> I put the following in <rules.h> […]
Right spinlock worked by start with 1 and decrementing. mutex works by starting with 0 and setting to 1 when locked.
I don't quite understand. In romstage `ENV_STAGE_SUPPORTS_SMP == 0`.
File src/lib/mutex.c:
https://review.coreboot.org/c/coreboot/+/59320/comment/5cc4c584_e36003d2
PS5, Line 24: #if ENV_X86
> No arch-dependency under lib/ please. […]
I wanted to avoid all the extra noop functions. Done.
https://review.coreboot.org/c/coreboot/+/59320/comment/ea929b82_365ab373
PS5, Line 37: assert(thread_yield() >= 0);
> Are the assert() here and below why you did not want to change printk() to mutex? […]
Yeah, otherwise we get into a deadlock. Since printk is the primary debugging mechanism I wanted to keep it functional. I would prefer to keep it functional for threading.
File src/lib/mutex.c:
https://review.coreboot.org/c/coreboot/+/59320/comment/6ee9b37a_9c1432cd
PS6, Line 23: if (thread_yield() < 0) {
> This path already handles COOP_MULTITHREADING=y, do you really want a separate _mutex_lock_coop() be […]
I wanted to keep the assert in the coop-only case that we are yielding. Otherwise if that fails we will be stuck looping forever. I also wasn't sure how the atomics would work in a CAR environment, so I felt it was safer to not rely on them in the `pre-RAM` stages.
--
To view, visit https://review.coreboot.org/c/coreboot/+/59320
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41e02a54a17b1f6513b36a0274e43fc715472d78
Gerrit-Change-Number: 59320
Gerrit-PatchSet: 7
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Mon, 22 Nov 2021 18:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Julius Werner, Kyösti Mälkki, Rob Barnes, Karthik Ramasubramanian.
Hello build bot (Jenkins), Julius Werner, Rob Barnes, Kyösti Mälkki, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/59320
to look at the new patch set (#7).
Change subject: lib: Add a mutex
......................................................................
lib: Add a mutex
We currently have two synchronization primatives, spinlock and
thread_mutex. spinlock is meant to block multiple CPUs from entering a
critical section. thread_mutex is meant to block multiple coop-threads
from entering a critical section. It is not AP aware at all.
This CL introduces a mutex that can handle both concepts. The
implementation is using the GCC/LLVM atomic builtin functions. The
generated code uses the xchg instruction vs spinlock which uses (lock)
decb.
8: b0 01 mov $0x1,%al
a: 86 03 xchg %al,(%ebx)
c: 84 c0 test %al,%al
BUG=b:179699789
TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: I41e02a54a17b1f6513b36a0274e43fc715472d78
---
A src/include/mutex.h
M src/lib/Makefile.inc
A src/lib/mutex.c
3 files changed, 85 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/59320/7
--
To view, visit https://review.coreboot.org/c/coreboot/+/59320
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41e02a54a17b1f6513b36a0274e43fc715472d78
Gerrit-Change-Number: 59320
Gerrit-PatchSet: 7
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Lance Zhao, Patrick Georgi, Martin Roth, Tim Wawrzynczak, Julius Werner.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59504 )
Change subject: acpi,Makefile: Add preload_acpi_dsdt
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> it seems slightly odd to have a function for each file in CBFS you want to preload.
Do you have a different proposal in mind?
My concern with Patrick's solution is the added complexity. It sounds like something that would need to be properly thought out and designed. I don't personally want to tackle it :)
--
To view, visit https://review.coreboot.org/c/coreboot/+/59504
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibf69ecb947811a2eec861018e3ba5f858155f1c3
Gerrit-Change-Number: 59504
Gerrit-PatchSet: 2
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Lance Zhao
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Lance Zhao
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Comment-Date: Mon, 22 Nov 2021 18:06:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Raul Rangel <rrangel(a)chromium.org>
Comment-In-Reply-To: Patrick Georgi <patrick(a)coreboot.org>
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: comment