Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5255848ybi; Tue, 4 Jun 2019 03:57:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLadgINBCNBJtANRzve3puZAJAawFDldP5pGp3jiccISyM/y1glfZf0oT3gVA+S6V/+7uJ X-Received: by 2002:a63:6685:: with SMTP id a127mr28030654pgc.22.1559645870402; Tue, 04 Jun 2019 03:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559645870; cv=none; d=google.com; s=arc-20160816; b=bUx2IZt3zYJANYZGoT+TU85UxzBbLfYzt3fxcVp/MXQZy/rC7Px/iZpCvN8QV/siF9 s26zvWUIMMaDV/zszsUGzu8tDQeBSd7sRzp84jTeBDrCLBCOA4kWX4WB8DEaQQcFAotp YVRYW8g7LMLYUedviKSYMtthrasqeHU7EHN4AdyvEhqA2L0cIjDOUoNNnXVBogprbwTB fXcECibg/zOSbNKPGIhSsfVCN+uoy0BvhhwqilnzZuhJRMe0Wz5lamD7ojTI+cSdmodB sAMx/VGBY3EmaB0nxl2r5maEwe7Cfp1D3nrYqfGkm4OAnP208vDOqUp0ahY5VYJl5iaD 88Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=VkW9cy4YJk0SohAwrXnBa1FW+jWBbjS5fybjVG4LyGk=; b=m+E2oXwLNLXt/85hJs/4BonPg73lbIDvHG/ChaXGtp8RwzdUq6qHAmKIkdl4wxbpV0 MWML63lR83AuYSC15QfDm1smpbBPcgcJurrw7F/HZ+4sHQmD8D+Cm69ZSH00U9knwjXc 0aCMLOS3HimNRq1v0Rks8ZZBtGA4Efmdb+O+vlmObYR2+RhsKOOH2jE96J78p+sbEeAP ejTuxlGWMJ2TUimO2A7tYoVod11dyea4MSg3hx2aGm80rjwCO8K2okCj3MIW6IIujv3W GyJupImeXkgKjj/4Or0D3oqeZAk08TqZ2hCBLMBPU1ILQe6k5G6/ELak/fp2OK9F0UzU ofGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si11043130plh.368.2019.06.04.03.57.34; Tue, 04 Jun 2019 03:57:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbfFDK4N (ORCPT + 99 others); Tue, 4 Jun 2019 06:56:13 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:35773 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbfFDK4L (ORCPT ); Tue, 4 Jun 2019 06:56:11 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07611556|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.136347-0.00582676-0.857826;FP=11371346456618404203|2|2|3|0|-1|-1|-1;HT=e01a16368;MF=han_mao@c-sky.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.EhJMHgY_1559645768; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.EhJMHgY_1559645768) by smtp.aliyun-inc.com(10.147.42.197); Tue, 04 Jun 2019 18:56:08 +0800 From: Mao Han To: linux-kernel@vger.kernel.org Cc: Guo Ren , linux-csky@vger.kernel.org, Mao Han , Guo Ren Subject: [PATCH V5 5/6] csky: Fixup some error count in 810 & 860. Date: Tue, 4 Jun 2019 18:54:48 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren CK810 pmu only support event with index 0-8 and 0xd; CK860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han Cc: Guo Ren Cc: linux-csky@vger.kernel.org --- arch/csky/kernel/perf_event.c | 60 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index 8d4547e..499427e 100644 --- a/arch/csky/kernel/perf_event.c +++ b/arch/csky/kernel/perf_event.c @@ -734,6 +734,20 @@ static const int csky_pmu_hw_map[PERF_COUNT_HW_MAX] = { #define CACHE_OP_UNSUPPORTED 0xffff static const int csky_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { [C(L1D)] = { +#ifdef CONFIG_CPU_CK810 + [C(OP_READ)] = { + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + }, + [C(OP_WRITE)] = { + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + }, + [C(OP_PREFETCH)] = { + [C(RESULT_ACCESS)] = 0x5, + [C(RESULT_MISS)] = 0x6, + }, +#else [C(OP_READ)] = { [C(RESULT_ACCESS)] = 0x14, [C(RESULT_MISS)] = 0x15, @@ -743,9 +757,10 @@ static const int csky_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { [C(RESULT_MISS)] = 0x17, }, [C(OP_PREFETCH)] = { - [C(RESULT_ACCESS)] = 0x5, - [C(RESULT_MISS)] = 0x6, + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, +#endif }, [C(L1I)] = { [C(OP_READ)] = { @@ -762,6 +777,20 @@ static const int csky_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { }, }, [C(LL)] = { +#ifdef CONFIG_CPU_CK810 + [C(OP_READ)] = { + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + }, + [C(OP_WRITE)] = { + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + }, + [C(OP_PREFETCH)] = { + [C(RESULT_ACCESS)] = 0x7, + [C(RESULT_MISS)] = 0x8, + }, +#else [C(OP_READ)] = { [C(RESULT_ACCESS)] = 0x18, [C(RESULT_MISS)] = 0x19, @@ -771,29 +800,48 @@ static const int csky_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { [C(RESULT_MISS)] = 0x1b, }, [C(OP_PREFETCH)] = { - [C(RESULT_ACCESS)] = 0x7, - [C(RESULT_MISS)] = 0x8, + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, +#endif }, [C(DTLB)] = { +#ifdef CONFIG_CPU_CK810 [C(OP_READ)] = { - [C(RESULT_ACCESS)] = 0x5, - [C(RESULT_MISS)] = 0xb, + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, [C(OP_WRITE)] = { [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, +#else + [C(OP_READ)] = { + [C(RESULT_ACCESS)] = 0x14, + [C(RESULT_MISS)] = 0xb, + }, + [C(OP_WRITE)] = { + [C(RESULT_ACCESS)] = 0x16, + [C(RESULT_MISS)] = 0xb, + }, +#endif [C(OP_PREFETCH)] = { [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, }, [C(ITLB)] = { +#ifdef CONFIG_CPU_CK810 + [C(OP_READ)] = { + [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + }, +#else [C(OP_READ)] = { [C(RESULT_ACCESS)] = 0x3, [C(RESULT_MISS)] = 0xa, }, +#endif [C(OP_WRITE)] = { [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, -- 2.7.4