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: <20130912122534.GA18794@gmail.com>
Date:	Thu, 12 Sep 2013 14:25:34 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andi Kleen <ak@...ux.intel.com>, Peter Anvin <hpa@...or.com>,
	Mike Galbraith <bitbucket@...ine.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Arjan van de Ven <arjan@...ux.intel.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 0/7] preempt_count rework -v2


* Peter Zijlstra <peterz@...radead.org> wrote:

> So the increase is there too, doing a objdump -D on them the first 
> difference is:
> 
> 0000000000000660 <do_page_add_anon_rmap>:
>      660:	55                   	push   %rbp
>      661:	48 89 e5             	mov    %rsp,%rbp
>      664:	48 83 ec 20          	sub    $0x20,%rsp
>      668:	48 89 5d f0          	mov    %rbx,-0x10(%rbp)
>      66c:	4c 89 65 f8          	mov    %r12,-0x8(%rbp)
>      670:	48 89 fb             	mov    %rdi,%rbx
>      673:	f0 ff 47 18          	lock incl 0x18(%rdi)
>      677:	0f 94 c0             	sete   %al
>      67a:	84 c0                	test   %al,%al
>      67c:	75 12                	jne    690 <do_page_add_anon_rmap+0x30>
>      67e:	48 8b 5d f0          	mov    -0x10(%rbp),%rbx
>      682:	4c 8b 65 f8          	mov    -0x8(%rbp),%r12
>      686:	c9                   	leaveq 
> 
> vs.:
> 
> 0000000000000660 <do_page_add_anon_rmap>:
>      660:	55                   	push   %rbp
>      661:	48 89 e5             	mov    %rsp,%rbp
>      664:	48 83 ec 20          	sub    $0x20,%rsp
>      668:	48 89 5d e0          	mov    %rbx,-0x20(%rbp)
>      66c:	4c 89 65 e8          	mov    %r12,-0x18(%rbp)
>      670:	48 89 fb             	mov    %rdi,%rbx
>      673:	4c 89 6d f0          	mov    %r13,-0x10(%rbp)
>      677:	4c 89 75 f8          	mov    %r14,-0x8(%rbp)
>      67b:	f0 ff 47 18          	lock incl 0x18(%rdi)
>      67f:	74 17                	je     698 <do_page_add_anon_rmap+0x38>
>      681:	48 8b 5d e0          	mov    -0x20(%rbp),%rbx
>      685:	4c 8b 65 e8          	mov    -0x18(%rbp),%r12
>      689:	4c 8b 6d f0          	mov    -0x10(%rbp),%r13
>      68d:	4c 8b 75 f8          	mov    -0x8(%rbp),%r14
>      691:	c9                   	leaveq 
> 
> For some obscure (to me) reason the new fangled asm goto construct 
> generates a bunch of extra MOVs.

It adds two pairs of MOVs that shows that R13 and R14 got clobbered, but 
the change also got rid of of a SETE and a TEST here:

>      673:	f0 ff 47 18          	lock incl 0x18(%rdi)
>      677:	0f 94 c0             	sete   %al
>      67a:	84 c0                	test   %al,%al
>      67c:	75 12                	jne    690 <do_page_add_anon_rmap+0x30>

so there's a slight increase in size, but the extra instructions look 
rather lightweight and it could all go away if asm goto is improved ...

It would all be very sweet if all those clobbers went away.

Thanks,

	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