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
Hello Patrick Georgi, Aaron Durbin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/41118
to review the following change.
Change subject: cbfstool: Rename cbfs_walk() to cbfs_legacy_walk()
......................................................................
cbfstool: Rename cbfs_walk() to cbfs_legacy_walk()
This function name clashes with cbfs_walk() in the new commonlib CBFS
stack, so rename it to cbfs_legacy_walk(). While we could replace it
with the new commonlib implementation, it still has support for certain
features in the deprecated pre-FMAP CBFSes (such as non-standard header
alignment), which are needed to handle old files but probably not
something we'd want to burden the commonlib implementation with. So
until we decide to deprecate support for those files from cbfstool as
well, it seems easier to just keep the existing implementation here.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I37c7e7aa9a206372817d8d0b8f66d72bafb4f346
---
M util/cbfstool/cbfs_image.c
M util/cbfstool/cbfs_image.h
2 files changed, 13 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/41118/1
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 035b196..7942b27 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -469,7 +469,7 @@
cbfs_create_empty_entry(entry, CBFS_TYPE_NULL,
last_entry_size, "");
/* If the last entry was an empty file, merge them. */
- cbfs_walk(&image, cbfs_merge_empty_entry, NULL);
+ cbfs_legacy_walk(&image, cbfs_merge_empty_entry, NULL);
}
return 0;
@@ -621,7 +621,7 @@
prev_size, "");
/* Merge any potential empty entries together. */
- cbfs_walk(image, cbfs_merge_empty_entry, NULL);
+ cbfs_legacy_walk(image, cbfs_merge_empty_entry, NULL);
/*
* Since current switched to an empty file keep track of it.
@@ -760,7 +760,7 @@
// Merge empty entries.
DEBUG("(trying to merge empty entries...)\n");
- cbfs_walk(image, cbfs_merge_empty_entry, NULL);
+ cbfs_legacy_walk(image, cbfs_merge_empty_entry, NULL);
for (entry = cbfs_find_first_entry(image);
entry && cbfs_is_valid_entry(image, entry);
@@ -1380,7 +1380,7 @@
DEBUG("cbfs_remove_entry: Removed %s @ 0x%x\n",
entry->filename, cbfs_get_entry_addr(image, entry));
entry->type = htonl(CBFS_TYPE_DELETED);
- cbfs_walk(image, cbfs_merge_empty_entry, NULL);
+ cbfs_legacy_walk(image, cbfs_merge_empty_entry, NULL);
return 0;
}
@@ -1597,7 +1597,7 @@
if (cbfs_is_legacy_cbfs(image))
cbfs_print_header_info(image);
printf("%-30s %-10s %-12s Size Comp\n", "Name", "Offset", "Type");
- cbfs_walk(image, cbfs_print_entry_info, NULL);
+ cbfs_legacy_walk(image, cbfs_print_entry_info, NULL);
return 0;
}
@@ -1617,7 +1617,7 @@
for (i = 0; i < ARRAY_SIZE(header) - 1; i++)
fprintf(stdout, "%s%s", header[i], sep);
fprintf(stdout, "%s\n", header[i]);
- cbfs_walk(image, cbfs_print_parseable_entry_info, stdout);
+ cbfs_legacy_walk(image, cbfs_print_parseable_entry_info, stdout);
return 0;
}
@@ -1660,7 +1660,7 @@
return 0;
}
-int cbfs_walk(struct cbfs_image *image, cbfs_entry_callback callback,
+int cbfs_legacy_walk(struct cbfs_image *image, cbfs_entry_callback callback,
void *arg)
{
int count = 0;
@@ -1970,7 +1970,7 @@
need_len = metadata_size + size;
// Merge empty entries to build get max available space.
- cbfs_walk(image, cbfs_merge_empty_entry, NULL);
+ cbfs_legacy_walk(image, cbfs_merge_empty_entry, NULL);
/* Three cases of content location on memory page:
* case 1.
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index 6ff0746..a3a6fb9 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -129,16 +129,18 @@
int32_t cbfs_locate_entry(struct cbfs_image *image, size_t size,
size_t page_size, size_t align, size_t metadata_size);
-/* Callback function used by cbfs_walk.
+/* Callback function used by cbfs_legacy_walk.
* Returns 0 on success, or non-zero to stop further iteration. */
typedef int (*cbfs_entry_callback)(struct cbfs_image *image,
struct cbfs_file *file,
void *arg);
/* Iterates through all entries in CBFS image, and invoke with callback.
- * Stops if callback returns non-zero values.
+ * Stops if callback returns non-zero values. Unlike the commonlib cbfs_walk(),
+ * this can deal with different alignments in legacy CBFS (with master header).
* Returns number of entries invoked. */
-int cbfs_walk(struct cbfs_image *image, cbfs_entry_callback callback, void *arg);
+int cbfs_legacy_walk(struct cbfs_image *image, cbfs_entry_callback callback,
+ void *arg);
/* Primitive CBFS utilities */
--
To view, visit https://review.coreboot.org/c/coreboot/+/41118
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I37c7e7aa9a206372817d8d0b8f66d72bafb4f346
Gerrit-Change-Number: 41118
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
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48089 )
Change subject: intel/common/block/gpio: only reset configured SMI instead of all
......................................................................
Patch Set 10:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48089/10/src/soc/intel/common/bloc…
File src/soc/intel/common/block/gpio/gpio.c:
https://review.coreboot.org/c/coreboot/+/48089/10/src/soc/intel/common/bloc…
PS10, Line 170: en_value
> I used en_value, because it actually is the bitmask of the enabled smi. […]
Ack
--
To view, visit https://review.coreboot.org/c/coreboot/+/48089
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iecf789d3009011381835959cb1c166f703f1c0cc
Gerrit-Change-Number: 48089
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Wed, 02 Dec 2020 23:29:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Furquan Shaikh <furquan(a)google.com>
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-MessageType: comment
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48090 )
Change subject: soc/intel/common/block/gpio: add code for NMI enabling
......................................................................
Patch Set 10:
(2 comments)
https://review.coreboot.org/c/coreboot/+/48090/10/src/soc/intel/skylake/acp…
File src/soc/intel/skylake/acpi.c:
https://review.coreboot.org/c/coreboot/+/48090/10/src/soc/intel/skylake/acp…
PS10, Line 526: 5,
> mh, LINT1 is a ISA interrupt (see IOAPIC spec) - and ISA interrupts are always edge/active-high acco […]
Ack
https://review.coreboot.org/c/coreboot/+/48090/10/src/soc/intel/skylake/acp…
PS10, Line 526: 1)
> yes, see IOAPIC spec
thanks for the pointer.
--
To view, visit https://review.coreboot.org/c/coreboot/+/48090
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4fc1a35c99c6a28b20e08a80b97bb4b8624935c9
Gerrit-Change-Number: 48090
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Wed, 02 Dec 2020 23:26:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-MessageType: comment