Skip to contentSkip to conversation

sparc: use .data.init_task section for init_thread_union

PATCH Applied Sam Ravnborg 3 participants 7 messages Dec 21, 2008 – Dec 27, 2008 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc: use .data.init_task section for init_thread_union

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

---

Build tested on sparc32 and sparc64 - no boot test!

Sam

 arch/sparc/kernel/init_task.c   |    3 +--
 arch/sparc/kernel/vmlinux.lds.S |    9 +++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
arch/sparc/kernel/init_task.c +1 -2
index 8e64ebc..62126e4 100644
@@ -23,6 +23,5 @@ EXPORT_SYMBOL(init_task);
  * in etrap.S which assumes it.
  */
 union thread_union init_thread_union
-	__attribute__((section (".text\"\n\t#")))
-	__attribute__((aligned (THREAD_SIZE)))
+	__attribute__((section (".data.init_task")))
 	= { INIT_THREAD_INFO(init_task) };
arch/sparc/kernel/vmlinux.lds.S +9 -0
index 4bfbeff..59c8d09 100644
@@ -1,7 +1,9 @@
 /* ld script for sparc32/sparc64 kernel */
 
 #include <asm-generic/vmlinux.lds.h>
+
 #include <asm/page.h>
+#include <asm/thread_info.h>
 
 #ifdef CONFIG_SPARC32
 #define INITIAL_ADDRESS  0x10000 + SIZEOF_HEADERS
@@ -65,8 +67,15 @@ SECTIONS
 	.data.read_mostly : {
 		*(.data.read_mostly)
 	}
+	/* End of data section */
 	_edata = .;
 	PROVIDE (edata = .);
+
+	/* init_task */
+	. = ALIGN(THREAD_SIZE);
+	.data.init_task : {
+		*(.data.init_task)
+	}
 	.fixup : {
 		__start___fixup = .;
 		*(.fixup)
Signature · 1 line
1.6.0.2.GIT
#1 lore raw

Re: [PATCH] sparc: use .data.init_task section for

Quoted 9 lines · Sam Ravnborg

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

Thanks Sam!

I'm working on v2 of my init_task patchset, I'll try to post it to linux-arch this evening or Monday.

cheers, Kyle

maintainer
#2 lore raw

Re: [PATCH] sparc: use .data.init_task section for

In reply to Sam Ravnborg

From: Kyle McMartin <[email protected]>
Date: Sun, 21 Dec 2008 15:45:01 -0500

Quoted 12 lines · Sam Ravnborg
Quoted 8 lines

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

I'm working on v2 of my init_task patchset, I'll try to post it to linux-arch this evening or Monday.

Is this patch from Sam going into Kyle's patch set or should I apply it directly to sparc-next-2.6?

Just let me know...

#3 lore raw
In reply to Sam Ravnborg
Quoted 13 lines · David Miller

From: Kyle McMartin <[email protected]>
Date: Sun, 21 Dec 2008 15:45:01 -0500

Quoted 10 lines · Sam Ravnborg
Quoted 8 lines

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

Quoted 7 lines
Quoted 2 lines

I'm working on v2 of my init_task patchset, I'll try to post it to linux-arch this evening or Monday.

Is this patch from Sam going into Kyle's patch set or should I apply it directly to sparc-next-2.6?

Just let me know...

I suggest that you take it via sparc-next-2.6.

With your usual track schedule you will soon have this merged and Kyle can rebase on top of linus' tree.

This will also allow us to do some minimal testing to check that the conversion to the vmlinux.lds based alignmnet does not cause any troubles before we use the generic version.

I will follow up if there is any fallout.

Sam

maintainer
#4 lore raw

Re: [PATCH] sparc: use .data.init_task section for

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sat, 27 Dec 2008 08:03:05 +0100

Quoted 9 lines · David Miller
Quoted 4 lines

Is this patch from Sam going into Kyle's patch set or should I apply it directly to sparc-next-2.6?

Just let me know...

I suggest that you take it via sparc-next-2.6.

With your usual track schedule you will soon have this merged and Kyle can rebase on top of linus' tree.

Ok.

maintainer Applied
#5 lore raw

Re: [PATCH] sparc: use .data.init_task section for

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sun, 21 Dec 2008 21:40:54 +0100

Quoted 7 lines

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

Applied.

#6 lore raw

Re: [PATCH] sparc: use .data.init_task section for

In reply to Sam Ravnborg
Quoted 17 lines · Sam Ravnborg
Quoted 16 lines · David Miller

From: Kyle McMartin <[email protected]>
Date: Sun, 21 Dec 2008 15:45:01 -0500

Quoted 12 lines · Sam Ravnborg
Quoted 8 lines

Use a dedicated aligned section for the init_thread_union variable and declare this section in vmlinux.lds.

This align sparc with most other architectures.
Eventually this allow the init_task bits to be unified across all architectures.

I'm working on v2 of my init_task patchset, I'll try to post it to linux-arch this evening or Monday.

Quoted 8 lines
Quoted 4 lines

Is this patch from Sam going into Kyle's patch set or should I apply it directly to sparc-next-2.6?

Just let me know...

I suggest that you take it via sparc-next-2.6.

With your usual track schedule you will soon have this merged and Kyle can rebase on top of linus' tree.

Aye, with the coming sparc merge this is the sensible option. :)

cheers, Kyle