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: <20081227110909.GA15377@elte.hu>
Date:	Sat, 27 Dec 2008 12:09:09 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Brian Gerst <brgerst@...il.com>, linux-kernel@...r.kernel.org,
	Christoph Lameter <cl@...ux-foundation.org>,
	Mike Travis <travis@....com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Alexander van Heukelum <heukelum@...lshack.com>
Subject: Re: [PATCH 2/3] x86-64: Unify x86_*_percpu() functions.


* Jeremy Fitzhardinge <jeremy@...p.org> wrote:

> Brian Gerst wrote:
>> Merge the 32-bit and 64-bit versions of these functions.  Unlike 32-bit,
>> the segment base is the current cpu's PDA instead of the offset from the
>> original per-cpu area.  This is because GCC hardcodes the stackprotector
>> canary at %gs:40.  Since the assembler is incapable of relocating against
>> multiple symbols, the code ends up looking like:
>>
>> 	movq $per_cpu__var, reg
>> 	subq $per_cpu__pda, reg
>> 	movq %gs:(reg), reg
>>
>> This is still atomic since the offset is a constant (just calculated at
>> runtime) and not dependant on the cpu number.
>>   
>
> Yeah, it's a real pity we can't convince the linker to do this simple 
> computation as a single %gs:ADDR addressing mode.  On the other hand, if 
> the compiler can reuse the computation of %reg 2-3 times, then the 
> generated code could well end up being denser.

There's a nice project for linker hackers?

I'd like to see some kernel image size measurements done on x86 defconfig 
to see how much real impact this has on code density. Unless the impact is 
horribly unacceptable, removing ~200 lines of weird x86-specific APIs is a 
definitive plus.

	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