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]
Date:	Tue, 24 Mar 2015 20:34:22 +0100
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Andy Lutomirski <luto@...capital.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>, Oleg Nesterov <oleg@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Will Drewry <wad@...omium.org>,
	Kees Cook <keescook@...omium.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/asm/entry/64: Merge the field offset into the THREAD_INFO()
 macro

On 03/24/2015 08:29 PM, Ingo Molnar wrote:
>>> Before:
>>>
>>>    TI_sysenter_return+THREAD_INFO(%rsp,3*8),%r10d
>>>
>>> After:
>>>
>>>    movl    THREAD_INFO(TI_sysenter_return, %rsp, 3*8), %r10d
>>>
>>> to turn it into a clear thread_info accessor.
>>
>> Good idea, I also wanted to do this.
>> I propose a more C-like order of arguments instead.
>> In C, field names are on the right: obj.field, ptr->field.
>>
>>     THREAD_INFO(%rsp, 3*8, TI_field_name)
>>
>> would suggest to the reader a pseudo-C construct:
>>
>>     THREAD_INFO(sp, offset)->field_name
> 
> So I picked that order, because the C code we want to emulate here 
> visually is:
> 
> 	thread_info->field_name
> 
> and visually this order represents just that:
> 
> 	THREAD_INFO(TI_field_name, ...)
> 
> " ,%reg, offset" in that sense is just a 'detail' to how to access 
> thread_info.
> 
> That order also resembles the assembly format more, which is usually 
> in field(reg) order, i.e.:
> 
> 	THREAD_INFO(field, %reg, ...)
> 
> Hm?

Okay.

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