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.
It appears when I run under Virtualbox that no fixed or variable MTRRs are present.
Is this correct or am I doing something wrong, and how can it not support any of the mtrrs. Perhaps there is a way to enable them? (Google and the manual haven't revealed anything as yet).
Virtualbox uses the virtualization features on your host cpu, so in theory should support whatever features that has (unless used in 32-bit mode with virtualization disabled).
I don't have much experience with MTRR's so bear with me, but I had a quick glance over the virtualbox manual and didn't see any mention of MTRR's either. Though I could of been looking in the wrong place or they could be using a certain key-word or phrase. You best bet is to download the source code and take a look for yourself, vritualbox is based on parts of qemu which has support for MTRR's so technically is should but not I'm 100% sure without looking at the code, hopefully someone else has more experience with this.
"I think it may be time for some guru meditation"
"Barbarians don't do advanced wizardry"
My host cpu is an intel i7 x64 / quadcore (3610QM).. sandybridge era.. it definitely has mtrrs.. qemu/bochs/vpc all report mtrrs.
For example only the first two fixed mtrr entries have values under bochs (type 6) the rest are type 0, uncacheable,
the rest including the variable mtrrs are all 0. (except the first variable range base is set to either 0x80000000 or 0xc0000000 in qemu/bochs respectively).
On real h/w the variable mtrrs are all populated (i assume by firmware mapping nvram, pci mmio ranges etc).
I'm not sure if one should/could rely on the mtrr settings at boot though.. it might be wise for me to re-program them (for example for each PCI device i bring online, check it's BARs and set mtrrs accordingly)?
Have you enabled virtualization support in virtualbox (settings->system->processor->enable vt-x/amd-v)? I'm not sure if the emulated 32-bit processor used otherwise is fully feature complete.
Regards,
John.
edit: it appears actually that virtualbox doesn't support mtrrs. Confirmed with a test on my machine just now.