Attention is currently required from: Andrey Pronin, Raul Rangel, Mohan Viswanathan, Name of user not set #1004133, Jon Murphy, Paul Menzel, Rob Barnes, Yu-Ping Wu, Karthik Ramasubramanian.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/61521 )
Change subject: security/vboot/secdata_tpm: Set up space for widevine counter info
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS3:
> Julius, […]
Okay, I'm not sure why this needs to be so complicated but I'll trust you on that I guess. Are there any possible issues from the counters and the info space going out of sync due to random power loss while writing them? That would be one of my concerns about creating so many different spaces that depend on each other.
--
To view, visit https://review.coreboot.org/c/coreboot/+/61521
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I80de9024195452a235cbed73e21410f848c91722
Gerrit-Change-Number: 61521
Gerrit-PatchSet: 4
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Andrey Pronin <apronin(a)google.com>
Gerrit-Reviewer: Jon Murphy <jpmurphy(a)google.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Mohan Viswanathan
Gerrit-CC: Name of user not set #1004133
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Andrey Pronin <apronin(a)google.com>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Mohan Viswanathan
Gerrit-Attention: Name of user not set #1004133
Gerrit-Attention: Jon Murphy <jpmurphy(a)google.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Fri, 04 Feb 2022 02:29:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mohan Viswanathan
Comment-In-Reply-To: Name of user not set #1004133
Comment-In-Reply-To: Julius Werner <jwerner(a)chromium.org>
Comment-In-Reply-To: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: comment
Julius Werner has uploaded a new patch set (#3). ( https://review.coreboot.org/c/coreboot/+/61613 )
Change subject: console: Add compile-time fast path when only CBMEM console is used
......................................................................
console: Add compile-time fast path when only CBMEM console is used
A common use case when running coreboot on production systems is that
only the CBMEM console (the one with the least impact on boot speed) is
enabled. In this case, some of the code in the console subsystem has no
effect. Due to the way it's all genericized over multiple consoles and
tied together with function pointers, not all of this can be
compile-time eliminated automatically, so this patch adds a little
helper to facilitate that. This results in roughly 200 (compressed)
bytes of savings per stage on an arm64 system.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
---
M src/console/console.c
M src/console/printk.c
M src/include/console/console.h
3 files changed, 20 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/61613/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/61613
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
Gerrit-Change-Number: 61613
Gerrit-PatchSet: 3
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: newpatchset
Julius Werner has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/61613 )
Change subject: console: Add compile-time fast path when only CBMEM console is used
......................................................................
console: Add compile-time fast path when only CBMEM console is used
A common use case when running coreboot on production systems is that
only the CBMEM console (the one with the least impact on boot speed) is
enabled. In this case, some of the code in the console subsystem has no
effect. Due to the way it's all genericized over multiple consoles and
tied together with function pointers, not all of this can be
compile-time eliminated automatically, so this patch adds a little
helper to facilitate that. This results in roughly 200 (compressed)
bytes of savings per stage on an arm64 system.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
---
M src/console/console.c
M src/console/init.c
M src/console/printk.c
M src/include/console/console.h
4 files changed, 22 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/61613/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/61613
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
Gerrit-Change-Number: 61613
Gerrit-PatchSet: 2
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Raul Rangel, Nico Huber, Patrick Georgi, Kyösti Mälkki.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/61307 )
Change subject: console: Add ANSI escape sequences for highlighting
......................................................................
Patch Set 5:
(1 comment)
File src/console/printk.c:
https://review.coreboot.org/c/coreboot/+/61307/comment/32cf98a9_6ab47a5c
PS5, Line 82: console_interactive_tx_byte
> I think using `vtxprintf` would make this more maintainable.
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/61307
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I868f4026918bc0e967c32e14bcf3ac05816415e8
Gerrit-Change-Number: 61307
Gerrit-PatchSet: 5
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Comment-Date: Fri, 04 Feb 2022 02:05:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Raul Rangel <rrangel(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Raul Rangel, Nico Huber, Patrick Georgi, Kyösti Mälkki.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/61306 )
Change subject: console: Add loglevel prefix to interactive consoles
......................................................................
Patch Set 5:
(3 comments)
File src/console/printk.c:
https://review.coreboot.org/c/coreboot/+/61306/comment/fd65199e_06322cfc
PS5, Line 80: console_interactive_tx_byte
> Might be cleaner to add a `static interactive_printk(fmt, args)`. […]
Yeah... well you can't build a va_list from scratch in C (and you shouldn't try to fake it with a pointer because the format can be architecture-dependent), but I can write another vararg wrapper just for this here. I guess it does look a bit cleaner... I'm just worried because each of these things adds a little bit of overhead again and I was trying to be explicitly lightweight with my changes to such a central piece of code. Putting the vtxprintf() here means it parses the format string every time even if there's no interactive console to print to.
I guess if you do have an interactive console, that level of overhead wouldn't matter. And if you don't, it would be best if I could compile-time eliminate all of this anyway. I'll do that in a follow-up patch.
https://review.coreboot.org/c/coreboot/+/61306/comment/dfdde803_8d092248
PS5, Line 80: console_interactive_tx_byte
> Might be cleaner to add a `static interactive_printk(fmt, args)`. […]
Done
https://review.coreboot.org/c/coreboot/+/61306/comment/98e98463_2d7f47fc
PS5, Line 85:
> nit: Do we need two spaces?
This was my personal preference choice after playing around with various distances... I feel that with one space, the prefixes visually merge too much into the log text and it makes it harder to read the messages you're actually interested in without getting distracted by the clutter on the left. I'm open to discuss alternatives but please run it and look at the output first so you know how it looks in practice. (If anything, I'd suggest rather going up to 3 spaces than back down to 1, though. I don't want to make the distance too large since I want to be conscious of people with small terminals, too.)
--
To view, visit https://review.coreboot.org/c/coreboot/+/61306
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic83413475400821f8097ef1819a293ee8926bb0b
Gerrit-Change-Number: 61306
Gerrit-PatchSet: 5
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
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: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Comment-Date: Fri, 04 Feb 2022 02:05:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Raul Rangel <rrangel(a)chromium.org>
Gerrit-MessageType: comment
Julius Werner has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61613 )
Change subject: console: Add compile-time fast path when only CBMEM console is used
......................................................................
console: Add compile-time fast path when only CBMEM console is used
A common use case when running coreboot on production systems is that
only the CBMEM console (the one with the least impact on boot speed) is
enabled. In this case, some of the code in the console subsystem has no
effect. Due to the way it's all genericized over multiple consoles and
tied together with function pointers, not all of this can be
compile-time eliminated automatically, so this patch adds a little
helper to facilitate that. This results in roughly 200 (compressed)
bytes of savings per stage on an arm64 system.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
---
M src/console/console.c
M src/console/init.c
M src/console/printk.c
M src/include/console/console.h
4 files changed, 23 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/61613/1
diff --git a/src/console/console.c b/src/console/console.c
index 5b8a872..f37f120 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -11,6 +11,8 @@
#include <console/flash.h>
#include <console/system76_ec.h>
+/* Note: when adding a new console, make sure you update the definition of
+ HAS_ONLY_FAST_CONSOLES in <console.h>! */
void console_hw_init(void)
{
__cbmemc_init();
diff --git a/src/console/init.c b/src/console/init.c
index 4f93997..da8d8f7 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -37,6 +37,9 @@
if (log_level < 0)
return CONSOLE_LOG_NONE;
+ if (HAS_ONLY_FAST_CONSOLES)
+ return CONSOLE_LOG_FAST;
+
if (msg_level <= log_level)
return CONSOLE_LOG_ALL;
diff --git a/src/console/printk.c b/src/console/printk.c
index d24dc9db..8db2c45 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -67,6 +67,8 @@
};
};
+#define LOG_FAST(state) (HAS_ONLY_FAST_CONSOLES || ((state).level == CONSOLE_LOG_FAST))
+
static void wrap_interactive_printf(const char *fmt, ...)
{
va_list args;
@@ -83,11 +85,11 @@
LOG_FAST mode, just write the marker to CBMC and exit -- the rest of this function
implements the LOG_ALL case. */
unsigned char marker = BIOS_LOG_LEVEL_TO_MARKER(state.level);
- if (state.speed == CONSOLE_LOG_FAST) {
+ if (LOG_FAST(state)) {
__cbmemc_tx_byte(marker);
return;
}
- console_stored_tx_byte(marker);
+ console_stored_tx_byte(marker, NULL);
/* Interactive consoles get a `[DEBUG] ` style readable prefix,
and potentially an escape sequence for highlighting. */
@@ -98,7 +100,7 @@
static void line_end(union log_state state)
{
- if (CONFIG(CONSOLE_USE_ANSI_ESCAPES) && state.speed != CONSOLE_LOG_FAST)
+ if (CONFIG(CONSOLE_USE_ANSI_ESCAPES) && !LOG_FAST(state))
wrap_interactive_printf(BIOS_LOG_ESCAPE_RESET);
}
@@ -115,7 +117,7 @@
line_started = true;
}
- if (state.speed == CONSOLE_LOG_FAST)
+ if (LOG_FAST(state))
__cbmemc_tx_byte(byte);
else
console_tx_byte(byte);
@@ -138,7 +140,7 @@
console_time_run();
i = vtxprintf(wrap_putchar, fmt, args, state.as_ptr);
- if (state.speed != CONSOLE_LOG_FAST)
+ if (LOG_FAST(state))
console_tx_flush();
console_time_stop();
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 5546aa9..e4090af 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -61,7 +61,18 @@
long console_time_get_and_reset(void);
void console_time_report(void);
+/*
+ * "Fast" basically means only the CBMEM console right now. This is used to still
+ * print debug messages there when loglevel disables the other consoles. It is also
+ * used to compile-time eliminate code paths that only affect "interactive" consoles
+ * (which are all "slow") when none of those are enabled.
+ */
enum { CONSOLE_LOG_NONE = 0, CONSOLE_LOG_FAST, CONSOLE_LOG_ALL };
+#define HAS_ONLY_FAST_CONSOLES !(CONFIG(SPKMODEM) || CONFIG(CONSOLE_QEMU_DEBUGCON) || \
+ CONFIG(CONSOLE_SERIAL) || CONFIG(CONSOLE_NE2K) || CONFIG(CONSOLE_USB) || \
+ CONFIG(EM100PRO_SPI_CONSOLE) || CONFIG(CONSOLE_SPI_FLASH) || \
+ CONFIG(CONSOLE_SYSTEM76_EC))
+
#else
static inline int get_log_level(void) { return -1; }
static inline void console_init(void) {}
--
To view, visit https://review.coreboot.org/c/coreboot/+/61613
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1d5b8bda80d02a13ee0b7835e0805c4319fd21d8
Gerrit-Change-Number: 61613
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Patrick Georgi, Julius Werner, Kyösti Mälkki.
Hello build bot (Jenkins), Raul Rangel, Nico Huber, Patrick Georgi, Kyösti Mälkki,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/61307
to look at the new patch set (#6).
Change subject: console: Add ANSI escape sequences for highlighting
......................................................................
console: Add ANSI escape sequences for highlighting
This patch adds ANSI escape sequences to highlight a log line based on
its loglevel to the output of "interactive" consoles that are meant to
be displayed on a terminal (e.g. UART). This should help make errors and
warnings stand out better among the usual spew of debug messages. For
users whose terminal or use case doesn't support these sequences for
some reason (or who simply don't like them), they can be disabled with a
Kconfig.
While ANSI escape sequences can be used to add color, minicom (the
presumably most common terminal emulator for UART endpoints?) doesn't
support color output unless explicitly enabled (via -c command line
flag), and other terminal emulators may have similar restrictions, so in
an effort to make this as widely useful by default as possible I have
chosen not to use color codes and implement this highlighting via
bolding, underlining and inverting alone (which seem to go through in
all cases). If desired, support for separate color highlighting could be
added via Kconfig later.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I868f4026918bc0e967c32e14bcf3ac05816415e8
---
M src/commonlib/include/commonlib/loglevel.h
M src/console/Kconfig
M src/console/printk.c
3 files changed, 44 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/07/61307/6
--
To view, visit https://review.coreboot.org/c/coreboot/+/61307
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I868f4026918bc0e967c32e14bcf3ac05816415e8
Gerrit-Change-Number: 61307
Gerrit-PatchSet: 6
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nico Huber, Patrick Georgi, Julius Werner, Kyösti Mälkki.
Hello build bot (Jenkins), Raul Rangel, Nico Huber, Patrick Georgi, Kyösti Mälkki,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/61306
to look at the new patch set (#6).
Change subject: console: Add loglevel prefix to interactive consoles
......................................................................
console: Add loglevel prefix to interactive consoles
In an attempt to make loglevels more visible (and therefore useful,
hopefully), this patch adds a prefix indicating the log level to every
line sent to an "interactive" console (such as a UART). If the code
contains a `printk(BIOS_DEBUG, "This is a debug message!\n"), it will
now show up as
[DEBUG] This is a debug message!
on the UART output.
"Stored" consoles (such as in CBMEM) will get a similar but more
space-efficient feature in a later CL.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: Ic83413475400821f8097ef1819a293ee8926bb0b
---
M src/commonlib/include/commonlib/loglevel.h
M src/console/console.c
M src/console/printk.c
M src/include/console/streams.h
4 files changed, 70 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/61306/6
--
To view, visit https://review.coreboot.org/c/coreboot/+/61306
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic83413475400821f8097ef1819a293ee8926bb0b
Gerrit-Change-Number: 61306
Gerrit-PatchSet: 6
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newpatchset