Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1463686ybe; Fri, 6 Sep 2019 18:57:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzi7Xj0H6SNNfHAQ0wn9E4V01ICZEDOHKG3Ht351/mKu7OtsZI/8vwh3sij3anvCC0d6ql8 X-Received: by 2002:a5e:de49:: with SMTP id e9mr5292034ioq.308.1567821435622; Fri, 06 Sep 2019 18:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567821435; cv=none; d=google.com; s=arc-20160816; b=Mttc5kORp0jCItZKisF7U4wbml0glFiQaIvWKJjs/oJc2Qq2Sz2UxYJOViHcA8Nt/x P8aDtnkxPRXo3lAcLoWhnEkDXg8uix0RoJ2d2BhnvY793whMHNz3NAs8GzQMLScgw3os DHYUSzb6yVwjOHZ2asmNGZD7Px56yNC1HjDQ0vZq4VuP1vYkP7DbE265oooaLpTXYX9x CjqQYimLDktyyUbPSGifT/ZmKXYuv9pKZRGWmfrbJwzObc7B3QSnSJ2fxE4sgV40qE5j dSn7UPUmvbclPkSaPDtJX6yhJaXonSl1wbbB2uMXcCCDAF/qGxO80YHrWsfwnjnYlQH+ Nd8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=HYy/Kz0v61OqnQFfu1YshStF4A1xzGIyW/gUjXEvO3c=; b=ZzvorMy0TFWWpM0NV3BaYTR/RmCst+45j/5W5Gx/HSVDZT0CNqGIfEZqmzC9sUdPfZ Rmc7khukigeoJuWoHYnampKkZi32FB5+0mEhmWfaVmmEgldVWStUWe76cZe2pySMzhl2 xoBv0AVGD84xYmJslk59WiJX6tsQQ4aQBqOl9ZH/MsYvw2TrYmGVbXabtzqn5m/jQkhI 9cmGFZ1XaELJBIuh+JZF1UPJ6EJ5ELm69Zk5t933ZoSvBc//3+oLx1yqc19BW27+vPW9 vHhoCIdmgewnveBYqhh0F8Nc39oX+kIeJlUoDVTP6bnMte995042ZqPxx9mUDv4pTltp ssHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si11165062jan.53.2019.09.06.18.56.20; Fri, 06 Sep 2019 18:57:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405652AbfIFPHc (ORCPT + 99 others); Fri, 6 Sep 2019 11:07:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:1619 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730480AbfIFPHb (ORCPT ); Fri, 6 Sep 2019 11:07:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 08:07:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="267388494" Received: from spandruv-mobl3.jf.intel.com ([10.251.22.142]) by orsmga001.jf.intel.com with ESMTP; 06 Sep 2019 08:07:30 -0700 Message-ID: Subject: Re: [PATCH 2/2] tools/power/x86/intel-speed-select: Display core count for bucket From: Srinivas Pandruvada To: Andy Shevchenko , Prarit Bhargava Cc: darcari@redhat.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Date: Fri, 06 Sep 2019 08:07:29 -0700 In-Reply-To: <6b576770a4bbe6c24ea524083dec5a16bf3c9e94.camel@linux.intel.com> References: <20190905233748.6822-1-srinivas.pandruvada@linux.intel.com> <20190905233748.6822-2-srinivas.pandruvada@linux.intel.com> <780a3faf-9e44-64f4-a354-bdee39af3af5@redhat.com> <20190906134655.GU2680@smile.fi.intel.com> <6b576770a4bbe6c24ea524083dec5a16bf3c9e94.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-3.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-09-06 at 07:50 -0700, Srinivas Pandruvada wrote: > On Fri, 2019-09-06 at 16:46 +0300, Andy Shevchenko wrote: > > On Fri, Sep 06, 2019 at 05:39:54AM -0400, Prarit Bhargava wrote: > > > On 9/5/19 7:37 PM, Srinivas Pandruvada wrote: > > > > Read the bucket and core count relationship via MSR and display > > > > when displaying turbo ratio limits. > > > > + ret = isst_send_msr_command(cpu, 0x1ae, 0, > > > > buckets_info); > > > > > > ^^^ you can get rid of the magic number 0x1ae by doing (sorry for > > > the cut-and-paste) > > > > > > diff --git a/tools/power/x86/intel-speed-select/Makefile > > > b/tools/power/x86/intel > > > index 12c6939dca2a..087d802ad844 100644 > > > --- a/tools/power/x86/intel-speed-select/Makefile > > > +++ b/tools/power/x86/intel-speed-select/Makefile > > > @@ -15,6 +15,8 @@ endif > > > MAKEFLAGS += -r > > > > > > override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include > > > +override CFLAGS += -I../../../include > > > +override CFLAGS += > > > -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' > > No, we can't use msr_index. This comment was meant for use of /dev/cpu/X/msr not msr_index. I didn't want to bring in dependency on msr-index.h for couple of 2 MSRs and the names in msr-index.h doesn't really reflect the actual processing, they are doing. For example MSR_TURBO_RATIO_LIMIT1 for 0x1ae. The definition of 0x1AE is different on cpu model 0x55 and beyond. > > > > > I guess it can be done in more neat way. > > > > > As I've been looking at this code I have been wondering why > > > didn't > > > you just use > > > the standard /dev/cpu/X/msr interface that other x86 power > > > utilities (turbostat, > > > x86_energy_perf_policy) use? Implementing msr_read() is trivial > > > (warning > > > untested and uncompiled code) > > No. We can't. The MSR interface is disabled on several distribution > and > platforms with secured boot. So some special MSRs are only allowed > via > this IOCTL interface. > > Thanks, > Srinivas > > > > > > Actually good point! > >