Page 1 of 1

Guest OS to use Hardware Performance Counters

Posted: 18. Dec 2013, 15:26
by Taral
Hi All,

Does anyone know if there is any setting that can be done to allows the guest OS to use hardware performance counters directly. For example in linux using perf utility. Basically i want CPU perf counters to be accessed directly in the VM guest (Linux).

Re: Guest OS to use Hardware Performance Counters

Posted: 18. Dec 2013, 15:34
by Ramshankar
We don't yet implement the performance counter MSRs correctly (i.e. our RDPMC implementation just returns zeros) but might we might handle a few of them that makes sense. And no, there is no simple "Setting" which will make this work. Implementing them in a somewhat sensible manner even though a few of them makes no sense in a VM requires a lot of code and it is work in progress.

Re: Guest OS to use Hardware Performance Counters

Posted: 18. Dec 2013, 16:05
by Taral
Thanks RamShankar for quick response

Re: Guest OS to use Hardware Performance Counters

Posted: 5. Apr 2015, 17:37
by mancha
Hello Ramshankar et al.

First of all, many thanks for all your great work with VirtualBox!

It's been a bit since this thread was started and I was wondering if there was any news regarding progress with virtualizing CPU counters. As long as I'm asking, I was also curious if there were plans to add support for newer instructions (e.g. sse4).

Thanks.

--mancha

Re: Guest OS to use Hardware Performance Counters

Posted: 5. Apr 2015, 18:16
by Perryg
Can't answer the first question but the second has been available as experimental since 4.3.8
http://www.virtualbox.org/manual/ch09.h ... assthrough

Re: Guest OS to use Hardware Performance Counters

Posted: 5. Apr 2015, 21:48
by mancha
Perryg wrote:Can't answer the first question but the second has been available as experimental since 4.3.8
Hi. Thanks for the link! Will test sse4 support while I wait for word from Oracle regarding CPU perf virtualization.