[coreboot] Quick questions on the mtrr setup code

Corey Osgood corey.osgood at gmail.com
Sat Apr 4 07:21:14 CEST 2009


I'm poking around mtrr.c (v2 and v3 are almost identical, but I'm looking at
v3), and I'm trying to understand set_var_mtrr_resource(). It looks to me
like the code is setting up the mtrrs for the var_mtrr_state struct, then
setting var_mtrr_state struct to equal the values passed by the resource
struct, so it's always one base/size behind. This then has to be corrected
for in x86_setup_var_mtrrs(), which writes the last mtrr. It would make more
sense to me for var_mtrr_state to be the state of the mtrrs AFTER the
function runs, and for the function to be setting up the mtrrs for the
resource it was just passed. It would also make the code to automagically
figure out if it's better to use additive or subtractive mtrrs marginally
simpler to write. Is there any reason for it to work this way, or was it
just pulled from kernel source that way?

Also, does anyone know of any CPUs or situations where a subtractive MTRR
setup would break things?

Thanks,
Corey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090404/2a465f01/attachment.html>


More information about the coreboot mailing list