[lkml]   [2018]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 03/35] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler
On Wed, Apr 18, 2018 at 5:38 PM, Andi Kleen <> wrote:
> On Wed, Apr 18, 2018 at 05:02:02PM -0700, Linus Torvalds wrote:
>> On Wed, Apr 18, 2018 at 4:26 PM, Andi Kleen <> wrote:
>> >
>> > Seems like a hack. Why can't that be stored in a per cpu variable?
>> It *is* a percpu variable - the whole x86_tss structure is percpu.
>> I guess it could be a different (separate) percpu variable, but might
>> as well use the space we already have allocated.
> Would be better/cleaner to use a separate variable instead of reusing
> x86 structures like this. Who knows what subtle side effects that
> may have eventually.

This variable is extremely hot, and it’s used under the same
circumstances as sp0, so sharing a cache line makes sense. And x86_64
works this way.

> It will be also easier to understand in the code.

I suppose it could go right before the TSS, but then we have potential
alignment issues. We could also muck with unions to give the field an
alternative, clearer name, I suppose. But this patch should go in
regardless and any cleanups should be done on x86_32 and x86_64
simultaneously, I think.

 \ /
  Last update: 2018-04-19 02:46    [W:0.091 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site