Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30432 )
Change subject: drivers/smmstore: Fix some issues ......................................................................
Patch Set 15:
(4 comments)
https://review.coreboot.org/c/coreboot/+/30432/15/src/drivers/smmstore/store... File src/drivers/smmstore/store.c:
https://review.coreboot.org/c/coreboot/+/30432/15/src/drivers/smmstore/store... PS15, Line 97: *bufsize = 0; Did you want to get rid of this? The SMI external interface might assume that things are zero'd out on failure? I'm not really sure of the expectation of what would happen with SMMSTORE_RET_FAILURE from the callee.
https://review.coreboot.org/c/coreboot/+/30432/15/src/drivers/smmstore/store... PS15, Line 136: ssize_t *end There's no need for this.
https://review.coreboot.org/c/coreboot/+/30432/15/src/drivers/smmstore/store... PS15, Line 185: you can do this here:
if (rdev_chain(store, store, end, data_sz - end)) return CB_ERR;
return CB_SUCCESS;
Upon returning from this function. The region device is pointing at the next section that is writable.
https://review.coreboot.org/c/coreboot/+/30432/15/src/drivers/smmstore/store... PS15, Line 217: end And this would be 0 once scan_end() has positioned the region device correctly. And it can also be named correctly: offset.