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: <dbdc2f6947cfffe0a3dc9a599bb48f31f9e25abd.camel@intel.com>
Date: Fri, 12 Jul 2024 03:29:22 +0000
From: "Zhang, Rui" <rui.zhang@...el.com>
To: "alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "Hunter, Adrian"
	<adrian.hunter@...el.com>, "mingo@...hat.com" <mingo@...hat.com>,
	"irogers@...gle.com" <irogers@...gle.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "gustavoars@...nel.org" <gustavoars@...nel.org>,
	"kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>, "kees@...nel.org"
	<kees@...nel.org>, "mark.rutland@....com" <mark.rutland@....com>,
	"peterz@...radead.org" <peterz@...radead.org>, "Dhananjay.Ugwekar@....com"
	<Dhananjay.Ugwekar@....com>, "bp@...en8.de" <bp@...en8.de>, "acme@...nel.org"
	<acme@...nel.org>, "oleksandr@...alenko.name" <oleksandr@...alenko.name>,
	"jolsa@...nel.org" <jolsa@...nel.org>, "x86@...nel.org" <x86@...nel.org>,
	"namhyung@...nel.org" <namhyung@...nel.org>
CC: "ravi.bangoria@....com" <ravi.bangoria@....com>, "kprateek.nayak@....com"
	<kprateek.nayak@....com>, "gautham.shenoy@....com" <gautham.shenoy@....com>,
	"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>,
	"sandipan.das@....com" <sandipan.das@....com>, "ananth.narayan@....com"
	<ananth.narayan@....com>, "linux-pm@...r.kernel.org"
	<linux-pm@...r.kernel.org>
Subject: Re: [PATCH v4 09/11] perf/x86/rapl: Remove the global variable
 rapl_msrs

On Thu, 2024-07-11 at 10:24 +0000, Dhananjay Ugwekar wrote:
> After making the rapl_model struct global, the rapl_msrs global
> variable isn't needed, so remove it.
> 
> Also it will be cleaner when new per-core scope PMU is added. As we
> will
> need to maintain two rapl_msrs array(one for per-core scope and one
> for
> package scope PMU), inside the rapl_model struct.
> 
> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@....com>

Reviewed-by: Zhang Rui <rui.zhang@...el.com>

-rui

> ---
>  arch/x86/events/rapl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c
> index 9beded3d4a14..7691497042e9 100644
> --- a/arch/x86/events/rapl.c
> +++ b/arch/x86/events/rapl.c
> @@ -145,7 +145,6 @@ static int rapl_pkg_hw_unit[NR_RAPL_PKG_DOMAINS]
> __read_mostly;
>  static struct rapl_pmus *rapl_pmus_pkg;
>  static unsigned int rapl_pkg_cntr_mask;
>  static u64 rapl_timer_ms;
> -static struct perf_msr *rapl_msrs;
>  static struct rapl_model *rapl_model;
>  
>  /*
> @@ -387,7 +386,7 @@ static int rapl_pmu_event_init(struct perf_event
> *event)
>                 return -EINVAL;
>         event->cpu = rapl_pmu->cpu;
>         event->pmu_private = rapl_pmu;
> -       event->hw.event_base = rapl_msrs[bit].msr;
> +       event->hw.event_base = rapl_model->rapl_msrs[bit].msr;
>         event->hw.config = cfg;
>         event->hw.idx = bit;
>  
> @@ -875,9 +874,7 @@ static int __init rapl_pmu_init(void)
>  
>         rapl_model = (struct rapl_model *) id->driver_data;
>  
> -       rapl_msrs = rapl_model->rapl_pkg_msrs;
> -
> -       rapl_pkg_cntr_mask = perf_msr_probe(rapl_msrs,
> PERF_RAPL_PKG_EVENTS_MAX,
> +       rapl_pkg_cntr_mask = perf_msr_probe(rapl_model->rapl_msrs,
> PERF_RAPL_PKG_EVENTS_MAX,
>                                         false, (void *) &rapl_model-
> >pkg_events);
>  
>         ret = rapl_check_hw_unit();

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ