Attention is currently required from: Anil Kumar K, Arthur Heymans, Bora Guvendik, Cliff Huang, Jérémy Compostella, Martin L Roth, Patrick Georgi, Paul Menzel, Yu-Ping Wu.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/77289?usp=email )
The change is no longer submittable: All-Comments-Resolved is unsatisfied now.
Change subject: x86: Add .data section support for pre-memory stages
......................................................................
Patch Set 35: Code-Review+1
(1 comment)
File src/lib/bootblock.c:
https://review.coreboot.org/c/coreboot/+/77289/comment/b6327351_f8c7d8d3 :
PS35, Line 90: base_timestamp = timestamp_get();
Seems like implementations of init_timer() and timestamp_get() must not have non-zero static variables, since .data_load to .data copy happens later? I cannot remember who calls this main() function, though.
However the same applies to any caller of bootblock_main_with_timestamp(), execution path prior to that will see uninitialised (or zero-initialised) .data for globals? If the variable was written to, memcpy() will unconditionally overwrite it. I cannot think of an easy way to detect this buildtime and I am worried sometime in future someone will waste fair amount of time debugging a runtime failure due to this.
Ideally the memcpy() would happen before C entry to make sure this cannot happen?
--
To view, visit
https://review.coreboot.org/c/coreboot/+/77289?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I030407fcc72776e59def476daa5b86ad0495debe
Gerrit-Change-Number: 77289
Gerrit-PatchSet: 35
Gerrit-Owner: Jérémy Compostella
jeremy.compostella@intel.com
Gerrit-Reviewer: Anil Kumar K
anil.kumar.k@intel.com
Gerrit-Reviewer: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Bora Guvendik
bora.guvendik@intel.com
Gerrit-Reviewer: Cliff Huang
cliff.huang@intel.com
Gerrit-Reviewer: Julius Werner
jwerner@chromium.org
Gerrit-Reviewer: Kyösti Mälkki
kyosti.malkki@gmail.com
Gerrit-Reviewer: Martin L Roth
gaumless@gmail.com
Gerrit-Reviewer: Yu-Ping Wu
yupingso@google.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Hannah Williams
hannah.williams@intel.com
Gerrit-CC: Nico Huber
nico.h@gmx.de
Gerrit-CC: Patrick Georgi
patrick@coreboot.org
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-CC: Subrata Banik
subratabanik@google.com
Gerrit-CC: Wonkyu Kim
Gerrit-Attention: Bora Guvendik
bora.guvendik@intel.com
Gerrit-Attention: Anil Kumar K
anil.kumar.k@intel.com
Gerrit-Attention: Cliff Huang
cliff.huang@intel.com
Gerrit-Attention: Patrick Georgi
patrick@coreboot.org
Gerrit-Attention: Martin L Roth
gaumless@gmail.com
Gerrit-Attention: Jérémy Compostella
jeremy.compostella@intel.com
Gerrit-Attention: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Attention: Yu-Ping Wu
yupingso@google.com
Gerrit-Comment-Date: Fri, 08 Sep 2023 10:16:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment