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: <48762DD2.5090802@zytor.com>
Date:	Thu, 10 Jul 2008 11:42:10 -0400
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Christoph Lameter <cl@...ux-foundation.org>
CC:	Jeremy Fitzhardinge <jeremy@...p.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Ingo Molnar <mingo@...e.hu>, Mike Travis <travis@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jack Steiner <steiner@....com>, linux-kernel@...r.kernel.org,
	Arjan van de Ven <arjan@...radead.org>
Subject: Re: [RFC 00/15] x86_64: Optimize percpu accesses

Christoph Lameter wrote:
> 
> Well the zero based results in this becoming always
> 
> 	gs_base + absolute address in per cpu segment

You can do either way.  For RIP-based, you have to worry about the 
possible range for the RIP register when referencing.  Currently, even 
for "make allyesconfig" the per cpu segment is a lot smaller than the 
minimum value for CONFIG_PHYSICAL_START (2 MB), so there is no issue, 
but there is a distinct lack of wiggle room, which can be resolved 
either by using negative offsets, or by moving the kernel text area up a 
bit from -2 GB.

> Why are RIP based references cheaper? The offset to the per cpu segment is certainly more than what can be fit into 16 bits.

Where are you getting 16 bits from?!?!  *There are no 16-bit offsets in 
64-bit mode, period, full stop.*

RIP-based references are cheaper because the x86-64 architects chose to 
optimize RIP-based references over absolute references.  Therefore 
RIP-based references are encodable with only a MODR/M byte, whereas 
absolute references require a SIB byte as well -- longer instruction, 
possibly a less optimized path through the CPU, and *definitely* 
something that gets exercised less in the linker.

	-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