Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44017 )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
arch/x86/smbios: Validate data for type17
Validate that the memory frequency reported is within the spec. Helps identifying platforms where the unit is wrong (MT/s vs MHz).
Change-Id: I8b3d51464a92ed25017127f911a2292b0e10fb04 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/44017/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 700de23..f27006b 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -1078,6 +1078,38 @@ return len; }
+static void smbios_type17_validate_dimm(struct dimm_info *dimm) +{ + u16 minf, maxf; + + switch (dimm->ddr_type) { + case MEMORY_TYPE_DDR4: + minf = 800; maxf = 1600; + break; + case MEMORY_TYPE_LPDDR4: + minf = 1600; maxf = 2133; + break; + case MEMORY_TYPE_DDR3: + minf = 400; maxf = 1067; + break; + case MEMORY_TYPE_LPDDR3: + minf = 800; maxf = 1067; + break; + case MEMORY_TYPE_DDR2: + minf = 400; maxf = 534; + break; + case MEMORY_TYPE_LPDDR2: + minf = 400; maxf = 534; + break; + default: + printk(BIOS_ERR, "SMBIOS: Unknown DIMM type %x\n", dimm->ddr_type); + return; + } + + if (dimm->ddr_frequency < minf || dimm->ddr_frequency > maxf) + printk(BIOS_ERR, "SMBIOS: Type 17 has invalid memory frequency: %d MHz\n", dimm->ddr_frequency); +} + static int smbios_write_type17(unsigned long *current, int *handle) { int len = sizeof(struct smbios_type17); @@ -1094,6 +1126,7 @@ i++) { struct dimm_info *dimm; dimm = &meminfo->dimm[i]; + smbios_type17_validate_dimm(dimm); len = create_smbios_type17_for_dimm(dimm, current, handle); *current += len; totallen += len;
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44017 )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44017/1/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/44017/1/src/arch/x86/smbios.c@1110 PS1, Line 1110: printk(BIOS_ERR, "SMBIOS: Type 17 has invalid memory frequency: %d MHz\n", dimm->ddr_frequency); line over 96 characters
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44017 )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
Patch Set 1: Code-Review+2
Christian Walter has uploaded a new patch set (#2) to the change originally created by Patrick Rudolph. ( https://review.coreboot.org/c/coreboot/+/44017 )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
arch/x86/smbios: Validate data for type17
Validate that the memory frequency reported is within the spec. Helps identifying platforms where the unit is wrong (MT/s vs MHz).
Change-Id: I8b3d51464a92ed25017127f911a2292b0e10fb04 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/smbios.c 1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/44017/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44017 )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
Patch Set 2:
(1 comment)
File src/arch/x86/smbios.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-117975): https://review.coreboot.org/c/coreboot/+/44017/comment/5c5e62cf_f6d8fbb0 PS2, Line 1084: printk(BIOS_ERR, "SMBIOS: Type 17 has invalid memory frequency: %d MHz\n", dimm->ddr_frequency); line over 96 characters
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/44017?usp=email )
Change subject: arch/x86/smbios: Validate data for type17 ......................................................................
Abandoned