Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp249026ybm; Wed, 22 May 2019 02:28:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN5VMchXAIYGC0zCtKuGheuledlQNlpGXBhQm67xBssVLeTzyl8017V16FupmaYx7pCWoq X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr89329461plt.336.1558517301409; Wed, 22 May 2019 02:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558517301; cv=none; d=google.com; s=arc-20160816; b=EWu4siOr9TqcrtznyemECB5KpzEwASfGST2NoACmRmGGmEqrHRK0zcXDMpMdWQ8n2V aMuw4u+ROzy4qs7JviKzXnOikTssWGKcYt75OE93UfmMleWd4qoL3g7EeKy/cvdteoOj IVPySFRH9gEXI+xLG3WyaZq7Q0ox1zC0Mg0fU1noo5HdI4rEwqr/8qolMZxzKJHGBWmy UUU48sk6+wD4nyzs+DWnDcrpAe6Hwnnxv5IbYPM4tXr6myAIoltulWY/sD07gN4P0qWR IkRavLNcP742yRb4OLJbhxsjg3ml02pv/5AchXoodMa2cHEwphijLWcRmvExLEp4i10C 6vpw== 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=TeUEv+85zJZIxeOlLRK0wEIB3zMTW7vT+YHUQYnyEok=; b=tFX0zURcf/fAI0R3PZio7z0zTaX2ZcZfSjpp/8A2cJatadCeKGRjoCR9rZZ8iK5zzE mS3/v6MjtjhardyQQ0ewP+wyIbJOy5FebIYje5PVwOheX+2gRR3gIa/2rfKLENocPFOV ZC/ezJez3msKjGAQ5aCKVVVvDITskGpzHjERNxZB4JagdziRM8xzlYfOSwOs1fkgIUm6 RhDQyzGjCt6iSR1n/yqOENgiSKaSzOvTm0nLZqRMd+YtH3LNaJt03g626OzgwZ/p2dXf NVtyAImkZ5y4OVBJXKYQP/vheEb2rp9vYK+ci85mba8avBQdP8tUBYaN53scBmDMkDlw grDg== 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 ch16si26366766plb.76.2019.05.22.02.28.05; Wed, 22 May 2019 02:28:21 -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 S1729071AbfEVJ0y (ORCPT + 99 others); Wed, 22 May 2019 05:26:54 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:58228 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728584AbfEVJ0x (ORCPT ); Wed, 22 May 2019 05:26:53 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07611752|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.136347-0.00582676-0.857826;FP=0|0|0|0|0|-1|-1|-1;HT=e01l07447;MF=han_mao@c-sky.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.EbUK8s2_1558517210; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.EbUK8s2_1558517210) by smtp.aliyun-inc.com(10.147.42.135); Wed, 22 May 2019 17:26:50 +0800 From: Mao Han To: linux-kernel@vger.kernel.org Cc: Guo Ren , Mao Han , Guo Ren , linux-csky@vger.kernel.org Subject: [PATCH 5/5] csky: Fixup some error count in 810 & 860. Date: Wed, 22 May 2019 17:25:32 +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 2ea9083..b105d55 100644 --- a/arch/csky/kernel/perf_event.c +++ b/arch/csky/kernel/perf_event.c @@ -735,6 +735,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, @@ -744,9 +758,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)] = { @@ -763,6 +778,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, @@ -772,29 +801,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