From patchwork Fri Aug 4 15:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 9881545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 11286602B8 for ; Fri, 4 Aug 2017 15:42:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBD0128720 for ; Fri, 4 Aug 2017 15:42:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD9D028893; Fri, 4 Aug 2017 15:42:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 720DD28720 for ; Fri, 4 Aug 2017 15:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbdHDPm1 (ORCPT ); Fri, 4 Aug 2017 11:42:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:65158 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbdHDPm1 (ORCPT ); Fri, 4 Aug 2017 11:42:27 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Aug 2017 08:42:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,321,1498546800"; d="scan'208";a="1159224601" Received: from abityuts-desk.fi.intel.com ([10.237.72.76]) by orsmga001.jf.intel.com with ESMTP; 04 Aug 2017 08:42:25 -0700 From: Artem Bityutskiy To: Len Brown Cc: linux-pm@vger.kernel.org Subject: turbostat: fix Skylake server package Date: Fri, 4 Aug 2017 18:42:23 +0300 Message-Id: <20170804154223.16223-1-artem.bityutskiy@linux.intel.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the problem of turbostat not reporting any package C-states on Skylake Xeon processor when the deepest package C-stated is configured as "no limit" in the UEFI firmware configuration menu. The lowest 3 bits of the MSR_PKG_CST_CONFIG_CONTROL (0x000000e2) register contain 7 in this case, meaning "No Package C state limits" (see Intel SDM, vol 4, Table 2-41 - MSRs Supported by Intel® Xeon® Processor Scalable Family with DisplayFamily_DisplayModel 06_55H). The problem was that turbostat's internal array of supported package C-sates (skx_pkg_cstate_limits) marked position #7 as "PCLRSV" (reserved), instead of "PCLUNL" (not limited). Instead, position #8 was incorrectly marked as "PCLUNL" (probably due to a typo). This patch fixes the issue by marking position #7 as "not limited", and position #8 as "reserved". Signed-off-by: Artem Bityutskiy --- turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbostat.c b/turbostat.c index 6c185a9..1c4d3e2 100644 --- a/turbostat.c +++ b/turbostat.c @@ -1816,7 +1816,7 @@ int slv_pkg_cstate_limits[16] = {PCL__0, PCL__1, PCLRSV, PCLRSV, PCL__4, PCLRSV, int amt_pkg_cstate_limits[16] = {PCLUNL, PCL__1, PCL__2, PCLRSV, PCLRSV, PCLRSV, PCL__6, PCL__7, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV}; int phi_pkg_cstate_limits[16] = {PCL__0, PCL__2, PCL_6N, PCL_6R, PCLRSV, PCLRSV, PCLRSV, PCLUNL, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV}; int bxt_pkg_cstate_limits[16] = {PCL__0, PCL__2, PCLUNL, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV}; -int skx_pkg_cstate_limits[16] = {PCL__0, PCL__2, PCL_6N, PCL_6R, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLUNL, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV}; +int skx_pkg_cstate_limits[16] = {PCL__0, PCL__2, PCL_6N, PCL_6R, PCLRSV, PCLRSV, PCLRSV, PCLUNL, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV, PCLRSV}; static void