lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zggoz46PSlCN5Bt+@dragon>
Date: Sat, 30 Mar 2024 22:59:27 +0800
From: Shawn Guo <shawnguo2@...h.net>
To: Robin Murphy <robin.murphy@....com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Mark Rutland <mark.rutland@....com>, Will Deacon <will@...nel.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	x86@...nel.org, linux-perf-users@...r.kernel.org,
	jialong.yang@...ngroup.cn, Russell King <linux@...linux.org.uk>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>
Subject: Re: [PATCH 10/10] ARM: Use common uncore PMU capabilities

On Tue, Mar 12, 2024 at 05:34:12PM +0000, Robin Murphy wrote:
> Switch the ARM system PMU drivers over to the new common capabilities,
> allowing to remove all the checks that perf core now takes care of.
> 
> CC: Russell King <linux@...linux.org.uk>
> CC: Shawn Guo <shawnguo@...nel.org>
> CC: Sascha Hauer <s.hauer@...gutronix.de>
> Signed-off-by: Robin Murphy <robin.murphy@....com>
> ---
>  arch/arm/mach-imx/mmdc.c     | 16 +---------------

Acked-by: Shawn Guo <shawnguo@...nel.org>

>  arch/arm/mm/cache-l2x0-pmu.c | 12 +-----------
>  2 files changed, 2 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
> index 444a7eaa320c..806ab6675b37 100644
> --- a/arch/arm/mach-imx/mmdc.c
> +++ b/arch/arm/mach-imx/mmdc.c
> @@ -280,20 +280,6 @@ static int mmdc_pmu_event_init(struct perf_event *event)
>  	struct mmdc_pmu *pmu_mmdc = to_mmdc_pmu(event->pmu);
>  	int cfg = event->attr.config;
>  
> -	if (event->attr.type != event->pmu->type)
> -		return -ENOENT;
> -
> -	if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
> -		return -EOPNOTSUPP;
> -
> -	if (event->cpu < 0) {
> -		dev_warn(pmu_mmdc->dev, "Can't provide per-task data!\n");
> -		return -EOPNOTSUPP;
> -	}
> -
> -	if (event->attr.sample_period)
> -		return -EINVAL;
> -
>  	if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS)
>  		return -EINVAL;
>  
> @@ -445,7 +431,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
>  			.start          = mmdc_pmu_event_start,
>  			.stop           = mmdc_pmu_event_stop,
>  			.read           = mmdc_pmu_event_update,
> -			.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
> +			.capabilities	= PERF_PMU_UNCORE_CAPS,
>  		},
>  		.mmdc_base = mmdc_base,
>  		.dev = dev,
> diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c
> index 993fefdc167a..a2567d953fdb 100644
> --- a/arch/arm/mm/cache-l2x0-pmu.c
> +++ b/arch/arm/mm/cache-l2x0-pmu.c
> @@ -295,16 +295,6 @@ static int l2x0_pmu_event_init(struct perf_event *event)
>  {
>  	struct hw_perf_event *hw = &event->hw;
>  
> -	if (event->attr.type != l2x0_pmu->type)
> -		return -ENOENT;
> -
> -	if (is_sampling_event(event) ||
> -	    event->attach_state & PERF_ATTACH_TASK)
> -		return -EINVAL;
> -
> -	if (event->cpu < 0)
> -		return -EINVAL;
> -
>  	if (event->attr.config & ~L2X0_EVENT_CNT_CFG_SRC_MASK)
>  		return -EINVAL;
>  
> @@ -524,7 +514,7 @@ static __init int l2x0_pmu_init(void)
>  		.del = l2x0_pmu_event_del,
>  		.event_init = l2x0_pmu_event_init,
>  		.attr_groups = l2x0_pmu_attr_groups,
> -		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
> +		.capabilities = PERF_PMU_UNCORE_CAPS,
>  	};
>  
>  	l2x0_pmu_reset();
> -- 
> 2.39.2.101.g768bb238c484.dirty
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ