cvs commit: src/sys/dev/hwpmc hwpmc_x86.c

Joseph Koshy jkoshy at FreeBSD.org
Tue Dec 4 21:25:35 PST 2007


km> Can you say a little more about what the differences are or where one
km> could find a discussion of them without wading through different
km> processor model revisions? Kris, SCC, and I have been obtaining
km> sensible results using 0xE and 0xF for the small set of sampling
km> operations that we use.

Well I discovered them by wading through the documentation for
different processor model revisions :).

One set of hardware events requires 'core specificity' to be
programmed on dual core processors.  HWPMC's P6 MD layer knows
nothing core specificity and does the wrong thing for such events.

As a concrete example, consider events 0x21--0x27 which have P6
names 'L2_ADS', 'L2_DBUS_BUSY', 'L2_DBUS_BUSY_RD', 'L2_LINES_IN'
etc.  HWPMC's P6 driver sets the UMASK field [bits 8:15] of the PMC
event select registers to 0x00 since this is the only valid value
for P6 PMCs for these events.  But for dual core "Core" family
processors, per Intel's documentation for these events, bits 15:14
of the UMASK field should not be '00B'.  Valid values are '11B' or
'01B' with '00B' marked as reserved. [Tables 18-7 & A-3 of the
Software Developer's Manual, System Programming Guide, Vol 3B].


Then there are potential differences between "Core" and "Core 2"
PMCs that HWPMC'S P6 MD layer knows nothing about.

For example, there are a class of P6 events that appear to be forward
compatible with Intel "Core" processors but not with "Core 2"
processors.  As a specific example, P6 event LD_BLOCKS [0x03] has
a valid UMASK value of exactly 0x00.  For this event on "Core 2"
family processors, documentation indicates that valid values of the
UMASK field are 0x02/04/08/10/20 but not 0x00.  In a separate table
(Table A-4 in the System Programming Guide), a UMASK value of 0x00
is mentioned valid for Intel "Core" processors.

So in short, although Core/Core2 PMCs overlap the functionality of
the P6 PMCs they are not 100% backward compatible with them.

Regards,
Koshy
<jkoshy at freebsd.org>


More information about the cvs-src mailing list