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: <Z_ZcjvdC0W3Kq2kq@gmail.com>
Date: Wed, 9 Apr 2025 13:39:58 +0200
From: Ingo Molnar <mingo@...nel.org>
To: mark.barnett@....com
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
	namhyung@...nel.org, irogers@...gle.com, ben.gainey@....com,
	deepak.surti@....com, ak@...ux.intel.com, will@...nel.org,
	james.clark@....com, mark.rutland@....com,
	alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
	adrian.hunter@...el.com, linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v4 1/5] perf: Record sample last_period before updating


* mark.barnett@....com <mark.barnett@....com> wrote:

> From: Mark Barnett <mark.barnett@....com>
> 
> This change alters the PowerPC and x86 driver implementations to record
> the last sample period before the event is updated for the next period.
> 
> A common pattern in PMU driver implementations is to have a
> "*_event_set_period" function which takes care of updating the various
> period-related fields in a perf_event structure. In most cases, the
> drivers choose to call this function after initializing a sample data
> structure with perf_sample_data_init. The x86 and PowerPC drivers
> deviate from this, choosing to update the period before initializing the
> sample data. When using an event with an alternate sample period, this
> causes an incorrect period to be written to the sample data that gets
> reported to userspace.
> 
> Link: https://lore.kernel.org/r/20240515193610.2350456-4-yabinc@google.com
> Signed-off-by: Mark Barnett <mark.barnett@....com>
> ---
>  arch/powerpc/perf/core-book3s.c  | 3 ++-
>  arch/powerpc/perf/core-fsl-emb.c | 3 ++-
>  arch/x86/events/core.c           | 4 +++-
>  arch/x86/events/intel/core.c     | 5 ++++-
>  arch/x86/events/intel/knc.c      | 4 +++-
>  5 files changed, 14 insertions(+), 5 deletions(-)

I've picked up this patch into tip:perf/core, because I think it makes 
sense standalone as well.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ