From patchwork Wed Mar 1 05:27:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9597727 X-Patchwork-Delegate: rjw@sisk.pl 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 83C5B604DC for ; Wed, 1 Mar 2017 07:28:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75CD81FF28 for ; Wed, 1 Mar 2017 07:28:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A92B28405; Wed, 1 Mar 2017 07:28:23 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 F248B1FF28 for ; Wed, 1 Mar 2017 07:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750713AbdCAH2T (ORCPT ); Wed, 1 Mar 2017 02:28:19 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35937 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbdCAH2R (ORCPT ); Wed, 1 Mar 2017 02:28:17 -0500 Received: by mail-qk0-f195.google.com with SMTP id u188so8651738qkc.3; Tue, 28 Feb 2017 23:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=kZZai/IqL9l1vvv03/87QtW+e1rx/EjzFIzf0H3QHfI=; b=BiyDJo0W0En/KiJEONQrux1LzvnotjM7KdBOExxT+J81HgOf8oG0xZk9ClSfS/alQ4 BmgyUOf/ql++ZzKKtWkqIYgqL9Hz9DutKvh5S+qpn4uTKpGbXw4qohpMsqkdP0bDAZn6 WL8IQWzQDShqzBqeDlpXk80jWhFWELlhCo/lWXm9dWMFaM2NbqJROtjowENGm1RC/Y1F VuzZckT7URsfSjxPbwrW4KeSLbLHvaFWvxyGoCBwCn6wXRu0eam0l8G9KSVt0I+1PKEv Eh1uh4IUKjdWfaJPtFjVf+YsVP6oura23vhWzU0blaN9TjAzErgCXwxmbX3KUCB9BtB/ eroQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=kZZai/IqL9l1vvv03/87QtW+e1rx/EjzFIzf0H3QHfI=; b=Ef3Ae2SrPMtwQUYDnLIn/tUFHct2Mr4yugjHVEGuEpSM8c4fgbzOOH+qiFsPRQJ2L8 xZuEPlsURhQbbrgxATg6J9zveMO1IfetXy/QQY1Idlo+2SiMQkEM6ULtFJmz/NFwCbNF BGMqAX3mfUJQov0u6Q2sO1P5Vi/Mca+AV3dez0/W0uObjR/NkmMevSAy7Zb5BOTwVBrg +bj6fbDqHwqutr8ELWS1HF0yhRK2LUIJrmuHX0QRJmZcTKJkxPF3AdOuJnIKL51kVqh6 2VsUyEss9T5zms6xWTNPhJDjBtXm1QPo8Sud8lu303lf2VuAMaoM2ej5DQ1Yaj6vmUAy cD9w== X-Gm-Message-State: AMke39kBu8/OwOshzdo/5cll/O0KGIPDKXyQLQTxxmtCwT1irtcg9wJlJ3y0dAM9DZknxg== X-Received: by 10.55.143.197 with SMTP id r188mr7458742qkd.129.1488346104677; Tue, 28 Feb 2017 21:28:24 -0800 (PST) Received: from z87.localdomain (pool-96-230-116-151.bstnma.fios.verizon.net. [96.230.116.151]) by smtp.gmail.com with ESMTPSA id c141sm2530517qkb.10.2017.02.28.21.28.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:24 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 04/44] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration Date: Wed, 1 Mar 2017 00:27:08 -0500 Message-Id: <71616c8e936a6dd541f0627d7bf4ff09971d8ccb.1488345270.git.len.brown@intel.com> X-Mailer: git-send-email 2.11.0.161.g6610af872 In-Reply-To: <20170301052748.27810-1-lenb@kernel.org> References: <20170301052748.27810-1-lenb@kernel.org> In-Reply-To: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> References: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center 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: Len Brown with --debug, see: cpu0: MSR_CC6_DEMOTION_POLICY_CONFIG: 0x00000000 (DISable-CC6-Demotion) cpu0: MSR_MC6_DEMOTION_POLICY_CONFIG: 0x00000000 (DISable-MC6-Demotion) Note that the hardware default is to enable demotion, and Linux started clearing these registers in 3.17. Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index fdf0273465fa..1b762f67e3e2 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -3263,6 +3263,27 @@ int has_snb_msrs(unsigned int family, unsigned int model) } /* + * SLV client has supporet for unique MSRs: + * + * MSR_CC6_DEMOTION_POLICY_CONFIG + * MSR_MC6_DEMOTION_POLICY_CONFIG + */ + +int has_slv_msrs(unsigned int family, unsigned int model) +{ + if (!genuine_intel) + return 0; + + switch (model) { + case INTEL_FAM6_ATOM_SILVERMONT1: + case INTEL_FAM6_ATOM_MERRIFIELD: + case INTEL_FAM6_ATOM_MOOREFIELD: + return 1; + } + return 0; +} + +/* * HSW adds support for additional MSRs: * * MSR_PKG_C8_RESIDENCY 0x00000630 @@ -3496,6 +3517,24 @@ void decode_misc_pwr_mgmt_msr(void) msr & (1 << 1) ? "EN" : "DIS", msr & (1 << 8) ? "EN" : "DIS"); } +/* + * Decode MSR_CC6_DEMOTION_POLICY_CONFIG, MSR_MC6_DEMOTION_POLICY_CONFIG + * + * This MSRs are present on Silvermont processors, + * Intel Atom processor E3000 series (Baytrail), and friends. + */ +void decode_c6_demotion_policy_msr(void) +{ + unsigned long long msr; + + if (!get_msr(base_cpu, MSR_CC6_DEMOTION_POLICY_CONFIG, &msr)) + fprintf(outf, "cpu%d: MSR_CC6_DEMOTION_POLICY_CONFIG: 0x%08llx (%sable-CC6-Demotion)\n", + base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); + + if (!get_msr(base_cpu, MSR_MC6_DEMOTION_POLICY_CONFIG, &msr)) + fprintf(outf, "cpu%d: MSR_MC6_DEMOTION_POLICY_CONFIG: 0x%08llx (%sable-MC6-Demotion)\n", + base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS"); +} void process_cpuid() { @@ -3700,6 +3739,9 @@ void process_cpuid() if (debug) decode_misc_pwr_mgmt_msr(); + if (debug && has_slv_msrs(family, model)) + decode_c6_demotion_policy_msr(); + rapl_probe(family, model); perf_limit_reasons_probe(family, model);