2009-05-01 00:02:58

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 0/5] section name cleanup for parisc

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

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

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

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

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

-Tim Abbott


Tim Abbott (5):
parisc: use NOSAVE_DATA macro for .data.nosave section.
parisc: use new macro for .data.cacheline_aligned section.
parisc: use new macros for .data.init_task.
parisc: use new macro for .data.read_mostly section.
parisc: convert to new generic read_mostly support.

arch/parisc/Kconfig | 3 +++
arch/parisc/include/asm/cache.h | 2 --
arch/parisc/kernel/head.S | 3 ++-
arch/parisc/kernel/init_task.c | 2 +-
arch/parisc/kernel/vmlinux.lds.S | 36 +++++-------------------------------
5 files changed, 11 insertions(+), 35 deletions(-)


2009-05-01 00:00:40

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 2/5] parisc: use new macro for .data.cacheline_aligned section.

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

Signed-off-by: Tim Abbott <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
---
arch/parisc/kernel/vmlinux.lds.S | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 0cc9658..b5936c9 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -104,15 +104,11 @@ SECTIONS
/* Data */
.data : {
NOSAVE_DATA
+ CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
DATA_DATA
CONSTRUCTORS
}

- . = ALIGN(L1_CACHE_BYTES);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
- }
-
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN(16);
.data.lock_aligned : {
--
1.6.2.1

2009-05-01 00:01:04

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 4/5] parisc: use new macro for .data.read_mostly section.

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

I used alignment L1_CACHE_BYTES instead of 16 since the whole point is
for read-mostly data to have different cache lines than other stuff.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
---
arch/parisc/kernel/vmlinux.lds.S | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index c8a528d..3176407 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -94,19 +94,13 @@ SECTIONS
__stop___unwind = .;
}

- /* rarely changed data like cpu maps */
- . = ALIGN(16);
- .data.read_mostly : {
- *(.data.read_mostly)
- }
-
- . = ALIGN(L1_CACHE_BYTES);
/* Data */
.data : {
/* assembler code expects init_task to be 16k aligned */
INIT_TASK_DATA(16384)
NOSAVE_DATA
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
+ READ_MOSTLY_DATA(L1_CACHE_BYTES)
DATA_DATA
CONSTRUCTORS
}
--
1.6.2.1

2009-05-01 00:01:55

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 1/5] parisc: use NOSAVE_DATA macro for .data.nosave section.

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

Signed-off-by: Tim Abbott <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
---
arch/parisc/kernel/vmlinux.lds.S | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index fd2cc4f..0cc9658 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -103,6 +103,7 @@ SECTIONS
. = ALIGN(L1_CACHE_BYTES);
/* Data */
.data : {
+ NOSAVE_DATA
DATA_DATA
CONSTRUCTORS
}
@@ -118,17 +119,6 @@ SECTIONS
*(.data.lock_aligned)
}

- /* nosave data is really only used for software suspend...it's here
- * just in case we ever implement it
- */
- . = ALIGN(PAGE_SIZE);
- __nosave_begin = .;
- .data_nosave : {
- *(.data.nosave)
- }
- . = ALIGN(PAGE_SIZE);
- __nosave_end = .;
-
/* End of data section */
_edata = .;

--
1.6.2.1

2009-05-01 00:03:58

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 5/5] parisc: convert to new generic read_mostly support.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
---
arch/parisc/Kconfig | 3 +++
arch/parisc/include/asm/cache.h | 2 --
arch/parisc/kernel/head.S | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9038f39..cc113d0 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -101,6 +101,9 @@ config ARCH_MAY_HAVE_PC_FDC
depends on BROKEN
default y

+config HAVE_READ_MOSTLY_DATA
+ def_bool y
+
source "init/Kconfig"

source "kernel/Kconfig.freezer"
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 32c2cca..21e0865 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -28,8 +28,6 @@

#define SMP_CACHE_BYTES L1_CACHE_BYTES

-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
void parisc_cache_init(void); /* initializes cache-flushing */
void disable_sr_hashing_asm(int); /* low level support for above */
void disable_sr_hashing(void); /* turns off space register hashing */
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0e3d9f9..712d29d 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -19,6 +19,7 @@
#include <asm/assembly.h>
#include <asm/pgtable.h>

+#include <linux/cache.h>
#include <linux/linkage.h>
#include <linux/init.h>

@@ -345,7 +346,7 @@ smp_slave_stext:
ENDPROC(stext)

#ifndef CONFIG_64BIT
- .section .data.read_mostly
+ __READ_MOSTLY

.align 4
.export $global$,data
--
1.6.2.1

2009-05-01 00:06:35

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 3/5] parisc: use new macros for .data.init_task.

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

Signed-off-by: Tim Abbott <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
---
arch/parisc/kernel/init_task.c | 2 +-
arch/parisc/kernel/vmlinux.lds.S | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 1e25a45..8ee17ea 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
+ __attribute__((aligned(128))) __init_task_data =
{ INIT_THREAD_INFO(init_task) };

#if PT_NLEVELS == 3
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index b5936c9..c8a528d 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -103,6 +103,8 @@ SECTIONS
. = ALIGN(L1_CACHE_BYTES);
/* Data */
.data : {
+ /* assembler code expects init_task to be 16k aligned */
+ INIT_TASK_DATA(16384)
NOSAVE_DATA
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
DATA_DATA
@@ -133,14 +135,6 @@ SECTIONS
}
__bss_stop = .;

-
- /* assembler code expects init_task to be 16k aligned */
- . = ALIGN(16384);
- /* init_task */
- .data.init_task : {
- *(.data.init_task)
- }
-
#ifdef CONFIG_64BIT
. = ALIGN(16);
/* Linkage tables */
--
1.6.2.1