Page 1 of 1

Bios + the MTRRs

Posted: Sun Feb 22, 2009 4:24 pm
by JohnnyTheDon
From Intel 3A:
Intel 3A 10.11 wrote:Typically, the BIOS (basic input/output system) software configures
the MTRRs.
Do BIOSes almost always do this, or this one of those things that crappy BIOSes leave out? And when booting a (64-bit) SMP system would I need to mirror the MTRRs from the BSP to the APs?

Re: Bios + the MTRRs

Posted: Sun Feb 22, 2009 5:03 pm
by Brendan
Hi,
JohnnyTheDon wrote:From Intel 3A:
Intel 3A 10.11 wrote:Typically, the BIOS (basic input/output system) software configures
the MTRRs.
Do BIOSes almost always do this, or this one of those things that crappy BIOSes leave out?
The BIOS configures MTRRs during boot, except for memory mapped PCI devices (e.g. video display memory) which will be left as "uncached". A crappy BIOS still does it, but might not use the best arrangement (for e.g. it might waste a variable range MTRR when it's avoidable).

An OS can reconfigure the MTRRs if it wants to or double check that the BIOS did it right, but it doesn't have to and most OSs don't.
JohnnyTheDon wrote:And when booting a (64-bit) SMP system would I need to mirror the MTRRs from the BSP to the APs?
All CPUs need to have the same MTRRs, unless caching is disabled.

The BIOS will configure MTRRs in all CPUs the same (during boot), but if you change the MTRRs then you'd need to change all CPUs at the same time (otherwise you get cache coherency problems).


Cheers,

Brendan

Re: Bios + the MTRRs

Posted: Sun Feb 22, 2009 10:22 pm
by bewing
Brendan wrote: A crappy BIOS still does it, but might not use the best arrangement (for e.g. it might waste a variable range MTRR when it's avoidable).

An OS can reconfigure the MTRRs if it wants to or double check that the BIOS did it right, but it doesn't have to and most OSs don't.
I've got a Phoenix BIOS on my main development machine. I'm not sure whether I'd call that a crappy BIOS or not ... and it's not exactly like it wastes VRs ... but it certainly doesn't follow the proper rules that are listed in the manual about how the ranges of the MTRRs are supposed to be configured. One thing I've wanted to do with my OS at some point (since I pulled the MTRR data and saw that it was so "funky") is reconfigure the MTRRs according to the proper rules, and see if there is a performance difference.