mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@quark.didntduck.org>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] explicity align tss->stack
Date: Sat, 04 Sep 2004 09:45:06 -0400	[thread overview]
Message-ID: <4139C6E2.1050000@quark.didntduck.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

Use an alignment attribute on the stack member of struct tss_struct 
instead of padding.  Also mark the limit of the TSS segment.

--
				Brian Gerst

[-- Attachment #2: tss-stack-align --]
[-- Type: text/plain, Size: 1323 bytes --]

diff -urN linux-2.6.9-rc1-bk/include/asm-i386/desc.h linux/include/asm-i386/desc.h
--- linux-2.6.9-rc1-bk/include/asm-i386/desc.h	2004-08-25 11:52:00.000000000 -0400
+++ linux/include/asm-i386/desc.h	2004-09-04 09:20:29.216440282 -0400
@@ -47,7 +47,7 @@
 static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
 {
 	_set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[entry], (int)addr,
-		offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89);
+		offsetof(struct tss_struct, tss_limit) - 1, 0x89);
 }
 
 #define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
diff -urN linux-2.6.9-rc1-bk/include/asm-i386/processor.h linux/include/asm-i386/processor.h
--- linux-2.6.9-rc1-bk/include/asm-i386/processor.h	2004-09-03 02:13:03.000000000 -0400
+++ linux/include/asm-i386/processor.h	2004-09-04 09:20:40.573961012 -0400
@@ -391,14 +391,11 @@
 	 * be within the limit.
 	 */
 	unsigned long	io_bitmap[IO_BITMAP_LONGS + 1];
-	/*
-	 * pads the TSS to be cacheline-aligned (size is 0x100)
-	 */
-	unsigned long __cacheline_filler[37];
+	unsigned long	tss_limit[0];
 	/*
 	 * .. and then another 0x100 bytes for emergency kernel stack
 	 */
-	unsigned long stack[64];
+	unsigned long	stack[64] __attribute__((aligned(0x100)));
 } __attribute__((packed));
 
 #define ARCH_MIN_TASKALIGN	16

             reply	other threads:[~2004-09-04 13:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-04 13:45 Brian Gerst [this message]
2004-09-05 21:41 ` Andrew Morton
2004-09-06 14:33   ` Brian Gerst

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=4139C6E2.1050000@quark.didntduck.org \
    --to=bgerst@quark.didntduck.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.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

Powered by JetHome