lkml.org 
[lkml]   [2009]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/asm] x86/i386: Make sure stack-protector segment base is cache aligned
On 09/03/09 13:26, H. Peter Anvin wrote:
> With the new zero-based percpu segment, it seems we should be able to
> subsume the stack protector into the percpu segment and reference both
> via %gs -- we just have to reserve the first 24 bytes of the segment,
> and being able to reduce the number of segments we need in the kernel is
> good for multiple reasons.
>
> Tejun - am I missing something why that would be hard or impossible?
>

Two problems:

* gcc generates %gs: references for stack-protector, but we use %fs
for percpu data (because restoring %fs is faster if it's a null
selector; TLS uses %gs). I guess we could use %fs if
!CONFIG_CC_STACKPROTECTOR, or %gs if we are using it (though that
has some fiddly ramifications for things like ptrace).
* The i386 percpu %fs base is offset by -__per_cpu_start from the
percpu variables, so we can directly refer to %fs:per_cpu__foo.
I'm not sure what it would take to unify i386 to use the same
scheme as x86-64.

Neither looks insoluble.

J


\
 
 \ /
  Last update: 2009-09-03 22:49    [W:0.068 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site