Patchwork sparc: use .data.init_task section for init_thread_union

login
register
mail settings
Submitter Sam Ravnborg
Date Dec. 21, 2008, 8:40 p.m.
Message ID <20081221204054.GA18284@uranus.ravnborg.org>
Download mbox | patch
Permalink /patch/15174/
State Accepted
Delegated to: David Miller
Headers show

Comments

Sam Ravnborg - Dec. 21, 2008, 8:40 p.m.
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.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
---

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(-)
Kyle McMartin - Dec. 21, 2008, 8:45 p.m.
On Sun, Dec 21, 2008 at 09:40:54PM +0100, Sam Ravnborg wrote:
> 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.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Kyle McMartin <kyle@mcmartin.ca>
>

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
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 26, 2008, 11:33 p.m.
From: Kyle McMartin <kyle@infradead.org>
Date: Sun, 21 Dec 2008 15:45:01 -0500

> On Sun, Dec 21, 2008 at 09:40:54PM +0100, Sam Ravnborg wrote:
> > 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.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Kyle McMartin <kyle@mcmartin.ca>
> 
> 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...
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sam Ravnborg - Dec. 27, 2008, 7:03 a.m.
On Fri, Dec 26, 2008 at 03:33:50PM -0800, David Miller wrote:
> From: Kyle McMartin <kyle@infradead.org>
> Date: Sun, 21 Dec 2008 15:45:01 -0500
> 
> > On Sun, Dec 21, 2008 at 09:40:54PM +0100, Sam Ravnborg wrote:
> > > 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.
> > > 
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Kyle McMartin <kyle@mcmartin.ca>
> > 
> > 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
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 27, 2008, 8:34 a.m.
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 27 Dec 2008 08:03:05 +0100

> On Fri, Dec 26, 2008 at 03:33:50PM -0800, David Miller wrote:
> > 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.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 27, 2008, 8:35 a.m.
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sun, 21 Dec 2008 21:40:54 +0100

> 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.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kyle McMartin - Dec. 27, 2008, 3:49 p.m.
On Sat, Dec 27, 2008 at 08:03:05AM +0100, Sam Ravnborg wrote:
> On Fri, Dec 26, 2008 at 03:33:50PM -0800, David Miller wrote:
> > From: Kyle McMartin <kyle@infradead.org>
> > Date: Sun, 21 Dec 2008 15:45:01 -0500
> > 
> > > On Sun, Dec 21, 2008 at 09:40:54PM +0100, Sam Ravnborg wrote:
> > > > 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.
> > > > 
> > > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > > Cc: Kyle McMartin <kyle@mcmartin.ca>
> > > 
> > > 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.

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

cheers, Kyle
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index 8e64ebc..62126e4 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -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) };
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 4bfbeff..59c8d09 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -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)