Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp214707rbe; Wed, 28 Feb 2024 18:28:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXAedw7qbPVXoPEQ3jZegjSYMEC4HdDMGzoSGEYmoJ5qALmFdQrek/E8KVbXEgZav4SuNqScY1Umn04Qy7rTmkfYHlUQW50cUtXe68Z9Q== X-Google-Smtp-Source: AGHT+IFNCLbSzT29Obovp9vt1h8IliqwoYLPx7STWQOGcCSGx0zintwNcW2rCLfpluY/du7scJrU X-Received: by 2002:a05:6402:358f:b0:566:8058:1304 with SMTP id y15-20020a056402358f00b0056680581304mr549808edc.36.1709173689131; Wed, 28 Feb 2024 18:28:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709173689; cv=pass; d=google.com; s=arc-20160816; b=AJCXXB2NWcR9SZ0oczfcSk/OPJdf5OeuvsrKYboF4voSFC9Af0fi24EKSKumQjCnlb BGKtCbuNnwkzP1gv7hpcmty/6ElnQXC/X56/jGgsLtqBUsB/QUqtZrOs5Lgr70TkcceG gOSyXPZ88XExmKT6viNe6MTrdFA8RUYmCNNet18t7q5nPx9IRiWCVj0DXbGHRCt0PJyH PhlQTWZUd76UMpajXWShlzS6v/FAY1ckX/M5ZGKgJGIHPZZOdek31u02S2iCoeyt1cC9 TpTAQnhgIG6X55Al+1TK+tIvqhIdD+Sa7ADLL5KPLlK3mcERqY6zbRgt6D+MhAevCBg7 YdDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:in-reply-to:references:cc:to :from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=IVeLHpFuywOsJp1jPtCUqAan1KreSWoxMszj8rAbKmE=; fh=XOTHCGKVIr1rwxxJHjZLZG/l4xIO6T0qGaiVrpUNM9M=; b=uz2aVc/EeOa+AuRIGDKzrKmAZJJZIkXL+EnyRi12vfd/KGijORH3WgMf5W+RpAQnYf MZPWzefMdXVr8BMvChlKsZUZBcNKYZyQMsaLycKVgdNbAU1tTXsYDB+aQAjCDyNgH5K7 AwRPPwaJHdqnc5BM1vwiR+z5AwDLhel6TWc/a8JoxC9cILMReBmgVLWOSdF/dmkF66D1 kvTw9w85gsVC1BdwySJWhDruoX1pTmmeR0dcb2hn1MZaChFwGw/eljV3EidVGzxszFmP tU76TuS/wHCR7Sg3X4wRf23mkiW0nqCuEwxLbM6Ilcye7VnOmlmQwBXVGiwkfu8JyS6H TCWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-86046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e9-20020a056402190900b005666edf5195si139010edz.93.2024.02.28.18.28.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 18:28:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-86046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AD3ED1F225AB for ; Thu, 29 Feb 2024 02:28:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8DC836B0D; Thu, 29 Feb 2024 02:28:01 +0000 (UTC) Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E17DA168AB for ; Thu, 29 Feb 2024 02:27:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.16.166 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709173681; cv=none; b=j8vQ8zuxDbJtGCd5JBMt7YT2/O0HPL3FsAF5+YrP/FjZ4D7UUOdc9fSLOfg1FzHH35BLaA99lvb9co4inbBwyx57xkqezuVhYeUu66SeZVtBkAVaKPTSwJ7ePGlF3KIul3PKqEACo5vn0TSXF2S4mpsGIMJ6jvHd7PtbQ6mS0iI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709173681; c=relaxed/simple; bh=X8tVYvUWVwPWvXjSZ7OR7RRWVXQ5R2FhzevYeToQz7w=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=IC4jML+gwjL/Ls4R7DSHiJfKoiqlbGRk2zWU0nP5q+pKGoc2z4JtVTZJ5xCpV0649XeXMIIaHmE06NtT0ryqhATP+OVpuO/C5i2ZbRZKmkO57V9XLbKiD9Js0faiftizADUWx4YTom+XJMk8H8ZkLmSEC2iNTc7uTs/DP7+nkMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.206.16.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp78t1709173594tnnbjmsc X-QQ-Originating-IP: 5b/G22WXjuRBomPeANlV/+RUg08N1JFgoyc+wAUXL3M= Received: from [127.0.0.1] ( [223.112.234.130]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 29 Feb 2024 10:26:32 +0800 (CST) X-QQ-SSF: 01400000000000B0B000000A0000000 X-QQ-FEAT: aBJFcW+uBGYb7MYu3t9R58LypuhxPKLYFfis+igqKlqyR1PWpW/I+28e+/e1X wprJhHyY1/RnVLHZuesR2KKsc8Uap5oQs6dBAyFXkT6h5xbqtU+ip2E9wvF14oMP5w+gHwx PCI2WXFpRNC1Qbc/kG1sNWttmSsfEWAWbutlhi1oREjfcjcAjExnLmtMD6bGE4B0Lxe7tsx QeFaEA+tqjRxedZZ/ABzk3N0uE3zvZUQYwoM1al11KiNBElNTm50Uh8Q8xSoQ0BLAWz5Teo 2LV2YxNlMaiy762TUC55Rp7EoUCWkg53S3oGU61+M1PevBG/i5CCjUHul6OiNRvOJnuitOS 3UeQHcRE6u2Si1yKxnlJPU5yHLPWZvngVgm8lmLoSnHOH7Foj8oeqJ5i5pHJ/rVhWS22ykZ 820yi0ApbEtAYfJJb/jaDg== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 1125513446898690848 Message-ID: <29BBBFFB3CD52ED1+e0feef57-e609-4e14-acb0-65212a39380b@shingroup.cn> Date: Thu, 29 Feb 2024 10:26:32 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] perf/hx_arm_ni: Support uncore ARM NI-700 PMU Content-Language: en-US From: =?UTF-8?B?WWFuZyBKaWFsb25nIOadqOS9s+m+mQ==?= To: Robin Murphy , Will Deacon , Mark Rutland Cc: shenghui.qu@shingroup.cn, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240131070821.11477-1-jialong.yang@shingroup.cn> <7C9733413A0F8F60+0214f04d-173d-4513-ac1e-681c2f2a8de4@shingroup.cn> <8daf740f-f16b-49af-8da9-7c7750092539@arm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz6a-1 From d11d3c01978ef0fd8bfd125189c671c9bcc3c096 Mon Sep 17 00:00:00 2001 From: yjl00405 Date: Thu, 29 Feb 2024 09:39:51 +0800 Subject: [PATCH] arm-ni:Some changes. --- 1. Some small mistakes. 2. Have not given 'NI_PMU unit->ns = true'. So no cycles event exists in arm_ni_0_cd_0/events. Test(multiple cores server): 1. hotplug test pass. ~ # cat /sys/bus/event_source/devices/arm_ni_0_cd_0/cpumask 0 ~ # echo 0 > /sys/devices/system/cpu/cpu0/online ~ # cat /sys/bus/event_source/devices/arm_ni_0_cd_0/cpumask 1 ~ # # Test cycles event ~ # perf stat -e arm_ni_0_cd_0/type=6/ echo Performance counter stats for 'system wide': 397282 arm_ni_0_cd_0/type=6/ 0.000228680 seconds time elapsed 2. Normal event test and overflow interrupt handler test pass. ~ # perf stat -e arm_ni_0_cd_0/type=4,nodeid=0,eventid=1/ Performance counter stats for 'system wide': 8192 arm_ni_0_cd_0/type=4,nodeid=0,eventid=1/ 0.123881102 seconds time elapsed There is no device after the interface. So I use devmem tool give a 0x80001000 first time. Then trigger the ovsr. See the counter value 0x80000000. Then I give 0x80001000 again and exit. It's very hard to write such code without machine with NI component. Could we merge our code and push it into community together? drivers/perf/arm-ni.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c index 4a769a421c81..d14ebcbeb598 100644 --- a/drivers/perf/arm-ni.c +++ b/drivers/perf/arm-ni.c @@ -171,7 +171,7 @@ static umode_t arm_ni_event_attr_is_visible(struct kobject *kobj, eattr = container_of(attr, typeof(*eattr), attr.attr); cd_for_each_unit(cd, unit) { - if (unit->type == eattr->type && unit->ns) + if (unit->type == eattr->type && (unit->ns | unit->type == NI_PMU)) return attr->mode; } @@ -592,7 +592,7 @@ static int arm_ni_probe(struct platform_device *pdev) for (int v = 0; v < cfg.num_components; v++) { reg = readl_relaxed(cfg.base + NI_CHILD_PTR(v)); arm_ni_probe_domain(base + reg, &vd); - for (int p = 0; p < vd.num_components; v++) { + for (int p = 0; p < vd.num_components; p++) { reg = readl_relaxed(vd.base + NI_CHILD_PTR(p)); arm_ni_probe_domain(base + reg, &pd); num_cds += pd.num_components; @@ -612,13 +612,13 @@ static int arm_ni_probe(struct platform_device *pdev) for (int v = 0; v < cfg.num_components; v++) { reg = readl_relaxed(cfg.base + NI_CHILD_PTR(v)); arm_ni_probe_domain(base + reg, &vd); - for (int p = 0; p < pd.num_components; v++) { + for (int p = 0; p < pd.num_components; p++) { reg = readl_relaxed(vd.base + NI_CHILD_PTR(p)); arm_ni_probe_domain(base + reg, &pd); for (int c = 0; c < vd.num_components; c++) { int ret; - reg = readl_relaxed(vd.base + NI_CHILD_PTR(c)); + reg = readl_relaxed(pd.base + NI_CHILD_PTR(c)); arm_ni_probe_domain(base + reg, &cd); ret = arm_ni_init_cd(ni, &cd); if (ret) -- 2.27.0