Bios + the MTRRs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Bios + the MTRRs

Post 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?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Bios + the MTRRs

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Bios + the MTRRs

Post 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.
Post Reply