Attention is currently required from: Nico Huber, Michał Żygowski. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56023 )
Change subject: board_enable.c: Add ME unlock function for TUXEDO laptops ......................................................................
Patch Set 1:
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/56023/comment/aade2173_d0bfded7 PS1, Line 7: board_enable.c: Add ME unlock function for TUXEDO laptops I'd appreciate if you could explain in the commit message what this "ME unlock" is about. Also missing is information on how to undo this unlocking (the code only implements unlocking).
Wild guess after a very quick glance: this code tells the EC to assert the HDA_SDO strap using a GPIO.
File board_enable.c:
https://review.coreboot.org/c/flashrom/+/56023/comment/0a6a6720_b9534deb PS1, Line 2315: if (!arg && strcmp(arg, "yes")) : return 0; Hmmm, this check will call `strcmp()` only when `arg` is NULL. I don't think undefined behavior is what you wanted to do? 😄
If you want to bail out unless the param exists and equals `yes`, I would do:
char *arg = extract_programmer_param("unlockmeonly"); const bool proceed = arg && strcmp(arg, "yes") == 0; free(arg); if (!proceed) return 0;
Note that `free()` is unconditionally called, even when `arg` is NULL. This is a non-issue because the C standard explicitly states the following about the `free()` function:
If ptr is a null pointer, no action occurs.