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: <ZwYjlm-lzDd4XG3U@google.com>
Date: Tue, 8 Oct 2024 23:32:54 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ravi Bangoria <ravi.bangoria@....com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
	eranian@...gle.com, 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, x86@...nel.org, hpa@...or.com,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	santosh.shukla@....com, ananth.narayan@....com,
	sandipan.das@....com
Subject: Re: [PATCH 6/8] perf/amd/ibs: Add pmu specific minimum period

On Tue, Oct 08, 2024 at 11:16:43AM +0530, Ravi Bangoria wrote:
> >> @@ -295,10 +296,14 @@ static int perf_ibs_init(struct perf_event *event)
> >>  			/* raw max_cnt may not be set */
> >>  			return -EINVAL;
> >>  
> >> -		/* Silently mask off lower nibble. IBS hw mandates it. */
> >> -		hwc->sample_period &= ~0x0FULL;
> >> -		if (!hwc->sample_period)
> >> -			hwc->sample_period = 0x10;
> >> +		if (event->attr.freq) {
> >> +			hwc->sample_period = perf_ibs->min_period;
> >> +		} else {
> >> +			/* Silently mask off lower nibble. IBS hw mandates it. */
> >> +			hwc->sample_period &= ~0x0FULL;
> >> +			if (hwc->sample_period < perf_ibs->min_period)
> >> +				return -EINVAL;
> > 
> > Maybe it needs to check perf_ibs->max_period as well.
> 
> We do allow event with sample_period > pmu->max_period and handle it with
> "period_left" logic.

Oh, ok then.

Thanks,
Namhyung


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ