Attention is currently required from: Furquan Shaikh, Tim Wawrzynczak, Subrata Banik, Angel Pons. Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56151 )
Change subject: cpu/x86/mtrr: Add check_var_mtrr_range_enabled() helper function ......................................................................
Patch Set 1:
(1 comment)
File src/cpu/x86/mtrr/earlymtrr.c:
https://review.coreboot.org/c/coreboot/+/56151/comment/5d32231a_ee39183a PS1, Line 168: bool check_var_mtrr_range_enabled(uintptr_t base, size_t size)
This function relies on the caller to align base and size of the address range you want to check. That's not a good API. I'd prefer a function that can check if a certain arbitrary range is cached a certain way: UC/RW/RO/WC... e.g.: checking if [0xff700000, 0xffffffff] is covered by RO caching type MTRR. You also don't want to make assumptions on the MTRR default caching type: read it out first.
It can also be the case that your input range spans multiple MTRRs.