Skip to contentSkip to conversation

explicity align tss->stack

PATCH In review Brian Gerst 2 participants 3 messages Sep 4, 2004 – Sep 6, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 explicity align tss->stack

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

include/asm-i386/desc.h +1 -1
diff -urN linux-2.6.9-rc1-bk/include/asm-i386/desc.h linux/include/asm-i386/desc.h
@@ -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)
include/asm-i386/processor.h +2 -5
diff -urN linux-2.6.9-rc1-bk/include/asm-i386/processor.h linux/include/asm-i386/processor.h
@@ -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
#1 lore raw
Quoted 3 lines · Brian Gerst

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

The TSS code got a significant working-over recently. Please take a look at next -mm, see if this patch is still appropriate?

#2 lore raw
Quoted 8 lines · Andrew Morton
Quoted 1 line · Brian Gerst

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

The TSS code got a significant working-over recently. Please take a look at next -mm, see if this patch is still appropriate?

There are no conflicts in -mm3.

--
Brian Gerst