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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250616130736.GA788469@e132581.arm.com>
Date: Mon, 16 Jun 2025 14:07:36 +0100
From: Leo Yan <leo.yan@....com>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com>
Cc: James Clark <james.clark@...aro.org>,
	yangyicong <yangyicong@...wei.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
	Ali Saidi <alisaidi@...zon.com>, Leo Yan <leo.yan@...aro.org>,
	Will Deacon <will@...nel.org>, James Morse <james.morse@....com>,
	Catalin Marinas <catalin.marinas@....com>,
	yangjinqian <yangjinqian1@...wei.com>,
	Douglas Anderson <dianders@...omium.org>,
	Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Ian Rogers <irogers@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
	Kan Liang <kan.liang@...ux.intel.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: perf usage of arch/arm64/include/asm/cputype.h

On Mon, Jun 16, 2025 at 09:54:43AM +0000, Shameerali Kolothum Thodi wrote:

[...]

> > > -bool is_midr_in_range_list(struct midr_range const *ranges) -{
> > > -	while (ranges->model)
> > > -		if (is_midr_in_range(ranges++))
> > > -			return true;
> > >   	return false;
> > >   }

> > Looks ok to me.
> > 
> > You could do it with slightly less churn on the kernel side if you keep the
> > function name and arguments the same there. There's only one usage in
> > Perf so that one could be renamed and have the midr argument added back
> > in.
> 
> +1.
> 
> Can we use a separate one for perf here, something like below(untested)?

Thanks for working on this. Agreed.

> --- a/tools/perf/util/arm-spe.c
> +++ b/tools/perf/util/arm-spe.c
> @@ -842,6 +842,18 @@ static void arm_spe__synth_memory_level(const
> struct arm_spe_record *record,
>                 data_src->mem_lvl |= PERF_MEM_LVL_REM_CCE1;
>  }
> 
> +static bool is_perf_midr_in_range_list(u32 midr, struct midr_range
> const *ranges)
> +{
> +       while (ranges->model) {
> +               if (midr_is_cpu_model_range(midr, ranges->model,
> +                                           ranges->rv_min, ranges->rv_max)) {
> +                       return true;
> +               }
> +               ranges++;
> +       }
> +       return false;
> +}

Maybe we can make it more general. For example, move this function into
a common header such as tools/perf/arch/arm64/include/cputype.h. Then,
util/arm-spe.c can include this header.

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ