Page 1 of 1

Virtualbox MTRR support

Posted: Wed Mar 11, 2015 8:32 am
by johnsa
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).

Code: Select all


MSR_IA32_MTRRCAP equ 0feh

bits 0-7 here report a 0.
bit 8 is also 0. I can read the MTRR MSRs without a GP or anything, but they're all zero.

i get back valid info from bochs, qemu and real h/w so I can only assume that VirtualBox is missing this.

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 11:09 am
by jnc100
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).

What is your host cpu?

Regards,
John.

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 11:21 am
by beyondsociety
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.

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 11:54 am
by johnsa
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)?

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 3:51 pm
by jnc100
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.

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 4:41 pm
by iansjack
That ticket is 8 years old (and is marked as fixed), so I wouldn't take it too seriously with respect to current versions of VirtualBox.

Re: Virtualbox MTRR support

Posted: Wed Mar 11, 2015 5:23 pm
by johnsa
Yep i have that checkbox enabled, in fact it won't let me not have it checked anyway as my guest os is smp/64bit.