public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	mingo@redhat.com, linux-kernel@vger.kernel.org,
	jeremy.fitzhardinge@citrix.com, stable@kernel.org,
	tglx@linutronix.de, mingo@elte.hu,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/asm] x86/i386: Make sure stack-protector segment base is cache aligned
Date: Fri, 04 Sep 2009 11:51:12 +0900	[thread overview]
Message-ID: <4AA080A0.7010804@kernel.org> (raw)
In-Reply-To: <4AA031DE.2070109@zytor.com>

Hello,

H. Peter Anvin wrote:
> On 09/03/2009 01:45 PM, Jeremy Fitzhardinge wrote:
>> 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).
> 
> Well, by touching two segments we're getting the worst of both worlds,
> so at least assuming some significant number of real-world deployments
> use CC_STACKPROTECTOR, we really don't want to pessimize that case too much.

Yes, this one definitely seems doable.  BTW, how much performance does
CC_STACKPROTECTOR cost?  That's an ambiguous question but really any
number would help to develop a general sense.  Considering fedora is
doing it by default, I assume it isn't too high?

>>     * 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.
> 
> OK, I was under the impression that that had already been done (and no,
> I didn't bother to look at the code.)  I guess I was wrong (and yes,
> this is an absolute precondition.)

I tried this a while ago but hit an obstacle which I don't remember
what exactly was now and decided the conversion wasn't worth the
trouble.  IIRC, it was something substantial.  I'll dig through my
trees.

Thanks.

-- 
tejun

  parent reply	other threads:[~2009-09-04  2:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 19:27 [PATCH] x86/i386: make sure stack-protector segment base is cache aligned Jeremy Fitzhardinge
2009-09-03 19:47 ` Eric Dumazet
2009-09-03 20:41   ` Jeremy Fitzhardinge
2009-09-03 21:07     ` Eric Dumazet
2009-09-03 21:31       ` Jeremy Fitzhardinge
2009-09-04  7:58         ` [tip:x86/asm] x86/i386: Put aligned stack-canary in percpu shared_aligned section tip-bot for Jeremy Fitzhardinge
2009-09-03 20:03 ` [tip:x86/asm] x86/i386: Make sure stack-protector segment base is cache aligned tip-bot for Jeremy Fitzhardinge
2009-09-03 20:26   ` H. Peter Anvin
2009-09-03 20:45     ` Jeremy Fitzhardinge
2009-09-03 21:15       ` H. Peter Anvin
2009-09-03 21:18         ` Ingo Molnar
2009-09-03 21:21           ` H. Peter Anvin
2009-09-04 14:15           ` Arjan van de Ven
2009-09-04 15:59             ` Jeremy Fitzhardinge
2009-09-04 16:06             ` H. Peter Anvin
2009-09-03 21:28         ` Jeremy Fitzhardinge
2009-09-04  2:51         ` Tejun Heo [this message]
2009-09-04  2:59           ` Tejun Heo
2009-09-04  3:35             ` H. Peter Anvin
2009-09-04  3:47               ` Tejun Heo
2009-09-04  3:51                 ` H. Peter Anvin
2009-09-04  5:06                   ` Tejun Heo
2009-09-04  5:12                     ` Ingo Molnar
2009-09-04 16:04                     ` Jeremy Fitzhardinge
2009-09-04 16:09                       ` Tejun Heo
2009-09-04 16:13                       ` H. Peter Anvin
2009-09-04 16:01               ` Jeremy Fitzhardinge
2009-09-04 16:52                 ` H. Peter Anvin
2009-09-04 16:57                   ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA080A0.7010804@kernel.org \
    --to=tj@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox