mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: cbmem_console: Improve 'cbmem -1' behavior for truncated pre-CBMEM logs
The 'cbmem -1' flag that cuts off console output before the last boot
will ignore content from earlier stages if it was truncated due to lack
of pre-CBMEM console space. This patch makes the "log truncated" message
more specific and adds it as an additional cut-off marker to 'cbmem -1'
to counteract that problem.
Also raise the log level of the coreboot banner one step to BIOS_NOTICE
to make it more likely to be included in the output for 'cbmem -1' to
find. (I believe NOTICE is reasonable but I wouldn't want to go as far
as WARN which should be reserved for actual problems. Of course this is
not ideal, but then again, our whole log-level system really isn't... it
would be better if we could make it always print a banner to the CBMEM
console without affecting the UART at the same time, but that would
require a larger amount of work.)
BUG=none
BRANCH=none
TEST=none
Change-Id: I71f5ae9e44509608d3c47edcb4a7c869d0d650db
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: d906bb68c3
Original-Change-Id: I58288593dfa757e14f4a9da4ffa7e27b0b66feb9
Original-Reported-by: https://ticket.coreboot.org/issues/117
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/19720
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/509513
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
parent
5e4166c1ae
commit
c7de8a8526
3 changed files with 7 additions and 4 deletions
|
@ -71,6 +71,6 @@ asmlinkage void console_init(void)
|
|||
|
||||
console_hw_init();
|
||||
|
||||
printk(BIOS_INFO, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n",
|
||||
printk(BIOS_NOTICE, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n",
|
||||
coreboot_version, coreboot_extra_version, coreboot_build);
|
||||
}
|
||||
|
|
|
@ -156,8 +156,8 @@ static void copy_console_buffer(struct cbmem_console *src_cons_p)
|
|||
return;
|
||||
|
||||
if (src_cons_p->cursor & OVERFLOW) {
|
||||
const char overflow_warning[] = "\n*** Pre-CBMEM console "
|
||||
"overflowed, log truncated ***\n";
|
||||
const char overflow_warning[] = "\n*** Pre-CBMEM " ENV_STRING
|
||||
" console overflowed, log truncated! ***\n";
|
||||
for (c = 0; c < sizeof(overflow_warning) - 1; c++)
|
||||
cbmemc_tx_byte(overflow_warning[c]);
|
||||
for (c = src_cons_p->cursor & CURSOR_MASK;
|
||||
|
|
|
@ -670,9 +670,12 @@ static void dump_console(int one_boot_only)
|
|||
cursor = 0;
|
||||
if (one_boot_only) {
|
||||
#define BANNER_REGEX(stage) "\n\ncoreboot-[^\n]* " stage " starting\\.\\.\\.\n"
|
||||
#define OVERFLOW_REGEX(stage) "\n*** Pre-CBMEM " stage " console overflowed"
|
||||
const char *regex[] = { BANNER_REGEX("bootblock"),
|
||||
BANNER_REGEX("romstage"),
|
||||
BANNER_REGEX("ramstage")};
|
||||
OVERFLOW_REGEX("romstage"),
|
||||
BANNER_REGEX("ramstage"),
|
||||
OVERFLOW_REGEX("ramstage") };
|
||||
int i;
|
||||
|
||||
for (i = 0; !cursor && i < ARRAY_SIZE(regex); i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue