From patchwork Wed Nov 27 08:02:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1201410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NCtC3S8Cz9sSt; Wed, 27 Nov 2019 19:02:27 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iZsHH-00026o-UZ; Wed, 27 Nov 2019 08:02:23 +0000 Received: from mail-pf1-f195.google.com ([209.85.210.195]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZsHG-00026T-R2 for kernel-team@lists.ubuntu.com; Wed, 27 Nov 2019 08:02:22 +0000 Received: by mail-pf1-f195.google.com with SMTP id y206so1953360pfb.0 for ; Wed, 27 Nov 2019 00:02:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ejWt5rJPuTQP5BxWsaFSX39hzfyyZ5Ygli9hikLNzSE=; b=g0G059KlJQaJYL3mMkq4c+scgr51o1q1an/ITGIzlfJMwHIyJA4/sUzGWQg280LL8c XdYhu7AJ7jUEFEthtUQrwYzhVkvapZ2b4++ItVhNd4YZfO3SyldbBAT3Y1Ov6XgUhOw6 N1pdsJ0wNsQy2GR7kmgDlW75jyDvch4FNjt4aZf18IiIAJ1viLlD9O07jO4vs4y44o2K RB9uRsnbXaJd8BJvf11TkX2gf35D1+0BHI3pGNFuO4PBFMV9W+0D5R1geG4tqg6ZVr8X sdjzO6KzYjVc0WW0+16JfPdK8qKFC11zsy1z8lnaH4T5Z1+sjrxizDaXQZe6CBAEkJNg 6zDQ== X-Gm-Message-State: APjAAAWazmReajweBwNiS1X9LvhSN75hXQ95utqFr3Kc1CeETMvp9vmT tKPrTXU9iCRZ5kMChPNcYdvfnNKN X-Google-Smtp-Source: APXvYqxagoC2CIRTSNxQkkLBmKBdA9wa5qYnX6Hj083tyW1VHi0QmFEJwSKRUtgzc1+FKh7Ue1R7XQ== X-Received: by 2002:a63:d550:: with SMTP id v16mr3283883pgi.443.1574841739865; Wed, 27 Nov 2019 00:02:19 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id q16sm15310619pgg.40.2019.11.27.00.02.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:02:19 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH v2 1/5] perf/x86/intel: Add Comet Lake CPU support Date: Wed, 27 Nov 2019 16:02:11 +0800 Message-Id: <20191127080215.203148-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127080215.203148-1-vicamo.yang@canonical.com> References: <20191127080215.203148-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kan Liang Comet Lake is the new 10th Gen Intel processor. From the perspective of Intel PMU, there is nothing changed compared with Sky Lake. Share the perf code with Sky Lake. The patch has been tested on real hardware. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1570549810-25049-3-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar (backported from commit 9066288b2aab1804dc1eebec6ff88474363b89cb) Signed-off-by: You-Sheng Yang --- arch/x86/events/intel/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index e4c2cb65ea50..4a8e3a28c618 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4965,6 +4965,8 @@ __init int intel_pmu_init(void) case INTEL_FAM6_SKYLAKE_DESKTOP: case INTEL_FAM6_KABYLAKE_MOBILE: case INTEL_FAM6_KABYLAKE_DESKTOP: + case INTEL_FAM6_COMETLAKE_L: + case INTEL_FAM6_COMETLAKE: x86_add_quirk(intel_pebs_isolation_quirk); x86_pmu.late_ack = true; memcpy(hw_cache_event_ids, skl_hw_cache_event_ids, sizeof(hw_cache_event_ids)); From patchwork Wed Nov 27 08:02:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1201411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NCtG10cmz9sSq; Wed, 27 Nov 2019 19:02:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iZsHK-000287-2d; Wed, 27 Nov 2019 08:02:26 +0000 Received: from mail-pj1-f67.google.com ([209.85.216.67]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZsHI-00026k-Du for kernel-team@lists.ubuntu.com; Wed, 27 Nov 2019 08:02:24 +0000 Received: by mail-pj1-f67.google.com with SMTP id a16so9548382pjs.13 for ; Wed, 27 Nov 2019 00:02:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LGnFWCkPUru3vkE3vner4Ob7Ql9X2FRJ6gza609735k=; b=l63qbEwGY3dfhOZFPIpd3HhvOl6yUUNNGEfWd2Ciev0VckFzmKww3tHIqN+XVbS5pd FWGkbsMeNbGO5ZeVHra3lFRod5jXpE+k/y9bNtYDyI2GCItCegtancKnvv6KuLP/1/Da Cqlfw8bfx4EGlxkmHIzgb//pw9S2w4QMbuuwfYevd31DhzHVI6rT2OghOg1rHLfcCalA I3rYJhn3nAewUDMMguLMbCAaWoUlIbn5Suly8hyKiM2QodTNAPheV2dnX1xLFYWXpocF 4I/OpsP/Z/QVu1QA+rpcaL65JErcdAMKEuR8svzuCpBhf8E4pUyt1C70mWtocPc4Wz8S 7MaQ== X-Gm-Message-State: APjAAAWOR/jRd3jAWZJ24rix2m6F32hB4K8ERHtrf/2+orv9dG+U8TG6 wno4xIlxx5T9qbhWMkomoFFRAswU X-Google-Smtp-Source: APXvYqzg9ahQbv+3AOrywQlehDrGOWmnbWpTOWMDbh2LtH/bPM9vYoG7xqPCx8xWpbNHLIUGSYC4Mw== X-Received: by 2002:a17:902:aa97:: with SMTP id d23mr2643287plr.337.1574841742336; Wed, 27 Nov 2019 00:02:22 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id h3sm5413761pji.16.2019.11.27.00.02.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:02:21 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH v2 2/5] perf/x86/msr: Add Comet Lake CPU support Date: Wed, 27 Nov 2019 16:02:12 +0800 Message-Id: <20191127080215.203148-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127080215.203148-1-vicamo.yang@canonical.com> References: <20191127080215.203148-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kan Liang Comet Lake is the new 10th Gen Intel processor. PPERF and SMI_COUNT MSRs are also supported. The External Design Specification (EDS) is not published yet. It comes from an authoritative internal source. The patch has been tested on real hardware. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1570549810-25049-4-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar (backported from commit 9674b1cc0f94c34f76e58c102623a866836f269e) Signed-off-by: You-Sheng Yang --- arch/x86/events/msr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c index 9431447541e9..ddab9d68c1e9 100644 --- a/arch/x86/events/msr.c +++ b/arch/x86/events/msr.c @@ -89,6 +89,8 @@ static bool test_intel(int idx, void *data) case INTEL_FAM6_SKYLAKE_X: case INTEL_FAM6_KABYLAKE_MOBILE: case INTEL_FAM6_KABYLAKE_DESKTOP: + case INTEL_FAM6_COMETLAKE_L: + case INTEL_FAM6_COMETLAKE: case INTEL_FAM6_ICELAKE_MOBILE: if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) return true; From patchwork Wed Nov 27 08:02:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1201412 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NCtH721Kz9sSq; Wed, 27 Nov 2019 19:02:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iZsHM-00029Q-8K; Wed, 27 Nov 2019 08:02:28 +0000 Received: from mail-pg1-f194.google.com ([209.85.215.194]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZsHK-000288-Uf for kernel-team@lists.ubuntu.com; Wed, 27 Nov 2019 08:02:27 +0000 Received: by mail-pg1-f194.google.com with SMTP id z188so10402241pgb.1 for ; Wed, 27 Nov 2019 00:02:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OE6TRsIF4VoI/3sA5fGhBM8LNE2c/yjORZYKGsgGR/Y=; b=UwqMiuIw9zof2L/NkRTkus/8+MpMZeiYbF8Wk6JXagJWqrO4QERGVejq969q+qk0K6 xlo7exxS50pfbHDCvGU3snjW/M+hfppva5aDJ3ojVpLetLrvh0gk4dUhCN3/zOqQNsV4 nAJlkn9AQlL8MTjG/nXvoUyj8up7JQM2FBqJK0E6R0C7ZZuLzCeg0uftWn08oPxjlO+x jG0NiFkXv5XMbsPnhKEnBjBuXWMi7/HZZPVxW7OP4DATZIp6DW0KTjukVknPKz15mKON oBo6KAWeg/VGt7c31RQ5S0a/pinpUyZWqLXwQYt9FNY+ShpytxUG4QDOJeduEnclcSmj lUmw== X-Gm-Message-State: APjAAAXaH6CFA32lE+XKC7epTLJ0lfs6HRZmkoLO41j632qgxEslS3xV HwWJ17bidWaYu6R/1/geR+vORTFA X-Google-Smtp-Source: APXvYqxQ8dHjhUq9H7NEQUKvuyn94boLpTeAtP3CAAa1sAeGM1FwPBX0Y3za+lpLD/fbaEA+2AWSbg== X-Received: by 2002:a65:5c48:: with SMTP id v8mr3396486pgr.419.1574841744811; Wed, 27 Nov 2019 00:02:24 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id v16sm6069334pje.1.2019.11.27.00.02.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:02:23 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH v2 3/5] perf/x86/cstate: Add Comet Lake CPU support Date: Wed, 27 Nov 2019 16:02:13 +0800 Message-Id: <20191127080215.203148-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127080215.203148-1-vicamo.yang@canonical.com> References: <20191127080215.203148-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kan Liang Comet Lake is the new 10th Gen Intel processor. From the perspective of Intel cstate residency counters, there is nothing changed compared with Kaby Lake. Share hswult_cstates with Kaby Lake. Update the comments for Comet Lake. Kaby Lake is missed in the comments for some Residency Counters. Update the comments for Kaby Lake as well. The External Design Specification (EDS) is not published yet. It comes from an authoritative internal source. The patch has been tested on real hardware. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1570549810-25049-5-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar (backported from commit 1ffa6c04dae39776a3c222bdf88051e394386c01) Signed-off-by: You-Sheng Yang --- arch/x86/events/intel/cstate.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index 688592b34564..7b8f983ac50e 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -45,46 +45,48 @@ * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter * perf code: 0x01 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM, - CNL + * CNL,KBL,CML * 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,CNL + * SKL,KNL,GLM,CNL,KBL,CML * Scope: Core * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter * perf code: 0x03 - * Available model: SNB,IVB,HSW,BDW,SKL,CNL + * Available model: SNB,IVB,HSW,BDW,SKL,CNL,KBL,CML * Scope: Core * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter. * perf code: 0x00 - * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL + * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, + * KBL,CML * 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,CNL + * GLM,CNL,KBL,CML * 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,CNL + * SKL,KNL,GLM,CNL,KBL,CML * Scope: Package (physical package) * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. * perf code: 0x03 - * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,CNL + * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,CNL, + * KBL,CML * Scope: Package (physical package) * MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter. * perf code: 0x04 - * Available model: HSW ULT,KBL,CNL + * Available model: HSW ULT,KBL,CNL,CML * Scope: Package (physical package) * MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter. * perf code: 0x05 - * Available model: HSW ULT,KBL,CNL + * Available model: HSW ULT,KBL,CNL,CML * Scope: Package (physical package) * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. * perf code: 0x06 - * Available model: HSW ULT,KBL,GLM,CNL + * Available model: HSW ULT,KBL,GLM,CNL,CML * Scope: Package (physical package) * */ @@ -614,6 +616,8 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE, hswult_cstates), X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, hswult_cstates), + X86_CSTATES_MODEL(INTEL_FAM6_COMETLAKE_L, hswult_cstates), + X86_CSTATES_MODEL(INTEL_FAM6_COMETLAKE, hswult_cstates), X86_CSTATES_MODEL(INTEL_FAM6_CANNONLAKE_MOBILE, cnl_cstates), From patchwork Wed Nov 27 08:02:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1201413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NCtL2pWkz9sSq; Wed, 27 Nov 2019 19:02:34 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iZsHO-0002B6-Hu; Wed, 27 Nov 2019 08:02:30 +0000 Received: from mail-pj1-f65.google.com ([209.85.216.65]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZsHN-00029T-FM for kernel-team@lists.ubuntu.com; Wed, 27 Nov 2019 08:02:29 +0000 Received: by mail-pj1-f65.google.com with SMTP id cq11so9573679pjb.3 for ; Wed, 27 Nov 2019 00:02:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jq700dVIeCvlPxyc4+R37BAbvXGGaz2FpTugItUMsio=; b=js0osKSqHLGwQN/AJzG8ggYQqagiXnfZj2Exn/ErBwYH5DZLnAF1DGH+5EA45jv9op yrsXfbV4Gy4xVNaMT5yRjQu1W3eCt6AtHgg3KyLVZ2Oviv2ISoBU00p6kp3ZH+Zjj0Ae DlccoKtPmFScj81bY0NEz/KQL2AWh0Yz8qMTKfkvomdCOW31zj91wIkUQWddBKlR5zNn AB5BtV+J6OuMweXzTokIU9Egaq5fDLllOVOik2XXewrEf7bHPNoHaKtlBHaZuIlSbZEQ NNnkt41nnVG77guKFGitGH9ISWy3225KfB0dWM8dLwydQJ9beOecJIphwXuzD5bJGV4Y cUqw== X-Gm-Message-State: APjAAAU0e7JuwEgkick+g/UVLaz/ZNOD34slaab+EXznjffTokvLIXSI jW13k+Xte+aXN7fpoEx7AwwvkKu5 X-Google-Smtp-Source: APXvYqwfvSgheWECCnKYKfAXiuZnVqJQvEJAkoe/sR0pkSFzrTklKKrcEzSyMmNNG0dOQRlyHYhjuQ== X-Received: by 2002:a17:90a:bb82:: with SMTP id v2mr4364579pjr.90.1574841747153; Wed, 27 Nov 2019 00:02:27 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id g191sm4972006pfb.19.2019.11.27.00.02.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:02:26 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH v2 4/5] perf/x86/msr: Add new CPU model numbers for Ice Lake Date: Wed, 27 Nov 2019 16:02:14 +0800 Message-Id: <20191127080215.203148-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127080215.203148-1-vicamo.yang@canonical.com> References: <20191127080215.203148-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kan Liang PPERF and SMI_COUNT MSRs are also supported by Ice Lake desktop and server. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1570549810-25049-6-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar (backported from commit 1a5da78d00ce0152994946debd1417513dc35eb3) Signed-off-by: You-Sheng Yang --- arch/x86/events/msr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c index ddab9d68c1e9..48d2571e5863 100644 --- a/arch/x86/events/msr.c +++ b/arch/x86/events/msr.c @@ -92,6 +92,9 @@ static bool test_intel(int idx, void *data) case INTEL_FAM6_COMETLAKE_L: case INTEL_FAM6_COMETLAKE: case INTEL_FAM6_ICELAKE_MOBILE: + case INTEL_FAM6_ICELAKE_DESKTOP: + case INTEL_FAM6_ICELAKE_X: + case INTEL_FAM6_ICELAKE_XEON_D: if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) return true; break; From patchwork Wed Nov 27 08:02:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1201414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NCtP5lT8z9sSt; Wed, 27 Nov 2019 19:02:37 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iZsHR-0002DI-Qz; Wed, 27 Nov 2019 08:02:33 +0000 Received: from mail-pf1-f193.google.com ([209.85.210.193]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZsHP-0002BA-H4 for kernel-team@lists.ubuntu.com; Wed, 27 Nov 2019 08:02:31 +0000 Received: by mail-pf1-f193.google.com with SMTP id 193so10553549pfc.13 for ; Wed, 27 Nov 2019 00:02:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6SYRyYWOiLqdnaSSt9GjrEtav7OXH+KK94uFIfpd9EE=; b=ppMUttjVb+mCQ9Ssi5SMz8cnPCYBe4x9CmC+7tpgx2bmtgDZ6NXkNMTBT2kXKk4zpd qfk5z3l4xvBbO+Or01dp5bIqRDTu0alPCKXscLnw4lrZ1xAFkGDQY0SjnHPjU3lBf2+H 2ANqKbQu4rULbHR6Vr0HgJ/kRA+BusDDf6WBVgkPWNqjqIMMznB9JPT7KaPVnRVVhICn xHVhOBdqzsk5twXVxg9XWBFew+znyosZz+7dGe5/NK399ej8YCYVBUChmWJ52QazJvjT 89iJaBTI79pKk92zqrfQZ7FVCQQp0nV//E3wr6isPQ7sengGS/xrvmIQ11xqjvJaf58l mU1Q== X-Gm-Message-State: APjAAAX9xwzpjYVfZLXpKK029OFaYbDy7ZG+NrysW3PMt5lk0N/RWMqC QTZgpPuJtC3liVniw2NVq+joFfo7 X-Google-Smtp-Source: APXvYqw3r7P/RrcdATa/U75piKuV5RiBilUYrzVXnwBz+m5gCqfwisz2pRgrFz+JaYlXE9BZt3ybCQ== X-Received: by 2002:aa7:8b1a:: with SMTP id f26mr24677519pfd.81.1574841749448; Wed, 27 Nov 2019 00:02:29 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id b13sm15483321pgj.28.2019.11.27.00.02.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:02:28 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][E][PATCH v2 5/5] perf/x86/cstate: Update C-state counters for Ice Lake Date: Wed, 27 Nov 2019 16:02:15 +0800 Message-Id: <20191127080215.203148-6-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127080215.203148-1-vicamo.yang@canonical.com> References: <20191127080215.203148-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kan Liang There is no Core C3 C-State counter for Ice Lake. Package C8/C9/C10 C-State counters are added for Ice Lake. Introduce a new event list, icl_cstates, for Ice Lake. Update the comments accordingly. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: f08c47d1f86c ("perf/x86/intel/cstate: Add Icelake support") Link: https://lkml.kernel.org/r/1570549810-25049-7-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar (backported from commit f1857a2467755e5faa3c727d7146b6db960abee1) Signed-off-by: You-Sheng Yang --- arch/x86/events/intel/cstate.c | 36 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index 7b8f983ac50e..ba3842d6a659 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -50,43 +50,44 @@ * MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter * perf code: 0x02 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, - * SKL,KNL,GLM,CNL,KBL,CML + * SKL,KNL,GLM,CNL,KBL,CML,ICL * Scope: Core * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter * perf code: 0x03 - * Available model: SNB,IVB,HSW,BDW,SKL,CNL,KBL,CML + * Available model: SNB,IVB,HSW,BDW,SKL,CNL,KBL,CML, + * ICL * Scope: Core * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter. * perf code: 0x00 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, - * KBL,CML + * KBL,CML,ICL * 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,CNL,KBL,CML + * GLM,CNL,KBL,CML,ICL * 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,CNL,KBL,CML + * SKL,KNL,GLM,CNL,KBL,CML,ICL * Scope: Package (physical package) * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. * perf code: 0x03 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,CNL, - * KBL,CML + * KBL,CML,ICL * Scope: Package (physical package) * MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter. * perf code: 0x04 - * Available model: HSW ULT,KBL,CNL,CML + * Available model: HSW ULT,KBL,CNL,CML,ICL * Scope: Package (physical package) * MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter. * perf code: 0x05 - * Available model: HSW ULT,KBL,CNL,CML + * Available model: HSW ULT,KBL,CNL,CML,ICL * Scope: Package (physical package) * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. * perf code: 0x06 - * Available model: HSW ULT,KBL,GLM,CNL,CML + * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL * Scope: Package (physical package) * */ @@ -546,6 +547,19 @@ static const struct cstate_model cnl_cstates __initconst = { BIT(PERF_CSTATE_PKG_C10_RES), }; +static const struct cstate_model icl_cstates __initconst = { + .core_events = 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), @@ -629,8 +643,8 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_PLUS, glm_cstates), - X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_MOBILE, snb_cstates), - X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_DESKTOP, snb_cstates), + X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_MOBILE, icl_cstates), + X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_DESKTOP, icl_cstates), { }, }; MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match);