From patchwork Thu Jul 27 11:41:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 9866673 X-Patchwork-Delegate: lenb@kernel.org 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 80D4B6035E for ; Thu, 27 Jul 2017 11:41:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72715287F9 for ; Thu, 27 Jul 2017 11:41:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6737028802; Thu, 27 Jul 2017 11:41:51 +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 DF0F6287F9 for ; Thu, 27 Jul 2017 11:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750992AbdG0Llu (ORCPT ); Thu, 27 Jul 2017 07:41:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:61525 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbdG0Llt (ORCPT ); Thu, 27 Jul 2017 07:41:49 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 27 Jul 2017 04:41:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,419,1496127600"; d="scan'208";a="1176974668" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 27 Jul 2017 04:41:43 -0700 Received: from abityuts-desk.ger.corp.intel.com (abityuts-desk.ger.corp.intel.com [10.237.72.56]) by linux.intel.com (Postfix) with ESMTP id 5BED8580571; Thu, 27 Jul 2017 04:41:40 -0700 (PDT) Message-ID: <1501155699.2643.9.camel@linux.intel.com> Subject: [PATCH] turbostat: fix Skylake server package C-states reporting From: Artem Bityutskiy Reply-To: artem.bityutskiy@linux.intel.com To: "Brown, Len" Cc: linux-pm@vger.kernel.org Date: Thu, 27 Jul 2017 14:41:39 +0300 X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) 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 From: Artem Bityutskiy 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