lkml.org 
[lkml]   [2008]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 00/15] x86_64: Optimize percpu accesses
Eric W. Biederman wrote:
> I just took a quick look at how stack_protector works on x86_64. Unless there is
> some deep kernel magic that changes the segment register to %gs from the ABI specified
> %fs CC_STACKPROTECTOR is totally broken on x86_64. We access our pda through %gs.
>

-mcmodel=kernel switches it to using %gs.

> Further -fstack-protector-all only seems to detect against buffer overflows and
> thus corruption of the stack. Not stack overflows. So it doesn't appear especially
> useful.
>

It's a bit useful. But at the cost of preventing a pile of more useful
unification work, not to mention making all access to per-cpu variables
more expensive.

> So we don't we kill the broken CONFIG_CC_STACKPROTECTOR. Stop trying to figure out
> how to use a zero based percpu area.
>

Yes, please.

> That should allow us to make the current pda a per cpu variable, and use %gs with
> a large offset to access the per cpu area. And since it is only the per cpu accesses
> and the pda accesses that will change we should not need to fight toolchain issues
> and other weirdness. The linked binary can remain the same.
>

Yes, and it would be functionally identical to the 32-bit code.

J


\
 
 \ /
  Last update: 2008-07-09 22:09    [W:0.311 / U:0.380 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site