Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30432 )
Change subject: drivers/smmstore: Fix some issues ......................................................................
Patch Set 9:
(3 comments)
https://review.coreboot.org/#/c/30432/9/src/drivers/smmstore/store.c File src/drivers/smmstore/store.c:
https://review.coreboot.org/#/c/30432/9/src/drivers/smmstore/store.c@200 PS9, Line 200: if (region_is_subregion(region_device_region(&store), &subregion)) { If you just use rdev_chain() you'll have a region_device that is strictly the are you are about to write. Similarly, the subregion checking is already done in rdev_chain().
i.e.
if (rdev_chain(&store, &store, end, size)) fail;
https://review.coreboot.org/#/c/30432/9/src/drivers/smmstore/store.c@212 PS9, Line 212: key_sz value_sz
https://review.coreboot.org/#/c/30432/9/src/drivers/smmstore/store.c@227 PS9, Line 227: if (rdev_writeat(&store, &nul, end, sizeof(nul)) != sizeof(nul)) { Would it be better to have the equivalent of FILE such that the offset is tracked and bumped when reading/writing?