All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] macros for section name cleanup
@ 2009-04-30 19:54 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

(this patch series differs from v1 only in the CC list; some of the
architecture lists I sent the previous one to are moderated against
non-members; all replies should go to this version).

Here are the architecture-independent macro definitions needed for
to clean up the kernel's section names.  The overall diffstat from
this section name cleanup project is:

 96 files changed, 261 insertions(+), 503 deletions(-)

The decrease results from removing a lot of redundancy in the linker
scripts.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  These patch series implement that
cleanup.  Later, there will be another patch series to actually rename
the sections.

I'm hoping we can get just these macro definitions into 2.6.30 so that
the arch maintainers don't have to grab the macro definitions for
their trees while reviewing the patches for 2.6.31.

Shortly, I'm going to send one patch series for each of the
architectures updating those architectures to use these new macros
(and otherwise cleaning up section names on those architectures).

	-Tim Abbott

Tim Abbott (6):
  Add new macros for page-aligned data and bss sections.
  Add new NOSAVE_DATA linker script macro.
  Add new CACHELINE_ALIGNED_DATA linker script macro.
  Add new INIT_TASK_DATA() linker script macro.
  Add new READ_MOSTLY_DATA(align) linker script macro.
  Add support for __read_mostly to linux/cache.h

 include/asm-generic/vmlinux.lds.h |   27 +++++++++++++++++++++++++++
 include/linux/cache.h             |    6 ++++++
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)

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

* [PATCH v2 0/6] macros for section name cleanup
@ 2009-04-30 19:54 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

(this patch series differs from v1 only in the CC list; some of the
architecture lists I sent the previous one to are moderated against
non-members; all replies should go to this version).

Here are the architecture-independent macro definitions needed for
to clean up the kernel's section names.  The overall diffstat from
this section name cleanup project is:

 96 files changed, 261 insertions(+), 503 deletions(-)

The decrease results from removing a lot of redundancy in the linker
scripts.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  These patch series implement that
cleanup.  Later, there will be another patch series to actually rename
the sections.

I'm hoping we can get just these macro definitions into 2.6.30 so that
the arch maintainers don't have to grab the macro definitions for
their trees while reviewing the patches for 2.6.31.

Shortly, I'm going to send one patch series for each of the
architectures updating those architectures to use these new macros
(and otherwise cleaning up section names on those architectures).

	-Tim Abbott

Tim Abbott (6):
  Add new macros for page-aligned data and bss sections.
  Add new NOSAVE_DATA linker script macro.
  Add new CACHELINE_ALIGNED_DATA linker script macro.
  Add new INIT_TASK_DATA() linker script macro.
  Add new READ_MOSTLY_DATA(align) linker script macro.
  Add support for __read_mostly to linux/cache.h

 include/asm-generic/vmlinux.lds.h |   27 +++++++++++++++++++++++++++
 include/linux/cache.h             |    6 ++++++
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)

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

* [PATCH v2 0/6] macros for section name cleanup
@ 2009-04-30 19:54 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

(this patch series differs from v1 only in the CC list; some of the
architecture lists I sent the previous one to are moderated against
non-members; all replies should go to this version).

Here are the architecture-independent macro definitions needed for
to clean up the kernel's section names.  The overall diffstat from
this section name cleanup project is:

 96 files changed, 261 insertions(+), 503 deletions(-)

The decrease results from removing a lot of redundancy in the linker
scripts.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  These patch series implement that
cleanup.  Later, there will be another patch series to actually rename
the sections.

I'm hoping we can get just these macro definitions into 2.6.30 so that
the arch maintainers don't have to grab the macro definitions for
their trees while reviewing the patches for 2.6.31.

Shortly, I'm going to send one patch series for each of the
architectures updating those architectures to use these new macros
(and otherwise cleaning up section names on those architectures).

	-Tim Abbott

Tim Abbott (6):
  Add new macros for page-aligned data and bss sections.
  Add new NOSAVE_DATA linker script macro.
  Add new CACHELINE_ALIGNED_DATA linker script macro.
  Add new INIT_TASK_DATA() linker script macro.
  Add new READ_MOSTLY_DATA(align) linker script macro.
  Add support for __read_mostly to linux/cache.h

 include/asm-generic/vmlinux.lds.h |   27 +++++++++++++++++++++++++++
 include/linux/cache.h             |    6 ++++++
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)

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

* [PATCH v2 0/6] macros for section name cleanup
@ 2009-04-30 19:54 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Tim Abbott, Cyrill Gorcunov, Michal Simek,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

(this patch series differs from v1 only in the CC list; some of the
architecture lists I sent the previous one to are moderated against
non-members; all replies should go to this version).

Here are the architecture-independent macro definitions needed for
to clean up the kernel's section names.  The overall diffstat from
this section name cleanup project is:

 96 files changed, 261 insertions(+), 503 deletions(-)

The decrease results from removing a lot of redundancy in the linker
scripts.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  These patch series implement that
cleanup.  Later, there will be another patch series to actually rename
the sections.

I'm hoping we can get just these macro definitions into 2.6.30 so that
the arch maintainers don't have to grab the macro definitions for
their trees while reviewing the patches for 2.6.31.

Shortly, I'm going to send one patch series for each of the
architectures updating those architectures to use these new macros
(and otherwise cleaning up section names on those architectures).

	-Tim Abbott

Tim Abbott (6):
  Add new macros for page-aligned data and bss sections.
  Add new NOSAVE_DATA linker script macro.
  Add new CACHELINE_ALIGNED_DATA linker script macro.
  Add new INIT_TASK_DATA() linker script macro.
  Add new READ_MOSTLY_DATA(align) linker script macro.
  Add support for __read_mostly to linux/cache.h

 include/asm-generic/vmlinux.lds.h |   27 +++++++++++++++++++++++++++
 include/linux/cache.h             |    6 ++++++
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)

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

* [PATCH v2 0/6] macros for section name cleanup
@ 2009-04-30 19:54 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

(this patch series differs from v1 only in the CC list; some of the
architecture lists I sent the previous one to are moderated against
non-members; all replies should go to this version).

Here are the architecture-independent macro definitions needed for
to clean up the kernel's section names.  The overall diffstat from
this section name cleanup project is:

 96 files changed, 261 insertions(+), 503 deletions(-)

The decrease results from removing a lot of redundancy in the linker
scripts.

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 */

Sam Ravnborg proposed that rather than just renaming all the sections
outright, we should start by first getting more control over the
section names used in the kernel so that we can later rename sections
without touching too many files.  These patch series implement that
cleanup.  Later, there will be another patch series to actually rename
the sections.

I'm hoping we can get just these macro definitions into 2.6.30 so that
the arch maintainers don't have to grab the macro definitions for
their trees while reviewing the patches for 2.6.31.

Shortly, I'm going to send one patch series for each of the
architectures updating those architectures to use these new macros
(and otherwise cleaning up section names on those architectures).

	-Tim Abbott

Tim Abbott (6):
  Add new macros for page-aligned data and bss sections.
  Add new NOSAVE_DATA linker script macro.
  Add new CACHELINE_ALIGNED_DATA linker script macro.
  Add new INIT_TASK_DATA() linker script macro.
  Add new READ_MOSTLY_DATA(align) linker script macro.
  Add support for __read_mostly to linux/cache.h

 include/asm-generic/vmlinux.lds.h |   27 +++++++++++++++++++++++++++
 include/linux/cache.h             |    6 ++++++
 include/linux/init_task.h         |    3 +++
 include/linux/linkage.h           |    9 +++++++++
 4 files changed, 45 insertions(+), 0 deletions(-)



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

* [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
       [not found] ` <1241121253-32341-1-git-send-email-tabbott-3s7WtUTddSA@public.gmane.org>
                       ` (2 preceding siblings ...)
  (?)
@ 2009-04-30 19:54     ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax-VrBV9hrLPhE, Geert Uytterhoeven, Greg Ungerer,
	Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, H. Peter Anvin, Ingo Molnar, Jeff Dike

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott-3s7WtUTddSA@public.gmane.org>
Cc: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/asm-generic/vmlinux.lds.h |    8 ++++++++
 include/linux/linkage.h           |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+#define PAGE_ALIGNED_DATA						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.bss.page_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.2.1

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

* [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-04-30 19:54     ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax-VrBV9hrLPhE, Geert Uytterhoeven, Greg Ungerer,
	Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, H. Peter Anvin, Ingo Molnar, Jeff Dike

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott-3s7WtUTddSA@public.gmane.org>
Cc: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
Acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/asm-generic/vmlinux.lds.h |    8 ++++++++
 include/linux/linkage.h           |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+#define PAGE_ALIGNED_DATA						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.bss.page_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.2.1

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

* [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-04-30 19:54     ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott, Sam Ravnborg

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: David Howells <dhowells@redhat.com>
---
 include/asm-generic/vmlinux.lds.h |    8 ++++++++
 include/linux/linkage.h           |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+#define PAGE_ALIGNED_DATA						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.bss.page_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.2.1

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

* [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-04-30 19:54     ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: David Howells <dhowells@redhat.com>
---
 include/asm-generic/vmlinux.lds.h |    8 ++++++++
 include/linux/linkage.h           |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+#define PAGE_ALIGNED_DATA						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.bss.page_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.2.1

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

* [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-04-30 19:54     ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Sam Ravnborg, Waseem Daher,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, microblaze-uclinux,
	Russell King, user-mode-linux-devel, Heiko Carstens, Jeff Dike,
	dev-etrax, Mikael Starvik, Tim Abbott, Cyrill Gorcunov,
	Michal Simek, Richard Henderson, Chris Zankel, Bryan Wu,
	Tony Luck, linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

This patch is preparation for replacing most uses of
".bss.page_aligned" and ".data.page_aligned" in the kernel with
macros, so that the section name can later be changed without having
to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: David Howells <dhowells@redhat.com>
---
 include/asm-generic/vmlinux.lds.h |    8 ++++++++
 include/linux/linkage.h           |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..3d88c87 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,14 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+#define PAGE_ALIGNED_DATA						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.data.page_aligned)
+
+#define PAGE_ALIGNED_BSS						\
+	. = ALIGN(PAGE_SIZE);						\
+	*(.bss.page_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..af051fc 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
 #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
 
 /*
+ * For assembly routines.
+ *
+ * Note when using these that you must specify the appropriate
+ * alignment directives yourself
+ */
+#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
+#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
+
+/*
  * This is used by architectures to keep arguments on the stack
  * untouched by the compiler by keeping them live until the end.
  * The argument stack may be owned by the assembly-language
-- 
1.6.2.1

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

* [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
       [not found]     ` <1241121253-32341-2-git-send-email-tabbott-3s7WtUTddSA@public.gmane.org>
                           ` (2 preceding siblings ...)
  (?)
@ 2009-04-30 19:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax-VrBV9hrLPhE, Geert Uytterhoeven, Greg Ungerer,
	Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, H. Peter Anvin, Ingo Molnar, Jeff Dike

This patch is preparation for replacing most ".data.nosave" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott-3s7WtUTddSA@public.gmane.org>
Cc: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
---
 include/asm-generic/vmlinux.lds.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d88c87..f5ebd2b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,6 +124,13 @@
 	. = ALIGN(PAGE_SIZE);						\
 	*(.bss.page_aligned)
 
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_begin = .;						\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_end = .;
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-04-30 19:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax-VrBV9hrLPhE, Geert Uytterhoeven, Greg Ungerer,
	Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, H. Peter Anvin, Ingo Molnar, Jeff Dike

This patch is preparation for replacing most ".data.nosave" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott-3s7WtUTddSA@public.gmane.org>
Cc: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
---
 include/asm-generic/vmlinux.lds.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d88c87..f5ebd2b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,6 +124,13 @@
 	. = ALIGN(PAGE_SIZE);						\
 	*(.bss.page_aligned)
 
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_begin = .;						\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_end = .;
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-04-30 19:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott, Sam Ravnborg

This patch is preparation for replacing most ".data.nosave" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d88c87..f5ebd2b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,6 +124,13 @@
 	. = ALIGN(PAGE_SIZE);						\
 	*(.bss.page_aligned)
 
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_begin = .;						\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_end = .;
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-04-30 19:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

This patch is preparation for replacing most ".data.nosave" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d88c87..f5ebd2b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,6 +124,13 @@
 	. = ALIGN(PAGE_SIZE);						\
 	*(.bss.page_aligned)
 
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_begin = .;						\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_end = .;
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-04-30 19:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Sam Ravnborg, Waseem Daher,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, microblaze-uclinux,
	Russell King, user-mode-linux-devel, Heiko Carstens, Jeff Dike,
	dev-etrax, Mikael Starvik, Tim Abbott, Cyrill Gorcunov,
	Michal Simek, Richard Henderson, Chris Zankel, Bryan Wu,
	Tony Luck, linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

This patch is preparation for replacing most ".data.nosave" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d88c87..f5ebd2b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -124,6 +124,13 @@
 	. = ALIGN(PAGE_SIZE);						\
 	*(.bss.page_aligned)
 
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_begin = .;						\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	__nosave_end = .;
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
  2009-04-30 19:54         ` Tim Abbott
                             ` (3 preceding siblings ...)
  (?)
@ 2009-04-30 19:54           ` Tim Abbott
  -1 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
@ 2009-04-30 19:54           ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
@ 2009-04-30 19:54           ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott, Sam Ravnborg

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
@ 2009-04-30 19:54           ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
@ 2009-04-30 19:54           ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Sam Ravnborg, Waseem Daher,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, microblaze-uclinux,
	Russell King, user-mode-linux-devel, Heiko Carstens, Jeff Dike,
	dev-etrax, Mikael Starvik, Tim Abbott, Cyrill Gorcunov,
	Michal Simek, Richard Henderson, Chris Zankel, Bryan Wu,
	Tony Luck, linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA linker script macro.
@ 2009-04-30 19:54           ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.cacheline_aligned"
in the kernel with macros, so that the section name can later be
changed without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f5ebd2b..fa7801b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -131,6 +131,10 @@
 	. = ALIGN(PAGE_SIZE);						\
 	__nosave_end = .;
 
+#define CACHELINE_ALIGNED_DATA(alignment)				\
+	. = ALIGN(alignment);						\
+	*(.data.cacheline_aligned)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1



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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
  2009-04-30 19:54           ` Tim Abbott
                               ` (3 preceding siblings ...)
  (?)
@ 2009-04-30 19:54             ` Tim Abbott
  -1 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1

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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
@ 2009-04-30 19:54             ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1

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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
@ 2009-04-30 19:54             ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott, Sam Ravnborg

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1

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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
@ 2009-04-30 19:54             ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1

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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
@ 2009-04-30 19:54             ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Sam Ravnborg, Waseem Daher,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, microblaze-uclinux,
	Russell King, user-mode-linux-devel, Heiko Carstens, Jeff Dike,
	dev-etrax, Mikael Starvik, Tim Abbott, Cyrill Gorcunov,
	Michal Simek, Richard Henderson, Chris Zankel, Bryan Wu,
	Tony Luck, linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1

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

* [PATCH v2 4/6] Add new INIT_TASK_DATA() linker script macro.
@ 2009-04-30 19:54             ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.init_task" in the
kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 include/linux/init_task.h         |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index fa7801b..4b020e8 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -135,6 +135,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.cacheline_aligned)
 
+#define INIT_TASK_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.init_task)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d87247d..e555baa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,5 +184,8 @@ extern struct cred init_cred;
 	LIST_HEAD_INIT(cpu_timers[2]),					\
 }
 
+/* Attach to the init_task data structure for proper alignment */
+#define __init_task_data __attribute__((__section__(".data.init_task")))
+
 
 #endif
-- 
1.6.2.1



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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
  2009-04-30 19:54             ` Tim Abbott
                                 ` (3 preceding siblings ...)
  (?)
@ 2009-04-30 19:54               ` Tim Abbott
  -1 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
@ 2009-04-30 19:54               ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
@ 2009-04-30 19:54               ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott, Sam Ravnborg

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
@ 2009-04-30 19:54               ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
@ 2009-04-30 19:54               ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Sam Ravnborg, Waseem Daher,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, microblaze-uclinux,
	Russell King, user-mode-linux-devel, Heiko Carstens, Jeff Dike,
	dev-etrax, Mikael Starvik, Tim Abbott, Cyrill Gorcunov,
	Michal Simek, Richard Henderson, Chris Zankel, Bryan Wu,
	Tony Luck, linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1

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

* [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) linker script macro.
@ 2009-04-30 19:54               ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

This patch is preparation for replacing most ".data.read_mostly" in
the kernel with macros, so that the section name can later be changed
without having to touch a lot of the kernel.

The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections.  This requires renaming all magic sections with names
of the form ".data.foo".

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 include/asm-generic/vmlinux.lds.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4b020e8..a4b4f4a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -139,6 +139,10 @@
 	. = ALIGN(alignment);						\
 	*(.data.init_task)
 
+#define READ_MOSTLY_DATA(alignment)					\
+	. = ALIGN(alignment);						\
+	*(.data.read_mostly)
+
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
-- 
1.6.2.1



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

* [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h
  2009-04-30 19:54               ` Tim Abbott
                                   ` (2 preceding siblings ...)
  (?)
@ 2009-04-30 19:54                 ` Tim Abbott
  -1 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
 include/linux/cache.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e2488..99d8a6f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,13 @@
 #endif
 
 #ifndef __read_mostly
+#ifdef CONFIG_HAVE_READ_MOSTLY_DATA
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __READ_MOSTLY .section ".data.read_mostly", "aw"
+#else
 #define __read_mostly
+#define __READ_MOSTLY
+#endif /* CONFIG_HAVE_READ_MOSTLY_DATA */
 #endif
 
 #ifndef ____cacheline_aligned
-- 
1.6.2.1

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

* [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h
@ 2009-04-30 19:54                 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
 include/linux/cache.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e2488..99d8a6f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,13 @@
 #endif
 
 #ifndef __read_mostly
+#ifdef CONFIG_HAVE_READ_MOSTLY_DATA
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __READ_MOSTLY .section ".data.read_mostly", "aw"
+#else
 #define __read_mostly
+#define __READ_MOSTLY
+#endif /* CONFIG_HAVE_READ_MOSTLY_DATA */
 #endif
 
 #ifndef ____cacheline_aligned
-- 
1.6.2.1

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

* [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h
@ 2009-04-30 19:54                 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato, Tim Abbott

Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
 include/linux/cache.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e2488..99d8a6f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,13 @@
 #endif
 
 #ifndef __read_mostly
+#ifdef CONFIG_HAVE_READ_MOSTLY_DATA
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __READ_MOSTLY .section ".data.read_mostly", "aw"
+#else
 #define __read_mostly
+#define __READ_MOSTLY
+#endif /* CONFIG_HAVE_READ_MOSTLY_DATA */
 #endif
 
 #ifndef ____cacheline_aligned
-- 
1.6.2.1

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

* [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h
@ 2009-04-30 19:54                 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Tim Abbott, Cyrill Gorcunov, Michal Simek,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, Thomas Gleixner, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
 include/linux/cache.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e2488..99d8a6f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,13 @@
 #endif
 
 #ifndef __read_mostly
+#ifdef CONFIG_HAVE_READ_MOSTLY_DATA
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __READ_MOSTLY .section ".data.read_mostly", "aw"
+#else
 #define __read_mostly
+#define __READ_MOSTLY
+#endif /* CONFIG_HAVE_READ_MOSTLY_DATA */
 #endif
 
 #ifndef ____cacheline_aligned
-- 
1.6.2.1

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

* [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h
@ 2009-04-30 19:54                 ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-04-30 19:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

Signed-off-by: Tim Abbott <tabbott@mit.edu>
---
 include/linux/cache.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e2488..99d8a6f 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,13 @@
 #endif
 
 #ifndef __read_mostly
+#ifdef CONFIG_HAVE_READ_MOSTLY_DATA
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __READ_MOSTLY .section ".data.read_mostly", "aw"
+#else
 #define __read_mostly
+#define __READ_MOSTLY
+#endif /* CONFIG_HAVE_READ_MOSTLY_DATA */
 #endif
 
 #ifndef ____cacheline_aligned
-- 
1.6.2.1



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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-04-30 19:54 ` Tim Abbott
                     ` (2 preceding siblings ...)
  (?)
@ 2009-05-01  9:04   ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:04 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).

Hi Tim.

We agreed to get the common stuff and one architecture done before
proceeding with the rest.
Please stick to that plan so we avoid patch-bombing lkml + maintainers.

When we have this ready it will be a simple one-patch-per-arch to cover
the rest.

I will comment on your common patches for now.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01  9:04   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:04 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).

Hi Tim.

We agreed to get the common stuff and one architecture done before
proceeding with the rest.
Please stick to that plan so we avoid patch-bombing lkml + maintainers.

When we have this ready it will be a simple one-patch-per-arch to cover
the rest.

I will comment on your common patches for now.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01  9:04   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:04 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).

Hi Tim.

We agreed to get the common stuff and one architecture done before
proceeding with the rest.
Please stick to that plan so we avoid patch-bombing lkml + maintainers.

When we have this ready it will be a simple one-patch-per-arch to cover
the rest.

I will comment on your common patches for now.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01  9:04   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:04 UTC (permalink / raw)
  To: Tim Abbott
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Richard Henderson,
	Chris Zankel, Bryan Wu, Tony Luck, linux-parisc,
	Haavard Skinnemoen, Hirokazu Takata, Linux kernel mailing list,
	Ralf Baechle, Anders Kaseorg, Kyle McMartin, Paul Mundt,
	Thomas Gleixner, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).

Hi Tim.

We agreed to get the common stuff and one architecture done before
proceeding with the rest.
Please stick to that plan so we avoid patch-bombing lkml + maintainers.

When we have this ready it will be a simple one-patch-per-arch to cover
the rest.

I will comment on your common patches for now.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01  9:04   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:04 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).

Hi Tim.

We agreed to get the common stuff and one architecture done before
proceeding with the rest.
Please stick to that plan so we avoid patch-bombing lkml + maintainers.

When we have this ready it will be a simple one-patch-per-arch to cover
the rest.

I will comment on your common patches for now.

	Sam


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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
  2009-04-30 19:54     ` Tim Abbott
                         ` (2 preceding siblings ...)
  (?)
@ 2009-05-01  9:18       ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:18 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most uses of
> ".bss.page_aligned" and ".data.page_aligned" in the kernel with
> macros, so that the section name can later be changed without having
> to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Acked-by: David Howells <dhowells@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h |    8 ++++++++
>  include/linux/linkage.h           |    9 +++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 89853bc..3d88c87 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -116,6 +116,14 @@
>  	FTRACE_EVENTS()							\
>  	TRACE_SYSCALLS()
>  
> +#define PAGE_ALIGNED_DATA						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.data.page_aligned)
> +
> +#define PAGE_ALIGNED_BSS						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.bss.page_aligned)
> +
>  #define RO_DATA(align)							\
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
> index fee9e59..af051fc 100644
> --- a/include/linux/linkage.h
> +++ b/include/linux/linkage.h
> @@ -22,6 +22,15 @@
>  #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
>  
>  /*
> + * For assembly routines.
> + *
> + * Note when using these that you must specify the appropriate
> + * alignment directives yourself
> + */
> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits

The above will work on most architectures but fails (silently?) on arm.
arm uses %{progbits,nobits} where all other uses @{nobits,progbits}.

I know we do not use page_aligned in arm assembler code for now,
but if we do then it should work.
It is my understanding that the linker will automatically
assume nobits for section names starting with .bss and likewise
progbits for section names starting with .data - so we can leave them out?


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01  9:18       ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:18 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most uses of
> ".bss.page_aligned" and ".data.page_aligned" in the kernel with
> macros, so that the section name can later be changed without having
> to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Acked-by: David Howells <dhowells@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h |    8 ++++++++
>  include/linux/linkage.h           |    9 +++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 89853bc..3d88c87 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -116,6 +116,14 @@
>  	FTRACE_EVENTS()							\
>  	TRACE_SYSCALLS()
>  
> +#define PAGE_ALIGNED_DATA						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.data.page_aligned)
> +
> +#define PAGE_ALIGNED_BSS						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.bss.page_aligned)
> +
>  #define RO_DATA(align)							\
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
> index fee9e59..af051fc 100644
> --- a/include/linux/linkage.h
> +++ b/include/linux/linkage.h
> @@ -22,6 +22,15 @@
>  #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
>  
>  /*
> + * For assembly routines.
> + *
> + * Note when using these that you must specify the appropriate
> + * alignment directives yourself
> + */
> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits

The above will work on most architectures but fails (silently?) on arm.
arm uses %{progbits,nobits} where all other uses @{nobits,progbits}.

I know we do not use page_aligned in arm assembler code for now,
but if we do then it should work.
It is my understanding that the linker will automatically
assume nobits for section names starting with .bss and likewise
progbits for section names starting with .data - so we can leave them out?


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01  9:18       ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:18 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most uses of
> ".bss.page_aligned" and ".data.page_aligned" in the kernel with
> macros, so that the section name can later be changed without having
> to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Acked-by: David Howells <dhowells@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h |    8 ++++++++
>  include/linux/linkage.h           |    9 +++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 89853bc..3d88c87 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -116,6 +116,14 @@
>  	FTRACE_EVENTS()							\
>  	TRACE_SYSCALLS()
>  
> +#define PAGE_ALIGNED_DATA						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.data.page_aligned)
> +
> +#define PAGE_ALIGNED_BSS						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.bss.page_aligned)
> +
>  #define RO_DATA(align)							\
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
> index fee9e59..af051fc 100644
> --- a/include/linux/linkage.h
> +++ b/include/linux/linkage.h
> @@ -22,6 +22,15 @@
>  #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
>  
>  /*
> + * For assembly routines.
> + *
> + * Note when using these that you must specify the appropriate
> + * alignment directives yourself
> + */
> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits

The above will work on most architectures but fails (silently?) on arm.
arm uses %{progbits,nobits} where all other uses @{nobits,progbits}.

I know we do not use page_aligned in arm assembler code for now,
but if we do then it should work.
It is my understanding that the linker will automatically
assume nobits for section names starting with .bss and likewise
progbits for section names starting with .data - so we can leave them out?


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01  9:18       ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:18 UTC (permalink / raw)
  To: Tim Abbott
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Richard Henderson,
	Chris Zankel, Bryan Wu, Tony Luck, linux-parisc,
	Haavard Skinnemoen, Hirokazu Takata, Linux kernel mailing list,
	Ralf Baechle, Anders Kaseorg, Kyle McMartin, Paul Mundt,
	Thomas Gleixner, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most uses of
> ".bss.page_aligned" and ".data.page_aligned" in the kernel with
> macros, so that the section name can later be changed without having
> to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Acked-by: David Howells <dhowells@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h |    8 ++++++++
>  include/linux/linkage.h           |    9 +++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 89853bc..3d88c87 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -116,6 +116,14 @@
>  	FTRACE_EVENTS()							\
>  	TRACE_SYSCALLS()
>  
> +#define PAGE_ALIGNED_DATA						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.data.page_aligned)
> +
> +#define PAGE_ALIGNED_BSS						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.bss.page_aligned)
> +
>  #define RO_DATA(align)							\
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
> index fee9e59..af051fc 100644
> --- a/include/linux/linkage.h
> +++ b/include/linux/linkage.h
> @@ -22,6 +22,15 @@
>  #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
>  
>  /*
> + * For assembly routines.
> + *
> + * Note when using these that you must specify the appropriate
> + * alignment directives yourself
> + */
> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits

The above will work on most architectures but fails (silently?) on arm.
arm uses %{progbits,nobits} where all other uses @{nobits,progbits}.

I know we do not use page_aligned in arm assembler code for now,
but if we do then it should work.
It is my understanding that the linker will automatically
assume nobits for section names starting with .bss and likewise
progbits for section names starting with .data - so we can leave them out?


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01  9:18       ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:18 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most uses of
> ".bss.page_aligned" and ".data.page_aligned" in the kernel with
> macros, so that the section name can later be changed without having
> to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Acked-by: David Howells <dhowells@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h |    8 ++++++++
>  include/linux/linkage.h           |    9 +++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 89853bc..3d88c87 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -116,6 +116,14 @@
>  	FTRACE_EVENTS()							\
>  	TRACE_SYSCALLS()
>  
> +#define PAGE_ALIGNED_DATA						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.data.page_aligned)
> +
> +#define PAGE_ALIGNED_BSS						\
> +	. = ALIGN(PAGE_SIZE);						\
> +	*(.bss.page_aligned)
> +
>  #define RO_DATA(align)							\
>  	. = ALIGN((align));						\
>  	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
> diff --git a/include/linux/linkage.h b/include/linux/linkage.h
> index fee9e59..af051fc 100644
> --- a/include/linux/linkage.h
> +++ b/include/linux/linkage.h
> @@ -22,6 +22,15 @@
>  #define __page_aligned_bss	__section(.bss.page_aligned) __aligned(PAGE_SIZE)
>  
>  /*
> + * For assembly routines.
> + *
> + * Note when using these that you must specify the appropriate
> + * alignment directives yourself
> + */
> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits

The above will work on most architectures but fails (silently?) on arm.
arm uses %{progbits,nobits} where all other uses @{nobits,progbits}.

I know we do not use page_aligned in arm assembler code for now,
but if we do then it should work.
It is my understanding that the linker will automatically
assume nobits for section names starting with .bss and likewise
progbits for section names starting with .data - so we can leave them out?


	Sam


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

* Re: [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
  2009-04-30 19:54         ` Tim Abbott
                             ` (2 preceding siblings ...)
  (?)
@ 2009-05-01  9:21           ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:09PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most ".data.nosave" in the
> kernel with macros, so that the section name can later be changed
> without having to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  include/asm-generic/vmlinux.lds.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d88c87..f5ebd2b 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -124,6 +124,13 @@
>  	. = ALIGN(PAGE_SIZE);						\
>  	*(.bss.page_aligned)
>  
> +#define NOSAVE_DATA							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_begin = .;						\
> +	*(.data.nosave)							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_end = .;
> +

You need to use:
	VMLINUX_SYMBOL(__nosave_begin) = .;

Otherwise architectures such as m68k wil break as they
add a leading underscore.

See other symbols that is defined inside vmlinux.lds.h

	Sam

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

* Re: [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-05-01  9:21           ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

On Thu, Apr 30, 2009 at 03:54:09PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most ".data.nosave" in the
> kernel with macros, so that the section name can later be changed
> without having to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  include/asm-generic/vmlinux.lds.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d88c87..f5ebd2b 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -124,6 +124,13 @@
>  	. = ALIGN(PAGE_SIZE);						\
>  	*(.bss.page_aligned)
>  
> +#define NOSAVE_DATA							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_begin = .;						\
> +	*(.data.nosave)							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_end = .;
> +

You need to use:
	VMLINUX_SYMBOL(__nosave_begin) = .;

Otherwise architectures such as m68k wil break as they
add a leading underscore.

See other symbols that is defined inside vmlinux.lds.h

	Sam

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

* Re: [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-05-01  9:21           ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Thu, Apr 30, 2009 at 03:54:09PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most ".data.nosave" in the
> kernel with macros, so that the section name can later be changed
> without having to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  include/asm-generic/vmlinux.lds.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d88c87..f5ebd2b 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -124,6 +124,13 @@
>  	. = ALIGN(PAGE_SIZE);						\
>  	*(.bss.page_aligned)
>  
> +#define NOSAVE_DATA							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_begin = .;						\
> +	*(.data.nosave)							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_end = .;
> +

You need to use:
	VMLINUX_SYMBOL(__nosave_begin) = .;

Otherwise architectures such as m68k wil break as they
add a leading underscore.

See other symbols that is defined inside vmlinux.lds.h

	Sam

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

* Re: [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-05-01  9:21           ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Richard Henderson,
	Chris Zankel, Bryan Wu, Tony Luck, linux-parisc,
	Haavard Skinnemoen, Hirokazu Takata, Linux kernel mailing list,
	Ralf Baechle, Anders Kaseorg, Kyle McMartin, Paul Mundt,
	Thomas Gleixner, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Thu, Apr 30, 2009 at 03:54:09PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most ".data.nosave" in the
> kernel with macros, so that the section name can later be changed
> without having to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  include/asm-generic/vmlinux.lds.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d88c87..f5ebd2b 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -124,6 +124,13 @@
>  	. = ALIGN(PAGE_SIZE);						\
>  	*(.bss.page_aligned)
>  
> +#define NOSAVE_DATA							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_begin = .;						\
> +	*(.data.nosave)							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_end = .;
> +

You need to use:
	VMLINUX_SYMBOL(__nosave_begin) = .;

Otherwise architectures such as m68k wil break as they
add a leading underscore.

See other symbols that is defined inside vmlinux.lds.h

	Sam

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

* Re: [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro.
@ 2009-05-01  9:21           ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01  9:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:09PM -0400, Tim Abbott wrote:
> This patch is preparation for replacing most ".data.nosave" in the
> kernel with macros, so that the section name can later be changed
> without having to touch a lot of the kernel.
> 
> The long-term goal here is to be able to change the kernel's magic
> section names to those that are compatible with -ffunction-sections
> -fdata-sections.  This requires renaming all magic sections with names
> of the form ".data.foo".
> 
> Signed-off-by: Tim Abbott <tabbott@mit.edu>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  include/asm-generic/vmlinux.lds.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d88c87..f5ebd2b 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -124,6 +124,13 @@
>  	. = ALIGN(PAGE_SIZE);						\
>  	*(.bss.page_aligned)
>  
> +#define NOSAVE_DATA							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_begin = .;						\
> +	*(.data.nosave)							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	__nosave_end = .;
> +

You need to use:
	VMLINUX_SYMBOL(__nosave_begin) = .;

Otherwise architectures such as m68k wil break as they
add a leading underscore.

See other symbols that is defined inside vmlinux.lds.h

	Sam


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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
  2009-05-01  9:18       ` Sam Ravnborg
                           ` (2 preceding siblings ...)
  (?)
@ 2009-05-01 13:54         ` Tim Abbott
  -1 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-05-01 13:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Fri, 1 May 2009, Sam Ravnborg wrote:

> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> > +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> > +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> 
> It is my understanding that the linker will automatically
> assume nobits for section names starting with .bss and likewise
> progbits for section names starting with .data - so we can leave them out?

I believe that is correct.

	-Tim Abbott

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 13:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-05-01 13:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

On Fri, 1 May 2009, Sam Ravnborg wrote:

> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> > +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> > +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> 
> It is my understanding that the linker will automatically
> assume nobits for section names starting with .bss and likewise
> progbits for section names starting with .data - so we can leave them out?

I believe that is correct.

	-Tim Abbott

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 13:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-05-01 13:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Fri, 1 May 2009, Sam Ravnborg wrote:

> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> > +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> > +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> 
> It is my understanding that the linker will automatically
> assume nobits for section names starting with .bss and likewise
> progbits for section names starting with .data - so we can leave them out?

I believe that is correct.

	-Tim Abbott

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 13:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-05-01 13:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Richard Henderson,
	Chris Zankel, Bryan Wu, Tony Luck, linux-parisc,
	Haavard Skinnemoen, Hirokazu Takata, Linux kernel mailing list,
	Ralf Baechle, Anders Kaseorg, Kyle McMartin, Paul Mundt,
	Thomas Gleixner, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Fri, 1 May 2009, Sam Ravnborg wrote:

> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> > +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> > +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> 
> It is my understanding that the linker will automatically
> assume nobits for section names starting with .bss and likewise
> progbits for section names starting with .data - so we can leave them out?

I believe that is correct.

	-Tim Abbott

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 13:54         ` Tim Abbott
  0 siblings, 0 replies; 95+ messages in thread
From: Tim Abbott @ 2009-05-01 13:54 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Fri, 1 May 2009, Sam Ravnborg wrote:

> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> > +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> > +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> 
> It is my understanding that the linker will automatically
> assume nobits for section names starting with .bss and likewise
> progbits for section names starting with .data - so we can leave them out?

I believe that is correct.

	-Tim Abbott




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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-04-30 19:54 ` Tim Abbott
                     ` (2 preceding siblings ...)
  (?)
@ 2009-05-01 14:21   ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 14:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).
> 
> 	-Tim Abbott
> 
> Tim Abbott (6):
>   Add new macros for page-aligned data and bss sections.
>   Add new NOSAVE_DATA linker script macro.
>   Add new CACHELINE_ALIGNED_DATA linker script macro.
>   Add new INIT_TASK_DATA() linker script macro.
>   Add new READ_MOSTLY_DATA(align) linker script macro.

I am about to apply this part of your patches.
I am doing some additional modifications and
will most likely apply them as one patch.

Will post to linux-arch for review when it is ready.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01 14:21   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 14:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).
> 
> 	-Tim Abbott
> 
> Tim Abbott (6):
>   Add new macros for page-aligned data and bss sections.
>   Add new NOSAVE_DATA linker script macro.
>   Add new CACHELINE_ALIGNED_DATA linker script macro.
>   Add new INIT_TASK_DATA() linker script macro.
>   Add new READ_MOSTLY_DATA(align) linker script macro.

I am about to apply this part of your patches.
I am doing some additional modifications and
will most likely apply them as one patch.

Will post to linux-arch for review when it is ready.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01 14:21   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 14:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds, linux-alpha, linux-ia64, linux-m68k, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).
> 
> 	-Tim Abbott
> 
> Tim Abbott (6):
>   Add new macros for page-aligned data and bss sections.
>   Add new NOSAVE_DATA linker script macro.
>   Add new CACHELINE_ALIGNED_DATA linker script macro.
>   Add new INIT_TASK_DATA() linker script macro.
>   Add new READ_MOSTLY_DATA(align) linker script macro.

I am about to apply this part of your patches.
I am doing some additional modifications and
will most likely apply them as one patch.

Will post to linux-arch for review when it is ready.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01 14:21   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 14:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Greg Ungerer, Jeff Arnold, linuxppc-dev, Paul Mackerras,
	H. Peter Anvin, sparclinux, Waseem Daher, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, microblaze-uclinux, Russell King,
	user-mode-linux-devel, Heiko Carstens, Jeff Dike, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Richard Henderson,
	Chris Zankel, Bryan Wu, Tony Luck, linux-parisc,
	Haavard Skinnemoen, Hirokazu Takata, Linux kernel mailing list,
	Ralf Baechle, Anders Kaseorg, Kyle McMartin, Paul Mundt,
	Thomas Gleixner, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).
> 
> 	-Tim Abbott
> 
> Tim Abbott (6):
>   Add new macros for page-aligned data and bss sections.
>   Add new NOSAVE_DATA linker script macro.
>   Add new CACHELINE_ALIGNED_DATA linker script macro.
>   Add new INIT_TASK_DATA() linker script macro.
>   Add new READ_MOSTLY_DATA(align) linker script macro.

I am about to apply this part of your patches.
I am doing some additional modifications and
will most likely apply them as one patch.

Will post to linux-arch for review when it is ready.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-01 14:21   ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 14:21 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Benjamin Herrenschmidt, Bryan Wu,
	Chris Zankel, Cyrill Gorcunov, David Howells, David S. Miller,
	dev-etrax, Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Jesper Nilsson, Kyle McMartin,
	Linus Torvalds

On Thu, Apr 30, 2009 at 03:54:07PM -0400, Tim Abbott wrote:
> (this patch series differs from v1 only in the CC list; some of the
> architecture lists I sent the previous one to are moderated against
> non-members; all replies should go to this version).
> 
> Here are the architecture-independent macro definitions needed for
> to clean up the kernel's section names.  The overall diffstat from
> this section name cleanup project is:
> 
>  96 files changed, 261 insertions(+), 503 deletions(-)
> 
> The decrease results from removing a lot of redundancy in the linker
> scripts.
> 
> 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 */
> 
> Sam Ravnborg proposed that rather than just renaming all the sections
> outright, we should start by first getting more control over the
> section names used in the kernel so that we can later rename sections
> without touching too many files.  These patch series implement that
> cleanup.  Later, there will be another patch series to actually rename
> the sections.
> 
> I'm hoping we can get just these macro definitions into 2.6.30 so that
> the arch maintainers don't have to grab the macro definitions for
> their trees while reviewing the patches for 2.6.31.
> 
> Shortly, I'm going to send one patch series for each of the
> architectures updating those architectures to use these new macros
> (and otherwise cleaning up section names on those architectures).
> 
> 	-Tim Abbott
> 
> Tim Abbott (6):
>   Add new macros for page-aligned data and bss sections.
>   Add new NOSAVE_DATA linker script macro.
>   Add new CACHELINE_ALIGNED_DATA linker script macro.
>   Add new INIT_TASK_DATA() linker script macro.
>   Add new READ_MOSTLY_DATA(align) linker script macro.

I am about to apply this part of your patches.
I am doing some additional modifications and
will most likely apply them as one patch.

Will post to linux-arch for review when it is ready.

	Sam


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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
       [not found]         ` <alpine.DEB.1.10.0905010951100.3955-KERi1O17UK+7LhyUQnA0IJVzexx5G7lz@public.gmane.org>
  2009-05-01 16:33             ` H. Peter Anvin
  (?)
@ 2009-05-01 16:33             ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 16:33 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Sam Ravnborg, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Tim Abbott wrote:
> On Fri, 1 May 2009, Sam Ravnborg wrote:
> 
>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>> It is my understanding that the linker will automatically
>> assume nobits for section names starting with .bss and likewise
>> progbits for section names starting with .data - so we can leave them out?
> 
> I believe that is correct.
> 

... but that doesn't mean it's the right thing to do.

It's better to be fully explicit when macroizing this kind of stuff.
This is part of why macroizing it is good: it means we end up with *one*
place that determines this stuff, not some magic heuristics in the linker.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 16:33             ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 16:33 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Sam Ravnborg, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Tim Abbott wrote:
> On Fri, 1 May 2009, Sam Ravnborg wrote:
> 
>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>> It is my understanding that the linker will automatically
>> assume nobits for section names starting with .bss and likewise
>> progbits for section names starting with .data - so we can leave them out?
> 
> I believe that is correct.
> 

... but that doesn't mean it's the right thing to do.

It's better to be fully explicit when macroizing this kind of stuff.
This is part of why macroizing it is good: it means we end up with *one*
place that determines this stuff, not some magic heuristics in the linker.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 16:33             ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 16:33 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Sam Ravnborg, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds, linux-alpha, linux-ia64,
	linux-m68k, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

Tim Abbott wrote:
> On Fri, 1 May 2009, Sam Ravnborg wrote:
> 
>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>> It is my understanding that the linker will automatically
>> assume nobits for section names starting with .bss and likewise
>> progbits for section names starting with .data - so we can leave them out?
> 
> I believe that is correct.
> 

... but that doesn't mean it's the right thing to do.

It's better to be fully explicit when macroizing this kind of stuff.
This is part of why macroizing it is good: it means we end up with *one*
place that determines this stuff, not some magic heuristics in the linker.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 16:33             ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 16:33 UTC (permalink / raw)
  To: Tim Abbott
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Heiko Carstens, linuxppc-dev, Paul Mackerras, Greg Ungerer,
	sparclinux, Sam Ravnborg, Thomas Gleixner, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, Russell King, user-mode-linux-devel,
	microblaze-uclinux, Jeff Dike, Jeff Arnold, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Waseem Daher,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

Tim Abbott wrote:
> On Fri, 1 May 2009, Sam Ravnborg wrote:
> 
>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>> It is my understanding that the linker will automatically
>> assume nobits for section names starting with .bss and likewise
>> progbits for section names starting with .data - so we can leave them out?
> 
> I believe that is correct.
> 

... but that doesn't mean it's the right thing to do.

It's better to be fully explicit when macroizing this kind of stuff.
This is part of why macroizing it is good: it means we end up with *one*
place that determines this stuff, not some magic heuristics in the linker.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
  2009-05-01 16:33             ` H. Peter Anvin
  (?)
  (?)
@ 2009-05-01 17:17               ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:17 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds

On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> Tim Abbott wrote:
> > On Fri, 1 May 2009, Sam Ravnborg wrote:
> > 
> >> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >> It is my understanding that the linker will automatically
> >> assume nobits for section names starting with .bss and likewise
> >> progbits for section names starting with .data - so we can leave them out?
> > 
> > I believe that is correct.
> > 
> 
> ... but that doesn't mean it's the right thing to do.
> 
> It's better to be fully explicit when macroizing this kind of stuff.
> This is part of why macroizing it is good: it means we end up with *one*
> place that determines this stuff, not some magic heuristics in the linker.

Do you know if we can use % in place of @?
I could see that gas supports both - at least in trunk in cvs.

	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:17               ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:17 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds

On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> Tim Abbott wrote:
> > On Fri, 1 May 2009, Sam Ravnborg wrote:
> > 
> >> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >> It is my understanding that the linker will automatically
> >> assume nobits for section names starting with .bss and likewise
> >> progbits for section names starting with .data - so we can leave them out?
> > 
> > I believe that is correct.
> > 
> 
> ... but that doesn't mean it's the right thing to do.
> 
> It's better to be fully explicit when macroizing this kind of stuff.
> This is part of why macroizing it is good: it means we end up with *one*
> place that determines this stuff, not some magic heuristics in the linker.

Do you know if we can use % in place of @?
I could see that gas supports both - at least in trunk in cvs.

	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:17               ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:17 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds, linux-alpha, linux-ia64,
	linux-m68k, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> Tim Abbott wrote:
> > On Fri, 1 May 2009, Sam Ravnborg wrote:
> > 
> >> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >> It is my understanding that the linker will automatically
> >> assume nobits for section names starting with .bss and likewise
> >> progbits for section names starting with .data - so we can leave them out?
> > 
> > I believe that is correct.
> > 
> 
> ... but that doesn't mean it's the right thing to do.
> 
> It's better to be fully explicit when macroizing this kind of stuff.
> This is part of why macroizing it is good: it means we end up with *one*
> place that determines this stuff, not some magic heuristics in the linker.

Do you know if we can use % in place of @?
I could see that gas supports both - at least in trunk in cvs.

	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:17               ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:17 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Tim Abbott, Heiko Carstens, linuxppc-dev, Paul Mackerras,
	Greg Ungerer, sparclinux, Thomas Gleixner, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, Russell King, user-mode-linux-devel,
	microblaze-uclinux, Jeff Dike, Jeff Arnold, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Waseem Daher,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> Tim Abbott wrote:
> > On Fri, 1 May 2009, Sam Ravnborg wrote:
> > 
> >> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >> It is my understanding that the linker will automatically
> >> assume nobits for section names starting with .bss and likewise
> >> progbits for section names starting with .data - so we can leave them out?
> > 
> > I believe that is correct.
> > 
> 
> ... but that doesn't mean it's the right thing to do.
> 
> It's better to be fully explicit when macroizing this kind of stuff.
> This is part of why macroizing it is good: it means we end up with *one*
> place that determines this stuff, not some magic heuristics in the linker.

Do you know if we can use % in place of @?
I could see that gas supports both - at least in trunk in cvs.

	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
       [not found]               ` <20090501171717.GA26401-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
  2009-05-01 17:18                   ` H. Peter Anvin
  (?)
@ 2009-05-01 17:18                   ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:18 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Sam Ravnborg wrote:
> On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
>> Tim Abbott wrote:
>>> On Fri, 1 May 2009, Sam Ravnborg wrote:
>>>
>>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>>>> It is my understanding that the linker will automatically
>>>> assume nobits for section names starting with .bss and likewise
>>>> progbits for section names starting with .data - so we can leave them out?
>>> I believe that is correct.
>>>
>> ... but that doesn't mean it's the right thing to do.
>>
>> It's better to be fully explicit when macroizing this kind of stuff.
>> This is part of why macroizing it is good: it means we end up with *one*
>> place that determines this stuff, not some magic heuristics in the linker.
> 
> Do you know if we can use % in place of @?
> I could see that gas supports both - at least in trunk in cvs.
> 

I think it might depend on the architecture(!)... but it would
definitely have to be an issue with testing a bunch of different versions.

What's wrong with @?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:18                   ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:18 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Sam Ravnborg wrote:
> On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
>> Tim Abbott wrote:
>>> On Fri, 1 May 2009, Sam Ravnborg wrote:
>>>
>>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>>>> It is my understanding that the linker will automatically
>>>> assume nobits for section names starting with .bss and likewise
>>>> progbits for section names starting with .data - so we can leave them out?
>>> I believe that is correct.
>>>
>> ... but that doesn't mean it's the right thing to do.
>>
>> It's better to be fully explicit when macroizing this kind of stuff.
>> This is part of why macroizing it is good: it means we end up with *one*
>> place that determines this stuff, not some magic heuristics in the linker.
> 
> Do you know if we can use % in place of @?
> I could see that gas supports both - at least in trunk in cvs.
> 

I think it might depend on the architecture(!)... but it would
definitely have to be an issue with testing a bunch of different versions.

What's wrong with @?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:18                   ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:18 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds, linux-alpha, linux-ia64,
	linux-m68k, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

Sam Ravnborg wrote:
> On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
>> Tim Abbott wrote:
>>> On Fri, 1 May 2009, Sam Ravnborg wrote:
>>>
>>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>>>> It is my understanding that the linker will automatically
>>>> assume nobits for section names starting with .bss and likewise
>>>> progbits for section names starting with .data - so we can leave them out?
>>> I believe that is correct.
>>>
>> ... but that doesn't mean it's the right thing to do.
>>
>> It's better to be fully explicit when macroizing this kind of stuff.
>> This is part of why macroizing it is good: it means we end up with *one*
>> place that determines this stuff, not some magic heuristics in the linker.
> 
> Do you know if we can use % in place of @?
> I could see that gas supports both - at least in trunk in cvs.
> 

I think it might depend on the architecture(!)... but it would
definitely have to be an issue with testing a bunch of different versions.

What's wrong with @?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:18                   ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:18 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Tim Abbott, Heiko Carstens, linuxppc-dev, Paul Mackerras,
	Greg Ungerer, sparclinux, Thomas Gleixner, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, Russell King, user-mode-linux-devel,
	microblaze-uclinux, Jeff Dike, Jeff Arnold, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Waseem Daher,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

Sam Ravnborg wrote:
> On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
>> Tim Abbott wrote:
>>> On Fri, 1 May 2009, Sam Ravnborg wrote:
>>>
>>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
>>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
>>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
>>>> It is my understanding that the linker will automatically
>>>> assume nobits for section names starting with .bss and likewise
>>>> progbits for section names starting with .data - so we can leave them out?
>>> I believe that is correct.
>>>
>> ... but that doesn't mean it's the right thing to do.
>>
>> It's better to be fully explicit when macroizing this kind of stuff.
>> This is part of why macroizing it is good: it means we end up with *one*
>> place that determines this stuff, not some magic heuristics in the linker.
> 
> Do you know if we can use % in place of @?
> I could see that gas supports both - at least in trunk in cvs.
> 

I think it might depend on the architecture(!)... but it would
definitely have to be an issue with testing a bunch of different versions.

What's wrong with @?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
  2009-05-01 17:18                   ` H. Peter Anvin
  (?)
  (?)
@ 2009-05-01 17:44                     ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:44 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds

On Fri, May 01, 2009 at 10:18:20AM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> > On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> >> Tim Abbott wrote:
> >>> On Fri, 1 May 2009, Sam Ravnborg wrote:
> >>>
> >>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >>>> It is my understanding that the linker will automatically
> >>>> assume nobits for section names starting with .bss and likewise
> >>>> progbits for section names starting with .data - so we can leave them out?
> >>> I believe that is correct.
> >>>
> >> ... but that doesn't mean it's the right thing to do.
> >>
> >> It's better to be fully explicit when macroizing this kind of stuff.
> >> This is part of why macroizing it is good: it means we end up with *one*
> >> place that determines this stuff, not some magic heuristics in the linker.
> > 
> > Do you know if we can use % in place of @?
> > I could see that gas supports both - at least in trunk in cvs.
> > 
> 
> I think it might depend on the architecture(!)... but it would
> definitely have to be an issue with testing a bunch of different versions.
> 
> What's wrong with @?
arm does not support it :-(
I recall it denote a comment in arm assembler.

I could do some magic to detect the ARM case but I'm reluctant to do so.
I could also ignore the arm issue for now as it is not used by arm,
but that strikes me as the wrong approach.


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:44                     ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:44 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds

On Fri, May 01, 2009 at 10:18:20AM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> > On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> >> Tim Abbott wrote:
> >>> On Fri, 1 May 2009, Sam Ravnborg wrote:
> >>>
> >>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >>>> It is my understanding that the linker will automatically
> >>>> assume nobits for section names starting with .bss and likewise
> >>>> progbits for section names starting with .data - so we can leave them out?
> >>> I believe that is correct.
> >>>
> >> ... but that doesn't mean it's the right thing to do.
> >>
> >> It's better to be fully explicit when macroizing this kind of stuff.
> >> This is part of why macroizing it is good: it means we end up with *one*
> >> place that determines this stuff, not some magic heuristics in the linker.
> > 
> > Do you know if we can use % in place of @?
> > I could see that gas supports both - at least in trunk in cvs.
> > 
> 
> I think it might depend on the architecture(!)... but it would
> definitely have to be an issue with testing a bunch of different versions.
> 
> What's wrong with @?
arm does not support it :-(
I recall it denote a comment in arm assembler.

I could do some magic to detect the ARM case but I'm reluctant to do so.
I could also ignore the arm issue for now as it is not used by arm,
but that strikes me as the wrong approach.


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:44                     ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:44 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds, linux-alpha, linux-ia64,
	linux-m68k, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

On Fri, May 01, 2009 at 10:18:20AM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> > On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> >> Tim Abbott wrote:
> >>> On Fri, 1 May 2009, Sam Ravnborg wrote:
> >>>
> >>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >>>> It is my understanding that the linker will automatically
> >>>> assume nobits for section names starting with .bss and likewise
> >>>> progbits for section names starting with .data - so we can leave them out?
> >>> I believe that is correct.
> >>>
> >> ... but that doesn't mean it's the right thing to do.
> >>
> >> It's better to be fully explicit when macroizing this kind of stuff.
> >> This is part of why macroizing it is good: it means we end up with *one*
> >> place that determines this stuff, not some magic heuristics in the linker.
> > 
> > Do you know if we can use % in place of @?
> > I could see that gas supports both - at least in trunk in cvs.
> > 
> 
> I think it might depend on the architecture(!)... but it would
> definitely have to be an issue with testing a bunch of different versions.
> 
> What's wrong with @?
arm does not support it :-(
I recall it denote a comment in arm assembler.

I could do some magic to detect the ARM case but I'm reluctant to do so.
I could also ignore the arm issue for now as it is not used by arm,
but that strikes me as the wrong approach.


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:44                     ` Sam Ravnborg
  0 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 17:44 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Tim Abbott, Heiko Carstens, linuxppc-dev, Paul Mackerras,
	Greg Ungerer, sparclinux, Thomas Gleixner, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, Russell King, user-mode-linux-devel,
	microblaze-uclinux, Jeff Dike, Jeff Arnold, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Waseem Daher,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

On Fri, May 01, 2009 at 10:18:20AM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> > On Fri, May 01, 2009 at 09:33:13AM -0700, H. Peter Anvin wrote:
> >> Tim Abbott wrote:
> >>> On Fri, 1 May 2009, Sam Ravnborg wrote:
> >>>
> >>>> On Thu, Apr 30, 2009 at 03:54:08PM -0400, Tim Abbott wrote:
> >>>>> +#define __PAGE_ALIGNED_DATA	.section ".data.page_aligned", "aw", @progbits
> >>>>> +#define __PAGE_ALIGNED_BSS	.section ".bss.page_aligned", "aw", @nobits
> >>>> It is my understanding that the linker will automatically
> >>>> assume nobits for section names starting with .bss and likewise
> >>>> progbits for section names starting with .data - so we can leave them out?
> >>> I believe that is correct.
> >>>
> >> ... but that doesn't mean it's the right thing to do.
> >>
> >> It's better to be fully explicit when macroizing this kind of stuff.
> >> This is part of why macroizing it is good: it means we end up with *one*
> >> place that determines this stuff, not some magic heuristics in the linker.
> > 
> > Do you know if we can use % in place of @?
> > I could see that gas supports both - at least in trunk in cvs.
> > 
> 
> I think it might depend on the architecture(!)... but it would
> definitely have to be an issue with testing a bunch of different versions.
> 
> What's wrong with @?
arm does not support it :-(
I recall it denote a comment in arm assembler.

I could do some magic to detect the ARM case but I'm reluctant to do so.
I could also ignore the arm issue for now as it is not used by arm,
but that strikes me as the wrong approach.


	Sam

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
       [not found]                     ` <20090501174457.GA26559-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
  2009-05-01 17:47                         ` H. Peter Anvin
  (?)
@ 2009-05-01 17:47                         ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:47 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Sam Ravnborg wrote:
>>
>> What's wrong with @?
> arm does not support it :-(
> I recall it denote a comment in arm assembler.
> 
> I could do some magic to detect the ARM case but I'm reluctant to do so.
> I could also ignore the arm issue for now as it is not used by arm,
> but that strikes me as the wrong approach.
> 

If we really have to use different tokens, I would say:

#ifdef __ARM__
# define _PROGBITS %progbits	/* or whatever */
# define _NOBITS   %nobits
#else
# define _PROGBITS @progbits
# define _NOBITS   @nobits
#endif

Otherwise we probably need to ask the binutils people...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:47                         ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:47 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax-VrBV9hrLPhE,
	Geert Uytterhoeven, Greg Ungerer, Haavard Skinnemoen,
	Heiko Carstens, Helge Deller, Hirokazu Takata, Ingo Molnar,
	Jeff Dike

Sam Ravnborg wrote:
>>
>> What's wrong with @?
> arm does not support it :-(
> I recall it denote a comment in arm assembler.
> 
> I could do some magic to detect the ARM case but I'm reluctant to do so.
> I could also ignore the arm issue for now as it is not used by arm,
> but that strikes me as the wrong approach.
> 

If we really have to use different tokens, I would say:

#ifdef __ARM__
# define _PROGBITS %progbits	/* or whatever */
# define _NOBITS   %nobits
#else
# define _PROGBITS @progbits
# define _NOBITS   @nobits
#endif

Otherwise we probably need to ask the binutils people...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:47                         ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:47 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tim Abbott, Linux kernel mailing list, Anders Kaseorg,
	Waseem Daher, Denys Vlasenko, Jeff Arnold,
	Benjamin Herrenschmidt, Bryan Wu, Chris Zankel, Cyrill Gorcunov,
	David Howells, David S. Miller, dev-etrax, Geert Uytterhoeven,
	Greg Ungerer, Haavard Skinnemoen, Heiko Carstens, Helge Deller,
	Hirokazu Takata, Ingo Molnar, Jeff Dike, Jesper Nilsson,
	Kyle McMartin, Linus Torvalds, linux-alpha, linux-ia64,
	linux-m68k, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	linux-sh, Martin Schwidefsky, Michal Simek, microblaze-uclinux,
	Mikael Starvik, Paul Mackerras, Paul Mundt, Ralf Baechle,
	Richard Henderson, Roman Zippel, Russell King, sparclinux,
	Thomas Gleixner, Tony Luck, uclinux-dist-devel,
	user-mode-linux-devel, Yoshinori Sato

Sam Ravnborg wrote:
>>
>> What's wrong with @?
> arm does not support it :-(
> I recall it denote a comment in arm assembler.
> 
> I could do some magic to detect the ARM case but I'm reluctant to do so.
> I could also ignore the arm issue for now as it is not used by arm,
> but that strikes me as the wrong approach.
> 

If we really have to use different tokens, I would say:

#ifdef __ARM__
# define _PROGBITS %progbits	/* or whatever */
# define _NOBITS   %nobits
#else
# define _PROGBITS @progbits
# define _NOBITS   @nobits
#endif

Otherwise we probably need to ask the binutils people...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 17:47                         ` H. Peter Anvin
  0 siblings, 0 replies; 95+ messages in thread
From: H. Peter Anvin @ 2009-05-01 17:47 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Tim Abbott, Heiko Carstens, linuxppc-dev, Paul Mackerras,
	Greg Ungerer, sparclinux, Thomas Gleixner, linux-s390,
	Jesper Nilsson, Yoshinori Sato, Helge Deller, Ingo Molnar,
	Geert Uytterhoeven, Russell King, user-mode-linux-devel,
	microblaze-uclinux, Jeff Dike, Jeff Arnold, dev-etrax,
	Mikael Starvik, Cyrill Gorcunov, Michal Simek, Waseem Daher,
	Richard Henderson, Chris Zankel, Bryan Wu, Tony Luck,
	linux-parisc, Haavard Skinnemoen, Hirokazu Takata,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, David S. Miller

Sam Ravnborg wrote:
>>
>> What's wrong with @?
> arm does not support it :-(
> I recall it denote a comment in arm assembler.
> 
> I could do some magic to detect the ARM case but I'm reluctant to do so.
> I could also ignore the arm issue for now as it is not used by arm,
> but that strikes me as the wrong approach.
> 

If we really have to use different tokens, I would say:

#ifdef __ARM__
# define _PROGBITS %progbits	/* or whatever */
# define _NOBITS   %nobits
#else
# define _PROGBITS @progbits
# define _NOBITS   @nobits
#endif

Otherwise we probably need to ask the binutils people...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-04-30 19:54 ` Tim Abbott
                   ` (6 preceding siblings ...)
  (?)
@ 2009-05-01 21:31 ` Sam Ravnborg
  2009-05-02  0:48   ` Tim Abbott
  -1 siblings, 1 reply; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-01 21:31 UTC (permalink / raw)
  To: Tim Abbott; +Cc: Linux kernel mailing list, linux arch

Hi Tim.

[cc trimmed so this hits lkml]

I've tried to make the patch to vmlinux.lds.h more complete.
With this patch I managed to achive the following diffstat:

 arch/mips/kernel/vmlinux.lds.S    |   70 ++----------------
 arch/mn10300/kernel/vmlinux.lds.S |   82 +++-------------------
 arch/sparc/kernel/vmlinux.lds.S   |   82 +++-------------------
 include/asm-generic/vmlinux.lds.h |  139 ++++++++++++++++++++++++++++++++++++-
 4 files changed, 165 insertions(+), 208 deletions(-)

So with 3 architecture I have more lines deleted than added.
None of these has been build tested but this shows the potential.

Below you will find the *untested* patch for vmlinux.lds.h.
This is the way I want to go where we have more complete
definitions in the shared file and we try to keep the arch
linker scripts to the arch specifc stuff.

This is not a 1:1 replacement for your patches as they touches files
outside vmlinux.lds.h but I concentrated on this single file for now.

Comments welcome!

	Sam

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..950d0d7 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -116,6 +116,43 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+/*
+ * Data section helpers
+ */
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	VMLINUX_SYMBOL(__nosave_begin) = .;				\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	VMLINUX_SYMBOL(__nosave_end) = .;
+
+#define PAGE_ALIGNED_DATA(page_align)					\
+	. = ALIGN((page_align));					\
+	*(.data.page_aligned)
+
+#define READ_MOSTLY_DATA(align)						\
+	. = ALIGN((align));						\
+	*(.data.read_mostly)
+
+#define CACHELINE_ALIGNED_DATA(align)					\
+	. = ALIGN((align));						\
+	*(.data.cacheline_aligned)
+
+/* use 0 as page_align if page_aligned data is not used */
+#define RW_DATA(page_align, readmostly_align, cache_align)		\
+	. = ALIGN(PAGE_SIZE);						\
+	.data : AT(ADDR(.data) - LOAD_OFFSET) {				\
+		DATA_DATA						\
+		CONSTRUCTORS						\
+		NOSAVE_DATA						\
+		PAGE_ALIGNED_DATA(page_align)				\
+		READMOSTLY_DATA((readmostly_align))			\
+		CACHELINE_ALIGNED_DATA((cache_align))			\
+	}
+
+/*
+ * Read only Data
+ */
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
@@ -274,6 +311,18 @@
  * All archs are supposed to use RO_DATA() */
 #define RODATA RO_DATA(4096)
 
+#ifdef CONFIG_BLK_DEV_INITRD
+#define INITRAMFS							\
+	. = ALIGN(PAGE_SIZE);						\
+	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {		\
+		VMLINUX_SYMBOL(__initramfs_start) = .;			\
+		*(.init.ramfs)						\
+		VMLINUX_SYMBOL(__initramfs_end) = .;			\
+	}
+#else
+#define INITRAMFS
+#endif
+
 #define SECURITY_INIT							\
 	.security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
 		VMLINUX_SYMBOL(__security_initcall_start) = .;		\
@@ -281,6 +330,24 @@
 		VMLINUX_SYMBOL(__security_initcall_end) = .;		\
 	}
 
+#define INITDATA(initsetup_align)					\
+	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
+		INIT_DATA						\
+		. = ALIGN(initsetup_align);				\
+		VMLINUX_SYMBOL(__setup_start) = .;			\
+		*(.init.setup)						\
+		VMLINUX_SYMBOL(__setup_end) = .;			\
+		VMLINUX_SYMBOL(__initcall_start) = .;			\
+		INITCALLS						\
+		VMLINUX_SYMBOL(__initcall_end) = .;			\
+		VMLINUX_SYMBOL(__con_initcall_start) = .;		\
+		*(.con_initcall.init)					\
+		VMLINUX_SYMBOL(__con_initcall_end) = .;
+		VMLINUX_SYMBOL(__security_initcall_start) = .;		\
+		*(.security_initcall.init)				\
+		VMLINUX_SYMBOL(__security_initcall_end) = .;		\
+	}
+
 /* .text section. Map to function alignment to avoid address changes
  * during second ld run in second ld pass when generating System.map */
 #define TEXT_TEXT							\
@@ -332,6 +399,29 @@
 /* Section used for early init (in .S files) */
 #define HEAD_TEXT  *(HEAD_TEXT_SECTION)
 
+/*
+ * Exception table
+ */
+#define EXCEPTION_TABLE(align)						\
+	. = ALIGN((align));						\
+	__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {		\
+		VMLINUX_SYMBOL(__start___ex_table) = .;			\
+		*(__ex_table)						\
+		VMLINUX_SYMBOL(__stop___ex_table) = .;			\
+	}
+
+/*
+ * Init task
+ */
+#define INIT_TASK							\
+	*(.data.init_task)
+
+#define INIT_TASK_DATA(align)						\
+	. = ALIGN((align));						\
+	.data.init_task : {						\
+		INIT_TASK						\
+	}
+
 /* init and exit section handling */
 #define INIT_DATA							\
 	*(.init.data)							\
@@ -363,9 +453,52 @@
 	CPU_DISCARD(exit.text)						\
 	MEM_DISCARD(exit.text)
 
-		/* DWARF debug sections.
-		Symbols in the DWARF debugging sections are relative to
-		the beginning of the section so we begin them at 0.  */
+#define INITTEXT(inittext_align)					\
+	. = ALIGN((inittext_align));					\
+	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {		\
+		VMLINUX_SYMBOL(__init_begin) = .;			\
+		VMLINUX_SYMBOL(_sinittext) = .;				\
+		INIT_TEXT						\
+		VMLINUX_SYMBOL(_einittext) = .;				\
+	}
+
+#define INITDATA(initdata_align)					\
+	. = ALIGN((initdata_align));					\
+	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
+		INIT_DATA						\
+	}
+
+/*
+ * bss
+ */
+#define SBSS(sbss_align)						\
+	. = ALIGN((sbss_align));					\
+	.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {				\
+		*(.sbss)						\
+		*(.scommon)						\
+	}
+
+#define BSS(bss_align)							\
+	. = ALIGN((bss_align));						\
+	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {				\
+		*(.bss.page_aligned)					\
+		*(.dynbss)						\
+		*(.bss)							\
+		*(COMMON)						\
+	}
+
+#define SBSS_BSS(sbss_align, bss_align)					\
+	VMLINUX_SYMBOL(__bss_start) = .;				\
+	SBSS(sbss_align)						\
+	BSS(bss_align)							\
+	ALIGN_FUNCTION();						\
+	VMLINUX_SYMBOL(__bss_stop) = .;
+
+/*
+ * DWARF debug sections.
+ * Symbols in the DWARF debugging sections are relative to
+ * the beginning of the section so we begin them at 0.
+ */
 #define DWARF_DEBUG							\
 		/* DWARF 1 */						\
 		.debug          0 : { *(.debug) }			\

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
  2009-05-01 17:47                         ` H. Peter Anvin
  (?)
@ 2009-05-01 23:02                           ` Andreas Schwab
  -1 siblings, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2009-05-01 23:02 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Sam Ravnborg, linux-mips, linux-m68k, linux-ia64, linux-sh,
	Denys Vlasenko, Tim Abbott, Heiko Carstens, linuxppc-dev,
	Paul Mackerras, Greg Ungerer, sparclinux, Thomas Gleixner,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, Russell King,
	user-mode-linux-devel, microblaze-uclinux, Jeff Dike,
	Jeff Arnold, dev-etrax, Mikael Starvik

"H. Peter Anvin" <hpa@zytor.com> writes:

> Sam Ravnborg wrote:
>>>
>>> What's wrong with @?
>> arm does not support it :-(
>> I recall it denote a comment in arm assembler.
>> 
>> I could do some magic to detect the ARM case but I'm reluctant to do so.
>> I could also ignore the arm issue for now as it is not used by arm,
>> but that strikes me as the wrong approach.
>> 
>
> If we really have to use different tokens, I would say:
>
> #ifdef __ARM__
> # define _PROGBITS %progbits	/* or whatever */
> # define _NOBITS   %nobits
> #else
> # define _PROGBITS @progbits
> # define _NOBITS   @nobits
> #endif

GAS has always supported both '@' and '%', so '%' can be used
everywhere.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 23:02                           ` Andreas Schwab
  0 siblings, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2009-05-01 23:02 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Sam Ravnborg, linux-mips, linux-m68k, linux-ia64, linux-sh,
	Denys Vlasenko, Tim Abbott, Heiko Carstens, linuxppc-dev,
	Paul Mackerras, Greg Ungerer, sparclinux, Thomas Gleixner,
	linux-s390, Jesper Nilsson, Yoshinori Sato, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, Russell King,
	user-mode-linux-devel, microblaze-uclinux, Jeff Dike,
	Jeff Arnold, dev-etrax, Mikael Starvik, Cyrill Gorcunov,
	Michal Simek, Waseem Daher, Richard Henderson, Chris Zankel,
	Bryan Wu, Tony Luck, linux-parisc, Haavard Skinnemoen,
	Hirokazu Takata, Linux kernel mailing list, Ralf Baechle,
	Anders Kaseorg, Kyle McMartin, Paul Mundt, linux-alpha,
	Martin Schwidefsky, uclinux-dist-devel, Linus Torvalds,
	David S. Miller

"H. Peter Anvin" <hpa@zytor.com> writes:

> Sam Ravnborg wrote:
>>>
>>> What's wrong with @?
>> arm does not support it :-(
>> I recall it denote a comment in arm assembler.
>> 
>> I could do some magic to detect the ARM case but I'm reluctant to do so.
>> I could also ignore the arm issue for now as it is not used by arm,
>> but that strikes me as the wrong approach.
>> 
>
> If we really have to use different tokens, I would say:
>
> #ifdef __ARM__
> # define _PROGBITS %progbits	/* or whatever */
> # define _NOBITS   %nobits
> #else
> # define _PROGBITS @progbits
> # define _NOBITS   @nobits
> #endif

GAS has always supported both '@' and '%', so '%' can be used
everywhere.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2 1/6] Add new macros for page-aligned data and bss sections.
@ 2009-05-01 23:02                           ` Andreas Schwab
  0 siblings, 0 replies; 95+ messages in thread
From: Andreas Schwab @ 2009-05-01 23:02 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-mips, linux-m68k, linux-ia64, linux-sh, Denys Vlasenko,
	Tim Abbott, Heiko Carstens, linuxppc-dev, Waseem, Paul Mackerras,
	Greg Ungerer, sparclinux, Sam Ravnborg, Bryan Wu, linux-s390,
	Jesper Nilsson, Yoshinori Sato, David S. Miller, Helge Deller,
	Ingo Molnar, Geert Uytterhoeven, Russell King,
	user-mode-linux-devel, microblaze-uclinux, Jeff Dike,
	Jeff Arnold, Michal Simek, Mikael Starvik, Cyrill Gorcunov,
	Thomas Gleixner, Daher, Richard Henderson, Chris Zankel,
	dev-etrax, Tony Luck, Haavard Skinnemoen, linux-parisc,
	Linux kernel mailing list, Ralf Baechle, Anders Kaseorg,
	Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
	uclinux-dist-devel, Linus Torvalds, Hirokazu Takata

"H. Peter Anvin" <hpa@zytor.com> writes:

> Sam Ravnborg wrote:
>>>
>>> What's wrong with @?
>> arm does not support it :-(
>> I recall it denote a comment in arm assembler.
>> 
>> I could do some magic to detect the ARM case but I'm reluctant to do so.
>> I could also ignore the arm issue for now as it is not used by arm,
>> but that strikes me as the wrong approach.
>> 
>
> If we really have to use different tokens, I would say:
>
> #ifdef __ARM__
> # define _PROGBITS %progbits	/* or whatever */
> # define _NOBITS   %nobits
> #else
> # define _PROGBITS @progbits
> # define _NOBITS   @nobits
> #endif

GAS has always supported both '@' and '%', so '%' can be used
everywhere.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-01 21:31 ` Sam Ravnborg
@ 2009-05-02  0:48   ` Tim Abbott
  2009-05-02 22:01     ` Sam Ravnborg
  0 siblings, 1 reply; 95+ messages in thread
From: Tim Abbott @ 2009-05-02  0:48 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Linux kernel mailing list, linux arch, Anders Kaseorg

On Fri, 1 May 2009, Sam Ravnborg wrote:

> This is the way I want to go where we have more complete
> definitions in the shared file and we try to keep the arch
> linker scripts to the arch specifc stuff.

I like the general look of this.  Indeed, I was planning to work on 
something like this as a follow-on to the linker script cleanup work I've 
done so far.

Some comments on the details are below.

> +#define PAGE_ALIGNED_DATA(page_align)                                \
> +     . = ALIGN((page_align));                                        \
> +     *(.data.page_aligned)

Why does this need an argument?  You should be able to just align to 
PAGE_SIZE.

Also, I'm not sure what you're trying to do with the double parentheses 
here (it also appears inconsistently in several other places in this 
patch).

> +/* use 0 as page_align if page_aligned data is not used */ 
> +#define RW_DATA(page_align, readmostly_align, cache_align)           \
> +     . = ALIGN(PAGE_SIZE);                                           \
> +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
> +             DATA_DATA                                               \
> +             CONSTRUCTORS                                            \
> +             NOSAVE_DATA                                             \
> +             PAGE_ALIGNED_DATA(page_align)                           \
> +             READMOSTLY_DATA((readmostly_align))                     \
> +             CACHELINE_ALIGNED_DATA((cache_align))                   \
> +     }

I think there are several architectures that have some other stuff in 
their .data output section (e.g. powerpc, frv, ia64), so we won't be able 
to use this on all architectures.  

Perhaps we want an intermediate macro between DATA_DATA and RW_DATA that 
is just the contents of .data here that those architectuere can use?

> +#define INITDATA(initsetup_align)					\
> +	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
> +		INIT_DATA						\
> +		. = ALIGN(initsetup_align);				\
> +               VMLINUX_SYMBOL(__setup_start) = .;                    \
> +               *(.init.setup)                                        \
[...]
> +#define INITDATA(initdata_align)					\
> +	. = ALIGN((initdata_align));					\
> +	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
> +		INIT_DATA						\
> +	}

You define two different macros called INITDATA; I'm not sure what the 
intention is here.

> +#define INIT_TASK                                                    \
> +     *(.data.init_task)
> +             
> +#define INIT_TASK_DATA(align)                                                
> +     . = ALIGN((align));                                             \
> +     .data.init_task : {                                             \
> +             INIT_TASK                                               \
> +     }
> +

You mentioned elsewhere you thought .data.init_task needs to be its own 
output section rather than part of the .data output section; why is that?  
There are several architectures on which it is part of the .data output 
section (e.g. sh, um, avr32).

Also, I think it is possible that INIT_TASK_DATA could just align to 
THREAD_SIZE rather than taking an argument.  While working on my patches 
for this I noticed there were only a couple of architectures where the 
alignment wasn't THREAD_SIZE (or a value equal to THREAD_SIZE was used).  
One exception was parisc, where the aligment is 16384 and THREAD_SIZE is 
always at least that but could be bigger in some configs where PAGE_SIZE 
is bigger.  I'm not sure whether this one exception is a bug.

	-Tim Abbott

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-02  0:48   ` Tim Abbott
@ 2009-05-02 22:01     ` Sam Ravnborg
  2009-05-04 14:27       ` Sam Ravnborg
  0 siblings, 1 reply; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-02 22:01 UTC (permalink / raw)
  To: Tim Abbott; +Cc: Linux kernel mailing list, linux arch, Anders Kaseorg

On Fri, May 01, 2009 at 08:48:53PM -0400, Tim Abbott wrote:
> On Fri, 1 May 2009, Sam Ravnborg wrote:
> 
> > This is the way I want to go where we have more complete
> > definitions in the shared file and we try to keep the arch
> > linker scripts to the arch specifc stuff.
> 
> I like the general look of this.  Indeed, I was planning to work on 
> something like this as a follow-on to the linker script cleanup work I've 
> done so far.

Keep in mind that my primary goal here is to clean up the linker scripts.
Support for -ffunction-sections is only a spin-off of that.
This is why I try to take a broader look at it.

> 
> Some comments on the details are below.
> 
> > +#define PAGE_ALIGNED_DATA(page_align)                                \
> > +     . = ALIGN((page_align));                                        \
> > +     *(.data.page_aligned)
> 
> Why does this need an argument?  You should be able to just align to 
> PAGE_SIZE.
Only a few archs supports .data.page_aligned so those that does not
pass a 0 as alignmnet thus they do not waste any memory.

> 
> Also, I'm not sure what you're trying to do with the double parentheses 
> here (it also appears inconsistently in several other places in this 
> patch).
Old habbit - dropped now.

> 
> > +/* use 0 as page_align if page_aligned data is not used */ 
> > +#define RW_DATA(page_align, readmostly_align, cache_align)           \
> > +     . = ALIGN(PAGE_SIZE);                                           \
> > +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
> > +             DATA_DATA                                               \
> > +             CONSTRUCTORS                                            \
> > +             NOSAVE_DATA                                             \
> > +             PAGE_ALIGNED_DATA(page_align)                           \
> > +             READMOSTLY_DATA((readmostly_align))                     \
> > +             CACHELINE_ALIGNED_DATA((cache_align))                   \
> > +     }
> 
> I think there are several architectures that have some other stuff in 
> their .data output section (e.g. powerpc, frv, ia64), so we won't be able 
> to use this on all architectures.
We have at least two situations to deal with:
1) archs that define more in .data
   They can either define another output section named '.data'
   or they can name it differently.

frv should be able to do:

	RW_DATA(...)

	.data : {
		*(.data.*)
		EXIT_DATA
	}

ld allow us to define identical named output sections
and it will append to the first when it encounter the
name for the second time.

2) archs that do something special.
x86 is an example with has:

        .data : AT(ADDR(.data) - LOAD_OFFSET) {
                DATA_DATA
        } :data

        .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
                *(.data.nosave)
        } :data.init2

See that it add the data section to two different PHDRS.
In this case they cannot use RW_DATA and need to fall
back to the individual defines. 
  
> 
> Perhaps we want an intermediate macro between DATA_DATA and RW_DATA that 
> is just the contents of .data here that those architectuere can use?
> 
> > +#define INITDATA(initsetup_align)					\
> > +	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
> > +		INIT_DATA						\
> > +		. = ALIGN(initsetup_align);				\
> > +               VMLINUX_SYMBOL(__setup_start) = .;                    \
> > +               *(.init.setup)                                        \
> [...]
> > +#define INITDATA(initdata_align)					\
> > +	. = ALIGN((initdata_align));					\
> > +	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
> > +		INIT_DATA						\
> > +	}
> 
> You define two different macros called INITDATA; I'm not sure what the 
> intention is here.
Bug - fixed.

> 
> > +#define INIT_TASK                                                    \
> > +     *(.data.init_task)
> > +             
> > +#define INIT_TASK_DATA(align)                                                
> > +     . = ALIGN((align));                                             \
> > +     .data.init_task : {                                             \
> > +             INIT_TASK                                               \
> > +     }
> > +
> 
> You mentioned elsewhere you thought .data.init_task needs to be its own 
> output section rather than part of the .data output section; why is that? 
> There are several architectures on which it is part of the .data output 
> section (e.g. sh, um, avr32).

I had noticed it was not part of the .data output section in some cases.
But it occur to me not to make any big difference now I have loked
closer so I have moved it inside RW_DATA() for now.

> 
> Also, I think it is possible that INIT_TASK_DATA could just align to 
> THREAD_SIZE rather than taking an argument.  While working on my patches 
> for this I noticed there were only a couple of architectures where the 
> alignment wasn't THREAD_SIZE (or a value equal to THREAD_SIZE was used).  
> One exception was parisc, where the aligment is 16384 and THREAD_SIZE is 
> always at least that but could be bigger in some configs where PAGE_SIZE 
> is bigger.  I'm not sure whether this one exception is a bug.
That triggered some discussions - I will read and see the conclusions.

	Sam

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-02 22:01     ` Sam Ravnborg
@ 2009-05-04 14:27       ` Sam Ravnborg
  2009-05-04 14:30         ` [PATCH/RFC] Sample conversion of powerpc Sam Ravnborg
  2009-05-04 16:32         ` [PATCH v2 0/6] macros for section name cleanup Tim Abbott
  0 siblings, 2 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-04 14:27 UTC (permalink / raw)
  To: Tim Abbott; +Cc: Linux kernel mailing list, linux arch, Anders Kaseorg

On Sun, May 03, 2009 at 12:01:32AM +0200, Sam Ravnborg wrote:
> On Fri, May 01, 2009 at 08:48:53PM -0400, Tim Abbott wrote:
> > On Fri, 1 May 2009, Sam Ravnborg wrote:
> > 
> > > This is the way I want to go where we have more complete
> > > definitions in the shared file and we try to keep the arch
> > > linker scripts to the arch specifc stuff.
> > 
> > I like the general look of this.  Indeed, I was planning to work on 
> > something like this as a follow-on to the linker script cleanup work I've 
> > done so far.
> 
> Keep in mind that my primary goal here is to clean up the linker scripts.
> Support for -ffunction-sections is only a spin-off of that.
> This is why I try to take a broader look at it.

Here comes the reworked version.
I have addressed your comments (thanks!), and also
added a lot more stuff.

I'm especially found of the "minimal" linker script
contained in the beginning of the file.
This helped me to gain better understanding of the general
sturcture - And I then also quickly spotted when an
architecture does not follow the normal flow.

I have converted powerpc to the new scheme - which
I have done a test build of.

If/when we get this in I will help all architectures
to convert to use these new defines killing a lot
of duplication in the process.
But we need to get this stuff agreed on first.

Comments appreciated!

	Sam

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 89853bc..91fe5d4 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -1,4 +1,60 @@
-#include <linux/section-names.h>
+/*
+ * Helper macros to support writing architecture specific
+ * linker scripts.
+ *
+ * A minimal linker scripts has following content:
+ *
+ * OUTPUT_FORMAT(...)
+ * OUTPUT_ARCH(...)
+ * ENTRY(...)
+ * SECTIONS
+ * {
+ *	. = START;
+ *	_stext = .;
+ *	.text : {
+ *		HEAD_TEXT
+ *		TEXT_TEXT
+ *		SCHED_TEXT
+ *		LOCK_TEXT
+ *		KPROBES_TEXT
+ *		IRQENTRY_TEXT
+ *	} = 0
+ *	_etext = .;
+ *
+ *	RO_DATA_SECTION(PAGE_SIZE)
+ *	RW_DATA_SECTION(...)
+ *	_edata = .;
+ *
+ *	EXCEPTION_TABLE(...)
+ *	NOTES
+ *
+ *	__init_begin = .;
+ *	INIT_TEXT_SECTION(PAGE_SIZE)
+ *	INIT_DATA_SECTION(...)
+ *	PERCPU(PAGE_SIZE)
+ *	__init_end = .;
+ *
+ *	BSS_SECTION(0, 0)
+ *	_end = .;
+ *
+ *	/DISCARD/ : {
+ *		EXIT_TEXT
+ *		EXIT_DATA
+ *		*(.exitcall.exit)
+ *	}
+ *	STABS_DEBUG
+ *	DWARF_DEBUG
+ * }
+ *
+ * [_stext, _etext] is the text section
+ * [_etext, _edata] is the data section
+ * [__init_begin, __init_end] is the init section that may be freed after init
+ *
+ * Some of the included output section include their own set of constants.
+ * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
+ *               [__nosave_begin, __nosave_end] for the nosave data
+ */
+ #include <linux/section-names.h>
 
 #ifndef LOAD_OFFSET
 #define LOAD_OFFSET 0
@@ -116,6 +172,35 @@
 	FTRACE_EVENTS()							\
 	TRACE_SYSCALLS()
 
+/*
+ * Data section helpers
+ */
+#define NOSAVE_DATA							\
+	. = ALIGN(PAGE_SIZE);						\
+	VMLINUX_SYMBOL(__nosave_begin) = .;				\
+	*(.data.nosave)							\
+	. = ALIGN(PAGE_SIZE);						\
+	VMLINUX_SYMBOL(__nosave_end) = .;
+
+#define PAGE_ALIGNED_DATA(page_align)					\
+	. = ALIGN(page_align);						\
+	*(.data.page_aligned)
+
+#define READ_MOSTLY_DATA(align)						\
+	. = ALIGN(align);						\
+	*(.data.read_mostly)
+
+#define CACHELINE_ALIGNED_DATA(align)					\
+	. = ALIGN(align);						\
+	*(.data.cacheline_aligned)
+
+#define INIT_TASK(align)						\
+	. = ALIGN(align);						\
+	*(.data.init_task)
+
+/*
+ * Read only Data
+ */
 #define RO_DATA(align)							\
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
@@ -332,6 +417,26 @@
 /* Section used for early init (in .S files) */
 #define HEAD_TEXT  *(HEAD_TEXT_SECTION)
 
+/*
+ * Exception table
+ */
+#define EXCEPTION_TABLE(align)						\
+	. = ALIGN(align);						\
+	__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {		\
+		VMLINUX_SYMBOL(__start___ex_table) = .;			\
+		*(__ex_table)						\
+		VMLINUX_SYMBOL(__stop___ex_table) = .;			\
+	}
+
+/*
+ * Init task
+ */
+#define INIT_TASK_DATA(align)						\
+	. = ALIGN(align);						\
+	.data.init_task : {						\
+		INIT_TASK						\
+	}
+
 /* init and exit section handling */
 #define INIT_DATA							\
 	*(.init.data)							\
@@ -363,9 +468,32 @@
 	CPU_DISCARD(exit.text)						\
 	MEM_DISCARD(exit.text)
 
-		/* DWARF debug sections.
-		Symbols in the DWARF debugging sections are relative to
-		the beginning of the section so we begin them at 0.  */
+/*
+ * bss (Block started by Symbol) - uninitialized data
+ * zeroed during startup
+ */
+#define SBSS								\
+	.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {				\
+		*(.sbss)						\
+		*(.scommon)						\
+	}
+
+#define BSS(bss_align)							\
+	. = ALIGN(bss_align);						\
+	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {				\
+		VMLINUX_SYMBOL(__bss_start) = .;			\
+		*(.bss.page_aligned)					\
+		*(.dynbss)						\
+		*(.bss)							\
+		*(COMMON)						\
+		VMLINUX_SYMBOL(__bss_stop) = .;				\
+	}
+
+/*
+ * DWARF debug sections.
+ * Symbols in the DWARF debugging sections are relative to
+ * the beginning of the section so we begin them at 0.
+ */
 #define DWARF_DEBUG							\
 		/* DWARF 1 */						\
 		.debug          0 : { *(.debug) }			\
@@ -432,6 +560,12 @@
 		VMLINUX_SYMBOL(__stop_notes) = .;			\
 	}
 
+#define INIT_SETUP(initsetup_align)					\
+		. = ALIGN(initsetup_align);				\
+		VMLINUX_SYMBOL(__setup_start) = .;			\
+		*(.init.setup)						\
+		VMLINUX_SYMBOL(__setup_end) = .;
+
 #define INITCALLS							\
 	*(.initcallearly.init)						\
 	VMLINUX_SYMBOL(__early_initcall_end) = .;			\
@@ -453,6 +587,31 @@
   	*(.initcall7.init)						\
   	*(.initcall7s.init)
 
+#define INIT_CALLS							\
+		VMLINUX_SYMBOL(__initcall_start) = .;			\
+		INITCALLS						\
+		VMLINUX_SYMBOL(__initcall_end) = .;
+
+#define CON_INITCALL							\
+		VMLINUX_SYMBOL(__con_initcall_start) = .;		\
+		*(.con_initcall.init)					\
+		VMLINUX_SYMBOL(__con_initcall_end) = .;
+
+#define SECURITY_INITCALL						\
+		VMLINUX_SYMBOL(__security_initcall_start) = .;		\
+		*(.security_initcall.init)				\
+		VMLINUX_SYMBOL(__security_initcall_end) = .;
+
+#ifdef CONFIG_BLK_DEV_INITRD
+#define INIT_RAM_FS							\
+	. = ALIGN(PAGE_SIZE);						\
+	VMLINUX_SYMBOL(__initramfs_start) = .;				\
+	*(.init.ramfs)							\
+	VMLINUX_SYMBOL(__initramfs_end) = .;
+#else
+#define INITRAMFS
+#endif
+
 /**
  * PERCPU_VADDR - define output section for percpu area
  * @vaddr: explicit base address (optional)
@@ -509,3 +668,49 @@
 		*(.data.percpu.shared_aligned)				\
 		VMLINUX_SYMBOL(__per_cpu_end) = .;			\
 	}
+
+
+/*
+ * Definition of the high level *_SECTION macros
+ * They will fit only a subset of the architectures
+ */
+
+#define RO_DATA_SECTION(align) RO_DATA(align)
+
+/* use 0 as page_align if page_aligned data is not used */
+#define RW_DATA_SECTION(page_align, readmostly_align, cache_align, inittask_align) \
+	. = ALIGN(PAGE_SIZE);						\
+	.data : AT(ADDR(.data) - LOAD_OFFSET) {				\
+		DATA_DATA						\
+		CONSTRUCTORS						\
+		NOSAVE_DATA						\
+		PAGE_ALIGNED_DATA(page_align)				\
+		READMOSTLY_DATA(readmostly_align)			\
+		CACHELINE_ALIGNED_DATA(cache_align)			\
+		INIT_TASK(inittask_align)				\
+	}
+
+#define INIT_TEXT_SECTION(inittext_align)				\
+	. = ALIGN(inittext_align);					\
+	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {		\
+		VMLINUX_SYMBOL(_sinittext) = .;				\
+		INIT_TEXT						\
+		VMLINUX_SYMBOL(_einittext) = .;				\
+	}
+
+#define INIT_DATA_SECTION(initsetup_align)				\
+	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
+		INIT_DATA						\
+		INIT_SETUP(initsetup_align)				\
+		INIT_CALLS						\
+		CON_INITCALL						\
+		SECURITY_INITCALL					\
+		INIT_RAM_FS						\
+	}
+
+#define BSS_SECTION(sbss_align, bss_align)				\
+	SBSS								\
+	VMLINUX_SYMBOL(__bss_start) = .;				\
+	BSS(bss_align)							\
+	. = ALIGN(4);							\
+	VMLINUX_SYMBOL(__bss_stop) = .;

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

* [PATCH/RFC] Sample conversion of powerpc
  2009-05-04 14:27       ` Sam Ravnborg
@ 2009-05-04 14:30         ` Sam Ravnborg
  2009-05-04 16:32         ` [PATCH v2 0/6] macros for section name cleanup Tim Abbott
  1 sibling, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-04 14:30 UTC (permalink / raw)
  To: Tim Abbott; +Cc: Linux kernel mailing list, linux arch, Anders Kaseorg

This is the patch to convert powerpc to the
new linker script setup.

Note that powerpc does not take benefit of all the consolidations.

	Sam

 arch/powerpc/kernel/vmlinux.lds.S |   53 +++++--------------------------------
 1 files changed, 7 insertions(+), 46 deletions(-)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index a047a6c..e0fef43 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -75,14 +75,8 @@ SECTIONS
 	PROVIDE32 (etext = .);
 
 	/* Read-only data */
-	RODATA
-
-	/* Exception & bug tables */
-	__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
-		__start___ex_table = .;
-		*(__ex_table)
-		__stop___ex_table = .;
-	}
+	RO_DATA_SECTION(PAGE_SIZE)
+	EXCEPTION_TABLE(1)
 
 	NOTES :kernel :notes
 
@@ -100,11 +94,7 @@ SECTIONS
 	. = ALIGN(PAGE_SIZE);
 	__init_begin = .;
 
-	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
-		_sinittext = .;
-		INIT_TEXT
-		_einittext = .;
-	} :kernel
+	INIT_TEXT_SECTION(PAGE_SIZE) :kernel
 
 	/* .exit.text is discarded at runtime, not link time,
 	 * to deal with references from __bug_table
@@ -113,8 +103,10 @@ SECTIONS
 		EXIT_TEXT
 	}
 
-	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
-		INIT_DATA
+	INIT_DATA_SECTION(16)
+	PERCPU(PAGE_SIZE)
+
+	.init.data :  {
 		__vtop_table_begin = .;
 		*(.vtop_fixup);
 		__vtop_table_end = .;
@@ -128,27 +120,6 @@ SECTIONS
 #endif
 	}
 
-	. = ALIGN(16);
-	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
-		__setup_start = .;
-		*(.init.setup)
-		__setup_end = .;
-	}
-
-	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
-		__initcall_start = .;
-		INITCALLS
-		__initcall_end = .;
-		}
-
-	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
-		__con_initcall_start = .;
-		*(.con_initcall.init)
-		__con_initcall_end = .;
-	}
-
-	SECURITY_INIT
-
 	. = ALIGN(8);
 	__ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
 		__start___ftr_fixup = .;
@@ -175,15 +146,6 @@ SECTIONS
 		__stop___fw_ftr_fixup = .;
 	}
 #endif
-#ifdef CONFIG_BLK_DEV_INITRD
-	. = ALIGN(PAGE_SIZE);
-	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
-		__initramfs_start = .;
-		*(.init.ramfs)
-		__initramfs_end = .;
-	}
-#endif
-	PERCPU(PAGE_SIZE)
 
 	. = ALIGN(8);
 	.machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) {
@@ -247,7 +209,6 @@ SECTIONS
 
 	. = ALIGN(PAGE_SIZE);
 	_edata  =  .;
-	PROVIDE32 (edata = .);
 
 	/* The initial task and kernel stack */
 #ifdef CONFIG_PPC32

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-04 14:27       ` Sam Ravnborg
  2009-05-04 14:30         ` [PATCH/RFC] Sample conversion of powerpc Sam Ravnborg
@ 2009-05-04 16:32         ` Tim Abbott
  2009-05-04 17:42             ` Mike Frysinger
  1 sibling, 1 reply; 95+ messages in thread
From: Tim Abbott @ 2009-05-04 16:32 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Linux kernel mailing list, linux arch, Anders Kaseorg

On Mon, 4 May 2009, Sam Ravnborg wrote:

> I'm especially fond of the "minimal" linker script
> contained in the beginning of the file.

I like this a lot too.

> + *   /DISCARD/ : {  
> + *           EXIT_TEXT
> + *           EXIT_DATA
> + *           *(.exitcall.exit)
> + *   }

You may want to create an EXIT_CALL macro, to remove the explicit mention 
of .exitcall.exit, which is the only input section referenced directly in 
the example script.

> +#define READ_MOSTLY_DATA(align)					\
> +	. = ALIGN(align);						\
> +	*(.data.read_mostly)

Should READ_MOSTLY_DATA have an ALIGN(align) at the end as well?  If the 
goal is to isolate READ_MOSTLY_DATA from other data at the given alignment 
level, this would seem appropriate.  Something similar may apply to 
CACHELINE_ALIGNED_DATA as well.

> +/*
> + * bss (Block started by Symbol) - uninitialized data
> + * zeroed during startup
> + */
> +#define SBSS								\
> +	.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {				\
> +		*(.sbss)						\
> +		*(.scommon)						\
> +	}

I notice that s390 and powerpc reference a ".dynsbss"; does that belong 
here?

> +#ifdef CONFIG_BLK_DEV_INITRD
> +#define INIT_RAM_FS							\
> +	. = ALIGN(PAGE_SIZE);						\
> +	VMLINUX_SYMBOL(__initramfs_start) = .;				\
> +	*(.init.ramfs)							\
> +	VMLINUX_SYMBOL(__initramfs_end) = .;
> +#else
> +#define INITRAMFS
> +#endif

I think you want the #else clause to be INIT_RAM_FS here.

> +/*
> + * Definition of the high level *_SECTION macros
> + * They will fit only a subset of the architectures
> + */

Do we want a TEXT_SECTION macro here as well that looks like what appears 
above in the example script?

> +#define RW_DATA_SECTION(page_align, readmostly_align, cache_align, 
inittask_align) \
> +     . = ALIGN(PAGE_SIZE);                                           \
> +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
> +             DATA_DATA                                               \
> +             CONSTRUCTORS                                            \
> +             NOSAVE_DATA                                             \
> +             PAGE_ALIGNED_DATA(page_align)                           \
> +             READMOSTLY_DATA(readmostly_align)                       \
> +             CACHELINE_ALIGNED_DATA(cache_align)                     \
> +             INIT_TASK(inittask_align)                               \
> +     }       

How did you pick the order of the sections here?  I would think that to 
pack the .data section efficiently, you'd want to sort by alignment 
requirements so that e.g. all the at-least-page aligned sections are 
adjacent (INIT_TASK and the page-aligned sections are separated by some 
much smaller aligments here).  So it would like either the following or 
the following reversed:

     . = ALIGN(PAGE_SIZE);                                           \
     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
             INIT_TASK(inittask_align)                               \
             NOSAVE_DATA                                             \
             PAGE_ALIGNED_DATA(page_align)                           \
             READMOSTLY_DATA(readmostly_align)                       \
             CACHELINE_ALIGNED_DATA(cache_align)                     \
             DATA_DATA                                               \
             CONSTRUCTORS                                            \
     }       

	-Tim Abbott

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-04 16:32         ` [PATCH v2 0/6] macros for section name cleanup Tim Abbott
@ 2009-05-04 17:42             ` Mike Frysinger
  0 siblings, 0 replies; 95+ messages in thread
From: Mike Frysinger @ 2009-05-04 17:42 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Sam Ravnborg, Linux kernel mailing list, linux arch, Anders Kaseorg

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1838 bytes --]

On Mon, May 4, 2009 at 12:32, Tim Abbott wrote:> On Mon, 4 May 2009, Sam Ravnborg wrote:>> +#define RW_DATA_SECTION(page_align, readmostly_align, cache_align,>>   inittask_align) \>> +     . = ALIGN(PAGE_SIZE);                                           \>> +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \>> +             DATA_DATA                                               \>> +             CONSTRUCTORS                                            \>> +             NOSAVE_DATA                                             \>> +             PAGE_ALIGNED_DATA(page_align)                           \>> +             READMOSTLY_DATA(readmostly_align)                       \>> +             CACHELINE_ALIGNED_DATA(cache_align)                     \>> +             INIT_TASK(inittask_align)                               \>> +     }>> How did you pick the order of the sections here?  I would think that to> pack the .data section efficiently, you'd want to sort by alignment> requirements so that e.g. all the at-least-page aligned sections are> adjacent (INIT_TASK and the page-aligned sections are separated by some> much smaller aligments here).
if this were actually the case, there should of course be some /*comments */ above the define explaining that the order wasntarbitrarily pulled like a rabbit from an orifice.  if you'rescratching your head, then there's going to be plenty more people whonever ask but treat it like untouchable voodoo.-mikeÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH v2 0/6] macros for section name cleanup
@ 2009-05-04 17:42             ` Mike Frysinger
  0 siblings, 0 replies; 95+ messages in thread
From: Mike Frysinger @ 2009-05-04 17:42 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Sam Ravnborg, Linux kernel mailing list, linux arch, Anders Kaseorg

On Mon, May 4, 2009 at 12:32, Tim Abbott wrote:
> On Mon, 4 May 2009, Sam Ravnborg wrote:
>> +#define RW_DATA_SECTION(page_align, readmostly_align, cache_align,
>>   inittask_align) \
>> +     . = ALIGN(PAGE_SIZE);                                           \
>> +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
>> +             DATA_DATA                                               \
>> +             CONSTRUCTORS                                            \
>> +             NOSAVE_DATA                                             \
>> +             PAGE_ALIGNED_DATA(page_align)                           \
>> +             READMOSTLY_DATA(readmostly_align)                       \
>> +             CACHELINE_ALIGNED_DATA(cache_align)                     \
>> +             INIT_TASK(inittask_align)                               \
>> +     }
>
> How did you pick the order of the sections here?  I would think that to
> pack the .data section efficiently, you'd want to sort by alignment
> requirements so that e.g. all the at-least-page aligned sections are
> adjacent (INIT_TASK and the page-aligned sections are separated by some
> much smaller aligments here).

if this were actually the case, there should of course be some /*
comments */ above the define explaining that the order wasnt
arbitrarily pulled like a rabbit from an orifice.  if you're
scratching your head, then there's going to be plenty more people who
never ask but treat it like untouchable voodoo.
-mike

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

* Re: [PATCH v2 0/6] macros for section name cleanup
  2009-05-04 17:42             ` Mike Frysinger
  (?)
@ 2009-05-04 17:54             ` Sam Ravnborg
  -1 siblings, 0 replies; 95+ messages in thread
From: Sam Ravnborg @ 2009-05-04 17:54 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Tim Abbott, Linux kernel mailing list, linux arch, Anders Kaseorg

On Mon, May 04, 2009 at 01:42:08PM -0400, Mike Frysinger wrote:
> On Mon, May 4, 2009 at 12:32, Tim Abbott wrote:
> > On Mon, 4 May 2009, Sam Ravnborg wrote:
> >> +#define RW_DATA_SECTION(page_align, readmostly_align, cache_align,
> >>   inittask_align) \
> >> +     . = ALIGN(PAGE_SIZE);                                           \
> >> +     .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
> >> +             DATA_DATA                                               \
> >> +             CONSTRUCTORS                                            \
> >> +             NOSAVE_DATA                                             \
> >> +             PAGE_ALIGNED_DATA(page_align)                           \
> >> +             READMOSTLY_DATA(readmostly_align)                       \
> >> +             CACHELINE_ALIGNED_DATA(cache_align)                     \
> >> +             INIT_TASK(inittask_align)                               \
> >> +     }
> >
> > How did you pick the order of the sections here?  I would think that to
> > pack the .data section efficiently, you'd want to sort by alignment
> > requirements so that e.g. all the at-least-page aligned sections are
> > adjacent (INIT_TASK and the page-aligned sections are separated by some
> > much smaller aligments here).
> 
> if this were actually the case, there should of course be some /*
> comments */ above the define explaining that the order wasnt
> arbitrarily pulled like a rabbit from an orifice.  if you're
> scratching your head, then there's going to be plenty more people who
> never ask but treat it like untouchable voodoo.

Point taken (from both of you).
I will try to document the order in next version.

In reality I just picked the order used for 32 bit x86 IIRC.

	Sam

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

end of thread, other threads:[~2009-05-04 17:52 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 19:54 [PATCH v2 0/6] macros for section name cleanup Tim Abbott
2009-04-30 19:54 ` Tim Abbott
2009-04-30 19:54 ` Tim Abbott
2009-04-30 19:54 ` Tim Abbott
2009-04-30 19:54 ` Tim Abbott
     [not found] ` <1241121253-32341-1-git-send-email-tabbott-3s7WtUTddSA@public.gmane.org>
2009-04-30 19:54   ` [PATCH v2 1/6] Add new macros for page-aligned data and bss sections Tim Abbott
2009-04-30 19:54     ` Tim Abbott
2009-04-30 19:54     ` Tim Abbott
2009-04-30 19:54     ` Tim Abbott
2009-04-30 19:54     ` Tim Abbott
     [not found]     ` <1241121253-32341-2-git-send-email-tabbott-3s7WtUTddSA@public.gmane.org>
2009-04-30 19:54       ` [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro Tim Abbott
2009-04-30 19:54         ` Tim Abbott
2009-04-30 19:54         ` Tim Abbott
2009-04-30 19:54         ` Tim Abbott
2009-04-30 19:54         ` Tim Abbott
2009-04-30 19:54         ` [PATCH v2 3/6] Add new CACHELINE_ALIGNED_DATA " Tim Abbott
2009-04-30 19:54           ` Tim Abbott
2009-04-30 19:54           ` Tim Abbott
2009-04-30 19:54           ` Tim Abbott
2009-04-30 19:54           ` Tim Abbott
2009-04-30 19:54           ` Tim Abbott
2009-04-30 19:54           ` [PATCH v2 4/6] Add new INIT_TASK_DATA() " Tim Abbott
2009-04-30 19:54             ` Tim Abbott
2009-04-30 19:54             ` Tim Abbott
2009-04-30 19:54             ` Tim Abbott
2009-04-30 19:54             ` Tim Abbott
2009-04-30 19:54             ` Tim Abbott
2009-04-30 19:54             ` [PATCH v2 5/6] Add new READ_MOSTLY_DATA(align) " Tim Abbott
2009-04-30 19:54               ` Tim Abbott
2009-04-30 19:54               ` Tim Abbott
2009-04-30 19:54               ` Tim Abbott
2009-04-30 19:54               ` Tim Abbott
2009-04-30 19:54               ` Tim Abbott
2009-04-30 19:54               ` [PATCH v2 6/6] Add support for __read_mostly to linux/cache.h Tim Abbott
2009-04-30 19:54                 ` Tim Abbott
2009-04-30 19:54                 ` Tim Abbott
2009-04-30 19:54                 ` Tim Abbott
2009-04-30 19:54                 ` Tim Abbott
2009-05-01  9:21         ` [PATCH v2 2/6] Add new NOSAVE_DATA linker script macro Sam Ravnborg
2009-05-01  9:21           ` Sam Ravnborg
2009-05-01  9:21           ` Sam Ravnborg
2009-05-01  9:21           ` Sam Ravnborg
2009-05-01  9:21           ` Sam Ravnborg
2009-05-01  9:18     ` [PATCH v2 1/6] Add new macros for page-aligned data and bss sections Sam Ravnborg
2009-05-01  9:18       ` Sam Ravnborg
2009-05-01  9:18       ` Sam Ravnborg
2009-05-01  9:18       ` Sam Ravnborg
2009-05-01  9:18       ` Sam Ravnborg
2009-05-01 13:54       ` Tim Abbott
2009-05-01 13:54         ` Tim Abbott
2009-05-01 13:54         ` Tim Abbott
2009-05-01 13:54         ` Tim Abbott
2009-05-01 13:54         ` Tim Abbott
     [not found]         ` <alpine.DEB.1.10.0905010951100.3955-KERi1O17UK+7LhyUQnA0IJVzexx5G7lz@public.gmane.org>
2009-05-01 16:33           ` H. Peter Anvin
2009-05-01 16:33             ` H. Peter Anvin
2009-05-01 16:33             ` H. Peter Anvin
2009-05-01 16:33             ` H. Peter Anvin
2009-05-01 17:17             ` Sam Ravnborg
2009-05-01 17:17               ` Sam Ravnborg
2009-05-01 17:17               ` Sam Ravnborg
2009-05-01 17:17               ` Sam Ravnborg
     [not found]               ` <20090501171717.GA26401-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2009-05-01 17:18                 ` H. Peter Anvin
2009-05-01 17:18                   ` H. Peter Anvin
2009-05-01 17:18                   ` H. Peter Anvin
2009-05-01 17:18                   ` H. Peter Anvin
2009-05-01 17:44                   ` Sam Ravnborg
2009-05-01 17:44                     ` Sam Ravnborg
2009-05-01 17:44                     ` Sam Ravnborg
2009-05-01 17:44                     ` Sam Ravnborg
     [not found]                     ` <20090501174457.GA26559-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2009-05-01 17:47                       ` H. Peter Anvin
2009-05-01 17:47                         ` H. Peter Anvin
2009-05-01 17:47                         ` H. Peter Anvin
2009-05-01 17:47                         ` H. Peter Anvin
2009-05-01 23:02                         ` Andreas Schwab
2009-05-01 23:02                           ` Andreas Schwab
2009-05-01 23:02                           ` Andreas Schwab
2009-05-01  9:04 ` [PATCH v2 0/6] macros for section name cleanup Sam Ravnborg
2009-05-01  9:04   ` Sam Ravnborg
2009-05-01  9:04   ` Sam Ravnborg
2009-05-01  9:04   ` Sam Ravnborg
2009-05-01  9:04   ` Sam Ravnborg
2009-05-01 14:21 ` Sam Ravnborg
2009-05-01 14:21   ` Sam Ravnborg
2009-05-01 14:21   ` Sam Ravnborg
2009-05-01 14:21   ` Sam Ravnborg
2009-05-01 14:21   ` Sam Ravnborg
2009-05-01 21:31 ` Sam Ravnborg
2009-05-02  0:48   ` Tim Abbott
2009-05-02 22:01     ` Sam Ravnborg
2009-05-04 14:27       ` Sam Ravnborg
2009-05-04 14:30         ` [PATCH/RFC] Sample conversion of powerpc Sam Ravnborg
2009-05-04 16:32         ` [PATCH v2 0/6] macros for section name cleanup Tim Abbott
2009-05-04 17:42           ` Mike Frysinger
2009-05-04 17:42             ` Mike Frysinger
2009-05-04 17:54             ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.