PMCTools in a VM

12 views
Skip to first unread message

ajray

unread,
Jun 2, 2009, 12:28:54 PM6/2/09
to PMCTools Discuss
Hey guys,

Is there a VM that someone could run FreeBSD in and get PMCTools to
work properly?

I understand for performance reasons the results would be skewed, but
is there a VM that correctly handles and uses performance counters?

Right now I've been working on querying the CPU in VMWare Player with
Minix, and I appear to be able to read from and write to MSRs and
PMCs, but thats it. Either it's quietly failing (the kernel is eating
the exception somehow) or VMWare Player only returns 0 when reading
PMCs.

Would PMCTools be able to detect that and handle it, or would it
assume that these work if the processor says they exist? Like
checking if a non-zero value can be written and read back?
(Processor is an E7500 Core2 Duo with Intel's Architectural
Performance Monitoring capabilities version 2)

Thanks,
Alex

Joseph Koshy

unread,
Jun 2, 2009, 11:21:59 PM6/2/09
to pmctools...@googlegroups.com
> Is there a VM that someone could run FreeBSD in and get PMCTools to
> work properly?

> I understand for performance reasons the results would be skewed, but
> is there a VM that correctly handles and uses performance counters?

AFAIK today's virtual machines do not fully emulate PMC behavior.

> Right now I've been working on querying the CPU in VMWare Player with
> Minix, and I appear to be able to read from and write to MSRs and
> PMCs, but thats it. Either it's quietly failing (the kernel is eating
> the exception somehow) or VMWare Player only returns 0 when reading
> PMCs.

You may need to run Minix on bare metal then.

> Would PMCTools be able to detect that and handle it, or would it
> assume that these work if the processor says they exist? Like
> checking if a non-zero value can be written and read back?
> (Processor is an E7500 Core2 Duo with Intel's Architectural
> Performance Monitoring capabilities version 2)

The kernel driver assumes that the PMCs that are reported as present
by the processor will work as documented.

Koshy

ajray

unread,
Jun 2, 2009, 11:30:34 PM6/2/09
to PMCTools Discuss
Alright, that's to be expected I guess.

I've been planning on running minix on bare metal, along with freebsd,
but for some reason the latest version of minix breaks on my machine.
Thats another problem though :-)

For the moment I'm porting hwpmc to be a 'server/driver' that runs as
a user process, and makes requests of the kernel only when something
needs to be done at ring0 (reading/writing from MSRs). I should be
done with it in the next week or two.

Thanks again,
~Alex
Reply all
Reply to author
Forward
0 new messages