From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbbHaM7M (ORCPT ); Mon, 31 Aug 2015 08:59:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:42005 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbbHaM7L (ORCPT ); Mon, 31 Aug 2015 08:59:11 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,440,1437462000"; d="scan'208";a="759123442" From: Alexander Shishkin To: Andi Kleen Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo Subject: Re: [PATCH] perf/x86/intel/pt: Export cpu frequency ratios needed by PT decoders In-Reply-To: <87lhcvtdg9.fsf@tassilo.jf.intel.com> References: <1440687986-27246-1-git-send-email-alexander.shishkin@linux.intel.com> <87lhcvtdg9.fsf@tassilo.jf.intel.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 31 Aug 2015 15:59:08 +0300 Message-ID: <87io7vhaw3.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andi Kleen writes: > Alexander Shishkin 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. Regards, -- Alex