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