From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF9C33E274B for ; Tue, 14 Jul 2026 12:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784032379; cv=none; b=qf8Nz5aGENamSzw+qJ+CQ5R9eWjozbvGvMYwaUmhmX6CPDoe8puL7ljaPBTkU/WlgPhYUnioICvZ5Ft4pNZBcj+1Vvcdx6kSSg9Vs7j5ghHY2/7RQZSmqkkXx/+686dNv0sFb0cdDb1MaTBhXE16nfJxhpKjpC/LjQIZ8VlcPqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784032379; c=relaxed/simple; bh=8uQgtjeLK7scX1aIYqYpHtffH9i8TQihtZnD4ZLZBk0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FYqWwsuXhnkI1zqNtDET0t/oGkf0LnCqS4wOqmNWaAW8bewjzLeBfkZcjpOqHgi61Ml0/oeSSHjKpbZhhbzGicrtE4S5eutOSkaMyxgjOKYJiqLiIbu8auDF+ZlkcZd1ehq4D6WVPfqmpejc3WM4AwHkf6x0XJ2cfxdFY5GN2g4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=h9nW5akJ; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="h9nW5akJ" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-4728c12ba97so1882794f8f.0 for ; Tue, 14 Jul 2026 05:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1784032368; x=1784637168; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Pup7WDa7Ky4wehwSLqoEAdDkExqfXTv2ZHtTc//0qvs=; b=h9nW5akJDoxaS853ZftqHaIQsRM1jmLEAXKIoiDIVFdp+h5Ocq/CPtRLlWjE0D7dRv ia2XQmuLdYmcO/Vw/3DWmbe1u2dQev7mBpVLBer22VtZ/rbvyj4MOA3IQnmCCUbNZJmK HLB40AzT6owqETZzLmw8dVTA0vySonvrkCN9j8dfWLg/Riv0IBnPjX/u+BqvJHEAHftD mpGU7B/Cna2EG31kfzMQPnz98NhYu8gPrTiFFDTmeIJk8ym45P1ppfqZOhJk7CwfvyjD fPCHWU9744KdHrCTvidNZQHNPkgZBVXwyXa2/Skx5Z5doXeJugSsMXUuMZkkd6iCnIo0 BvKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784032368; x=1784637168; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Pup7WDa7Ky4wehwSLqoEAdDkExqfXTv2ZHtTc//0qvs=; b=mrYeEMskazbG6RUv1KWxuv2cc+p42u1+x+dp80pTFul8VM7YMRStYdsVUTidGW/D+k fApAYhzmSQsrVNUn2ZOHTObQ/byQ/uPMHY3pyzJqZ7RUGClKPdwyY8rkrKUeqBt2wUcj gR4Fd00Jj4rMbYz2dep2BLzubGnlu0NB/RCiGenfSaYLWJ8QTU1yfkeKkt+TR88dcfQp UUt+M5Miib9+ecg80koXQCMMX3REQVT5SqQHaLscEI3PZIzln7/21xgMc2g+BbjgmTfn UXyBWRbrmvZtn7Xkxa9iqr0FZTsekQPUDyU4cQ36WdkvhYNS0MZZlrgl4TWE+BKaohm1 zKRA== X-Forwarded-Encrypted: i=1; AHgh+RqknQAx1ibZPVS7OqF/np1RpZcN9nElFKNnlT2ycGWb9uRdFr12YVKaQNjmp5792OpVOWUT7Fn3xvmHB+c=@vger.kernel.org X-Gm-Message-State: AOJu0YxJSCvv713T2zFSFkyEHpKDvQPnDkyZZIdk3HNwtH2a/BH/UTY2 w3yFZqOObKCcR7sKfeP0K01GKern8se+mPDmLNpE3B+SmzPwe7EKs0lND43TFUF0bkE= X-Gm-Gg: AfdE7cleuXzeG9OreF+n98wXE1MkxAFv4Yj3Y/sJXproGpjPYp4k6OuLCrguzRQGqWb 9pDlcs+WiO5eQaRf76LdW3ci+2uUvX6h7ISp47xJtWXB0XhsaeNxxZxbXHgHd0RDgoS47370YrN J1JOC8iiAyT3yLRuys+r+K4SQwgapBr+euwwMTl39Gn4BSS/bdJtxXjXHx/jHzFjoqWrn5vPhtw Amf7xHcVZEIe1d2VLFdwByeZpuSw44amD2PR76hXI01lUQEGw29sjzQ7o2WThBP0LePRHolBEde BxY7+ezuuLGCjG6IvxykXHo638Umyk9P//Sq3PlTZgAHr7jDR3PKGwKeVgKB4NXnblFe/Dm/VwN Lldv8KNpKd5nVMfUZ+yV5gaQLN2vsunqh6W+s/wXC9Vf2nutAAr1mMpoky0qhHWq2LKJmChT/p0 XKlhwY4jUdekiD/wV0LMQMIlVOVU6iORRSqOyJLKtHPFQ1g4OwAmd2bLVvmgbv264yu0f181kdZ NZ7 X-Received: by 2002:a5d:5f51:0:b0:46e:8226:96a8 with SMTP id ffacd0b85a97d-47f2dcb7439mr16285201f8f.17.1784032367909; Tue, 14 Jul 2026 05:32:47 -0700 (PDT) Received: from localhost (p200300f65f47db04b44a80421173aa03.dip0.t-ipconnect.de. [2003:f6:5f47:db04:b44a:8042:1173:aa03]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-47f464c7c96sm7856162f8f.33.2026.07.14.05.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 05:32:46 -0700 (PDT) Date: Tue, 14 Jul 2026 14:32:45 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Yushan Wang Cc: will@kernel.org, mark.rutland@arm.com, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fanghao11@huawei.com, linuxarm@huawei.com, liuyonglong@huawei.com, prime.zeng@hisilicon.com, wangzhou1@hisilicon.com Subject: Re: [PATCH v3 1/2] drivers/perf: hisi: Support uncore ITS PMU Message-ID: References: <20260713125647.2958626-1-wangyushan12@huawei.com> <20260713125647.2958626-2-wangyushan12@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4izklbuzoc3hgjg7" Content-Disposition: inline In-Reply-To: <20260713125647.2958626-2-wangyushan12@huawei.com> --4izklbuzoc3hgjg7 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v3 1/2] drivers/perf: hisi: Support uncore ITS PMU MIME-Version: 1.0 Hello, On Mon, Jul 13, 2026 at 08:56:46PM +0800, Yushan Wang wrote: > Support uncore ITS PMU, which provides the capability of counting > the number of interrupts routed to ITS by interrupt catagories, and the > latency. It also supports collecting statistics of micro-ops of ITS. >=20 > The driver adapts to HiSilicon uncore PMU framework. It does not support > overflow interruption, which is the same as NoC PMU, so a few dummy > functions or handling interrupts are left empty. >=20 > Signed-off-by: Yushan Wang > --- > Documentation/admin-guide/perf/hisi-pmu.rst | 13 + > drivers/perf/hisilicon/Makefile | 2 +- > drivers/perf/hisilicon/hisi_uncore_its_pmu.c | 393 +++++++++++++++++++ > 3 files changed, 407 insertions(+), 1 deletion(-) > create mode 100644 drivers/perf/hisilicon/hisi_uncore_its_pmu.c >=20 > diff --git a/Documentation/admin-guide/perf/hisi-pmu.rst b/Documentation/= admin-guide/perf/hisi-pmu.rst > index d56b2d690709..278bd7e0ae60 100644 > --- a/Documentation/admin-guide/perf/hisi-pmu.rst > +++ b/Documentation/admin-guide/perf/hisi-pmu.rst > @@ -128,6 +128,19 @@ channel with this option. The current supported chan= nels are as follows: > 7. tt_en: NoC PMU supports counting only transactions that have tracetag= set > if this option is set. See the 2nd list for more information about trace= tag. > =20 > +8. int_id: ITS PMU supports filtering by interrupt id, which is defined = by > +hardware. Interrupt id takes up to 32 bits, and can be divided into 2 pa= rts: > + > +- Upper 16 bits: DeviceID if counting LPI, PEID if counting SGI/PPI. > +- Lower 16 bits: EventID if counting LPI, IntID if counting SGI/PPI. > + > +int_id is a global configuration for each PMU instance. If multiple diff= erent > +int_id's are specified, the last came in will be effective. And if there= are > +already filtered events running, new filtered events came in will be ref= used. > + > +9. int_en: A one-bit flag to tell if int_id is used to filter the statis= tics. It > +allows filtering 0 DeviceID and EventID. > + > For HiSilicon uncore PMU v3 whose identifier is 0x40, some uncore PMUs a= re > further divided into parts for finer granularity of tracing, each part h= as its > own dedicated PMU, and all such PMUs together cover the monitoring job o= f events > diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Mak= efile > index 186be3d02238..5f28cfdb8a72 100644 > --- a/drivers/perf/hisilicon/Makefile > +++ b/drivers/perf/hisilicon/Makefile > @@ -2,7 +2,7 @@ > obj-$(CONFIG_HISI_PMU) +=3D hisi_uncore_pmu.o hisi_uncore_l3c_pmu.o \ > hisi_uncore_hha_pmu.o hisi_uncore_ddrc_pmu.o hisi_uncore_sllc_pmu.o= \ > hisi_uncore_pa_pmu.o hisi_uncore_cpa_pmu.o hisi_uncore_uc_pmu.o \ > - hisi_uncore_noc_pmu.o hisi_uncore_mn_pmu.o > + hisi_uncore_noc_pmu.o hisi_uncore_mn_pmu.o hisi_uncore_its_pmu.o > =20 > obj-$(CONFIG_HISI_PCIE_PMU) +=3D hisi_pcie_pmu.o > obj-$(CONFIG_HNS3_PMU) +=3D hns3_pmu.o > diff --git a/drivers/perf/hisilicon/hisi_uncore_its_pmu.c b/drivers/perf/= hisilicon/hisi_uncore_its_pmu.c > new file mode 100644 > index 000000000000..430e2b06cf4d > --- /dev/null > +++ b/drivers/perf/hisilicon/hisi_uncore_its_pmu.c > @@ -0,0 +1,393 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Driver for HiSilicon Uncore ITS PMU device > + * > + * Copyright (c) 2026 HiSilicon Technologies Co., Ltd. > + * Author: Yushan Wang > + */ > +#include > +#include > +#include > +#include > +#include Please rely on linux/platform_device.h to provice acpi_device_id and drop the include for . > +static int __init hisi_its_pmu_module_init(void) > +{ > + int ret =3D cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, > + "perf/hisi/its:online", > + hisi_uncore_pmu_online_cpu, > + hisi_uncore_pmu_offline_cpu); I don't know anything about the functions involved here This looks fishy. The module might be loaded on any machine, is it right to call hisilicon specific functions then? > + if (ret < 0) { > + pr_err("hisi_its_pmu: Fail to setup cpuhp callbacks, ret =3D %d\n", re= t); > + return ret; > + } > + hisi_its_pmu_cpuhp_state =3D ret; > + > + ret =3D platform_driver_register(&hisi_its_pmu_driver); > + if (ret) > + cpuhp_remove_multi_state(hisi_its_pmu_cpuhp_state); > + > + return ret; > +} > +module_init(hisi_its_pmu_module_init); Best regards Uwe --4izklbuzoc3hgjg7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmpWLGoACgkQj4D7WH0S /k7Kswf9FaAfaQAEr3HDZPNPx1kG76FIY/eH1ZH3tYM/DazDuEwUA7deVfJvi7ii +jiyVsRp73I5pEAt6lrhmMM5zF6PwgFoLOiT7rjk7P2JSXIAHndV9opBtNSDDNV8 wAbMW7BWMPQZK6yEArmo8FMqSp0R8UMZbr3yMUWOOwfb9eF4kmnR8nJ8M2O0wk/m xo4qZHTvT1mXpJkJQ4yTGRMjd6NiNE6RMMGxLkar2mgP2nKe60e7EyZOVtElcnsW p3l6FgRNVvvXGHyrszSFWNzIGVE6ObZ0dIyYKLU9g1MG+E/ssPTQUQi7wWGFfFok BtsNtXZ4CrC+J+pNoIwD+rl3dSjOPg== =iEvj -----END PGP SIGNATURE----- --4izklbuzoc3hgjg7--