mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] section name cleanup for sparc
@ 2009-04-30 23:58 Tim Abbott
  2009-04-30 23:58 ` [PATCH 1/4] sparc: use new macro for .data.cacheline_aligned section Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:58 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, David S. Miller, sparclinux,
	Tim Abbott

This patch series cleans up the section names on the sparc
architecture.  It requires the architecture-independent macro
definitions from this patch series:

<http://www.spinics.net/lists/mips/msg33499.html>

The long-term goal here is to add support for building the kernel with
-ffunction-sections -fdata-sections.  This requires renaming all the
magic section names in the kernel of the form .text.foo, .data.foo,
.bss.foo, and .rodata.foo to not have collisions with sections
generated for code like:

static int nosave = 0; /* -fdata-sections places in .data.nosave */
static void head(); /* -ffunction-sections places in .text.head */

Note that these patches have not been boot-tested (aside from testing
the analogous changes on x86), since I don't have access to the
appropriate hardware.

	-Tim Abbott


Tim Abbott (4):
  sparc: use new macro for .data.cacheline_aligned section.
  sparc: use new macros for .data.init_task.
  sparc: use new macro for .data.read_mostly section.
  sparc: convert to new generic read_mostly support.

 arch/sparc/Kconfig              |    3 +++
 arch/sparc/include/asm/cache.h  |    2 --
 arch/sparc/kernel/init_task.c   |    5 ++---
 arch/sparc/kernel/vmlinux.lds.S |   16 +++-------------
 4 files changed, 8 insertions(+), 18 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] sparc: use new macro for .data.cacheline_aligned section.
  2009-04-30 23:58 [PATCH 0/4] section name cleanup for sparc Tim Abbott
@ 2009-04-30 23:58 ` Tim Abbott
  2009-04-30 23:58   ` [PATCH 2/4] sparc: use new macros for .data.init_task Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:58 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, David S. Miller, sparclinux,
	Tim Abbott

.data.cacheline_aligned should not need a separate output section;
this change moves it into the .data section.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/vmlinux.lds.S |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index fcbbd00..6587e03 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -52,6 +52,7 @@ SECTIONS
 
 	RO_DATA(PAGE_SIZE)
 	.data :	{
+		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
 	}
@@ -59,10 +60,6 @@ SECTIONS
 		*(.data1)
 	}
 	. = ALIGN(SMP_CACHE_BYTES);
-	.data.cacheline_aligned : {
-		*(.data.cacheline_aligned)
-	}
-	. = ALIGN(SMP_CACHE_BYTES);
 	.data.read_mostly : {
 		*(.data.read_mostly)
 	}
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] sparc: use new macros for .data.init_task.
  2009-04-30 23:58 ` [PATCH 1/4] sparc: use new macro for .data.cacheline_aligned section Tim Abbott
@ 2009-04-30 23:58   ` Tim Abbott
  2009-04-30 23:58     ` [PATCH 3/4] sparc: use new macro for .data.read_mostly section Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:58 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, David S. Miller, sparclinux,
	Tim Abbott

.data.init_task should not need a separate output section; this change
moves it into the .data section.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/init_task.c   |    5 ++---
 arch/sparc/kernel/vmlinux.lds.S |    6 +-----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index f28cb82..7367984 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -21,6 +21,5 @@ EXPORT_SYMBOL(init_task);
  * If this is not aligned on a 8k boundry, then you should change code
  * in etrap.S which assumes it.
  */
-union thread_union init_thread_union
-	__attribute__((section (".data.init_task")))
-	= { INIT_THREAD_INFO(init_task) };
+union thread_union init_thread_union __init_task_data =
+	{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 6587e03..3fbf650 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -52,6 +52,7 @@ SECTIONS
 
 	RO_DATA(PAGE_SIZE)
 	.data :	{
+		INIT_TASK_DATA(THREAD_SIZE)
 		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
@@ -66,11 +67,6 @@ SECTIONS
 	/* End of data section */
 	_edata = .;
 
-	/* init_task */
-	. = ALIGN(THREAD_SIZE);
-	.data.init_task : {
-		*(.data.init_task)
-	}
 	.fixup : {
 		__start___fixup = .;
 		*(.fixup)
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] sparc: use new macro for .data.read_mostly section.
  2009-04-30 23:58   ` [PATCH 2/4] sparc: use new macros for .data.init_task Tim Abbott
@ 2009-04-30 23:58     ` Tim Abbott
  2009-04-30 23:58       ` [PATCH 4/4] sparc: convert to new generic read_mostly support Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:58 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, David S. Miller, sparclinux,
	Tim Abbott

.data.read_mostly should not need a separate output section; this
change moves it into the .data section.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/vmlinux.lds.S |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 3fbf650..4760796 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -54,16 +54,13 @@ SECTIONS
 	.data :	{
 		INIT_TASK_DATA(THREAD_SIZE)
 		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
+		READ_MOSTLY_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
 	}
 	.data1 : {
 		*(.data1)
 	}
-	. = ALIGN(SMP_CACHE_BYTES);
-	.data.read_mostly : {
-		*(.data.read_mostly)
-	}
 	/* End of data section */
 	_edata = .;
 
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] sparc: convert to new generic read_mostly support.
  2009-04-30 23:58     ` [PATCH 3/4] sparc: use new macro for .data.read_mostly section Tim Abbott
@ 2009-04-30 23:58       ` Tim Abbott
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:58 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, David S. Miller, sparclinux,
	Tim Abbott

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/Kconfig             |    3 +++
 arch/sparc/include/asm/cache.h |    2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index cc12cd4..fbdeded 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -127,6 +127,9 @@ config OF
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 	def_bool y if SPARC64
 
+config HAVE_READ_MOSTLY_DATA
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h
index 41f85ae..e614736 100644
--- a/arch/sparc/include/asm/cache.h
+++ b/arch/sparc/include/asm/cache.h
@@ -19,8 +19,6 @@
 
 #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
 
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
 #ifdef CONFIG_SPARC32
 #include <asm/asi.h>
 
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-01  0:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 23:58 [PATCH 0/4] section name cleanup for sparc Tim Abbott
2009-04-30 23:58 ` [PATCH 1/4] sparc: use new macro for .data.cacheline_aligned section Tim Abbott
2009-04-30 23:58   ` [PATCH 2/4] sparc: use new macros for .data.init_task Tim Abbott
2009-04-30 23:58     ` [PATCH 3/4] sparc: use new macro for .data.read_mostly section Tim Abbott
2009-04-30 23:58       ` [PATCH 4/4] sparc: convert to new generic read_mostly support Tim Abbott

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®