Virtualbox MTRR support

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
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Virtualbox MTRR support

Post 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.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Virtualbox MTRR support

Post 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.
User avatar
beyondsociety
Member
Member
Posts: 39
Joined: Tue Oct 17, 2006 10:35 pm
Location: Eagle, ID (USA)
Contact:

Re: Virtualbox MTRR support

Post 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.
"I think it may be time for some guru meditation"
"Barbarians don't do advanced wizardry"
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: Virtualbox MTRR support

Post 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)?
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Virtualbox MTRR support

Post 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.
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Virtualbox MTRR support

Post 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.
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: Virtualbox MTRR support

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