[coreboot-gerrit] Change in coreboot[master]: Turn CBMEM console into a ring buffer that can persist acros...
Julius Werner (Code Review)
gerrit at coreboot.org
Wed Apr 19 00:39:34 CEST 2017
Julius Werner has posted comments on this change. ( https://review.coreboot.org/18301 )
Change subject: Turn CBMEM console into a ring buffer that can persist across reboots
......................................................................
Patch Set 5:
(7 comments)
https://review.coreboot.org/#/c/18301/5/payloads/libpayload/drivers/cbmem_console.c
File payloads/libpayload/drivers/cbmem_console.c:
PS5, Line 67: uint32_t
> size_t
Done
https://review.coreboot.org/#/c/18301/5/src/lib/cbmem_console.c
File src/lib/cbmem_console.c:
PS5, Line 80: cbm_cons_p->size < CURSOR_MASK
> This is kinda odd to me. cursor is an index that can have the value of [0,
This restriction helps prevent overflows into bit 24 in cbmemc_tx_byte() below. I can rewrite that as you suggested and then allow another byte here. I just assumed no one would ever want anywhere near 16MB anyway.
(Then again, maybe with a lot of debug output... actually, let me throw in 4 more bits just to be sure.)
PS5, Line 84: inline
> Any reason you didn't remove this inline but you did on current_console() a
No, overlooked that one, thanks. I'm assuming that the compiler will do a better job deciding what's worth inlining in all these cases so we shouldn't specify it explicitly unless there's a good reason.
Line 120: * not disturb flags (and we check for overflow right after). */
> I just wrote out the following as an alternative. Your way works, but it as
Okay, fair enough, that looks better.
PS5, Line 162: preram
> fwiw, this object isn't exactly preram in ramstage and postcar situations.
Renamed.
Line 166: copy_console_buffer(preram_cons_p);
> Just a thought: make copy_console_buffer() check for NULL src then you can
Done
https://review.coreboot.org/#/c/18301/5/util/cbmem/cbmem.c
File util/cbmem/cbmem.c:
Line 643: if (console_p->cursor & CBMC_OVERFLOW) {
> The cursor value should still be checked in this path because cursor could
That shouldn't really happen with the new code, but I guess it doesn't hurt to check.
--
To view, visit https://review.coreboot.org/18301
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifcbf59d58e1ad20995b98d111c4647281fbb45ff
Gerrit-PatchSet: 5
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Alexander Couzens <lynxis at fe80.eu>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Kevin O'Connor <kevin at koconnor.net>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins)
Gerrit-HasComments: Yes
More information about the coreboot-gerrit
mailing list