Attention is currently required from: Gwendal Grignou, Nick Vaccaro, Shelley Chen.
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/80805?usp=email )
Change subject: drivers/vpd: Return NULL for missing "feature_device_info" ......................................................................
Patch Set 1:
(1 comment)
File src/drivers/vpd/vpd_device_feature.c:
https://review.coreboot.org/c/coreboot/+/80805/comment/45356a99_98508781 : PS1, Line 10: static char device_info[VPD_FEATURE_DEVICE_INFO_LEN];
Could |device_info| be in the stack and give as an argument to the function? The function is called only once and there is no logic to cache the data.
in that case the caller (outside drivers/vpd) of the vpd_get_feature_device_info() has to pass the `device_info` buffer and also needs to know the possible size (VPD_FEATURE_DEVICE_INFO_LEN) which may not required to be exposed outside of this file.
I don't think there is any problem of using static variable as we are in ramstage (and there is no memory specific restriction)
more reference here, https://github.com/coreboot/coreboot/blob/main/src/drivers/vpd/vpd_serial.c#...
I don't see any caller of VPD API are actually passing the argument over stack.