mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: lkml <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: x86_64: tss_struct layout does not match comments  !?
Date: Thu, 3 Jul 2008 13:39:25 +0200	[thread overview]
Message-ID: <20080703113925.GA5594@elte.hu> (raw)
In-Reply-To: <1215082049.3026.15.camel@castor.localdomain>


* Richard Kennedy <richard@rsk.demon.co.uk> wrote:

> Hi Ingo,
> 
> the comments in the definition of tss_struct suggests is should be
> cacheline aligned ( or 256 byte aligned ? ) :- 
> 
> |struct tss_struct {
> |....
> |	/*
> |	 * Pad the TSS to be cacheline-aligned (size is 0x100):
> |	 */
> |	unsigned long		__cacheline_filler[35];
> |	/*
> |	 * .. and then another 0x100 bytes for the emergency kernel stack:
> |	 */
> |	unsigned long		stack[64];
> |
> |} __attribute__((packed));
> 
> However on a 64 bit build the size of tss_struct is 9136,
> cacheline_filler is 280 and stack size is 512 at offset 8624.
> None of which are cacheline aligned.
> 
> I'm guessing this isn't what was intended.
> 
> do you know what the original intention was ?
> 
> 1. struct tss_struct{...} __cacheline_aligned;
> or just
> 2. struct tss_struct {
> ...
> long stack[64] __cacheline_aligned;
> }

#1 is the intent - because each CPU has a separate TSS. init_tss.stack 
is really just an emergency static stack we have in place for very early 
exceptions.

i think the __cacheline_filler could be removed safely. Mind sending a 
patch for that?

	Ingo

  reply	other threads:[~2008-07-03 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03 10:47 Richard Kennedy
2008-07-03 11:39 ` Ingo Molnar [this message]
2008-07-03 11:57   ` Richard Kennedy
2008-07-04 12:56   ` [PATCH] x86: cacheline_align tss_struct Richard Kennedy
2008-07-04 14:48     ` Ingo Molnar

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=20080703113925.GA5594@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@rsk.demon.co.uk \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®