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: <20241116101150.GO22801@noisy.programming.kicks-ass.net>
Date: Sat, 16 Nov 2024 11:11:50 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ragavendra <ragavendra.bn@...il.com>
Cc: mingo@...hat.com, acme@...nel.org, namhyung@...nel.org,
	mark.rutland@....com, alexander.shishkin@...ux.intel.com,
	jolsa@...nel.org, irogers@...gle.com, adrian.hunter@...el.com,
	kan.liang@...ux.intel.com, tglx@...utronix.de, bp@...en8.de,
	dave.hansen@...ux.intel.com, hpa@...or.com, x86@...nel.org,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/x86/intel: Cast u64 variable

On Fri, Nov 15, 2024 at 02:58:30PM -0800, Ragavendra wrote:
> Casting (1 >> bit) to u64 before it is compared with pebs_status variable.

I don't think this does what you want it to.

> Fixes: 21509084f999 perf/x86/intel: Handle multiple records in the PEBS buffer
> Signed-off-by: Ragavendra Nagraj <ragavendra.bn@...il.com>
> ---
>  arch/x86/events/intel/ds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index fa5ea65de0d0..9ea147565dc2 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -2072,7 +2072,7 @@ get_next_pebs_record_by_bit(void *base, void *top, int bit)
>  			/* clear non-PEBS bit and re-check */
>  			pebs_status = status & cpuc->pebs_enabled;
>  			pebs_status &= PEBS_COUNTER_MASK;
> -			if (pebs_status == (1 << bit))
> +			if (pebs_status == (u64) (1 << bit))
>  				return at;
>  		}
>  	}
> -- 
> 2.46.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ