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:	Tue, 25 Feb 2014 19:03:37 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Andy Lutomirski <luto@...capital.net>, behanw@...verseincode.com,
	tglx@...utronix.de, mingo@...hat.com, x86@...nel.org,
	peterz@...radead.org, ak@...ux.intel.com, oleg@...hat.com
CC:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: LLVMLinux: Reimplement current_stack_pointer without
 register usage.

On 02/25/2014 07:00 PM, Andy Lutomirski wrote:
>>
>> How much does this actually affect the output?  I only see three uses of
>> current_stack_pointer:
>>
>> /* how to get the thread information struct from C */
>> static inline struct thread_info *current_thread_info(void)
>> {
>>         return (struct thread_info *)
>>                 (current_stack_pointer & ~(THREAD_SIZE - 1));
>> }
>>
>> ... here we need the mov anyway, because we have to then AND it with a
>> mask, which we obviously can't do inside the stack pointer.
> 
> No clue what code is actually generated, but the new code could generate:
> 
> mov $MASK, %rax;
> and %esp, %rax;
> 
> Admittedly, I can't see any reason why this would be an improvement.
> 

You have to generate one of the code sequences:

	mov $MASK, %eax
	and %esp, %eax

... or ...

	mov %esp, %eax
	and $MASK, %eax

No real difference either way.

	-hpa


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