Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35558 )
Change subject: device/dram/ddr4: Check if total or used SPD bytes value is reserved ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35558/6/src/device/dram/ddr4.c File src/device/dram/ddr4.c:
https://review.coreboot.org/c/coreboot/+/35558/6/src/device/dram/ddr4.c@113 PS6, Line 113: : spd_bytes_total = (spd[0] >> 4) & ((1 << 3) - 1); : spd_bytes_used = spd[0] & ((1 << 4) - 1); Feel free to use proper hex for masks here.
https://review.coreboot.org/c/coreboot/+/35558/6/src/device/dram/ddr4.c@121 PS6, Line 121: : spd_bytes_total = 256 << (spd_bytes_total - 1); : : if (spd_bytes_total > 512) : printk(BIOS_WARNING, "SPD Bytes Total value is reserved\n"); The value '3' in bytes_total is reserved so check for that instead of a meaningless decoded value.
https://review.coreboot.org/c/coreboot/+/35558/6/src/device/dram/ddr4.c@132 PS6, Line 132: spd_bytes_used You could compare this to be smaller than spd_bytes_total as a sanity check