Hello Paul Menzel, Michael Niewöhner,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/48074
to review the following change.
Change subject: spi/flashconsole: Fix internal buffer overflow
......................................................................
spi/flashconsole: Fix internal buffer overflow
Once the console's FMAP region is full, we stop clearing the line
buffer and `line_offset` is not reset anymore. Hence, sanity check
`line_offset` everytime before writing to the buffer.
Change-Id: I36e9037d7baf8c1ed8b2d0c120bfffa58c089c95
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
M src/drivers/spi/flashconsole.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/48074/1
diff --git a/src/drivers/spi/flashconsole.c b/src/drivers/spi/flashconsole.c
index 654177f..d5c4382 100644
--- a/src/drivers/spi/flashconsole.c
+++ b/src/drivers/spi/flashconsole.c
@@ -75,7 +75,8 @@
size_t region_size = region_device_sz(rdev_ptr);
- line_buffer[line_offset++] = c;
+ if (line_offset < LINE_BUFFER_SIZE)
+ line_buffer[line_offset++] = c;
if (line_offset >= LINE_BUFFER_SIZE ||
offset + line_offset >= region_size || c == '\n') {
--
To view, visit https://review.coreboot.org/c/coreboot/+/48074
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I36e9037d7baf8c1ed8b2d0c120bfffa58c089c95
Gerrit-Change-Number: 48074
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43870 )
Change subject: [TESTONLY] build with TRACE=y
......................................................................
[TESTONLY] build with TRACE=y
Change-Id: Iee20e3c1fc31aba704d813f909c39986df3e2c29
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/Kconfig
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/43870/1
diff --git a/src/Kconfig b/src/Kconfig
index a4c2fa6..fb7cd2d 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -1055,7 +1055,7 @@
config TRACE
bool "Trace function calls"
- default n
+ default y
help
If enabled, every function will print information to console once
the function is entered. The syntax is ~0xaaaabbbb(0xccccdddd)
--
To view, visit https://review.coreboot.org/c/coreboot/+/43870
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iee20e3c1fc31aba704d813f909c39986df3e2c29
Gerrit-Change-Number: 43870
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange
Meera Ravindranath has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38682 )
Change subject: src/soc/tigerlake: Define and use a Kconfig for no of USB ports.
......................................................................
src/soc/tigerlake: Define and use a Kconfig for no of USB ports.
BUG=None
BRANCH=None
TEST=Compilation for jasper lake board is working
Change-Id: Ia8e88e92989fe40d7bd1c28942e005cb0d862fcb
Signed-off-by: Meera Ravindranath <meera.ravindranath(a)intel.com>
---
M src/soc/intel/tigerlake/Kconfig
M src/soc/intel/tigerlake/fsp_params_jsl.c
M src/soc/intel/tigerlake/fsp_params_tgl.c
3 files changed, 14 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/38682/1
diff --git a/src/soc/intel/tigerlake/Kconfig b/src/soc/intel/tigerlake/Kconfig
index cef1fd0..f50e40e 100644
--- a/src/soc/intel/tigerlake/Kconfig
+++ b/src/soc/intel/tigerlake/Kconfig
@@ -156,6 +156,16 @@
default 3 if SOC_INTEL_JASPERLAKE
default 4 if SOC_INTEL_TIGERLAKE
+config SOC_INTEL_USB2_DEV_MAX
+ int
+ default 8 if SOC_INTEL_JASPERLAKE
+ default 10 if SOC_INTEL_TIGERLAKE
+
+config SOC_INTEL_USB3_DEV_MAX
+ int
+ default 6 if SOC_INTEL_JASPERLAKE
+ default 4 if SOC_INTEL_TIGERLAKE
+
config SOC_INTEL_I2C_DEV_MAX
int
default 6
diff --git a/src/soc/intel/tigerlake/fsp_params_jsl.c b/src/soc/intel/tigerlake/fsp_params_jsl.c
index 8046b2e..d5d623b 100644
--- a/src/soc/intel/tigerlake/fsp_params_jsl.c
+++ b/src/soc/intel/tigerlake/fsp_params_jsl.c
@@ -106,7 +106,7 @@
memset(params->PcieRpPmSci, 0, sizeof(params->PcieRpPmSci));
/* USB configuration */
- for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
+ for (i = 0; i < CONFIG_SOC_INTEL_USB2_DEV_MAX; i++) {
params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
@@ -116,7 +116,7 @@
params->Usb2PhyPehalfbit[i] = config->usb2_ports[i].pre_emp_bit;
}
- for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) {
+ for (i = 0; i < CONFIG_SOC_INTEL_USB3_DEV_MAX; i++) {
params->PortUsb30Enable[i] = config->usb3_ports[i].enable;
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
diff --git a/src/soc/intel/tigerlake/fsp_params_tgl.c b/src/soc/intel/tigerlake/fsp_params_tgl.c
index 305748e..f027ee0 100644
--- a/src/soc/intel/tigerlake/fsp_params_tgl.c
+++ b/src/soc/intel/tigerlake/fsp_params_tgl.c
@@ -89,7 +89,7 @@
params->IomTypeCPortPadCfg[i] = 0x09000000;
/* USB */
- for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
+ for (i = 0; i < CONFIG_SOC_INTEL_USB2_DEV_MAX; i++) {
params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
params->Usb2PhyPetxiset[i] = config->usb2_ports[i].pre_emp_bias;
@@ -98,7 +98,7 @@
params->Usb2PhyPehalfbit[i] = config->usb2_ports[i].pre_emp_bit;
}
- for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) {
+ for (i = 0; i < CONFIG_SOC_INTEL_USB3_DEV_MAX; i++) {
params->PortUsb30Enable[i] = config->usb3_ports[i].enable;
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
if (config->usb3_ports[i].tx_de_emp) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/38682
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia8e88e92989fe40d7bd1c28942e005cb0d862fcb
Gerrit-Change-Number: 38682
Gerrit-PatchSet: 1
Gerrit-Owner: Meera Ravindranath <meera.ravindranath(a)intel.com>
Gerrit-MessageType: newchange
Hello Aaron Durbin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/46834
to review the following change.
Change subject: x86: Put bootblock startup code into .text._start section
......................................................................
x86: Put bootblock startup code into .text._start section
The initial bootblock assembly code on x86 is just put into the .text
section, which just happens to come before all the individual .text.*
function sections in the program.ld script. So it tends to be at the
start of the image, bit if you inserted another linker script section
with contents before .text, it would cause a problem. (I'm not sure if
it's an architectural requirement for _start16bit to come at the start
of the image, but at least its 4K alignment requirement would waste a
lot of space if it didn't.)
This patch moves the section to .text._start which is the name other
architectures use for the code they want in the very front of the image
and which is listed first in program.ld.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: Ia84e6e33ec29584d356e226e8fdcb8c9334d49af
---
M src/arch/x86/bootblock_crt0.S
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/46834/1
diff --git a/src/arch/x86/bootblock_crt0.S b/src/arch/x86/bootblock_crt0.S
index 3f41464..82ae97f 100644
--- a/src/arch/x86/bootblock_crt0.S
+++ b/src/arch/x86/bootblock_crt0.S
@@ -10,7 +10,7 @@
#include <cpu/x86/cr.h>
-.section .text
+.section .text._start
/*
* Include the old code for reset vector and protected mode entry. That code has
--
To view, visit https://review.coreboot.org/c/coreboot/+/46834
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia84e6e33ec29584d356e226e8fdcb8c9334d49af
Gerrit-Change-Number: 46834
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-MessageType: newchange
Hello Patrick Georgi, Aaron Durbin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/41119
to review the following change.
Change subject: cbfstool: Hide hash printing behind -v and add to parseable output
......................................................................
cbfstool: Hide hash printing behind -v and add to parseable output
With the upcoming introduction of CBFS verification, a lot more CBFS
files will have hashes. The current cbfstool default of always printing
hash attributes when they exist will make cbfstool print very messy.
Therefore, hide hash attribute output unless the user passed -v.
It would also be useful to be able to get file attributes like hashes in
machine parseable output. Unfortunately, our machine parseable format
(-k) doesn't really seem designed to be extensible. To avoid breaking
older parsers, this patch adds new attribute output behind -v (which
hopefully no current users pass since it doesn't change anything for -k
at the moment). With this patch cbfstool print -k -v may print an
arbitrary amount of extra tokens behind the predefined ones on a file
line. Tokens always begin with an identifying string (e.g. 'hash'),
followed by extra fields that should be separated by colons. Multiple
tokens are separated by the normal separator character (tab).
cbfstool print -k -v may also print additional information that applies
to the whole CBFS on separate lines. These lines will always begin with
a '[' (which hopefully nobody would use as a CBFS filename character
although we technically have no restrictions at the moment).
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I9e16cda393fa0bc1d8734d4b699e30e2ae99a36d
---
M util/cbfstool/cbfs_image.c
M util/cbfstool/cbfs_image.h
M util/cbfstool/cbfstool.c
3 files changed, 41 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/41119/1
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 7942b27..3a83694 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -1503,6 +1503,9 @@
decompressed_size
);
+ if (!verbose)
+ return 0;
+
struct cbfs_file_attr_hash *attr = NULL;
while ((attr = cbfs_file_get_next_hash(entry, attr)) != NULL) {
size_t hash_len = vb2_digest_size(attr->hash.algo);
@@ -1522,9 +1525,6 @@
free(hash_str);
}
- if (!verbose)
- return 0;
-
DEBUG(" cbfs_file=0x%x, offset=0x%x, content_address=0x%x+0x%x\n",
cbfs_get_entry_addr(image, entry), ntohl(entry->offset),
cbfs_get_entry_addr(image, entry) + ntohl(entry->offset),
@@ -1587,21 +1587,45 @@
fprintf(fp, "%s%s", type, sep);
fprintf(fp, "0x%zx%s", metadata_size, sep);
fprintf(fp, "0x%zx%s", data_size, sep);
- fprintf(fp, "0x%zx\n", metadata_size + data_size);
+ fprintf(fp, "0x%zx", metadata_size + data_size);
+
+ if (verbose) {
+ unsigned int decompressed_size = 0;
+ unsigned int compression = cbfs_file_get_compression_info(entry,
+ &decompressed_size);
+ if (compression != CBFS_COMPRESS_NONE)
+ fprintf(fp, "%scomp:%s:0x%x", sep, lookup_name_by_type(
+ types_cbfs_compression, compression, "????"),
+ decompressed_size);
+
+ struct cbfs_file_attr_hash *attr = NULL;
+ while ((attr = cbfs_file_get_next_hash(entry, attr)) != NULL) {
+ size_t hash_len = vb2_digest_size(attr->hash.algo);
+ if (!hash_len)
+ continue;
+ char *hash_str = bintohex(attr->hash.raw, hash_len);
+ int valid = vb2_hash_verify(CBFS_SUBHEADER(entry),
+ ntohl(entry->len), &attr->hash) == VB2_SUCCESS;
+ fprintf(fp, "%shash:%s:%s:%s", sep,
+ vb2_get_hash_algorithm_name(attr->hash.algo),
+ hash_str, valid ? "valid" : "invalid");
+ free(hash_str);
+ }
+ }
+ fprintf(fp, "\n");
return 0;
}
-int cbfs_print_directory(struct cbfs_image *image)
+void cbfs_print_directory(struct cbfs_image *image)
{
if (cbfs_is_legacy_cbfs(image))
cbfs_print_header_info(image);
printf("%-30s %-10s %-12s Size Comp\n", "Name", "Offset", "Type");
cbfs_legacy_walk(image, cbfs_print_entry_info, NULL);
- return 0;
}
-int cbfs_print_parseable_directory(struct cbfs_image *image)
+void cbfs_print_parseable_directory(struct cbfs_image *image)
{
size_t i;
const char *header[] = {
@@ -1618,7 +1642,6 @@
fprintf(stdout, "%s%s", header[i], sep);
fprintf(stdout, "%s\n", header[i]);
cbfs_legacy_walk(image, cbfs_print_parseable_entry_info, stdout);
- return 0;
}
int cbfs_merge_empty_entry(struct cbfs_image *image, struct cbfs_file *entry,
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index a3a6fb9..d633fee 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -174,8 +174,8 @@
int cbfs_is_valid_entry(struct cbfs_image *image, struct cbfs_file *entry);
/* Print CBFS component information. */
-int cbfs_print_directory(struct cbfs_image *image);
-int cbfs_print_parseable_directory(struct cbfs_image *image);
+void cbfs_print_directory(struct cbfs_image *image);
+void cbfs_print_parseable_directory(struct cbfs_image *image);
int cbfs_print_header_info(struct cbfs_image *image);
int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
void *arg);
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index f97745e..6015603 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -1087,12 +1087,16 @@
if (cbfs_image_from_buffer(&image, param.image_region,
param.headeroffset))
return 1;
- if (param.machine_parseable)
- return cbfs_print_parseable_directory(&image);
- else {
+ if (param.machine_parseable) {
+ if (verbose)
+ printf("[FMAP REGION]\t%s\n", param.region_name);
+ cbfs_print_parseable_directory(&image);
+ } else {
printf("FMAP REGION: %s\n", param.region_name);
- return cbfs_print_directory(&image);
+ cbfs_print_directory(&image);
}
+
+ return 0;
}
static int cbfs_extract(void)
--
To view, visit https://review.coreboot.org/c/coreboot/+/41119
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9e16cda393fa0bc1d8734d4b699e30e2ae99a36d
Gerrit-Change-Number: 41119
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange