Andi Kleen wrote:
> John Levon <levon@...> writes:
>>On Wed, Feb 25, 2004 at 12:05:43PM -0500, Will Cohen wrote:
>>>+inline static int __init is_ia32e(void)
>>>+ return (test_bit(X86_FEATURE_LM, current_cpu_data.x86_capability));
>>What's LM ? Is this at all like the Intel-preferred way of testing ?
> I don't think it's a good idea to only test for LM(=long mode) here.
> Future Intel CPUs may have completely different performance counters,
> but likely will still have LM. And the current shipping P4Es are
> Prescotts and have these counters, but long mode is not enabled.
> Better test for family/model (family == 15, model >= 3).
You are right that using the model number will be more reliable. For the
time being it appears that the ia32e performance monitoring hardware is
the same as p4. Future generation of intel processors may have different
performance monitoring hardware, but have a variety of LM.
> I must admit I never even liked the "x86_64" for hammer, because an
> hammer can as well run in 32bit legacy mode and then there is no
> x86-64. I think the event files should be only keyed on the CPU
> family/mode, not on 32bit/64bit. oprofile really should not
> care about the 32bit/64bitness, and I think it doesn't except
> for the naming. Call it always i386/cpu, like i386/p4e (=prescott)
So should have Opteron processors been "i386/amd64"? The amd64
performance monitoring events are a super set of the athlons. I haven't
tried it but I would think that those events are still available even
when the processor is running in 32-bit legacy mode.