Attention is currently required from: Tim Wawrzynczak, Arthur Heymans, Nick Vaccaro, Eric Lai. Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63492 )
Change subject: cpu/x86/mtrrlib: Use `need_restore_mtrr()` from set_var_mtrr function ......................................................................
Patch Set 1:
(1 comment)
File src/cpu/x86/mtrr/mtrrlib.c:
https://review.coreboot.org/c/coreboot/+/63492/comment/8dfd295a_358cf628 PS1, Line 52: /* Need to restore mtrr later using remove_temp_solution. */ : if (ENV_RAMSTAGE) : need_restore_mtrr();
I don't like this. set_var_mtrr should do just one thing: set a variable mtrr... I if you want a temp mtrr with this function, it should be the caller setting this up.
Are you suggesting to make need_restore_mtrr() from the caller of `set_var_mtrr()` ? I thought, after DRAM MTRR snapshot being implemented, if user called into `set_var_mtrr()` then set_var_mtrr() implement inherently sets put_back_original_solution variable. but I do see a value in your suggestion. I think try to call this call exclusive of set_var_mtrr().