mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH] perf/x86/intel/pt: Export cpu frequency ratios needed by PT decoders
Date: Mon, 31 Aug 2015 22:04:15 +0200	[thread overview]
Message-ID: <20150831200415.GQ1747@two.firstfloor.org> (raw)
In-Reply-To: <87io7vhaw3.fsf@ashishki-desk.ger.corp.intel.com>

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

      reply	other threads:[~2015-08-31 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 15:06 Alexander Shishkin
2015-08-28 19:33 ` Andi Kleen
2015-08-31 12:59   ` Alexander Shishkin
2015-08-31 20:04     ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150831200415.GQ1747@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome