Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: [WIP] soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
[WIP] soc/amd/picasso/fsp_params: add asserts for descriptor count
Will likely need to fix some issues this uncovered before this can get merged.
BUG=b:158695393
Change-Id: Ia220d5a9d4ff11707b795b04662ff7eead4e2888 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/fsp_params.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/43435/1
diff --git a/src/soc/amd/picasso/fsp_params.c b/src/soc/amd/picasso/fsp_params.c index 80d43fb..6fb3668 100644 --- a/src/soc/amd/picasso/fsp_params.c +++ b/src/soc/amd/picasso/fsp_params.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h> #include <device/pci.h> #include <soc/pci_devs.h> #include <soc/platform_descriptors.h> @@ -60,6 +61,9 @@ { size_t i;
+ ASSERT_MSG(num <= FSPS_UPD_DXIO_DESCRIPTOR_COUNT, + "Too many DXIO descriptors provided."); + for (i = 0; i < num; i++) { memcpy(scfg->dxio_descriptor[i], &descs[i], sizeof(scfg->dxio_descriptor[0])); } @@ -70,6 +74,9 @@ { size_t i;
+ ASSERT_MSG(num <= FSPS_UPD_DDI_DESCRIPTOR_COUNT, + "Too many DDI descriptors provided."); + for (i = 0; i < num; i++) { memcpy(&scfg->ddi_descriptor[i], &descs[i], sizeof(scfg->ddi_descriptor[0])); }
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: [WIP] soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
Patch Set 1: Code-Review+1
Hello build bot (Jenkins), Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43435
to look at the new patch set (#2).
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
soc/amd/picasso/fsp_params: add asserts for descriptor count
BUG=b:158695393
Change-Id: Ia220d5a9d4ff11707b795b04662ff7eead4e2888 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/fsp_params.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/43435/2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43435/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/43435/2//COMMIT_MSG@8 PS2, Line 8: Can you please summarize the bug report?
Hello build bot (Jenkins), Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43435
to look at the new patch set (#3).
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
soc/amd/picasso/fsp_params: add asserts for descriptor count
With the updated FSP UPD headers there are enough DXIO descriptor slots in the UPD, so we can now add asserts to make sure that the mainboard doesn't pass more DXIO/DDI descriptors than the UPD has slots for. This is part of the DXIO/DDI descriptor handling cleanup.
BUG=b:158695393
Change-Id: Ia220d5a9d4ff11707b795b04662ff7eead4e2888 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/fsp_params.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/43435/3
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43435/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/43435/2//COMMIT_MSG@8 PS2, Line 8:
Can you please summarize the bug report?
Done. The bug is about the DXIO/DDI descriptor cleanup
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
Patch Set 3: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
Patch Set 5: Code-Review+2
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43435 )
Change subject: soc/amd/picasso/fsp_params: add asserts for descriptor count ......................................................................
soc/amd/picasso/fsp_params: add asserts for descriptor count
With the updated FSP UPD headers there are enough DXIO descriptor slots in the UPD, so we can now add asserts to make sure that the mainboard doesn't pass more DXIO/DDI descriptors than the UPD has slots for. This is part of the DXIO/DDI descriptor handling cleanup.
BUG=b:158695393
Change-Id: Ia220d5a9d4ff11707b795b04662ff7eead4e2888 Signed-off-by: Felix Held felix-coreboot@felixheld.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/43435 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/picasso/fsp_params.c 1 file changed, 7 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/soc/amd/picasso/fsp_params.c b/src/soc/amd/picasso/fsp_params.c index 8683e9b..e7169d1 100644 --- a/src/soc/amd/picasso/fsp_params.c +++ b/src/soc/amd/picasso/fsp_params.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h> #include <device/pci.h> #include <soc/pci_devs.h> #include <soc/platform_descriptors.h> @@ -60,6 +61,9 @@ { size_t i;
+ ASSERT_MSG(num <= FSPS_UPD_DXIO_DESCRIPTOR_COUNT, + "Too many DXIO descriptors provided."); + for (i = 0; i < num; i++) { memcpy(scfg->dxio_descriptor[i], &descs[i], sizeof(scfg->dxio_descriptor[0])); } @@ -70,6 +74,9 @@ { size_t i;
+ ASSERT_MSG(num <= FSPS_UPD_DDI_DESCRIPTOR_COUNT, + "Too many DDI descriptors provided."); + for (i = 0; i < num; i++) { memcpy(&scfg->ddi_descriptor[i], &descs[i], sizeof(scfg->ddi_descriptor[0])); }