lkml.org 
[lkml]   [2015]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/x86/intel/pt: Export cpu frequency ratios needed by PT decoders
On Mon, Aug 31, 2015 at 03:59:08PM +0300, Alexander Shishkin wrote:
> Andi Kleen <andi@firstfloor.org> writes:
>
> > Alexander Shishkin <alexander.shishkin@linux.intel.com> writes:
> >> + return sprintf(page, "%lu\n", val);
> >> + case 1:
> >> + cpuid(0x15, &eax, &ebx, &ecx, &edx);
> >
> > Surely this needs to be protected by a cpuid level check?
> > Broadwell for once doesn't have CPUID 0x15.
>
> I couldn't find where this is explicitly said in the SDM. However, the
> leaf description says that CPUID.0x15.EBX[31:0]==0 means that the ratio
> is not enumerated. I don't see how to better communicate this to
> userspace though than to simply have 0 there.

What I meant is -- the kernel may crash on a older CPU that does
not support CPUID 0x15. For example Broadwell doesn't have it.
For CPUID you always need to check the level.

-Andi


\
 
 \ /
  Last update: 2015-08-31 22:41    [W:0.555 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site