section name cleanup for s390
cover section name cleanup for s390
This patch series cleans up the section names on the s390 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 (6):
s390: Use macros for .data.page_aligned.
s390: use NOSAVE_DATA macro for .data.nosave section.
s390: use new macro for .data.cacheline_aligned section.
s390: use new macros for .data.init_task.
s390: use new macro for .data.read_mostly section.
s390: convert to new generic read_mostly support.
arch/s390/Kconfig | 3 ++ arch/s390/include/asm/cache.h | 2 - arch/s390/kernel/init_task.c | 3 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/kernel/vdso32/vdso32_wrapper.S | 3 +- arch/s390/kernel/vdso64/vdso64_wrapper.S | 3 +- arch/s390/kernel/vmlinux.lds.S | 33 ++++------------------------- 7 files changed, 14 insertions(+), 35 deletions(-)
PATCH 1/6 s390: Use macros for .data.page_aligned.
.data.page_aligned should not need a separate output section, so as part of this cleanup I moved into the .data output section in the linker scripts in order to eliminate unnecessary references to the section name.
Remove the reference to .data.idt, since nothing is put into the .data.idt section on the s390 architecture. It looks like Cyrill Gorcunov posted a patch to remove the .data.idt code on s390 previously:
<http://lkml.indiana.edu/hypermail/linux/kernel/0802.2/2536.html>
CCing him and the people who acked that patch in case there's a reason it wasn't applied.
--- arch/s390/kernel/vdso.c | 2 +- arch/s390/kernel/vdso32/vdso32_wrapper.S | 3 ++- arch/s390/kernel/vdso64/vdso64_wrapper.S | 3 ++- arch/s390/kernel/vmlinux.lds.S | 6 +----- 4 files changed, 6 insertions(+), 8 deletions(-)
arch/s390/kernel/vdso.c +1 -1
@@ -64,7 +64,7 @@ __setup("vdso=", vdso_setup);static union {struct vdso_data data;u8 page[PAGE_SIZE ]; -} vdso_data_store __attribute__((__section__(".data.page_aligned"))); +} vdso_data_store __page_aligned_data;struct vdso_data *vdso_data = &vdso_data_store.data;/*
arch/s390/kernel/vdso32/vdso32_wrapper.S +2 -1
@@ -1,7 +1,8 @@ #include <linux/init.h> +#include <linux/linkage.h> #include <asm/page.h> - .section ".data.page_aligned" + __PAGE_ALIGNED_DATA .globl vdso32_start, vdso32_end .balign PAGE_SIZE
arch/s390/kernel/vdso64/vdso64_wrapper.S +2 -1
@@ -1,7 +1,8 @@ #include <linux/init.h> +#include <linux/linkage.h> #include <asm/page.h> - .section ".data.page_aligned" + __PAGE_ALIGNED_DATA .globl vdso64_start, vdso64_end .balign PAGE_SIZE
arch/s390/kernel/vmlinux.lds.S +1 -5
@@ -59,6 +59,7 @@ SECTIONS } :data .data : { /* Data */ + PAGE_ALIGNED_DATA DATA_DATA CONSTRUCTORS }
@@ -71,11 +72,6 @@ SECTIONS . = ALIGN(PAGE_SIZE); __nosave_end = .; - . = ALIGN(PAGE_SIZE); - .data.page_aligned : { - *(.data.idt) - } - . = ALIGN(0x100); .data.cacheline_aligned : { *(.data.cacheline_aligned)
Signature · 1 line
1.6.2.1
PATCH 2/6 s390: 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.
--- arch/s390/kernel/vmlinux.lds.S | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)
arch/s390/kernel/vmlinux.lds.S +1 -8
@@ -60,18 +60,11 @@ SECTIONS .data : { /* Data */ PAGE_ALIGNED_DATA + NOSAVE_DATA DATA_DATA CONSTRUCTORS } - . = ALIGN(PAGE_SIZE); - .data_nosave : { - __nosave_begin = .; - *(.data.nosave) - } - . = ALIGN(PAGE_SIZE); - __nosave_end = .; - . = ALIGN(0x100); .data.cacheline_aligned : { *(.data.cacheline_aligned)
Signature · 1 line
1.6.2.1
PATCH 3/6 s390: 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.
--- arch/s390/kernel/vmlinux.lds.S | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
arch/s390/kernel/vmlinux.lds.S +1 -5
@@ -61,16 +61,12 @@ SECTIONS .data : { /* Data */ PAGE_ALIGNED_DATA NOSAVE_DATA + CACHELINE_ALIGNED_DATA(0x100) DATA_DATA CONSTRUCTORS } . = ALIGN(0x100); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) - } - - . = ALIGN(0x100); .data.read_mostly : { *(.data.read_mostly) }
Signature · 1 line
1.6.2.1
PATCH 4/6 s390: 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.
--- arch/s390/kernel/init_task.c | 3 +-- arch/s390/kernel/vmlinux.lds.S | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-)
arch/s390/kernel/init_task.c +1 -2
@@ -29,8 +29,7 @@ EXPORT_SYMBOL(init_mm);* way process stacks are handled. This is done by having a special * "init_task" linker map entry.. */ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = +union thread_union init_thread_union __init_task_data = {INIT_THREAD_INFO (init_task) };/*
arch/s390/kernel/vmlinux.lds.S +1 -5
@@ -59,6 +59,7 @@ SECTIONS } :data .data : { /* Data */ + INIT_TASK_DATA(THREAD_SIZE) PAGE_ALIGNED_DATA NOSAVE_DATA CACHELINE_ALIGNED_DATA(0x100)
@@ -72,11 +73,6 @@ SECTIONS } _edata = .; /* End of data section */ - . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : { - *(.data.init_task) - } - /* will be freed after init */ . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .;
Signature · 1 line
1.6.2.1
PATCH 5/6 s390: 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.
--- arch/s390/kernel/vmlinux.lds.S | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
arch/s390/kernel/vmlinux.lds.S +1 -5
@@ -63,14 +63,10 @@ SECTIONS PAGE_ALIGNED_DATA NOSAVE_DATA CACHELINE_ALIGNED_DATA(0x100) + READ_MOSTLY_DATA(0x100) DATA_DATA CONSTRUCTORS } - - . = ALIGN(0x100); - .data.read_mostly : { - *(.data.read_mostly) - } _edata = .; /* End of data section */ /* will be freed after init */
Signature · 1 line
1.6.2.1
PATCH 6/6 s390: convert to new generic read_mostly support.
--- arch/s390/Kconfig | 3 +++ arch/s390/include/asm/cache.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/s390/Kconfig +3 -0
@@ -75,6 +75,9 @@ config VIRT_CPU_ACCOUNTING config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y +config HAVE_READ_MOSTLY_DATA + def_bool y + mainmenu "Linux Kernel Configuration" config S390
arch/s390/include/asm/cache.h +0 -2
@@ -14,6 +14,4 @@#define L1_CACHE_BYTES 256#define L1_CACHE_SHIFT 8 -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) -#endif
Signature · 1 line
1.6.2.1