Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4866861ybi; Mon, 3 Jun 2019 19:28:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQazgTi6LaB4CxHJIXPKh5Y/zhp3jdHkH/KFNu35IWEwiBnKcOhQ0EgBhZ7CwwzFTPvD/m X-Received: by 2002:a62:6585:: with SMTP id z127mr35223106pfb.179.1559615319572; Mon, 03 Jun 2019 19:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559615319; cv=none; d=google.com; s=arc-20160816; b=BNidy83tWEEBnMVpxqe/cxPU54hMo8L967J9jr9/j2S01R3Q8FUaeT36bxgzwolxHz vw5QQSWYXcl2MRPoJjzt+okm+a+RSTSs0/4VRaQX1u0NqH32N0XAVzRcHMLLfb+tkyvO qZ0WYQyMjnq70fAPrEFdY7AwO9mbWDiy+WfOBBrHy3Oke3B1BCm5pJVWNX95olHsFT2w T+ulGCG11QtSsK3zH+RN5l0VPTdyxWLIHCym0pLLozzf2SkCwo58VGSfpS3pEiT/Pqj3 vUkCYjbWjcEs8xN6eMW1Is/O3hUlWO1UkyxjahpN7sN59wcdU3EQ89ZMP/Qjjccq/atg b13A== 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=poGZk9EzJAr93hNDB185Y4Ap51/Qg85ec9MMwYxbfcE=; b=sL4pFLXCELdyhufV9NJMt5L4ol5PFnZQw7YRYye3VOznLv7PRyrMFa5uWOtu7en1V1 fqrYu/KXS37uyFlXvfu6mXli0huNQCFuslE0AbzGh4UBtvEz0sSaWk8qA+DAA3xXB27o qvoon3nxSh9cNwVhyqGvgq3v/Q/qwCnOnI4hN0zmaz7Yshdz7DPv0JdeveNy70MF+NfH AyYcKQd1XKHJucSsUbfrBFbrf3o/5ndjanOkzzQSixFzm693h3Yqr6jWWBJqdm8jcfR8 Sd5qofUa2MDI14ZSZK52UvsuMgaVPGrPAXmxUhZaBxip4gR6A3faFF7TAL7gXkpWTXoZ isCg== 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 h5si20450024pgc.8.2019.06.03.19.28.22; Mon, 03 Jun 2019 19:28: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; 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 S1726645AbfFDCZO (ORCPT + 99 others); Mon, 3 Jun 2019 22:25:14 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:47611 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbfFDCZM (ORCPT ); Mon, 3 Jun 2019 22:25:12 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07611825|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.136347-0.00582676-0.857826;FP=11371346456618404203|2|2|3|0|-1|-1|-1;HT=e02c03267;MF=han_mao@c-sky.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.Eh7C0DU_1559615109; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.Eh7C0DU_1559615109) by smtp.aliyun-inc.com(10.147.41.138); Tue, 04 Jun 2019 10:25:09 +0800 From: Mao Han To: linux-kernel@vger.kernel.org Cc: Guo Ren , linux-csky@vger.kernel.org, Mao Han , Guo Ren Subject: [PATCH V4 5/6] csky: Fixup some error count in 810 & 860. Date: Tue, 4 Jun 2019 10:23:59 +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 af09885..dc84dc7 100644 --- a/arch/csky/kernel/perf_event.c +++ b/arch/csky/kernel/perf_event.c @@ -737,6 +737,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, @@ -746,9 +760,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)] = { @@ -765,6 +780,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, @@ -774,29 +803,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