Received: by 10.213.65.68 with SMTP id h4csp45943imn; Mon, 19 Mar 2018 19:03:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELvQkOtVbAS4BX68m+ZyexoFbC/ZUEjrOepVYMOjxrE238OunU/y52IvH19tEAUFCFzkE+aa X-Received: by 10.101.66.132 with SMTP id j4mr8713068pgp.47.1521511419328; Mon, 19 Mar 2018 19:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521511419; cv=none; d=google.com; s=arc-20160816; b=KZTG1ZqxP36pxdJ95oNgpEdIT+warpLA3NMLlDEc6+L+Id1vCyhSExzVFaLYIabbx/ AYJkps4n0hdQhvKv5rqUY3p2tfaG876T1BteswhY6cmjrp7VJWVI5z3k6AGMf45pKKg1 RvZL9UBH+kOdgVOUFM67HyxKODbsz4ADiriNPGfjm/ypQCkKP9zHedxrICt52zEFEPEh h3dOZw8mTmUqM6f/aUPFznVGQcCMwtmdGQOlgLv8hpKkGdReqMJ/jfWq8vODd3IKu41l qIqmLdAq5EU6MZI+pkpcgRBN+n1sxYquaIUpIp/8ZOTtrM0Km5+uE9Dgez7mk5+dH+wo NnWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=wdleHo6moXwSVBKD9nEhSvvNUJQ7ri5OjlZJmUXIo5A=; b=Y4asEbcHT7B3hLyBARgcq1JnqS2grZEMO9xIptiPLqXYOKLD8w4ZYtvq+C3pjbg+ZO MJCvHa6CIma/Xj/qOPzmzgpnE1ZL390y8BlIJygpcp3MhAhLynSBQK7cbO5PXqrm0UnY tRuNAI/KyTDvBErLLyEdosiDLPNvaOzTLtkiuzFEbSNH5QOdYNfxfz3tYAMDLCIYUFYb uyFFtuNJwPeLPGveU0C/HgbVQfkmtS4HJ5/RgiHFQzpJmTdRywhxxsEEP6l8yYz58BMp weV89Bb2qeA6Z8P/2/UPpWtkx3AE6iWY0TV3b4S+CeOzRbneqwrCSAfkoSNEmjbb6I/D NhHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=J7pGPUYm; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si515325pll.585.2018.03.19.19.03.23; Mon, 19 Mar 2018 19:03:39 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=J7pGPUYm; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934161AbeCSXNF (ORCPT + 99 others); Mon, 19 Mar 2018 19:13:05 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:34747 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933619AbeCSXNC (ORCPT ); Mon, 19 Mar 2018 19:13:02 -0400 Received: by mail-yw0-f194.google.com with SMTP id x17so12016130ywj.1 for ; Mon, 19 Mar 2018 16:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wdleHo6moXwSVBKD9nEhSvvNUJQ7ri5OjlZJmUXIo5A=; b=J7pGPUYmT6OBOtofoVPpIqRXaSm7FCA9dKt44cie/YO5ptHWNJsH3R7Mr/JPAgqQJn SaAF2e/LOeViOFIvA7b+WDotMfFTbgGPCe47LA7RrDo5XH2500RdPK0A786QqlVHR6Fc KgFmZePvw79XPtcjIeLjgUYfPx8ng5/aZSB/yuie3PBVLxEzy3dmgxvgZKOUczyW9oyh FI+CZTNY43h4fy5g3xVMx+3DRS0eWsinsyUoqWoEo406zuaNkCUhtKbZtkEc3RfasOJP Py0GBT5QHPgzCQv493caUBW0bAkWgEm8PpDScrwotGqee5hazH3S5R15fr0kmXwlULF6 csFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wdleHo6moXwSVBKD9nEhSvvNUJQ7ri5OjlZJmUXIo5A=; b=JP7PKUF5YSw4Gnr2EAGgJXFtu8QPpCxpF8K/6vzMZrimf4rZJlaSOLzvDff1y9t8q+ m5lDuZECFYanepcW6ECnu+/5bsqHPyecZLzPaNpjeXYkDNa4kEhdcuFm0T3LvX3nI3IN 7e4YFvbB2blqnNh5nW017t/A2q3mfX14MhyN6WBBPLG0x4KGsZNbTvseFbvO+9RJG30s kTCglMv2+jss5YscmWEd5JD2Nv2bmCUUB69RLbDAKruZ4TzA8jAU3DMrd2fRYWfHHhrb u+x1H0HFh0tXkd4gtBUN6S7E+IwWcC+t8/qTSLulL5QesAjkIR4RaDrsUV8nWXB3WPzK r3tw== X-Gm-Message-State: AElRT7GIJ/k6yci35a03lzsLF1oEZVi/Vu8TpY5lvB98JZj1Xgq5drTJ 1XrEGqhj/onEKo5Q3ze0Z8BcawKIEI0XtaiYu+kXLA== X-Received: by 10.129.145.209 with SMTP id i200mr8041647ywg.364.1521501181177; Mon, 19 Mar 2018 16:13:01 -0700 (PDT) MIME-Version: 1.0 References: <20180309121549.630-1-harry.pan@intel.com> <20180309121549.630-3-harry.pan@intel.com> In-Reply-To: From: Puthikorn Voravootivat Date: Mon, 19 Mar 2018 23:12:45 +0000 Message-ID: Subject: Re: [PATCH 3/3] perf/x86/intel: Enable C-state residency events for Cannon Lake To: Benson Leung Cc: harry.pan@intel.com, linux-kernel@vger.kernel.org, gs0622@gmail.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, Kan.liang@intel.com, bleung@chromium.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 4:09 PM Benson Leung wrote: > Hi Harry, > On 03/09/2018 04:15 AM, Harry Pan wrote: > > Cannon Lake supports C1/C3/C6/C7, PC2/PC3/PC6/PC7/PC8/PC9/PC10 > > state residency counters, this patch enables those counters. > > > > The MSR information is based on Intel Software Developers' Manual, > > Vol. 4, Order No. 335592. > > > > Signed-off-by: Harry Pan > Reviewed-by: Benson Leung Tested-by: Puthikorn Voravootivat > > --- > > arch/x86/events/intel/cstate.c | 44 +++++++++++++++++++++++++++++------------- > > 1 file changed, 31 insertions(+), 13 deletions(-) > > > > diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c > > index 72db0664a53d..9aca448bb8e6 100644 > > --- a/arch/x86/events/intel/cstate.c > > +++ b/arch/x86/events/intel/cstate.c > > @@ -40,50 +40,51 @@ > > * Model specific counters: > > * MSR_CORE_C1_RES: CORE C1 Residency Counter > > * perf code: 0x00 > > - * Available model: SLM,AMT,GLM > > + * Available model: SLM,AMT,GLM,CNL > > * Scope: Core (each processor core has a MSR) > > * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter > > * perf code: 0x01 > > - * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM > > + * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM, > > + CNL > > * Scope: Core > > * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter > > * perf code: 0x02 > > - * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW > > - * SKL,KNL,GLM > > + * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, > > + * SKL,KNL,GLM,CNL > > * Scope: Core > > * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter > > * perf code: 0x03 > > - * Available model: SNB,IVB,HSW,BDW,SKL > > + * Available model: SNB,IVB,HSW,BDW,SKL,CNL > > * Scope: Core > > * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter. > > * perf code: 0x00 > > - * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM > > + * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. > > * perf code: 0x01 > > - * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL > > - * GLM > > + * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL, > > + * GLM,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter. > > * perf code: 0x02 > > * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW > > - * SKL,KNL,GLM > > + * SKL,KNL,GLM,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. > > * perf code: 0x03 > > - * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL > > + * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter. > > * perf code: 0x04 > > - * Available model: HSW ULT only > > + * Available model: HSW ULT,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter. > > * perf code: 0x05 > > - * Available model: HSW ULT only > > + * Available model: HSW ULT,CNL > > * Scope: Package (physical package) > > * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. > > * perf code: 0x06 > > - * Available model: HSW ULT, GLM > > + * Available model: HSW ULT,GLM,CNL > > * Scope: Package (physical package) > > * > > */ > > @@ -486,6 +487,21 @@ static const struct cstate_model hswult_cstates __initconst = { > > BIT(PERF_CSTATE_PKG_C10_RES), > > }; > > > > +static const struct cstate_model cnl_cstates __initconst = { > > + .core_events = BIT(PERF_CSTATE_CORE_C1_RES) | > > + BIT(PERF_CSTATE_CORE_C3_RES) | > > + BIT(PERF_CSTATE_CORE_C6_RES) | > > + BIT(PERF_CSTATE_CORE_C7_RES), > > + > > + .pkg_events = BIT(PERF_CSTATE_PKG_C2_RES) | > > + BIT(PERF_CSTATE_PKG_C3_RES) | > > + BIT(PERF_CSTATE_PKG_C6_RES) | > > + BIT(PERF_CSTATE_PKG_C7_RES) | > > + BIT(PERF_CSTATE_PKG_C8_RES) | > > + BIT(PERF_CSTATE_PKG_C9_RES) | > > + BIT(PERF_CSTATE_PKG_C10_RES), > > +}; > > + > > static const struct cstate_model slm_cstates __initconst = { > > .core_events = BIT(PERF_CSTATE_CORE_C1_RES) | > > BIT(PERF_CSTATE_CORE_C6_RES), > > @@ -557,6 +573,8 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { > > X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE, snb_cstates), > > X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, snb_cstates), > > > > + X86_CSTATES_MODEL(INTEL_FAM6_CANNONLAKE_MOBILE, cnl_cstates), > > + > > X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNL, knl_cstates), > > X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates), > > > > > Thank you! > -- > Benson Leung > Staff Software Engineer > Chrome OS Kernel > Google Inc. > bleung@google.com > Chromium OS Project > bleung@chromium.org