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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Mar 2009 10:42:46 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Paul Mackerras <paulus@...ba.org>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perfcounters: fix type/event_id layout on big-endian
	systems


* Paul Mackerras <paulus@...ba.org> wrote:

>  struct perf_counter_hw_event {
>  	union {
> +#ifndef __BIG_ENDIAN_BITFIELD
>  		struct {
>  			__u64			event_id	: 56,
>  						type		:  8;
> @@ -94,6 +96,16 @@ struct perf_counter_hw_event {
>  			__u64			raw_event_id	: 63,
>  						raw_type	:  1;
>  		};
> +#else
> +		struct {
> +			__u64			type		:  8,
> +						event_id	: 56;
> +		};
> +		struct {
> +			__u64			raw_type	:  1,
> +						raw_event_id	: 63;
> +		};
> +#endif /* __BIT_ENDIAN_BITFIELD */

hm, this ifdef really looks ugly. How about just changing event_id 
to 64 bits and having a separate u32 type field? The size impact is 
minimal, the cleanliness win is significant :-)

	Ingo
--
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