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: <20120907171845.GL8285@erda.amd.com>
Date:	Fri, 7 Sep 2012 19:18:45 +0200
From:	Robert Richter <robert.richter@....com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Ingo Molnar <mingo@...nel.org>, David Ahern <dsahern@...il.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf, ibs: Check syscall attribute flags

On 07.09.12 18:56:27, Peter Zijlstra wrote:

> > +               .exclude_user   = 1,
> > +               .exclude_kernel = 1,
> > +               .exclude_hv     = 1,
> > +               .exclude_idle   = 1,
> > +               .exclude_host   = 1,
> > +               .exclude_guest  = 1,
> 
> Ideally we'd grow support for those using SVM entry/exit hooks though.

Yes, I will look at this too. This patch is inteded for stable and
urgent.

> > +#define perf_flags(attr)       (*(&(attr)->read_format + 1))
> 
> 
> Another anonymous union shouldn't hurt..
> 
> ---
>  include/linux/perf_event.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index cc5e2cd..5df37a0 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -236,7 +236,9 @@ struct perf_event_attr {
>  	__u64			sample_type;
>  	__u64			read_format;
>  
> -	__u64			disabled       :  1, /* off by default        */
> +	union {
> +		__u64		flags;
> +		__u64		disabled       :  1, /* off by default        */
>  				inherit	       :  1, /* children inherit it   */
>  				pinned	       :  1, /* must always be on PMU */
>  				exclusive      :  1, /* only group on PMU     */
> @@ -272,6 +274,7 @@ struct perf_event_attr {
>  				exclude_callchain_user   : 1, /* exclude user callchains */
>  
>  				__reserved_1   : 41;
> +	};
>  
>  	union {
>  		__u32		wakeup_events;	  /* wakeup every n events */

I was thinking of this too. But this breaks existing code to compile
since static initialization of struct perf_event_attr fails, e.g.:

 builtin-test.c:469:3: error: unknown field ‘watermark’ specified in initializer

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ