From patchwork Wed Mar 1 05:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9599405 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 80FB9604A8 for ; Thu, 2 Mar 2017 01:12:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7295F28402 for ; Thu, 2 Mar 2017 01:12:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 668AD2857F; Thu, 2 Mar 2017 01:12:29 +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=unavailable 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 1369728402 for ; Thu, 2 Mar 2017 01:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903AbdCBBKn (ORCPT ); Wed, 1 Mar 2017 20:10:43 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35237 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753866AbdCBBJl (ORCPT ); Wed, 1 Mar 2017 20:09:41 -0500 Received: by mail-qk0-f194.google.com with SMTP id n127so15265043qkf.2; Wed, 01 Mar 2017 17:09:35 -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=PCGI2WgmXf361GUINAXs4pdc9HYKorwvhX3pk1ZVB/M=; b=K5eF//nI1dVB1ZxcU0ndOytp/kVzLTVU3KEo/NJvmp5QQUx899XpOeqbKodVj+VtgV 0ijYM5/cCwDV+/YQBfsHvVhlgjwSr9lqxWpT1jURMqqrPm6YIEMCWzJEfMLnDPAkRfV1 AuNUG4ZK37vcYStff7a067A6IVGdqyg0qDdQjyBb1cH9AlWANIMjdiryGbJcaVz1QAdJ 7iC7xUD5sq/yQC/n8hUX2tMvMSFbVroKfrK4j43A7bh6PV/rhthsh3/EKiLxUFLThnjK BkbdRJD82cBftIk3NFaW22W6RJuqzorl3ITVcQ3zEZ7I3eXvlIlOG8bjsgujWucfibx3 Pkfw== 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=PCGI2WgmXf361GUINAXs4pdc9HYKorwvhX3pk1ZVB/M=; b=iJVLL4wLTBDTmCmsR4WY76wrmi0NJiLZm/8lltxe0erSnOkCxEcMDVNq3WilumfpdQ 4Rn3+LWQusa7LBHmsRy9AfsU/I3cSHj7nk/FfQbb1wxHqdkQ4qtKqZIYyfZbvHCswF0x Jw5341L/CwMsoMT/t1wI7/NDjiCskW6RIP8Q/B1m+Odp29sXYrb4+Gt6s8PwrFSKzN4i 4jcZO9doxhozb1g8+M06zXgWAUWd5rzk2RdRDfksK+6obMeKXdNl4EM6k4j26KA2UcnT OvXX6a5rUAbuuSoFbjNRZTBjVeqWKeNLg716CHPljIWKAvjy8SMEFRxujE7N/RCKIeWX 1B+A== X-Gm-Message-State: AMke39nnBKS3AKXovu9uf6jH3b4YNvOjA8hWd71Muypw1HZ/xIzqrFWc378tt54OGLdXsA== X-Received: by 10.200.53.209 with SMTP id l17mr7679749qtb.281.1488346115196; Tue, 28 Feb 2017 21:28:35 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:34 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 19/44] tools/power turbostat: decode MSR_MISC_FEATURE_CONTROL Date: Wed, 1 Mar 2017 00:27:23 -0500 Message-Id: <33148d671cc191fceaca5017e1bb060e9f30fbf7.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 useful for observing if the BIOS disabled prefetch Not architectural, but docuemented as present on NHM, SNB and is present on others. Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 1011b5f7f21f..2f033f3d2a21 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -102,6 +102,7 @@ unsigned int has_hwp_notify; /* IA32_HWP_INTERRUPT */ unsigned int has_hwp_activity_window; /* IA32_HWP_REQUEST[bits 41:32] */ unsigned int has_hwp_epp; /* IA32_HWP_REQUEST[bits 31:24] */ unsigned int has_hwp_pkg; /* IA32_HWP_REQUEST_PKG */ +unsigned int has_misc_feature_control; #define RAPL_PKG (1 << 0) /* 0x610 MSR_PKG_POWER_LIMIT */ @@ -2466,6 +2467,7 @@ void check_permissions() * * Side effect: * sets global pkg_cstate_limit to decode MSR_PKG_CST_CONFIG_CONTROL + * sets has_misc_feature_control */ int probe_nhm_msrs(unsigned int family, unsigned int model) { @@ -2496,6 +2498,7 @@ int probe_nhm_msrs(unsigned int family, unsigned int model) case INTEL_FAM6_IVYBRIDGE: /* IVB */ case INTEL_FAM6_IVYBRIDGE_X: /* IVB Xeon */ pkg_cstate_limits = snb_pkg_cstate_limits; + has_misc_feature_control = 1; break; case INTEL_FAM6_HASWELL_CORE: /* HSW */ case INTEL_FAM6_HASWELL_X: /* HSX */ @@ -2510,9 +2513,11 @@ int probe_nhm_msrs(unsigned int family, unsigned int model) case INTEL_FAM6_KABYLAKE_MOBILE: /* KBL */ case INTEL_FAM6_KABYLAKE_DESKTOP: /* KBL */ pkg_cstate_limits = hsw_pkg_cstate_limits; + has_misc_feature_control = 1; break; case INTEL_FAM6_SKYLAKE_X: /* SKX */ pkg_cstate_limits = skx_pkg_cstate_limits; + has_misc_feature_control = 1; break; case INTEL_FAM6_ATOM_SILVERMONT1: /* BYT */ no_MSR_MISC_PWR_MGMT = 1; @@ -3579,6 +3584,21 @@ void decode_misc_enable_msr(void) msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ? "No-" : ""); } +void decode_misc_feature_control(void) +{ + unsigned long long msr; + + if (!has_misc_feature_control) + return; + + if (!get_msr(base_cpu, MSR_MISC_FEATURE_CONTROL, &msr)) + fprintf(outf, "cpu%d: MSR_MISC_FEATURE_CONTROL: 0x%08llx (%sL2-Prefetch %sL2-Prefetch-pair %sL1-Prefetch %sL1-IP-Prefetch)\n", + base_cpu, msr, + msr & (0 << 0) ? "No-" : "", + msr & (1 << 0) ? "No-" : "", + msr & (2 << 0) ? "No-" : "", + msr & (3 << 0) ? "No-" : ""); +} /* * Decode MSR_MISC_PWR_MGMT * @@ -3725,6 +3745,7 @@ void process_cpuid() if (debug) decode_misc_enable_msr(); + if (max_level >= 0x7 && debug) { int has_sgx; @@ -3852,6 +3873,9 @@ void process_cpuid() if (!access("/sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz", R_OK)) BIC_PRESENT(BIC_GFXMHz); + if (debug) + decode_misc_feature_control(); + return; }