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]
Date:   Wed, 31 Jul 2019 18:50:14 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc:     Arnaldo Carvalho de Melo <acme@...hat.com>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
        kan.liang@...ux.intel.com
Subject: Re: [PATCH v3 2/7] perf/x86/intel: Support PEBS output to PT

On Wed, Jul 31, 2019 at 05:30:36PM +0300, Alexander Shishkin wrote:
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index cfe256ca76df..6cf2a7ba822a 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1006,6 +1006,28 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
>  	/* current number of events already accepted */
>  	n = cpuc->n_events;
>  
> +	if (!cpuc->is_fake && leader->attr.precise_ip) {
> +		if (!n)
> +			cpuc->pebs_output = 0;

I think this can go wobbly if we add a !pebs event first.

That is, in that case '!n && !precise_ip' and we'll not reset the output
state.

> +
> +		/*
> +		 * For PEBS->PT, if !aux_event, the group leader (PT) went
> +		 * away, the group was broken down and this singleton event
> +		 * can't schedule any more.
> +		 */
> +		if (WARN_ON_ONCE(is_pebs_pt(leader) && !leader->aux_event))
> +			return -EINVAL;
> +
> +		/*
> +		 * pebs_output: 0: no PEBS so far, 1: PT, 2: DS
> +		 */
> +		if (cpuc->pebs_output &&
> +		    cpuc->pebs_output != is_pebs_pt(leader) + 1)
> +			return -EINVAL;
> +
> +		cpuc->pebs_output = is_pebs_pt(leader) + 1;
> +	}
> +
>  	if (is_x86_event(leader)) {
>  		if (n >= max_count)
>  			return -EINVAL;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ