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:   Thu, 20 Apr 2017 08:16:17 +1000
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        benh@...nel.crashing.org, paulus@...ba.org,
        sukadev@...ux.vnet.ibm.com, andrew.donnellan@....ibm.com,
        mingo@...hat.com, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, wangnan0@...wei.com,
        ast@...nel.org, eranian@...gle.com
Subject: Re: [PATCH v3 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

Madhavan Srinivasan <maddy@...ux.vnet.ibm.com> writes:
> On Wednesday 19 April 2017 10:20 AM, Michael Ellerman wrote:
>> It also occurred to me that we don't actually have to redefine the whole
>> union, it's only the bitfields that matter, so we could reduce the diff
>> to:
>>
>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>> index c66a485a24ac..97152c79df6b 100644
>> --- a/include/uapi/linux/perf_event.h
>> +++ b/include/uapi/linux/perf_event.h
>> @@ -894,12 +894,23 @@ enum perf_callchain_context {
>>   union perf_mem_data_src {
>>   	__u64 val;
>>   	struct {
>> +#if defined(__LITTLE_ENDIAN_BITFIELD)
>>   		__u64   mem_op:5,	/* type of opcode */
>>   			mem_lvl:14,	/* memory hierarchy level */
>>   			mem_snoop:5,	/* snoop mode */
>>   			mem_lock:2,	/* lock instr */
>>   			mem_dtlb:7,	/* tlb access */
>>   			mem_rsvd:31;
>> +#elif defined(__BIG_ENDIAN_BITFIELD)
>> +		__u64	mem_rsvd:31,
>> +			mem_dtlb:7,	/* tlb access */
>> +			mem_lock:2,	/* lock instr */
>> +			mem_snoop:5,	/* snoop mode */
>> +			mem_lvl:14,	/* memory hierarchy level */
>> +			mem_op:5;	/* type of opcode */
>> +#else
>> +#error "Unknown endianness"
>> +#endif
>>   	};
>>   };
>>
>>
>> That looks better to me, thoughts?
>
> Yep.  Looks fine to me and also tested the same.

I merged the original version, as that's what Peterz acked and I didn't
want to block the series any longer.

I'll send an incremental patch to do the cleanup.

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ