Re: [RFC 00/15] x86_64: Optimize percpu accesses
From: Arjan van de Ven
Date: Wed Jul 09 2008 - 17:11:36 EST
On Wed, 09 Jul 2008 13:22:06 -0700
ebiederm@xxxxxxxxxxxx (Eric W. Biederman) wrote:
> Jeremy Fitzhardinge <jeremy@xxxxxxxx> writes:
>
> > It's just the stack canary. It isn't library accesses; it's the
> > code gcc generates:
> >
> > foo: subq $152, %rsp
> > movq %gs:40, %rax
> > movq %rax, 136(%rsp)
> > ...
> > movq 136(%rsp), %rdx
> > xorq %gs:40, %rdx
> > je .L3
> > call __stack_chk_fail
> > .L3:
> > addq $152, %rsp
> > .p2align 4,,4
> > ret
> >
> >
> > There are two irritating things here:
> >
> > One is that the kernel supports -fstack-protector for x86-64, which
> > forces us into all these contortions in the first place. We don't
> > support stack-protector for 32-bit (gcc does), and things are much
> > easier.
>
> How does gcc know to use %gs instead of the usual %fs for accessing
> the stack protector variable? My older gcc-4.1.x on ubuntu always
> uses %fs.
ubuntu broke gcc (they don't want to have compiler flags per package so
patches stuff in gcc instead).
> I think the unification is valid and useful, and that trying to keep
> that stupid stack canary working is currently more trouble then it is
> worth.
I think that "unification over everything" is stupid, especially if it
removes useful features.
--
If you want to reach me at my work email, use arjan@xxxxxxxxxxxxxxx
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/