Attention is currently required from: Andrey Petrov.
Hello Andrey Petrov,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/69580
to look at the new patch set (#3).
Change subject: [RFC] drivers/intel/fsp2_0/hand_off_block: limit number of processed HOBs
......................................................................
[RFC] drivers/intel/fsp2_0/hand_off_block: limit number of processed HOBs
Limit the number of HOBs fsp_hob_iterator_get_next will process to avoid
a more or less infinite loop in case the HOB list in memory is broken.
A relatively large number is chosen for HOB_PROCESSING_LIMIT, so that
this check won't be run into during normal operation.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
---
M src/drivers/intel/fsp2_0/hand_off_block.c
1 file changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/69580/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/69580
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
Gerrit-Change-Number: 69580
Gerrit-PatchSet: 3
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-MessageType: newpatchset
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69475 )
Change subject: drivers/intel/fsp2_0/hand_off_block: add functions to iterate over HOBs
......................................................................
Patch Set 2:
(1 comment)
File src/drivers/intel/fsp2_0/hand_off_block.c:
https://review.coreboot.org/c/coreboot/+/69475/comment/b87a7967_a6ba49d2
PS1, Line 140: while ((*hob_iterator)->type != HOB_TYPE_END_OF_HOB_LIST) {
> i have no idea what a reasonable maximum number of hobs would be; 1000 maybe? since it's outside of […]
pushed this improvement as CB:69580
--
To view, visit https://review.coreboot.org/c/coreboot/+/69475
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If86dde2a9f41d0ca7941493a92f11b91a77e2ae0
Gerrit-Change-Number: 69475
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Martin L Roth <gaumless(a)gmail.com>
Gerrit-CC: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Comment-Date: Mon, 14 Nov 2022 19:27:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Martin L Roth <gaumless(a)gmail.com>
Comment-In-Reply-To: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Comment-In-Reply-To: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: comment
Attention is currently required from: Andrey Petrov.
Hello Andrey Petrov,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/69580
to look at the new patch set (#2).
Change subject: [RFC] drivers/intel/fsp2_0/hand_off_block: limit number of
......................................................................
[RFC] drivers/intel/fsp2_0/hand_off_block: limit number of
Limit the number of HOBs fsp_hob_iterator_get_next will process to avoid
a more or less infinite loop in case the HOB list in memory is broken.
A relatively large number is chosen for HOB_PROCESSING_LIMIT, so that
this check won't be run into during normal operation.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
---
M src/drivers/intel/fsp2_0/hand_off_block.c
1 file changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/69580/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/69580
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
Gerrit-Change-Number: 69580
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Andrey Petrov.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69580 )
Change subject: [RFC] drivers/intel/fsp2_0/hand_off_block: limit number of
......................................................................
Patch Set 1:
(1 comment)
File src/drivers/intel/fsp2_0/hand_off_block.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-163653):
https://review.coreboot.org/c/coreboot/+/69580/comment/aa0ba720_7ca11fc7
PS1, Line 156: "further HOBs. There's likely somthing wrong with the HOB data "
'somthing' may be misspelled - perhaps 'something'?
--
To view, visit https://review.coreboot.org/c/coreboot/+/69580
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
Gerrit-Change-Number: 69580
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Comment-Date: Mon, 14 Nov 2022 19:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69580 )
Change subject: [RFC] drivers/intel/fsp2_0/hand_off_block: limit number of
......................................................................
[RFC] drivers/intel/fsp2_0/hand_off_block: limit number of
Limit the number of HOBs fsp_hob_iterator_get_next will process to avoid
a more or less infinite loop in case the HOB list in memory is broken.
A relatively large number is chosen for HOB_PROCESSING_LIMIT, so that
this check won't be run into during normal operation.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
---
M src/drivers/intel/fsp2_0/hand_off_block.c
1 file changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/69580/1
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index 2ded33699..573cbc9 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -11,6 +11,11 @@
#define HOB_HEADER_LEN 8
+/* Only process HOB_PROCESSING_LIMIT HOBs in fsp_hob_iterator_get_next to avoid an inifinite
+ loops in case of a broken HOB list in memory. This number should be large enough to not run
+ into this during normal operation */
+#define HOB_PROCESSING_LIMIT 1000
+
/* GUIDs in little-endian, so they can be used with memcmp() */
const uint8_t fsp_bootloader_tolum_guid[16] = {
0x56, 0x4f, 0xff, 0x73, 0x8e, 0xaa, 0x51, 0x44,
@@ -137,13 +142,22 @@
const struct hob_header **hob)
{
const struct hob_header *current_hob;
+ size_t hobs_processed = 0;
while ((*hob_iterator)->type != HOB_TYPE_END_OF_HOB_LIST) {
current_hob = *hob_iterator;
*hob_iterator = fsp_next_hob(*hob_iterator);
+ hobs_processed++;
if (current_hob->type == hob_type) {
*hob = current_hob;
return CB_SUCCESS;
}
+ if (hobs_processed >= HOB_PROCESSING_LIMIT) {
+ printk(BIOS_ERR, "Processed more than %u HOBs; not proessing any "
+ "further HOBs. There's likely somthing wrong with the HOB data "
+ "structure in memory.\n",
+ HOB_PROCESSING_LIMIT);
+ return CB_ERR;
+ }
}
return CB_ERR;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/69580
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie89c5b7e0aff7926e819aca455554370afd36f43
Gerrit-Change-Number: 69580
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/69478 )
Change subject: drv/intel/fsp2_0/hand_off_block: rework fsp_find_extension_hob_by_guid
......................................................................
drv/intel/fsp2_0/hand_off_block: rework fsp_find_extension_hob_by_guid
Use the new fsp_hob_iterator_get_next_guid_extension function in
fsp_find_extension_hob_by_guid instead of iterating through the HOB list
in this function.
TEST=AMD_FSP_DMI_HOB is still found and the same type 17 DMI info is
printed on the console.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I4d4ce14c8a5494763de3f65ed049f98a768c40a5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69478
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/drivers/intel/fsp2_0/hand_off_block.c
1 file changed, 25 insertions(+), 13 deletions(-)
Approvals:
build bot (Jenkins): Verified
Arthur Heymans: Looks good to me, approved
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index 2738c78..2ded33699 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -233,22 +233,14 @@
const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)
{
- const uint8_t *hob_guid;
- const struct hob_header *hob = fsp_get_hob_list();
+ const struct hob_header *hob_iterator;
+ const void *hob_guid;
- if (!hob)
+ if (fsp_hob_iterator_init(&hob_iterator) != CB_SUCCESS)
return NULL;
- for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
- if (hob->type != HOB_TYPE_GUID_EXTENSION)
- continue;
-
- hob_guid = hob_header_to_struct(hob);
- if (fsp_guid_compare(hob_guid, guid)) {
- *size = hob->length - (HOB_HEADER_LEN + 16);
- return hob_header_to_extension_hob(hob);
- }
- }
+ if (fsp_hob_iterator_get_next_guid_extension(&hob_iterator, guid, &hob_guid, size) == CB_SUCCESS)
+ return hob_guid;
return NULL;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/69478
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4d4ce14c8a5494763de3f65ed049f98a768c40a5
Gerrit-Change-Number: 69478
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Tarun Tuli, Eran Mitrani, Nick Vaccaro.
Hello Eran Mitrani, Subrata Banik, Nick Vaccaro,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/69340
to look at the new patch set (#3).
Change subject: mb/google/brya/var/agah: Set GPP_H13 to reset on PLTRST
......................................................................
mb/google/brya/var/agah: Set GPP_H13 to reset on PLTRST
GPP_H13 should be reset when going to S5. Update it to do so on
PLTRST
BUG=b:240617195
TEST=Measured on Agah that PP3300_SD_X goes off in S5.
Change-Id: I959f92f2c486e0ca5cb4269b271c163b4c4925d4
Signed-off-by: Tarun Tuli <taruntuli(a)google.com>
---
M src/mainboard/google/brya/variants/agah/gpio.c
1 file changed, 18 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/69340/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/69340
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I959f92f2c486e0ca5cb4269b271c163b4c4925d4
Gerrit-Change-Number: 69340
Gerrit-PatchSet: 3
Gerrit-Owner: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani(a)google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Attention: Eran Mitrani <mitrani(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-MessageType: newpatchset