Ksplice: Rebootless kernel updates
Subsystems (23)
v3 cover Ksplice: Rebootless kernel updates
These patches add support for Ksplice [1], a rebootless update system, to the kernel. We now think that Ksplice is ready to be merged (ideally into -mm), and we are sending this RFC to see whether we can shake loose any comments or code review. If people have concerns about Ksplice, we'd like to hear them.
[1] http://www.ksplice.com/download
I previously mentioned Ksplice to the LKML in April [2], and I submitted RFC patches to the LKML in September [3]. The basic idea is that Ksplice can apply an update to a running Linux kernel based only on a source code patch and the original kernel source. The Ksplice technical overview document [4] describes the design of Ksplice and one of the ways that Ksplice has been evaluated.
[2] http://lkml.org/lkml/2008/4/23/330
[3] http://lkml.org/lkml/2008/9/13/6
[4] http://www.ksplice.com/doc/ksplice.pdf
Specifically, Ksplice has been used to correct every significant Linux kernel CVE from May 2005 to May 2008 [5]. 88% of these CVEs can be fixed without writing any new code at all; the remaining 12% of CVEs require a minimal amount of new code (on average, roughly 20 new semicolon-terminated lines per CVE).
[5] http://www.ksplice.com/cve-evaluation
The interface between the Ksplice kernel component and the userspace utilities is documented in the last patch of this series. The current implementation of the userspace utilities is available from the Ksplice website and the Ksplice git repository [6]. The Ksplice userspace utilities transparently support both "integrated" operation (updating a kernel patched with this patch series) and "standalone" operation (updating a completely unmodified kernel).
[6] http://www.ksplice.com/git/ksplice.git
Just to let you know what direction we are going in: We're currently working on the problem of making it feasible to apply the entire stable tree using Ksplice. Although Ksplice's original evaluation focused on patches for CVEs, we understand the idea that "security bugs are just 'normal bugs'" [7] (i.e., tracking security bugs separately from normal bugs can be difficult and isn't necessarily advisable). We ultimately want to provide to long-running machines hot updates for all of the bug fixes that go into the corresponding stable tree. We think that long-running machines will be more secure and reliable if they can regularly be updated to the latest stable kernel code (along with the usual user space updates provided by distributions).
[7] http://lkml.org/lkml/2008/7/14/465
Even though work on Ksplice is ongoing, I think that merging Ksplice makes sense at this point because (1) development on the Ksplice kernel code has stabilized, and (2) the system, as it currently stands, can be useful in a variety of situations.
Jeff Arnold
[email protected]
Changes since v2:
- added taint flag, as requested by Alexey Dobriyan
- various speed optimizations
- support for replacing functions mapped read-only (CONFIG_DEBUG_RODATA)
- run-pre matching extended to bug table, ex_table, exported symbol table
- added hooks for calling custom code during the update process
- struct ksplice_export eliminated (struct ksplice_patch used instead)
- minor sysfs API changes
- added support for ksplice-apply's --partial option
- improved -ffunction-sections patches and added them to this patch series
- dropped ARM support for now, for simplicity
==
Documentation/ksplice.txt | 282 ++ Documentation/mutex-design.txt | 4 +- MAINTAINERS | 10 + Makefile | 4 + arch/Kconfig | 14 + arch/alpha/kernel/head.S | 2 +- arch/alpha/kernel/init_task.c | 2 +- arch/alpha/kernel/vmlinux.lds.S | 14 +- arch/arm/kernel/head-nommu.S | 3 +- arch/arm/kernel/head.S | 3 +- arch/arm/kernel/init_task.c | 2 +- arch/arm/kernel/vmlinux.lds.S | 14 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-v7.S | 2 +- arch/arm/mm/tlb-v6.S | 2 +- arch/arm/mm/tlb-v7.S | 2 +- arch/avr32/kernel/init_task.c | 2 +- arch/avr32/kernel/vmlinux.lds.S | 6 +- arch/avr32/mm/init.c | 2 +- arch/blackfin/kernel/vmlinux.lds.S | 2 +- arch/cris/kernel/process.c | 2 +- arch/frv/kernel/break.S | 4 +- arch/frv/kernel/entry.S | 2 +- arch/frv/kernel/head-mmu-fr451.S | 2 +- arch/frv/kernel/head-uc-fr401.S | 2 +- arch/frv/kernel/head-uc-fr451.S | 2 +- arch/frv/kernel/head-uc-fr555.S | 2 +- arch/frv/kernel/head.S | 4 +- arch/frv/kernel/init_task.c | 2 +- arch/frv/kernel/vmlinux.lds.S | 18 +- arch/frv/mm/tlb-miss.S | 2 +- arch/h8300/boot/compressed/head.S | 2 +- arch/h8300/boot/compressed/vmlinux.lds | 2 +- arch/h8300/kernel/init_task.c | 2 +- arch/h8300/kernel/vmlinux.lds.S | 2 +- arch/ia64/include/asm/asmmacro.h | 12 +- arch/ia64/include/asm/cache.h | 2 +- arch/ia64/include/asm/percpu.h | 2 +- arch/ia64/kernel/Makefile | 2 +- arch/ia64/kernel/gate-data.S | 2 +- arch/ia64/kernel/gate.S | 8 +- arch/ia64/kernel/gate.lds.S | 10 +- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/init_task.c | 4 +- arch/ia64/kernel/ivt.S | 2 +- arch/ia64/kernel/minstate.h | 4 +- arch/ia64/kernel/paravirtentry.S | 12 +- arch/ia64/kernel/vmlinux.lds.S | 48 +- arch/ia64/kvm/vmm_ivt.S | 2 +- arch/ia64/xen/xensetup.S | 2 +- arch/m32r/kernel/init_task.c | 2 +- arch/m32r/kernel/vmlinux.lds.S | 6 +- arch/m68k/kernel/head.S | 2 +- arch/m68k/kernel/process.c | 2 +- arch/m68k/kernel/sun3-head.S | 2 +- arch/m68k/kernel/vmlinux-std.lds | 6 +- arch/m68k/kernel/vmlinux-sun3.lds | 4 +- arch/m68knommu/kernel/init_task.c | 2 +- arch/m68knommu/kernel/vmlinux.lds.S | 6 +- arch/m68knommu/platform/68360/head-ram.S | 2 +- arch/m68knommu/platform/68360/head-rom.S | 2 +- arch/mips/kernel/init_task.c | 2 +- arch/mips/kernel/vmlinux.lds.S | 8 +- arch/mips/lasat/image/head.S | 2 +- arch/mips/lasat/image/romscript.normal | 2 +- arch/mn10300/kernel/head.S | 2 +- arch/mn10300/kernel/init_task.c | 2 +- arch/mn10300/kernel/vmlinux.lds.S | 18 +- arch/parisc/include/asm/cache.h | 2 +- arch/parisc/include/asm/system.h | 2 +- arch/parisc/kernel/head.S | 2 +- arch/parisc/kernel/init_task.c | 8 +- arch/parisc/kernel/vmlinux.lds.S | 26 +- arch/powerpc/include/asm/cache.h | 2 +- arch/powerpc/include/asm/page_64.h | 2 +- arch/powerpc/include/asm/ppc_asm.h | 4 +- arch/powerpc/kernel/head_32.S | 2 +- arch/powerpc/kernel/head_40x.S | 2 +- arch/powerpc/kernel/head_44x.S | 2 +- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/kernel/head_fsl_booke.S | 2 +- arch/powerpc/kernel/init_task.c | 2 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kernel/vdso32/vdso32_wrapper.S | 2 +- arch/powerpc/kernel/vdso64/vdso64_wrapper.S | 2 +- arch/powerpc/kernel/vmlinux.lds.S | 28 +- arch/s390/include/asm/cache.h | 2 +- arch/s390/kernel/head.S | 2 +- arch/s390/kernel/init_task.c | 2 +- arch/s390/kernel/vmlinux.lds.S | 20 +- arch/sh/include/asm/cache.h | 2 +- arch/sh/kernel/cpu/sh5/entry.S | 4 +- arch/sh/kernel/head_32.S | 2 +- arch/sh/kernel/head_64.S | 2 +- arch/sh/kernel/init_task.c | 2 +- arch/sh/kernel/irq.c | 4 +- arch/sh/kernel/vmlinux_32.lds.S | 14 +- arch/sh/kernel/vmlinux_64.lds.S | 14 +- arch/sparc/boot/btfixupprep.c | 4 +- arch/sparc/include/asm/cache.h | 2 +- arch/sparc/kernel/head.S | 2 +- arch/sparc/kernel/vmlinux.lds.S | 8 +- arch/sparc64/kernel/head.S | 2 +- arch/sparc64/kernel/vmlinux.lds.S | 8 +- arch/um/include/asm/common.lds.S | 4 +- arch/um/kernel/dyn.lds.S | 4 +- arch/um/kernel/init_task.c | 4 +- arch/um/kernel/uml.lds.S | 4 +- arch/x86/Kconfig | 1 + arch/x86/boot/compressed/head_32.S | 2 +- arch/x86/boot/compressed/head_64.S | 2 +- arch/x86/boot/compressed/vmlinux.scr | 2 +- arch/x86/boot/compressed/vmlinux_32.lds | 14 +- arch/x86/boot/compressed/vmlinux_64.lds | 10 +- arch/x86/include/asm/cache.h | 4 +- arch/x86/kernel/acpi/wakeup_32.S | 2 +- arch/x86/kernel/head_32.S | 6 +- arch/x86/kernel/head_64.S | 4 +- arch/x86/kernel/init_task.c | 6 +- arch/x86/kernel/ksplice-arch.c | 125 + arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/vmlinux_32.lds.S | 37 +- arch/x86/kernel/vmlinux_64.lds.S | 27 +- arch/xtensa/kernel/head.S | 2 +- arch/xtensa/kernel/init_task.c | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 6 +- include/asm-frv/init.h | 8 +- include/asm-generic/vmlinux.lds.h | 16 +- include/linux/cache.h | 2 +- include/linux/init.h | 8 +- include/linux/kallsyms.h | 13 + include/linux/kernel.h | 1 + include/linux/ksplice.h | 212 ++ include/linux/linkage.h | 4 +- include/linux/module.h | 42 + include/linux/percpu.h | 12 +- include/linux/spinlock.h | 2 +- kernel/Makefile | 3 + kernel/extable.c | 3 + kernel/kallsyms.c | 19 + kernel/ksplice.c | 2716 +++++++++++++++++ kernel/module.c | 164 +- kernel/panic.c | 1 + kernel/sched.c | 1 + lib/Kconfig.debug | 9 + lib/bug.c | 1 + scripts/Makefile.modpost | 1 + scripts/mod/modpost.c | 22 +- scripts/recordmcount.pl | 6 +- 150 files changed, 3929 insertions(+), 409 deletions(-)
RFC PATCH v3 1/7 Make section names compatible with -ffunction-sections -fdata-sections
From: Denys Vlasenko <[email protected]>
This patch was originally written by Denys Vlasenko, but it has been substantially modified by Anders Kaseorg and Tim Abbott to update it to apply to the current kernel and fix bugs. Any bugs were added by Anders Kaseorg and Tim Abbott.
The purpose of this patch is to make it possible to build the kernel with "gcc -ffunction-sections -fdata-sections".
The problem is that with -ffunction-sections -fdata-sections, gcc creates sections like .text.head and .data.nosave whenever someone has innocuous code like this:
static void head(...) {...}
or this:
static int nosave = 1;
somewhere in the kernel.
The kernel linker scripts are confused by such names, and thus put these sections in the wrong places.
This patch renames all "magic" section names used by the kernel to not have this format, eliminating the possibility of such collisions.
Ksplice's 'run-pre matching' process is much simpler if the original kernel was compiled with -ffunction-sections and -fdata-sections.
Changelog since Denys Vlasenko's latest patch:
* Renamed .kernel.exit.text.refok to .kernel.text.exit.refok, for better analogy with .kernel.*.init.refok.
* Updated from 2.6.27-rc4-git3 to 2.6.28-rc5.
* Added some missing section flags for some of the .kernel.* sections (gcc assumes "ax" for sections with names starting with ".text", but does not for sections with names starting with ".kernel.text").
[[email protected]] Add missing section flags for .kernel.* sections.
[[email protected]] Update from 2.6.27-rc4-git3 to 2.6.28-rc5. [[email protected]] Rename .kernel.exit.text.refok.
--- Documentation/mutex-design.txt | 4 +- arch/alpha/kernel/head.S | 2 +- arch/alpha/kernel/init_task.c | 2 +- arch/alpha/kernel/vmlinux.lds.S | 14 ++++---- arch/arm/kernel/head-nommu.S | 3 +- arch/arm/kernel/head.S | 3 +- arch/arm/kernel/init_task.c | 2 +- arch/arm/kernel/vmlinux.lds.S | 14 ++++---- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-v7.S | 2 +- arch/arm/mm/tlb-v6.S | 2 +- arch/arm/mm/tlb-v7.S | 2 +- arch/avr32/kernel/init_task.c | 2 +- arch/avr32/kernel/vmlinux.lds.S | 6 ++-- arch/avr32/mm/init.c | 2 +- arch/blackfin/kernel/vmlinux.lds.S | 2 +- arch/cris/kernel/process.c | 2 +- arch/frv/kernel/break.S | 4 +- arch/frv/kernel/entry.S | 2 +- arch/frv/kernel/head-mmu-fr451.S | 2 +- arch/frv/kernel/head-uc-fr401.S | 2 +- arch/frv/kernel/head-uc-fr451.S | 2 +- arch/frv/kernel/head-uc-fr555.S | 2 +- arch/frv/kernel/head.S | 4 +- arch/frv/kernel/init_task.c | 2 +- arch/frv/kernel/vmlinux.lds.S | 18 +++++----- arch/frv/mm/tlb-miss.S | 2 +- arch/h8300/boot/compressed/head.S | 2 +- arch/h8300/boot/compressed/vmlinux.lds | 2 +- arch/h8300/kernel/init_task.c | 2 +- arch/h8300/kernel/vmlinux.lds.S | 2 +- arch/ia64/include/asm/asmmacro.h | 12 +++--- arch/ia64/include/asm/cache.h | 2 +- arch/ia64/include/asm/percpu.h | 2 +- arch/ia64/kernel/Makefile | 2 +- arch/ia64/kernel/gate-data.S | 2 +- arch/ia64/kernel/gate.S | 8 ++-- arch/ia64/kernel/gate.lds.S | 10 +++--- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/init_task.c | 4 +- arch/ia64/kernel/ivt.S | 2 +- arch/ia64/kernel/minstate.h | 4 +- arch/ia64/kernel/paravirtentry.S | 12 +++--- arch/ia64/kernel/vmlinux.lds.S | 48 +++++++++++++------------- arch/ia64/kvm/vmm_ivt.S | 2 +- arch/ia64/xen/xensetup.S | 2 +- arch/m32r/kernel/init_task.c | 2 +- arch/m32r/kernel/vmlinux.lds.S | 6 ++-- arch/m68k/kernel/head.S | 2 +- arch/m68k/kernel/process.c | 2 +- arch/m68k/kernel/sun3-head.S | 2 +- arch/m68k/kernel/vmlinux-std.lds | 6 ++-- arch/m68k/kernel/vmlinux-sun3.lds | 4 +- arch/m68knommu/kernel/init_task.c | 2 +- arch/m68knommu/kernel/vmlinux.lds.S | 6 ++-- arch/m68knommu/platform/68360/head-ram.S | 2 +- arch/m68knommu/platform/68360/head-rom.S | 2 +- arch/mips/kernel/init_task.c | 2 +- arch/mips/kernel/vmlinux.lds.S | 8 ++-- arch/mips/lasat/image/head.S | 2 +- arch/mips/lasat/image/romscript.normal | 2 +- arch/mn10300/kernel/head.S | 2 +- arch/mn10300/kernel/init_task.c | 2 +- arch/mn10300/kernel/vmlinux.lds.S | 18 +++++----- arch/parisc/include/asm/cache.h | 2 +- arch/parisc/include/asm/system.h | 2 +- arch/parisc/kernel/head.S | 2 +- arch/parisc/kernel/init_task.c | 8 ++-- arch/parisc/kernel/vmlinux.lds.S | 26 +++++++------- arch/powerpc/include/asm/cache.h | 2 +- arch/powerpc/include/asm/page_64.h | 2 +- arch/powerpc/include/asm/ppc_asm.h | 4 +- arch/powerpc/kernel/head_32.S | 2 +- arch/powerpc/kernel/head_40x.S | 2 +- arch/powerpc/kernel/head_44x.S | 2 +- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/kernel/head_fsl_booke.S | 2 +- arch/powerpc/kernel/init_task.c | 2 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/vdso.c | 2 +- arch/powerpc/kernel/vdso32/vdso32_wrapper.S | 2 +- arch/powerpc/kernel/vdso64/vdso64_wrapper.S | 2 +- arch/powerpc/kernel/vmlinux.lds.S | 28 ++++++++-------- arch/s390/include/asm/cache.h | 2 +- arch/s390/kernel/head.S | 2 +- arch/s390/kernel/init_task.c | 2 +- arch/s390/kernel/vmlinux.lds.S | 20 +++++----- arch/sh/include/asm/cache.h | 2 +- arch/sh/kernel/cpu/sh5/entry.S | 4 +- arch/sh/kernel/head_32.S | 2 +- arch/sh/kernel/head_64.S | 2 +- arch/sh/kernel/init_task.c | 2 +- arch/sh/kernel/irq.c | 4 +- arch/sh/kernel/vmlinux_32.lds.S | 14 ++++---- arch/sh/kernel/vmlinux_64.lds.S | 14 ++++---- arch/sparc/boot/btfixupprep.c | 4 +- arch/sparc/include/asm/cache.h | 2 +- arch/sparc/kernel/head.S | 2 +- arch/sparc/kernel/vmlinux.lds.S | 8 ++-- arch/sparc64/kernel/head.S | 2 +- arch/sparc64/kernel/vmlinux.lds.S | 8 ++-- arch/um/include/asm/common.lds.S | 4 +- arch/um/kernel/dyn.lds.S | 4 +- arch/um/kernel/init_task.c | 4 +- arch/um/kernel/uml.lds.S | 4 +- arch/x86/boot/compressed/head_32.S | 2 +- arch/x86/boot/compressed/head_64.S | 2 +- arch/x86/boot/compressed/vmlinux.scr | 2 +- arch/x86/boot/compressed/vmlinux_32.lds | 14 +++++-- arch/x86/boot/compressed/vmlinux_64.lds | 10 +++-- arch/x86/include/asm/cache.h | 4 +- arch/x86/kernel/acpi/wakeup_32.S | 2 +- arch/x86/kernel/head_32.S | 6 ++-- arch/x86/kernel/head_64.S | 4 +- arch/x86/kernel/init_task.c | 4 +- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/vmlinux_32.lds.S | 36 ++++++++++---------- arch/x86/kernel/vmlinux_64.lds.S | 26 +++++++------- arch/xtensa/kernel/head.S | 2 +- arch/xtensa/kernel/init_task.c | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 6 ++-- include/asm-frv/init.h | 8 ++-- include/asm-generic/vmlinux.lds.h | 14 ++++---- include/linux/cache.h | 2 +- include/linux/init.h | 8 ++-- include/linux/linkage.h | 4 +- include/linux/percpu.h | 12 +++--- include/linux/spinlock.h | 2 +- kernel/module.c | 2 +- scripts/mod/modpost.c | 12 +++--- scripts/recordmcount.pl | 6 ++-- 131 files changed, 356 insertions(+), 346 deletions(-)
Documentation/mutex-design.txt +2 -2
@@ -66,14 +66,14 @@ of advantages of mutexes: c0377ccb <mutex_lock>: c0377ccb: f0 ff 08 lock decl (%eax) - c0377cce: 78 0e js c0377cde <.text.lock.mutex> + c0377cce: 78 0e js c0377cde <.kernel.text.lock.mutex> c0377cd0: c3 ret the unlocking fastpath is equally tight: c0377cd1 <mutex_unlock>: c0377cd1: f0 ff 00 lock incl (%eax) - c0377cd4: 7e 0f jle c0377ce5 <.text.lock.mutex+0x7> + c0377cd4: 7e 0f jle c0377ce5 <.kernel.text.lock.mutex+0x7> c0377cd6: c3 ret - 'struct mutex' semantics are well-defined and are enforced if
arch/alpha/kernel/head.S +1 -1
@@ -10,7 +10,7 @@ #include <asm/system.h> #include <asm/asm-offsets.h> -.section .text.head, "ax" +.section .kernel.text.head, "ax" .globl swapper_pg_dir .globl _stext swapper_pg_dir=SWAPPER_PGD
arch/alpha/kernel/init_task.c +1 -1
@@ -18,5 +18,5 @@ EXPORT_SYMBOL(init_mm);EXPORT_SYMBOL (init_task); union thread_union init_thread_union - __attribute__((section(".data.init_thread"))) + __attribute__((section(".kernel.data.init_thread"))) = { INIT_THREAD_INFO(init_task) };
arch/alpha/kernel/vmlinux.lds.S +7 -7
@@ -16,7 +16,7 @@ SECTIONS _text = .; /* Text and read-only data */ .text : { - *(.text.head) + *(.kernel.text.head) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -93,18 +93,18 @@ SECTIONS /* Freed after init ends here */ /* Note 2 page alignment above. */ - .data.init_thread : { - *(.data.init_thread) + .kernel.data.init_thread : { + *(.kernel.data.init_thread) } . = ALIGN(PAGE_SIZE); - .data.page_aligned : { - *(.data.page_aligned) + .kernel.data.page_aligned : { + *(.kernel.data.page_aligned) } . = ALIGN(64); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } _data = .;
arch/arm/kernel/head-nommu.S +2 -1
@@ -32,7 +32,8 @@ * numbers for r1. * */ - .section ".text.head", "ax" + .section ".kernel.text.head", "ax" + .type stext, %function ENTRY(stext) msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode @ and irqs disabled
arch/arm/kernel/head.S +2 -1
@@ -74,7 +74,8 @@ * crap here - that's what the boot loader (or in extreme, well justified * circumstances, zImage) is for. */ - .section ".text.head", "ax" + .section ".kernel.text.head", "ax" + .type stext, %function ENTRY(stext) msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode @ and irqs disabled
arch/arm/kernel/init_task.c +1 -1
@@ -30,7 +30,7 @@ EXPORT_SYMBOL(init_mm);* The things we do for performance.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/arm/kernel/vmlinux.lds.S +7 -7
@@ -23,10 +23,10 @@ SECTIONS #else . = PAGE_OFFSET + TEXT_OFFSET; #endif - .text.head : { + .kernel.text.head : { _stext = .; _sinittext = .; - *(.text.head) + *(.kernel.text.head) } .init : { /* Init code and data */
@@ -65,8 +65,8 @@ SECTIONS #endif . = ALIGN(4096); __per_cpu_start = .; - *(.data.percpu) - *(.data.percpu.shared_aligned) + *(.kernel.data.percpu) + *(.kernel.data.percpu.shared_aligned) __per_cpu_end = .; #ifndef CONFIG_XIP_KERNEL __init_begin = _stext;
@@ -125,7 +125,7 @@ SECTIONS * first, the init task union, aligned * to an 8192 byte boundary. */ - *(.data.init_task) + *(.kernel.data.init_task) #ifdef CONFIG_XIP_KERNEL . = ALIGN(4096);
@@ -137,7 +137,7 @@ SECTIONS . = ALIGN(4096); __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) . = ALIGN(4096); __nosave_end = .;
@@ -145,7 +145,7 @@ SECTIONS * then the cacheline aligned data */ . = ALIGN(32); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) /* * The exception fixup table (might need resorting at runtime)
arch/arm/mm/proc-v6.S +1 -1
@@ -130,7 +130,7 @@ cpu_v6_name: .asciz "ARMv6-compatible processor" .align - .section ".text.init", #alloc, #execinstr + .section ".kernel.text.init", #alloc, #execinstr /* * __v6_setup
arch/arm/mm/proc-v7.S +1 -1
@@ -144,7 +144,7 @@ cpu_v7_name: .ascii "ARMv7 Processor" .align - .section ".text.init", #alloc, #execinstr + .section ".kernel.text.init", #alloc, #execinstr /* * __v7_setup
arch/arm/mm/tlb-v6.S +1 -1
@@ -87,7 +87,7 @@ ENTRY(v6wbi_flush_kern_tlb_range) mcr p15, 0, r2, c7, c5, 4 @ prefetch flush mov pc, lr - .section ".text.init", #alloc, #execinstr + .section ".kernel.text.init", #alloc, #execinstr .type v6wbi_tlb_fns, #object ENTRY(v6wbi_tlb_fns)
arch/arm/mm/tlb-v7.S +1 -1
@@ -80,7 +80,7 @@ ENTRY(v7wbi_flush_kern_tlb_range) mov pc, lr ENDPROC(v7wbi_flush_kern_tlb_range) - .section ".text.init", #alloc, #execinstr + .section ".kernel.text.init", #alloc, #execinstr .type v7wbi_tlb_fns, #object ENTRY(v7wbi_tlb_fns)
arch/avr32/kernel/init_task.c +1 -1
@@ -24,7 +24,7 @@ EXPORT_SYMBOL(init_mm);* Initial thread structure. Must be aligned on an 8192-byte boundary. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/avr32/kernel/vmlinux.lds.S +3 -3
@@ -95,15 +95,15 @@ SECTIONS /* * First, the init task union, aligned to an 8K boundary. */ - *(.data.init_task) + *(.kernel.data.init_task) /* Then, the page-aligned data */ . = ALIGN(PAGE_SIZE); - *(.data.page_aligned) + *(.kernel.data.page_aligned) /* Then, the cacheline aligned data */ . = ALIGN(L1_CACHE_BYTES); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) /* And the rest... */ *(.data.rel*)
arch/avr32/mm/init.c +1 -1
@@ -24,7 +24,7 @@#include <asm/setup.h> #include <asm/sections.h> -#define __page_aligned __attribute__((section(".data.page_aligned"))) +#define __page_aligned __attribute__((section(".kernel.data.page_aligned"))) DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
arch/blackfin/kernel/vmlinux.lds.S +1 -1
@@ -92,7 +92,7 @@ SECTIONS __sdata = .; /* This gets done first, so the glob doesn't suck it in */ . = ALIGN(32); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) #if !L1_DATA_A_LENGTH . = ALIGN(32);
arch/cris/kernel/process.c +1 -1
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/frv/kernel/break.S +2 -2
@@ -21,7 +21,7 @@ # # the break handler has its own stack # - .section .bss.stack + .section .bss.kernel.stack .globl __break_user_context .balign THREAD_SIZE __break_stack:
@@ -63,7 +63,7 @@ __break_trace_through_exceptions: # entry point for Break Exceptions/Interrupts # ############################################################################### - .section .text.break + .section .kernel.text.break,"ax",@progbits .balign 4 .globl __entry_break __entry_break:
arch/frv/kernel/entry.S +1 -1
@@ -38,7 +38,7 @@ #define nr_syscalls ((syscall_table_size)/4) - .section .text.entry + .section .kernel.text.entry,"ax",@progbits .balign 4 .macro LEDS val
arch/frv/kernel/head-mmu-fr451.S +1 -1
@@ -31,7 +31,7 @@ #define __400_LCR 0xfe000100 #define __400_LSBR 0xfe000c00 - .section .text.init,"ax" + .section .kernel.text.init,"ax" .balign 4 ###############################################################################
arch/frv/kernel/head-uc-fr401.S +1 -1
@@ -30,7 +30,7 @@ #define __400_LCR 0xfe000100 #define __400_LSBR 0xfe000c00 - .section .text.init,"ax" + .section .kernel.text.init,"ax" .balign 4 ###############################################################################
arch/frv/kernel/head-uc-fr451.S +1 -1
@@ -30,7 +30,7 @@ #define __400_LCR 0xfe000100 #define __400_LSBR 0xfe000c00 - .section .text.init,"ax" + .section .kernel.text.init,"ax" .balign 4 ###############################################################################
arch/frv/kernel/head-uc-fr555.S +1 -1
@@ -29,7 +29,7 @@ #define __551_LCR 0xfeff1100 #define __551_LSBR 0xfeff1c00 - .section .text.init,"ax" + .section .kernel.text.init,"ax" .balign 4 ###############################################################################
arch/frv/kernel/head.S +2 -2
@@ -27,7 +27,7 @@ # command line string # ############################################################################### - .section .text.head,"ax" + .section .kernel.text.head,"ax" .balign 4 .globl _boot, __head_reference
@@ -541,7 +541,7 @@ __head_end: .size _boot, .-_boot # provide a point for GDB to place a break - .section .text.start,"ax" + .section .kernel.text.start,"ax" .globl _start .balign 4 _start:
arch/frv/kernel/init_task.c +1 -1
@@ -25,7 +25,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/frv/kernel/vmlinux.lds.S +9 -9
@@ -26,7 +26,7 @@ SECTIONS _sinittext = .; .init.text : { - *(.text.head) + *(.kernel.text.head) #ifndef CONFIG_DEBUG_INFO INIT_TEXT EXIT_TEXT
@@ -71,13 +71,13 @@ SECTIONS /* put sections together that have massive alignment issues */ . = ALIGN(THREAD_SIZE); - .data.init_task : { + .kernel.data.init_task : { /* init task record & stack */ - *(.data.init_task) + *(.kernel.data.init_task) } . = ALIGN(L1_CACHE_BYTES); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + .kernel.data.cacheline_aligned : { *(.kernel.data.cacheline_aligned) } .trap : { /* trap table management - read entry-table.S before modifying */
@@ -94,10 +94,10 @@ SECTIONS _text = .; _stext = .; .text : { - *(.text.start) - *(.text.entry) - *(.text.break) - *(.text.tlbmiss) + *(.kernel.text.start) + *(.kernel.text.entry) + *(.kernel.text.break) + *(.kernel.text.tlbmiss) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -152,7 +152,7 @@ SECTIONS .sbss : { *(.sbss .sbss.*) } .bss : { *(.bss .bss.*) } - .bss.stack : { *(.bss) } + .bss.kernel.stack : { *(.bss) } __bss_stop = .; _end = . ;
arch/frv/mm/tlb-miss.S +1 -1
@@ -16,7 +16,7 @@ #include <asm/highmem.h> #include <asm/spr-regs.h> - .section .text.tlbmiss + .section .kernel.text.tlbmiss,"ax",@progbits .balign 4 .globl __entry_insn_mmu_miss
arch/h8300/boot/compressed/head.S +1 -1
@@ -9,7 +9,7 @@ #define SRAM_START 0xff4000 - .section .text.startup + .section .kernel.text.startup,"ax",@progbits .global startup startup: mov.l #SRAM_START+0x8000, sp
arch/h8300/boot/compressed/vmlinux.lds +1 -1
@@ -4,7 +4,7 @@ SECTIONS { __stext = . ; __text = .; - *(.text.startup) + *(.kernel.text.startup) *(.text) __etext = . ; }
arch/h8300/kernel/init_task.c +1 -1
@@ -37,6 +37,6 @@ EXPORT_SYMBOL(init_task);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };
arch/h8300/kernel/vmlinux.lds.S +1 -1
@@ -101,7 +101,7 @@ SECTIONS ___data_start = . ; . = ALIGN(0x2000) ; - *(.data.init_task) + *(.kernel.data.init_task) . = ALIGN(0x4) ; DATA_DATA . = ALIGN(0x4) ;
arch/ia64/include/asm/asmmacro.h +6 -6
@@ -70,12 +70,12 @@ name:* path (ivt.S - TLB miss processing) or in places where it might not be * safe to use a "tpa" instruction (mca_asm.S - error recovery). */ - .section ".data.patch.vtop", "a" // declare section & section attributes + .section ".kernel.data.patch.vtop", "a" // declare section & section attributes .previous#define LOAD_PHYSICAL (pr, reg, obj) \ [1:](pr)movl reg = obj; \ - .xdata4 ".data.patch.vtop", 1b-. + .xdata4 ".kernel.data.patch.vtop", 1b-./* * For now, we always put in the McKinley E9 workaround. On CPUs that don't need it,
@@ -84,11 +84,11 @@ name:#define DO_MCKINLEY_E9_WORKAROUND #ifdef DO_MCKINLEY_E9_WORKAROUND - .section ".data.patch.mckinley_e9", "a" + .section ".kernel.data.patch.mckinley_e9", "a" .previous/* workaround for Itanium 2 Errata 9: */ # define FSYS_RETURN \ - .xdata4 ".data.patch.mckinley_e9", 1f-.; \ + .xdata4 ".kernel.data.patch.mckinley_e9", 1f-.; \ 1:{ .mib; \ nop.m 0; \ mov r16=ar.pfs; \
@@ -107,11 +107,11 @@ name:* If physical stack register size is different from DEF_NUM_STACK_REG, * dynamically patch the kernel for correct size. */ - .section ".data.patch.phys_stack_reg", "a" + .section ".kernel.data.patch.phys_stack_reg", "a" .previous#define LOAD_PHYS_STACK_REG_SIZE (reg) \ [1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \ - .xdata4 ".data.patch.phys_stack_reg", 1b-. + .xdata4 ".kernel.data.patch.phys_stack_reg", 1b-./* * Up until early 2004, use of .align within a function caused bad unwind info.
arch/ia64/include/asm/cache.h +1 -1
@@ -24,6 +24,6 @@# define SMP_CACHE_BYTES (1 << 3)#endif -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#endif /* _ASM_IA64_CACHE_H */
arch/ia64/include/asm/percpu.h +1 -1
@@ -27,7 +27,7 @@ extern void *per_cpu_init(void);#else /* ! SMP */ -#define PER_CPU_ATTRIBUTES __attribute__((__section__(".data.percpu"))) +#define PER_CPU_ATTRIBUTES __attribute__((__section__(".kernel.data.percpu")))#define per_cpu_init () (__phys_per_cpu_start)
arch/ia64/kernel/Makefile +1 -1
@@ -72,7 +72,7 @@ GATECFLAGS_gate-syms.o = -r $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE $(call if_changed,gate) -# gate-data.o contains the gate DSO image as data in section .data.gate. +# gate-data.o contains the gate DSO image as data in section .kernel.data.gate. # We must build gate.so before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin $(obj)/gate-data.o: $(obj)/gate.so
arch/ia64/kernel/gate-data.S +1 -1
@@ -1,3 +1,3 @@ - .section .data.gate, "aw" + .section .kernel.data.gate, "aw" .incbin "arch/ia64/kernel/gate.so"
arch/ia64/kernel/gate.S +4 -4
@@ -20,18 +20,18 @@ * to targets outside the shared object) and to avoid multi-phase kernel builds, we * simply create minimalistic "patch lists" in special ELF sections. */ - .section ".data.patch.fsyscall_table", "a" + .section ".kernel.data.patch.fsyscall_table", "a" .previous #define LOAD_FSYSCALL_TABLE(reg) \ [1:] movl reg=0; \ - .xdata4 ".data.patch.fsyscall_table", 1b-. + .xdata4 ".kernel.data.patch.fsyscall_table", 1b-. - .section ".data.patch.brl_fsys_bubble_down", "a" + .section ".kernel.data.patch.brl_fsys_bubble_down", "a" .previous #define BRL_COND_FSYS_BUBBLE_DOWN(pr) \ [1:](pr)brl.cond.sptk 0; \ ;; \ - .xdata4 ".data.patch.brl_fsys_bubble_down", 1b-. + .xdata4 ".kernel.data.patch.brl_fsys_bubble_down", 1b-. GLOBAL_ENTRY(__kernel_syscall_via_break) .prologue
arch/ia64/kernel/gate.lds.S +5 -5
@@ -32,21 +32,21 @@ SECTIONS */ . = GATE_ADDR + 0x600; - .data.patch : { + .kernel.data.patch : { __start_gate_mckinley_e9_patchlist = .; - *(.data.patch.mckinley_e9) + *(.kernel.data.patch.mckinley_e9) __end_gate_mckinley_e9_patchlist = .; __start_gate_vtop_patchlist = .; - *(.data.patch.vtop) + *(.kernel.data.patch.vtop) __end_gate_vtop_patchlist = .; __start_gate_fsyscall_patchlist = .; - *(.data.patch.fsyscall_table) + *(.kernel.data.patch.fsyscall_table) __end_gate_fsyscall_patchlist = .; __start_gate_brl_fsys_bubble_down_patchlist = .; - *(.data.patch.brl_fsys_bubble_down) + *(.kernel.data.patch.brl_fsys_bubble_down) __end_gate_brl_fsys_bubble_down_patchlist = .; } :readable
arch/ia64/kernel/head.S +1 -1
@@ -181,7 +181,7 @@ swapper_pg_dir: halt_msg: stringz "Halting kernel\n" - .section .text.head,"ax" + .section .kernel.text.head,"ax" .global start_ap
arch/ia64/kernel/init_task.c +2 -2
@@ -28,7 +28,7 @@ EXPORT_SYMBOL(init_mm);* Initial task structure. * * We need to make sure that this is properly aligned due to the way process stacks are -* handled. This is done by having a special ".data.init_task" section... +* handled. This is done by having a special ".kernel.data.init_task" section... */ #define init_thread_info init_task_mem.s.thread_info
@@ -38,7 +38,7 @@ union {struct thread_info thread_info; } s;unsigned long stack[KERNEL_STACK_SIZE /sizeof (unsigned long )]; -} init_task_mem asm ("init_task") __attribute__((section(".data.init_task"))) = {{ +} init_task_mem asm ("init_task") __attribute__((section(".kernel.data.init_task"))) = {{ .task = INIT_TASK(init_task_mem.s.task), .thread_info = INIT_THREAD_INFO(init_task_mem.s.task) }};
arch/ia64/kernel/ivt.S +1 -1
@@ -83,7 +83,7 @@ mov r19=n;; /* prepare to save predicates */ \ br.sptk.many dispatch_to_fault_handler - .section .text.ivt,"ax" + .section .kernel.text.ivt,"ax" .align 32768 // align on 32KB boundary .global ia64_ivt
arch/ia64/kernel/minstate.h +2 -2
@@ -16,7 +16,7 @@#define ACCOUNT_SYS_ENTER #endif -.section ".data.patch.rse", "a" +.section ".kernel.data.patch.rse", "a" .previous/*
@@ -215,7 +215,7 @@ (pUStk) extr.u r17=r18,3,6; \ (pUStk) sub r16=r18,r22; \ [1:](pKStk) br.cond.sptk.many 1f; \ - .xdata4 ".data.patch.rse",1b-. \ + .xdata4 ".kernel.data.patch.rse",1b-. \ ;; \ cmp.ge p6,p7 = 33,r17; \ ;; \
arch/ia64/kernel/paravirtentry.S +6 -6
@@ -24,12 +24,12 @@ #include <asm/asm-offsets.h> #include "entry.h" -#define DATA8(sym, init_value) \ - .pushsection .data.read_mostly ; \ - .align 8 ; \ - .global sym ; \ - sym: ; \ - data8 init_value ; \ +#define DATA8(sym, init_value) \ + .pushsection .kernel.data.read_mostly,"aw",@progbits ; \ + .align 8 ; \ + .global sym ; \ + sym: ; \ + data8 init_value ; \ .popsection #define BRANCH(targ, reg, breg) \
arch/ia64/kernel/vmlinux.lds.S +24 -24
112 lines not on this page · raw message
arch/ia64/kvm/vmm_ivt.S +1 -1
@@ -97,7 +97,7 @@ END(kvm_panic) - .section .text.ivt,"ax" + .section .kernel.text.ivt,"ax" .align 32768 // align on 32KB boundary .global kvm_ia64_ivt
arch/ia64/xen/xensetup.S +1 -1
@@ -14,7 +14,7 @@ #include <linux/init.h> #include <xen/interface/elfnote.h> - .section .data.read_mostly + .section .kernel.data.read_mostly, "a" .align 8 .global xen_domain_type xen_domain_type:
arch/m32r/kernel/init_task.c +1 -1
@@ -26,7 +26,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/m32r/kernel/vmlinux.lds.S +3 -3
@@ -56,17 +56,17 @@ SECTIONS . = ALIGN(4096); __nosave_begin = .; - .data_nosave : { *(.data.nosave) } + .data_nosave : { *(.kernel.data.nosave) } . = ALIGN(4096); __nosave_end = .; . = ALIGN(32); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + .kernel.data.cacheline_aligned : { *(.kernel.data.cacheline_aligned) } _edata = .; /* End of data section */ . = ALIGN(8192); /* init_task */ - .data.init_task : { *(.data.init_task) } + .kernel.data.init_task : { *(.kernel.data.init_task) } /* will be freed after init */ . = ALIGN(4096); /* Init code and data */
arch/m68k/kernel/head.S +1 -1
@@ -577,7 +577,7 @@ func_define putn,1 #endif .endm -.section ".text.head","ax" +.section ".kernel.text.head","ax" ENTRY(_stext) /* * Version numbers of the bootinfo interface
arch/m68k/kernel/process.c +1 -1
@@ -48,7 +48,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);EXPORT_SYMBOL (init_mm); union thread_union init_thread_union -__attribute__((section(".data.init_task"), aligned(THREAD_SIZE))) +__attribute__((section(".kernel.data.init_task"), aligned(THREAD_SIZE))) = { INIT_THREAD_INFO(init_task) };/* initial task structure */
arch/m68k/kernel/sun3-head.S +1 -1
@@ -29,7 +29,7 @@ kernel_pmd_table: .skip 0x2000 .globl kernel_pg_dir .equ kernel_pg_dir,kernel_pmd_table - .section .text.head + .section .kernel.text.head, "ax" ENTRY(_stext) ENTRY(_start)
arch/m68k/kernel/vmlinux-std.lds +3 -3
@@ -12,7 +12,7 @@ SECTIONS . = 0x1000; _text = .; /* Text and read-only data */ .text : { - *(.text.head) + *(.kernel.text.head) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -35,7 +35,7 @@ SECTIONS } . = ALIGN(16); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + .kernel.data.cacheline_aligned : { *(.kernel.data.cacheline_aligned) } :data .bss : { *(.bss) } /* BSS */
@@ -78,7 +78,7 @@ SECTIONS . = ALIGN(8192); __init_end = .; - .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ + .kernel.data.init_task : { *(.kernel.data.init_task) } /* The initial task and kernel stack */ _end = . ;
arch/m68k/kernel/vmlinux-sun3.lds +2 -2
@@ -12,7 +12,7 @@ SECTIONS . = 0xE002000; _text = .; /* Text and read-only data */ .text : { - *(.text.head) + *(.kernel.text.head) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -69,7 +69,7 @@ __init_begin = .; #endif . = ALIGN(PAGE_SIZE); __init_end = .; - .data.init.task : { *(.data.init_task) } + .kernel.data.init.task : { *(.kernel.data.init_task) } .bss : { *(.bss) } /* BSS */
arch/m68knommu/kernel/init_task.c +1 -1
@@ -37,6 +37,6 @@ EXPORT_SYMBOL(init_task);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };
arch/m68knommu/kernel/vmlinux.lds.S +3 -3
@@ -55,7 +55,7 @@ SECTIONS { .romvec : { __rom_start = . ; _romvec = .; - *(.data.initvect) + *(.kernel.data.initvect) } > romvec #endif
@@ -66,7 +66,7 @@ SECTIONS { TEXT_TEXT SCHED_TEXT LOCK_TEXT - *(.text.lock) + *(.kernel.text.lock) . = ALIGN(16); /* Exception table */ __start___ex_table = .;
@@ -148,7 +148,7 @@ SECTIONS { _sdata = . ; DATA_DATA . = ALIGN(8192) ; - *(.data.init_task) + *(.kernel.data.init_task) _edata = . ; } > DATA
arch/m68knommu/platform/68360/head-ram.S +1 -1
@@ -280,7 +280,7 @@ _dprbase: * and then overwritten as needed. */ -.section ".data.initvect","awx" +.section ".kernel.data.initvect","awx" .long RAMEND /* Reset: Initial Stack Pointer - 0. */ .long _start /* Reset: Initial Program Counter - 1. */ .long buserr /* Bus Error - 2. */
arch/m68knommu/platform/68360/head-rom.S +1 -1
@@ -291,7 +291,7 @@ _dprbase: * and then overwritten as needed. */ -.section ".data.initvect","awx" +.section ".kernel.data.initvect","awx" .long RAMEND /* Reset: Initial Stack Pointer - 0. */ .long _start /* Reset: Initial Program Counter - 1. */ .long buserr /* Bus Error - 2. */
arch/mips/kernel/init_task.c +1 -1
@@ -27,7 +27,7 @@ EXPORT_SYMBOL(init_mm);* The things we do for performance.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"), + __attribute__((__section__(".kernel.data.init_task"), __aligned__(THREAD_SIZE))) = { INIT_THREAD_INFO(init_task) };
arch/mips/kernel/vmlinux.lds.S +4 -4
@@ -77,7 +77,7 @@ SECTIONS * object file alignment. Using 32768 */ . = ALIGN(_PAGE_SIZE); - *(.data.init_task) + *(.kernel.data.init_task) DATA_DATA CONSTRUCTORS
@@ -99,14 +99,14 @@ SECTIONS . = ALIGN(_PAGE_SIZE); .data_nosave : { __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) } . = ALIGN(_PAGE_SIZE); __nosave_end = .; . = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } _edata = .; /* End of data section */
arch/mips/lasat/image/head.S +1 -1
@@ -1,7 +1,7 @@ #include <asm/lasat/head.h> .text - .section .text.start, "ax" + .section .kernel.text.start, "ax" .set noreorder .set mips3
arch/mips/lasat/image/romscript.normal +1 -1
@@ -4,7 +4,7 @@ SECTIONS { .text : { - *(.text.start) + *(.kernel.text.start) } /* Data in ROM */
arch/mn10300/kernel/head.S +1 -1
@@ -19,7 +19,7 @@ #include <asm/param.h> #include <asm/unit/serial.h> - .section .text.head,"ax" + .section .kernel.text.head,"ax" ############################################################################### #
arch/mn10300/kernel/init_task.c +1 -1
@@ -32,7 +32,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/mn10300/kernel/vmlinux.lds.S +9 -9
@@ -27,7 +27,7 @@ SECTIONS _text = .; /* Text and read-only data */ .text : { *( - .text.head + .kernel.text.head .text ) TEXT_TEXT
@@ -57,25 +57,25 @@ SECTIONS . = ALIGN(4096); __nosave_begin = .; - .data_nosave : { *(.data.nosave) } + .data_nosave : { *(.kernel.data.nosave) } . = ALIGN(4096); __nosave_end = .; . = ALIGN(4096); - .data.page_aligned : { *(.data.idt) } + .kernel.data.page_aligned : { *(.kernel.data.idt) } . = ALIGN(32); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + .kernel.data.cacheline_aligned : { *(.kernel.data.cacheline_aligned) } /* rarely changed data like cpu maps */ . = ALIGN(32); - .data.read_mostly : AT(ADDR(.data.read_mostly)) { - *(.data.read_mostly) + .kernel.data.read_mostly : AT(ADDR(.kernel.data.read_mostly)) { + *(.kernel.data.read_mostly) _edata = .; /* End of data section */ } . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : { *(.data.init_task) } + .kernel.data.init_task : { *(.kernel.data.init_task) } /* might get freed after init */ . = ALIGN(4096);
@@ -128,7 +128,7 @@ SECTIONS . = ALIGN(32); __per_cpu_start = .; - .data.percpu : { *(.data.percpu) } + .kernel.data.percpu : { *(.kernel.data.percpu) } __per_cpu_end = .; . = ALIGN(4096); __init_end = .;
@@ -136,7 +136,7 @@ SECTIONS __bss_start = .; /* BSS */ .bss : { - *(.bss.page_aligned) + *(.bss.kernel.page_aligned) *(.bss) } . = ALIGN(4);
arch/parisc/include/asm/cache.h +1 -1
@@ -28,7 +28,7 @@#define SMP_CACHE_BYTES L1_CACHE_BYTES -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))void parisc_cache_init (void );/* initializes cache-flushing */ void disable_sr_hashing_asm (int );/* low level support for above */
arch/parisc/include/asm/system.h +1 -1
@@ -174,7 +174,7 @@ static inline void set_eiem(unsigned long val) })#ifdef CONFIG_SMP -# define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) +# define __lock_aligned __attribute__((__section__(".kernel.data.lock_aligned")))#endif #define arch_align_stack (x) (x)
arch/parisc/kernel/head.S +1 -1
@@ -345,7 +345,7 @@ smp_slave_stext: ENDPROC(stext) #ifndef CONFIG_64BIT - .section .data.read_mostly + .section .kernel.data.read_mostly,"aw",@progbits .align 4 .export $global$,data
arch/parisc/kernel/init_task.c +4 -4
@@ -49,7 +49,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))) __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };#if PT_NLEVELS ==3
@@ -58,11 +58,11 @@ union thread_union init_thread_union* guarantee that global objects will be laid out in memory in the same order * as the order of declaration, so put these in different sections and use * the linker script to order them. */ -pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE))); +pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".kernel.data.vm0.pmd"), aligned(PAGE_SIZE)));#endif -pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE))); -pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE))); +pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".kernel.data.vm0.pgd"), aligned(PAGE_SIZE))); +pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".kernel.data.vm0.pte"), aligned(PAGE_SIZE)));/* * Initial task structure.
arch/parisc/kernel/vmlinux.lds.S +13 -13
@@ -94,8 +94,8 @@ SECTIONS /* rarely changed data like cpu maps */ . = ALIGN(16); - .data.read_mostly : { - *(.data.read_mostly) + .kernel.data.read_mostly : { + *(.kernel.data.read_mostly) } . = ALIGN(L1_CACHE_BYTES);
@@ -106,14 +106,14 @@ SECTIONS } . = ALIGN(L1_CACHE_BYTES); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } /* PA-RISC locks requires 16-byte alignment */ . = ALIGN(16); - .data.lock_aligned : { - *(.data.lock_aligned) + .kernel.data.lock_aligned : { + *(.kernel.data.lock_aligned) } /* nosave data is really only used for software suspend...it's here
@@ -122,7 +122,7 @@ SECTIONS . = ALIGN(PAGE_SIZE); __nosave_begin = .; .data_nosave : { - *(.data.nosave) + *(.kernel.data.nosave) } . = ALIGN(PAGE_SIZE); __nosave_end = .;
@@ -134,10 +134,10 @@ SECTIONS __bss_start = .; /* page table entries need to be PAGE_SIZE aligned */ . = ALIGN(PAGE_SIZE); - .data.vmpages : { - *(.data.vm0.pmd) - *(.data.vm0.pgd) - *(.data.vm0.pte) + .kernel.data.vmpages : { + *(.kernel.data.vm0.pmd) + *(.kernel.data.vm0.pgd) + *(.kernel.data.vm0.pte) } .bss : { *(.bss)
@@ -149,8 +149,8 @@ SECTIONS /* assembler code expects init_task to be 16k aligned */ . = ALIGN(16384); /* init_task */ - .data.init_task : { - *(.data.init_task) + .kernel.data.init_task : { + *(.kernel.data.init_task) } #ifdef CONFIG_64BIT
arch/powerpc/include/asm/cache.h +1 -1
@@ -38,7 +38,7 @@ extern struct ppc64_caches ppc64_caches;#endif /* __powerpc64__ && ! __ASSEMBLY__ */ #if !defined(__ASSEMBLY__) -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#endif #endif /* __KERNEL__ */
arch/powerpc/include/asm/page_64.h +1 -1
@@ -157,7 +157,7 @@ do { \#else #define __page_aligned \ __attribute__((__aligned__(PAGE_SIZE), \ - __section__(".data.page_aligned"))) + __section__(".kernel.data.page_aligned")))#endif #define VM_DATA_DEFAULT_FLAGS \
arch/powerpc/include/asm/ppc_asm.h +2 -2
@@ -193,7 +193,7 @@ name: \ GLUE(.,name):#define _INIT_GLOBAL (name) \ - .section ".text.init.refok"; \ + .section ".kernel.text.init.refok","ax",@progbits; \ .align 2 ; \ .globl name; \ .globl GLUE(.,name); \
@@ -233,7 +233,7 @@ name: \ GLUE(.,name):#define _INIT_STATIC (name) \ - .section ".text.init.refok"; \ + .section ".kernel.text.init.refok","ax",@progbits; \ .align 2 ; \ .section ".opd","aw"; \ name: \
arch/powerpc/kernel/head_32.S +1 -1
@@ -49,7 +49,7 @@ mtspr SPRN_DBAT##n##L,RB; \ 1: - .section .text.head, "ax" + .section .kernel.text.head, "ax" .stabs "arch/powerpc/kernel/",N_SO,0,0,0f .stabs "head_32.S",N_SO,0,0,0f 0:
arch/powerpc/kernel/head_40x.S +1 -1
@@ -52,7 +52,7 @@ * * This is all going to change RSN when we add bi_recs....... -- Dan */ - .section .text.head, "ax" + .section .kernel.text.head, "ax" _ENTRY(_stext); _ENTRY(_start);
arch/powerpc/kernel/head_44x.S +1 -1
@@ -50,7 +50,7 @@ * r7 - End of kernel command line string * */ - .section .text.head, "ax" + .section .kernel.text.head, "ax" _ENTRY(_stext); _ENTRY(_start); /*
arch/powerpc/kernel/head_8xx.S +1 -1
@@ -38,7 +38,7 @@ #else #define DO_8xx_CPU6(val, reg) #endif - .section .text.head, "ax" + .section .kernel.text.head, "ax" _ENTRY(_stext); _ENTRY(_start);
arch/powerpc/kernel/head_fsl_booke.S +1 -1
@@ -53,7 +53,7 @@ * r7 - End of kernel command line string * */ - .section .text.head, "ax" + .section .kernel.text.head, "ax" _ENTRY(_stext); _ENTRY(_start); /*
arch/powerpc/kernel/init_task.c +1 -1
@@ -22,7 +22,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/powerpc/kernel/machine_kexec_64.c +1 -1
@@ -250,7 +250,7 @@ static void kexec_prepare_cpus(void)* current, but that audit has not been performed. */ static union thread_union kexec_stack - __attribute__((__section__(".data.init_task"))) = { }; + __attribute__((__section__(".kernel.data.init_task"))) = { };/* Our assembly helper, in kexec_stub.S */ extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
arch/powerpc/kernel/vdso.c +1 -1
@@ -74,7 +74,7 @@ static int vdso_ready;static union {struct vdso_data data;u8 page[PAGE_SIZE ]; -} vdso_data_store __attribute__((__section__(".data.page_aligned"))); +} vdso_data_store __attribute__((__section__(".kernel.data.page_aligned")));struct vdso_data *vdso_data = &vdso_data_store.data;/* Format of the patch table */
arch/powerpc/kernel/vdso32/vdso32_wrapper.S +1 -1
@@ -1,7 +1,7 @@ #include <linux/init.h> #include <asm/page.h> - .section ".data.page_aligned" + .section ".kernel.data.page_aligned","aw",@progbits .globl vdso32_start, vdso32_end .balign PAGE_SIZE
arch/powerpc/kernel/vdso64/vdso64_wrapper.S +1 -1
@@ -1,7 +1,7 @@ #include <linux/init.h> #include <asm/page.h> - .section ".data.page_aligned" + .section ".kernel.data.page_aligned","aw",@progbits .globl vdso64_start, vdso64_end .balign PAGE_SIZE
arch/powerpc/kernel/vmlinux.lds.S +14 -14
@@ -52,9 +52,9 @@ SECTIONS /* Text and gots */ .text : AT(ADDR(.text) - LOAD_OFFSET) { ALIGN_FUNCTION(); - *(.text.head) + *(.kernel.text.head) _text = .; - *(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*) + *(.text .fixup .kernel.text.init.refok .kernel.text.exit.refok __ftr_alt_*) SCHED_TEXT LOCK_TEXT KPROBES_TEXT
@@ -174,10 +174,10 @@ SECTIONS } #endif . = ALIGN(PAGE_SIZE); - .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { + .kernel.data.percpu : AT(ADDR(.kernel.data.percpu) - LOAD_OFFSET) { __per_cpu_start = .; - *(.data.percpu) - *(.data.percpu.shared_aligned) + *(.kernel.data.percpu) + *(.kernel.data.percpu.shared_aligned) __per_cpu_end = .; }
@@ -251,28 +251,28 @@ SECTIONS #else . = ALIGN(16384); #endif - .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { - *(.data.init_task) + .kernel.data.init_task : AT(ADDR(.kernel.data.init_task) - LOAD_OFFSET) { + *(.kernel.data.init_task) } . = ALIGN(PAGE_SIZE); - .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { - *(.data.page_aligned) + .kernel.data.page_aligned : AT(ADDR(.kernel.data.page_aligned) - LOAD_OFFSET) { + *(.kernel.data.page_aligned) } - .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : AT(ADDR(.kernel.data.cacheline_aligned) - LOAD_OFFSET) { + *(.kernel.data.cacheline_aligned) } . = ALIGN(L1_CACHE_BYTES); - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { - *(.data.read_mostly) + .kernel.data.read_mostly : AT(ADDR(.kernel.data.read_mostly) - LOAD_OFFSET) { + *(.kernel.data.read_mostly) } . = ALIGN(PAGE_SIZE); .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) . = ALIGN(PAGE_SIZE); __nosave_end = .; }
arch/s390/include/asm/cache.h +1 -1
@@ -14,6 +14,6 @@#define L1_CACHE_BYTES 256#define L1_CACHE_SHIFT 8 -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#endif
arch/s390/kernel/head.S +1 -1
@@ -35,7 +35,7 @@ #define ARCH_OFFSET 0 #endif -.section ".text.head","ax" +.section ".kernel.text.head","ax" #ifndef CONFIG_IPL .org 0 .long 0x00080000,0x80000000+startup # Just a restart PSW
arch/s390/kernel/init_task.c +1 -1
@@ -31,7 +31,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/s390/kernel/vmlinux.lds.S +10 -10
@@ -28,7 +28,7 @@ SECTIONS . = 0x00000000; .text : { _text = .; /* Text and read-only data */ - *(.text.head) + *(.kernel.text.head) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -65,30 +65,30 @@ SECTIONS . = ALIGN(PAGE_SIZE); .data_nosave : { __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) } . = ALIGN(PAGE_SIZE); __nosave_end = .; . = ALIGN(PAGE_SIZE); - .data.page_aligned : { - *(.data.idt) + .kernel.data.page_aligned : { + *(.kernel.data.idt) } . = ALIGN(0x100); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } . = ALIGN(0x100); - .data.read_mostly : { - *(.data.read_mostly) + .kernel.data.read_mostly : { + *(.kernel.data.read_mostly) } _edata = .; /* End of data section */ . = ALIGN(2 * PAGE_SIZE); /* init_task */ - .data.init_task : { - *(.data.init_task) + .kernel.data.init_task : { + *(.kernel.data.init_task) } /* will be freed after init */
arch/sh/include/asm/cache.h +1 -1
@@ -14,7 +14,7 @@#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#ifndef __ASSEMBLY__ struct cache_info {
arch/sh/kernel/cpu/sh5/entry.S +2 -2
@@ -2058,10 +2058,10 @@ asm_uaccess_end: /* - * --- .text.init Section + * --- .kernel.text.init Section */ - .section .text.init, "ax" + .section .kernel.text.init, "ax" /* * void trap_init (void)
arch/sh/kernel/head_32.S +1 -1
@@ -40,7 +40,7 @@ ENTRY(empty_zero_page) 1: .skip PAGE_SIZE - empty_zero_page - 1b - .section .text.head, "ax" + .section .kernel.text.head, "ax" /* * Condition at the entry of _stext:
arch/sh/kernel/head_64.S +1 -1
@@ -110,7 +110,7 @@ empty_bad_pte_table: fpu_in_use: .quad 0 - .section .text.head, "ax" + .section .kernel.text.head, "ax" .balign L1_CACHE_BYTES /* * Condition at the entry of __stext:
arch/sh/kernel/init_task.c +1 -1
@@ -22,7 +22,7 @@ EXPORT_SYMBOL(init_mm);* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
arch/sh/kernel/irq.c +2 -2
@@ -158,10 +158,10 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)#ifdef CONFIG_IRQSTACKS static char softirq_stack[NR_CPUS * THREAD_SIZE] - __attribute__((__section__(".bss.page_aligned"))); + __attribute__((__section__(".bss.kernel.page_aligned"))); static char hardirq_stack[NR_CPUS * THREAD_SIZE] - __attribute__((__section__(".bss.page_aligned"))); + __attribute__((__section__(".bss.kernel.page_aligned")));/* * allocate per-cpu stacks for hardirq and for softirq processing
arch/sh/kernel/vmlinux_32.lds.S +7 -7
@@ -28,7 +28,7 @@ SECTIONS } = 0 .text : { - *(.text.head) + *(.kernel.text.head) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -58,19 +58,19 @@ SECTIONS . = ALIGN(THREAD_SIZE); .data : { /* Data */ - *(.data.init_task) + *(.kernel.data.init_task) . = ALIGN(L1_CACHE_BYTES); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) . = ALIGN(L1_CACHE_BYTES); - *(.data.read_mostly) + *(.kernel.data.read_mostly) . = ALIGN(PAGE_SIZE); - *(.data.page_aligned) + *(.kernel.data.page_aligned) __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) . = ALIGN(PAGE_SIZE); __nosave_end = .;
@@ -128,7 +128,7 @@ SECTIONS .bss : { __init_end = .; __bss_start = .; /* BSS */ - *(.bss.page_aligned) + *(.bss.kernel.page_aligned) *(.bss) *(COMMON) . = ALIGN(4);
arch/sh/kernel/vmlinux_64.lds.S +7 -7
@@ -42,7 +42,7 @@ SECTIONS } = 0 .text : C_PHYS(.text) { - *(.text.head) + *(.kernel.text.head) TEXT_TEXT *(.text64) *(.text..SHmedia32)
@@ -70,19 +70,19 @@ SECTIONS . = ALIGN(THREAD_SIZE); .data : C_PHYS(.data) { /* Data */ - *(.data.init_task) + *(.kernel.data.init_task) . = ALIGN(L1_CACHE_BYTES); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) . = ALIGN(L1_CACHE_BYTES); - *(.data.read_mostly) + *(.kernel.data.read_mostly) . = ALIGN(PAGE_SIZE); - *(.data.page_aligned) + *(.kernel.data.page_aligned) __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) . = ALIGN(PAGE_SIZE); __nosave_end = .;
@@ -140,7 +140,7 @@ SECTIONS .bss : C_PHYS(.bss) { __init_end = .; __bss_start = .; /* BSS */ - *(.bss.page_aligned) + *(.bss.kernel.page_aligned) *(.bss) *(COMMON) . = ALIGN(4);
arch/sparc/boot/btfixupprep.c +2 -2
@@ -171,7 +171,7 @@ main1: } }else if (buffer[nbase+4 ] !='_' )continue ; -if (!strcmp (sect,".text.exit" )) +if (!strcmp (sect,".kernel.text.exit" ))continue ; if (strcmp (sect, ".text") && strcmp (sect, ".init.text") &&
@@ -325,7 +325,7 @@ main1: (*rr)->next =NULL ; }printf ("! Generated by btfixupprep. Do not edit.\n\n" ); -printf ("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n" ); +printf ("\t.section\t\".kernel.data.init\",#alloc,#write\n\t.align\t4\n\n" );printf ("\t.global\t___btfixup_start\n___btfixup_start:\n\n" );for (i =0 ; i < last; i++) { f = array + i;
arch/sparc/include/asm/cache.h +1 -1
@@ -19,7 +19,7 @@#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#ifdef CONFIG_SPARC32 #include <asm/asi.h>
arch/sparc/kernel/head.S +1 -1
@@ -735,7 +735,7 @@ go_to_highmem: nop /* The code above should be at beginning and we have to take care about - * short jumps, as branching to .text.init section from .text is usually + * short jumps, as branching to .kernel.text.init section from .text is usually * impossible */ __INIT /* Acquire boot time privileged register values, this will help debugging.
arch/sparc/kernel/vmlinux.lds.S +4 -4
@@ -86,12 +86,12 @@ SECTIONS . = ALIGN(PAGE_SIZE); __init_end = .; . = ALIGN(32); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } . = ALIGN(32); - .data.read_mostly : { - *(.data.read_mostly) + .kernel.data.read_mostly : { + *(.kernel.data.read_mostly) } __bss_start = .;
arch/sparc64/kernel/head.S +1 -1
@@ -467,7 +467,7 @@ jump_to_sun4u_init: jmpl %g2 + %g0, %g0 nop - .section .text.init.refok + .section .kernel.text.init.refok,"ax",@progbits sun4u_init: BRANCH_IF_SUN4V(g1, sun4v_init)
arch/sparc64/kernel/vmlinux.lds.S +4 -4
@@ -32,12 +32,12 @@ SECTIONS *(.data1) } . = ALIGN(64); - .data.cacheline_aligned : { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : { + *(.kernel.data.cacheline_aligned) } . = ALIGN(64); - .data.read_mostly : { - *(.data.read_mostly) + .kernel.data.read_mostly : { + *(.kernel.data.read_mostly) } _edata = .; PROVIDE (edata = .);
arch/um/include/asm/common.lds.S +2 -2
@@ -49,9 +49,9 @@ } . = ALIGN(32); - .data.percpu : { + .kernel.data.percpu : { __per_cpu_start = . ; - *(.data.percpu) + *(.kernel.data.percpu) __per_cpu_end = . ; }
arch/um/kernel/dyn.lds.S +2 -2
@@ -97,9 +97,9 @@ SECTIONS .fini_array : { *(.fini_array) } .data : { . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ - *(.data.init_task) + *(.kernel.data.init_task) . = ALIGN(KERNEL_STACK_SIZE); - *(.data.init_irqstack) + *(.kernel.data.init_irqstack) DATA_DATA *(.data.* .gnu.linkonce.d.*) SORT(CONSTRUCTORS)
arch/um/kernel/init_task.c +2 -2
@@ -35,9 +35,9 @@ EXPORT_SYMBOL(init_task);*/ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) }; union thread_union cpu0_irqstack - __attribute__((__section__(".data.init_irqstack"))) = + __attribute__((__section__(".kernel.data.init_irqstack"))) = { INIT_THREAD_INFO(init_task) };
arch/um/kernel/uml.lds.S +2 -2
@@ -53,9 +53,9 @@ SECTIONS .data : { . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ - *(.data.init_task) + *(.kernel.data.init_task) . = ALIGN(KERNEL_STACK_SIZE); - *(.data.init_irqstack) + *(.kernel.data.init_irqstack) DATA_DATA *(.gnu.linkonce.d*) CONSTRUCTORS
arch/x86/boot/compressed/head_32.S +1 -1
@@ -29,7 +29,7 @@ #include <asm/boot.h> #include <asm/asm-offsets.h> -.section ".text.head","ax",@progbits +.section ".kernel.text.head","ax",@progbits .globl startup_32 startup_32:
arch/x86/boot/compressed/head_64.S +1 -1
@@ -33,7 +33,7 @@ #include <asm/processor-flags.h> #include <asm/asm-offsets.h> -.section ".text.head" +.section ".kernel.text.head","ax",@progbits .code32 .globl startup_32
arch/x86/boot/compressed/vmlinux.scr +1 -1
@@ -1,6 +1,6 @@ SECTIONS { - .rodata.compressed : { + .kernel.rodata.compressed : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data)
arch/x86/boot/compressed/vmlinux_32.lds +10 -4
@@ -7,13 +7,13 @@ SECTIONS * address 0. */ . = 0; - .text.head : { + .kernel.text.head : { _head = . ; - *(.text.head) + *(.kernel.text.head) _ehead = . ; } - .rodata.compressed : { - *(.rodata.compressed) + .kernel.rodata.compressed : { + *(.kernel.rodata.compressed) } .text : { _text = .; /* Text */
@@ -21,6 +21,10 @@ SECTIONS *(.text.*) _etext = . ; } + .got : { + *(.got) + *(.got.*) + } .rodata : { _rodata = . ; *(.rodata) /* read-only data */
@@ -40,4 +44,6 @@ SECTIONS *(COMMON) _end = . ; } + /* Be bold, and discard everything not explicitly mentioned */ + /DISCARD/ : { *(*) } }
arch/x86/boot/compressed/vmlinux_64.lds +6 -4
@@ -7,13 +7,13 @@ SECTIONS * address 0. */ . = 0; - .text.head : { + .kernel.text.head : { _head = . ; - *(.text.head) + *(.kernel.text.head) _ehead = . ; } - .rodata.compressed : { - *(.rodata.compressed) + .kernel.rodata.compressed : { + *(.kernel.rodata.compressed) } .text : { _text = .; /* Text */
@@ -45,4 +45,6 @@ SECTIONS . = . + 4096 * 6; _ebss = .; } + /* Be bold, and discard everything not explicitly mentioned */ + /DISCARD/ : { *(*) } }
arch/x86/include/asm/cache.h +2 -2
@@ -5,7 +5,7 @@#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __read_mostly __attribute__((__section__(".kernel.data.read_mostly")))#ifdef CONFIG_X86_VSMP /* vSMP Internode cacheline shift */
@@ -13,7 +13,7 @@#ifdef CONFIG_SMP #define __cacheline_aligned_in_smp \ __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ - __attribute__((__section__(".data.page_aligned"))) + __attribute__((__section__(".kernel.data.page_aligned")))#endif #endif
arch/x86/kernel/acpi/wakeup_32.S +1 -1
@@ -1,4 +1,4 @@ - .section .text.page_aligned + .section .kernel.text.page_aligned,"ax",@progbits #include <linux/linkage.h> #include <asm/segment.h> #include <asm/page.h>
arch/x86/kernel/head_32.S +3 -3
@@ -81,7 +81,7 @@ INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_ * any particular GDT layout, because we load our own as soon as we * can. */ -.section .text.head,"ax",@progbits +.section .kernel.text.head,"ax",@progbits ENTRY(startup_32) /* test KEEP_SEGMENTS flag to see if the bootloader is asking us to not reload segments */
@@ -609,7 +609,7 @@ ENTRY(_stext) /* * BSS section */ -.section ".bss.page_aligned","wa" +.section ".bss.kernel.page_aligned","wa" .align PAGE_SIZE_asm #ifdef CONFIG_X86_PAE swapper_pg_pmd:
@@ -626,7 +626,7 @@ ENTRY(empty_zero_page) * This starts the data section. */ #ifdef CONFIG_X86_PAE -.section ".data.page_aligned","wa" +.section ".kernel.data.page_aligned","wa" /* Page-aligned for the benefit of paravirt? */ .align PAGE_SIZE_asm ENTRY(swapper_pg_dir)
arch/x86/kernel/head_64.S +2 -2
@@ -40,7 +40,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map) L3_START_KERNEL = pud_index(__START_KERNEL_map) .text - .section .text.head + .section .kernel.text.head,"ax",@progbits .code64 .globl startup_64 startup_64:
@@ -414,7 +414,7 @@ ENTRY(phys_base) ENTRY(idt_table) .skip 256 * 16 - .section .bss.page_aligned, "aw", @nobits + .section .bss.kernel.page_aligned, "aw", @nobits .align PAGE_SIZE ENTRY(empty_zero_page) .skip PAGE_SIZE
arch/x86/kernel/init_task.c +2 -2
@@ -24,7 +24,7 @@ EXPORT_UNUSED_SYMBOL(init_mm); /* will be removed in 2.6.26 */* "init_task" linker map entry.. */ union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };/*
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(init_task);/* * per-CPU TSS segments. Threads are completely 'soft' on Linux, * no more per-task TSS's. The TSS size is kept cacheline-aligned -* so they are allowed to end up in the .data.cacheline_aligned +* so they are allowed to end up in the .kernel.data.cacheline_aligned * section. Since TSS's are completely CPU-local, we want them * on exact cacheline boundaries, to eliminate cacheline ping-pong. */
arch/x86/kernel/traps.c +1 -1
@@ -86,7 +86,7 @@ char ignore_fpu_irq;* for this. */ gate_desc idt_table[256] - __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, }; + __attribute__((__section__(".kernel.data.idt"))) = { { { { 0, 0 } } }, };#endif static int ignore_nmis;
arch/x86/kernel/vmlinux_32.lds.S +18 -18
@@ -31,15 +31,15 @@ SECTIONS . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR; phys_startup_32 = startup_32 - LOAD_OFFSET; - .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) { + .kernel.text.head : AT(ADDR(.kernel.text.head) - LOAD_OFFSET) { _text = .; /* Text and read-only data */ - *(.text.head) + *(.kernel.text.head) } :text = 0x9090 /* read-only */ .text : AT(ADDR(.text) - LOAD_OFFSET) { . = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */ - *(.text.page_aligned) + *(.kernel.text.page_aligned) TEXT_TEXT SCHED_TEXT LOCK_TEXT
@@ -70,32 +70,32 @@ SECTIONS . = ALIGN(PAGE_SIZE); .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { __nosave_begin = .; - *(.data.nosave) + *(.kernel.data.nosave) . = ALIGN(PAGE_SIZE); __nosave_end = .; } . = ALIGN(PAGE_SIZE); - .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { - *(.data.page_aligned) - *(.data.idt) + .kernel.data.page_aligned : AT(ADDR(.kernel.data.page_aligned) - LOAD_OFFSET) { + *(.kernel.data.page_aligned) + *(.kernel.data.idt) } . = ALIGN(32); - .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : AT(ADDR(.kernel.data.cacheline_aligned) - LOAD_OFFSET) { + *(.kernel.data.cacheline_aligned) } /* rarely changed data like cpu maps */ . = ALIGN(32); - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { - *(.data.read_mostly) + .kernel.data.read_mostly : AT(ADDR(.kernel.data.read_mostly) - LOAD_OFFSET) { + *(.kernel.data.read_mostly) _edata = .; /* End of data section */ } . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { - *(.data.init_task) + .kernel.data.init_task : AT(ADDR(.kernel.data.init_task) - LOAD_OFFSET) { + *(.kernel.data.init_task) } /* might get freed after init */
@@ -178,11 +178,11 @@ SECTIONS } #endif . = ALIGN(PAGE_SIZE); - .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { + .kernel.data.percpu : AT(ADDR(.kernel.data.percpu) - LOAD_OFFSET) { __per_cpu_start = .; - *(.data.percpu.page_aligned) - *(.data.percpu) - *(.data.percpu.shared_aligned) + *(.kernel.data.percpu.page_aligned) + *(.kernel.data.percpu) + *(.kernel.data.percpu.shared_aligned) __per_cpu_end = .; } . = ALIGN(PAGE_SIZE);
@@ -191,7 +191,7 @@ SECTIONS .bss : AT(ADDR(.bss) - LOAD_OFFSET) { __init_end = .; __bss_start = .; /* BSS */ - *(.bss.page_aligned) + *(.bss.kernel.page_aligned) *(.bss) . = ALIGN(4); __bss_stop = .;
arch/x86/kernel/vmlinux_64.lds.S +13 -13
@@ -28,7 +28,7 @@ SECTIONS _text = .; /* Text and read-only data */ .text : AT(ADDR(.text) - LOAD_OFFSET) { /* First the code that has to be first for bootstrapping */ - *(.text.head) + *(.kernel.text.head) _stext = .; /* Then the rest */ TEXT_TEXT
@@ -62,17 +62,17 @@ SECTIONS . = ALIGN(PAGE_SIZE); . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); - .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { - *(.data.cacheline_aligned) + .kernel.data.cacheline_aligned : AT(ADDR(.kernel.data.cacheline_aligned) - LOAD_OFFSET) { + *(.kernel.data.cacheline_aligned) } . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES); - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { - *(.data.read_mostly) + .kernel.data.read_mostly : AT(ADDR(.kernel.data.read_mostly) - LOAD_OFFSET) { + *(.kernel.data.read_mostly) } #define VSYSCALL_ADDR (-10*1024*1024) -#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095)) -#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095)) +#define VSYSCALL_PHYS_ADDR ((LOADADDR(.kernel.data.read_mostly) + SIZEOF(.kernel.data.read_mostly) + 4095) & ~(4095)) +#define VSYSCALL_VIRT_ADDR ((ADDR(.kernel.data.read_mostly) + SIZEOF(.kernel.data.read_mostly) + 4095) & ~(4095)) #define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR) #define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
@@ -121,13 +121,13 @@ SECTIONS #undef VVIRT . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { - *(.data.init_task) + .kernel.data.init_task : AT(ADDR(.kernel.data.init_task) - LOAD_OFFSET) { + *(.kernel.data.init_task) }:data.init . = ALIGN(PAGE_SIZE); - .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { - *(.data.page_aligned) + .kernel.data.page_aligned : AT(ADDR(.kernel.data.page_aligned) - LOAD_OFFSET) { + *(.kernel.data.page_aligned) } /* might get freed after init */
@@ -214,13 +214,13 @@ SECTIONS . = ALIGN(PAGE_SIZE); __nosave_begin = .; - .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) } + .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.kernel.data.nosave) } . = ALIGN(PAGE_SIZE); __nosave_end = .; __bss_start = .; /* BSS */ .bss : AT(ADDR(.bss) - LOAD_OFFSET) { - *(.bss.page_aligned) + *(.bss.kernel.page_aligned) *(.bss) } __bss_stop = .;
arch/xtensa/kernel/head.S +1 -1
@@ -234,7 +234,7 @@ should_never_return: * BSS section */ -.section ".bss.page_aligned", "w" +.section ".bss.kernel.page_aligned", "w" ENTRY(swapper_pg_dir) .fill PAGE_SIZE, 1, 0 ENTRY(empty_zero_page)
arch/xtensa/kernel/init_task.c +1 -1
@@ -29,7 +29,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);EXPORT_SYMBOL (init_mm); union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = + __attribute__((__section__(".kernel.data.init_task"))) = { INIT_THREAD_INFO(init_task) };struct task_struct init_task =INIT_TASK (init_task);
arch/xtensa/kernel/vmlinux.lds.S +3 -3
@@ -121,14 +121,14 @@ SECTIONS DATA_DATA CONSTRUCTORS . = ALIGN(XCHAL_ICACHE_LINESIZE); - *(.data.cacheline_aligned) + *(.kernel.data.cacheline_aligned) } _edata = .; /* The initial task */ . = ALIGN(8192); - .data.init_task : { *(.data.init_task) } + .kernel.data.init_task : { *(.kernel.data.init_task) } /* Initialization code and data: */
@@ -259,7 +259,7 @@ SECTIONS /* BSS section */ _bss_start = .; - .bss : { *(.bss.page_aligned) *(.bss) } + .bss : { *(.bss.kernel.page_aligned) *(.bss) } _bss_end = .; _end = .;
include/asm-frv/init.h +4 -4
@@ -1,12 +1,12 @@#ifndef _ASM_INIT_H#define _ASM_INIT_H -#define __init __attribute__ ((__section__ (".text.init"))) -#define __initdata __attribute__ ((__section__ (".data.init"))) +#define __init __attribute__ ((__section__ (".kernel.text.init"))) +#define __initdata __attribute__ ((__section__ (".kernel.data.init")))/* For assembly routines */ -#define __INIT .section ".text.init",#alloc,#execinstr +#define __INIT .section ".kernel.text.init",#alloc,#execinstr#define __FINIT .previous -#define __INITDATA .section ".data.init",#alloc,#write +#define __INITDATA .section ".kernel.data.init",#alloc,#write#endif
include/asm-generic/vmlinux.lds.h +7 -7
@@ -48,7 +48,7 @@/* .data section */ #define DATA_DATA \ *(.data) \ - *(.data.init.refok) \ + *(.kernel.data.init.refok) \ *(.ref.data) \ DEV_KEEP(init.data) \ DEV_KEEP(exit.data) \
@@ -236,8 +236,8 @@ *(.text.hot) \ *(.text) \ *(.ref.text) \ - *(.text.init.refok) \ - *(.exit.text.refok) \ + *(.kernel.text.init.refok) \ + *(.kernel.text.exit.refok) \ DEV_KEEP(init.text) \ DEV_KEEP(exit.text) \CPU_KEEP (init.text) \
@@ -404,9 +404,9 @@#define PERCPU (align) \ . = ALIGN(align); \ VMLINUX_SYMBOL(__per_cpu_start) = .; \ - .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ - *(.data.percpu.page_aligned) \ - *(.data.percpu) \ - *(.data.percpu.shared_aligned) \ + .kernel.data.percpu : AT(ADDR(.kernel.data.percpu) - LOAD_OFFSET) { \ + *(.kernel.data.percpu.page_aligned) \ + *(.kernel.data.percpu) \ + *(.kernel.data.percpu.shared_aligned) \ } \ VMLINUX_SYMBOL(__per_cpu_end) = .;
include/linux/cache.h +1 -1
@@ -31,7 +31,7 @@#ifndef __cacheline_aligned#define __cacheline_aligned \ __attribute__((__aligned__(SMP_CACHE_BYTES), \ - __section__(".data.cacheline_aligned"))) + __section__(".kernel.data.cacheline_aligned")))#endif /* __cacheline_aligned */ #ifndef __cacheline_aligned_in_smp
include/linux/init.h +4 -4
@@ -62,9 +62,9 @@/* backward compatibility note * A few places hardcode the old section names: -* .text.init.refok -* .data.init.refok -* .exit.text.refok +* .kernel.text.init.refok +* .kernel.data.init.refok +* .kernel.text.exit.refok * They should be converted to use the defines from this file */
@@ -301,7 +301,7 @@ void __init parse_early_param(void);#endif /* Data marked not to be saved by software suspend */ -#define __nosavedata __section(.data.nosave) +#define __nosavedata __section(.kernel.data.nosave)/* This means "can be init if no module support, otherwise module load may call it." */
include/linux/linkage.h +2 -2
@@ -18,8 +18,8 @@# define asmregparm#endif -#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE) -#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) +#define __page_aligned_data __section(.kernel.data.page_aligned) __aligned(PAGE_SIZE) +#define __page_aligned_bss __section(.bss.kernel.page_aligned) __aligned(PAGE_SIZE)/* * This is used by architectures to keep arguments on the stack
include/linux/percpu.h +6 -6
@@ -10,13 +10,13 @@#ifdef CONFIG_SMP #define DEFINE_PER_CPU (type, name) \ - __attribute__((__section__(".data.percpu"))) \ + __attribute__((__section__(".kernel.data.percpu"))) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name#ifdef MODULE -#define SHARED_ALIGNED_SECTION ".data.percpu" +#define SHARED_ALIGNED_SECTION ".kernel.data.percpu"#else -#define SHARED_ALIGNED_SECTION ".data.percpu.shared_aligned" +#define SHARED_ALIGNED_SECTION ".kernel.data.percpu.shared_aligned"#endif #define DEFINE_PER_CPU_SHARED_ALIGNED (type, name) \
@@ -24,14 +24,14 @@ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ ____cacheline_aligned_in_smp -#define DEFINE_PER_CPU_PAGE_ALIGNED (type, name) \ - __attribute__((__section__(".data.percpu.page_aligned"))) \ +#define DEFINE_PER_CPU_PAGE_ALIGNED (type, name) \ + __attribute__((__section__(".kernel.data.percpu.page_aligned")))\ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name#else #define DEFINE_PER_CPU (type, name) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name -#define DEFINE_PER_CPU_SHARED_ALIGNED (type, name) \ +#define DEFINE_PER_CPU_SHARED_ALIGNED (type, name) \ DEFINE_PER_CPU(type, name)#define DEFINE_PER_CPU_PAGE_ALIGNED (type, name) \
include/linux/spinlock.h +1 -1
@@ -60,7 +60,7 @@/* * Must define these before including other files, inline functions need them */ -#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME +#define LOCK_SECTION_NAME ".kernel.text.lock."KBUILD_BASENAME#define LOCK_SECTION_START (extra) \ ".subsection 1\n\t" \
kernel/module.c +1 -1
@@ -484,7 +484,7 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr,Elf_Shdr *sechdrs, const char *secstrings) { - return find_sec(hdr, sechdrs, secstrings, ".data.percpu"); + return find_sec(hdr, sechdrs, secstrings, ".kernel.data.percpu"); }static void percpu_modcopy (void *pcpudest,const void *from,unsigned long size)
scripts/mod/modpost.c +6 -6
@@ -794,9 +794,9 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };/* sections that may refer to an init/exit section with no warning */ static const char *initref_sections[] = { -".text.init.refok*" , -".exit.text.refok*" , -".data.init.refok*" , +".kernel.text.init.refok*" , +".kernel.text.exit.refok*" , +".kernel.data.init.refok*" ,NULL };
@@ -915,7 +915,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)* Pattern 0: * Do not warn if funtion/data are marked with __init_refok/__initdata_refok. * The pattern is identified by: -* fromsec = .text.init.refok* | .data.init.refok* +* fromsec = .kernel.text.init.refok* | .kernel.data.init.refok* * * Pattern 1: * If a module parameter is declared __initdata and permissions=0
@@ -939,8 +939,8 @@ static int section_mismatch(const char *fromsec, const char *tosec)* *probe_one, *_console, *_timer * * Pattern 3: -* Whitelist all refereces from .text.head to .init.data -* Whitelist all refereces from .text.head to .init.text +* Whitelist all refereces from .kernel.text.head to .init.data +* Whitelist all refereces from .kernel.text.head to .init.text * * Pattern 4: * Some symbols belong to init section but still it is ok to reference
scripts/recordmcount.pl +3 -3
@@ -26,7 +26,7 @@ # which will also be the location of that section after final link. # e.g. # -# .section ".text.sched" +# .section ".sched.text" # .globl my_func # my_func: # [...]
@@ -39,7 +39,7 @@ # [...] # # Both relocation offsets for the mcounts in the above example will be -# offset from .text.sched. If we make another file called tmp.s with: +# offset from .sched.text. If we make another file called tmp.s with: # # .section __mcount_loc # .quad my_func + 0x5
@@ -51,7 +51,7 @@ # But this gets hard if my_func is not globl (a static function). # In such a case we have: # -# .section ".text.sched" +# .section ".sched.text" # my_func: # [...] # call mcount (offset: 0x5)
Signature · 1 line
1.5.6.3
RFC PATCH v3 2/7 x86: Add an option to compile with -ffunction-sections -fdata-sections
From: Waseem Daher <[email protected]>
This patch makes it possible to link and boot an x86 kernel with -ffunction-sections and -fdata-sections enabled.
Modpost currently warns whenever it sees a section with a name matching [.][0-9]+$ because they are often caused by section flag mismatch errors. When compiling with -ffunction-sections -fdata-sections, gcc places various classes of local symbols in sections with names such as .rodata.__func__.12345, causing these warnings to be printed spuriously. The simplest fix is to disable the warning when CONFIG_FUNCTION_DATA_SECTIONS is enabled.
--- Makefile | 4 ++++ arch/x86/kernel/vmlinux_32.lds.S | 1 + arch/x86/kernel/vmlinux_64.lds.S | 1 + include/asm-generic/vmlinux.lds.h | 2 ++ lib/Kconfig.debug | 9 +++++++++ scripts/Makefile.modpost | 1 + scripts/mod/modpost.c | 10 ++++++++-- 7 files changed, 26 insertions(+), 2 deletions(-)
Makefile +4 -0
@@ -540,6 +540,10 @@ ifdef CONFIG_FUNCTION_TRACER KBUILD_CFLAGS += -pg endif +ifdef CONFIG_FUNCTION_DATA_SECTIONS +KBUILD_CFLAGS += -ffunction-sections -fdata-sections +endif + # We trigger additional mismatches with less inlining ifdef CONFIG_DEBUG_SECTION_MISMATCH KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
arch/x86/kernel/vmlinux_32.lds.S +1 -0
@@ -193,6 +193,7 @@ SECTIONS __bss_start = .; /* BSS */ *(.bss.kernel.page_aligned) *(.bss) + *(.bss.*) . = ALIGN(4); __bss_stop = .; _end = . ;
arch/x86/kernel/vmlinux_64.lds.S +1 -0
@@ -222,6 +222,7 @@ SECTIONS .bss : AT(ADDR(.bss) - LOAD_OFFSET) { *(.bss.kernel.page_aligned) *(.bss) + *(.bss.*) } __bss_stop = .;
include/asm-generic/vmlinux.lds.h +2 -0
@@ -48,6 +48,7 @@/* .data section */ #define DATA_DATA \ *(.data) \ + *(.data.*) \ *(.kernel.data.init.refok) \ *(.ref.data) \ DEV_KEEP(init.data) \
@@ -235,6 +236,7 @@ALIGN_FUNCTION (); \ *(.text.hot) \ *(.text) \ + *(.text.*) \ *(.ref.text) \ *(.kernel.text.init.refok) \ *(.kernel.text.exit.refok) \
lib/Kconfig.debug +9 -0
@@ -557,6 +557,15 @@ config FRAME_POINTER some architectures or if you use external debuggers. If you don't debug the kernel, you can say N. +config FUNCTION_DATA_SECTIONS + bool "Compile with -ffunction-sections -fdata-sections" + depends on !FTRACE + help + If you say Y here the compiler will give each function + and data structure its own ELF section. + + If unsure, say N. + config BOOT_PRINTK_DELAY bool "Delay each boot printk message by N milliseconds" depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
scripts/Makefile.modpost +1 -0
@@ -87,6 +87,7 @@ modpost = scripts/mod/modpost \ $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ $(if $(CONFIG_MARKERS),-M $(markersfile)) \ + $(if $(filter -ffunction-sections -fdata-sections,$(KBUILD_CFLAGS) $(CFLAGS_KERNEL)),-F) \ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \ $(if $(cross_build),-c)
scripts/mod/modpost.c +8 -2
@@ -32,6 +32,8 @@ static int warn_unresolved = 0;/* How a symbol is exported */ static int sec_mismatch_count =0 ;static int sec_mismatch_verbose =1 ; +/* Are we using CONFIG_FUNCTION_DATA_SECTIONS? */ +static int function_data_sections =0 ;enum export { export_plain, export_unused, export_gpl,
@@ -736,7 +738,8 @@ static int check_section(const char *modname, const char *sec)/* consume all digits */ while (*e && e != sec &&isdigit (*e)) e--; -if (*e =='.' && !strstr (sec,".linkonce" )) { +if (*e =='.' && !strstr (sec,".linkonce" ) && + !function_data_sections) {warn ("%s (%s): unexpected section name.\n" "The (.[number]+) following section name are " "ld generated and not expected.\n"
@@ -2063,7 +2066,7 @@ int main(int argc, char **argv)struct ext_sym_list *extsym_iter;struct ext_sym_list *extsym_start =NULL ; -while ((opt =getopt (argc, argv,"i:I:e:cmsSo:awM:K:" )) !=-1 ) { +while ((opt =getopt (argc, argv,"i:I:e:cFmsSo:awM:K:" )) !=-1 ) {switch (opt) {case 'i' : kernel_read = optarg;
@@ -2083,6 +2086,9 @@ int main(int argc, char **argv) extsym_iter->file = optarg; extsym_start = extsym_iter;break ; +case 'F' : + function_data_sections =1 ; +break ;case 'm' : modversions =1 ;break ;
Signature · 1 line
1.5.6.3
RFC PATCH v3 3/7 Ksplice: Make find_symbol return a struct kernel_symbol
From: Tim Abbott <[email protected]>
Ksplice needs access to the kernel_symbol structure in order to support modifications to the exported symbol table.
--- kernel/module.c | 80 ++++++++++++++++++++++++++---------------------------- 1 files changed, 39 insertions(+), 41 deletions(-)
kernel/module.c +39 -41
@@ -282,7 +282,7 @@ struct find_symbol_arg {/* Output */ struct module *owner;const unsigned long *crc; -unsigned long value; +const struct kernel_symbol *sym; }; static bool find_symbol_in_section(const struct symsearch *syms,
@@ -323,17 +323,17 @@ static bool find_symbol_in_section(const struct symsearch *syms, fsa->owner = owner; fsa->crc =symversion (syms->crcs, symnum); - fsa->value = syms->start[symnum].value; + fsa->sym = &syms->start[symnum];return true; } -/* Find a symbol, return value, (optional) crc and (optional) module -* which owns it */ -static unsigned long find_symbol (const char *name, -struct module **owner, -const unsigned long **crc, -bool gplok, -bool warn) +/* Find a symbol and return it, along with, (optional) crc and +* (optional) module which owns it */ +static const struct kernel_symbol *find_symbol (const char *name, +struct module **owner, +const unsigned long **crc, +bool gplok, +bool warn) {struct find_symbol_arg fsa;
@@ -346,11 +346,11 @@ static unsigned long find_symbol(const char *name, *owner = fsa.owner;if (crc) *crc = fsa.crc; -return fsa.value; +return fsa.sym; }DEBUGP ("Failed to find symbol %s\n" , name); -return -ENOENT ; +return NULL ; }/* Search for module by name: must hold module_mutex. */
@@ -848,7 +848,7 @@ void __symbol_put(const char *symbol)struct module *owner;preempt_disable (); -if (IS_ERR_VALUE (find_symbol (symbol, &owner,NULL , true, false))) +if (find_symbol (symbol, &owner,NULL , true, false) ==NULL )BUG ();module_put (owner);preempt_enable ();
@@ -1011,7 +1011,7 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs, {const unsigned long *crc; -if (IS_ERR_VALUE (find_symbol ("struct_module" ,NULL , &crc, true, false))) +if (find_symbol ("struct_module" ,NULL , &crc, true, false) ==NULL )BUG ();return check_version (sechdrs, versindex,"struct_module" , mod, crc); }
@@ -1052,25 +1052,23 @@ static inline int same_magic(const char *amagic, const char *bmagic,/* Resolve a symbol for this module. I.e. if we find one, record usage. Must be holding module_mutex. */ -static unsigned long resolve_symbol (Elf_Shdr *sechdrs, -unsigned int versindex, -const char *name, -struct module *mod) +static const struct kernel_symbol *resolve_symbol (Elf_Shdr *sechdrs, +unsigned int versindex, +const char *name, +struct module *mod) {struct module *owner; -unsigned long ret; +const struct kernel_symbol *sym;const unsigned long *crc; - ret =find_symbol (name, &owner, &crc, + sym =find_symbol (name, &owner, &crc, !(mod->taints & (1 <<TAINT_PROPRIETARY_MODULE )), true); -if (!IS_ERR_VALUE (ret)) { -/* use_module can fail due to OOM, -or module initialization or unloading */ -if (!check_version (sechdrs, versindex, name, mod, crc) || - !use_module (mod, owner)) - ret = -EINVAL ; - } -return ret; +/* use_module can fail due to OOM, +or module initialization or unloading */ +if (!check_version (sechdrs, versindex, name, mod, crc) || + !use_module (mod, owner)) + sym =NULL ; +return sym; }/*
@@ -1466,17 +1464,15 @@ static void free_module(struct module *mod)void *__symbol_get (const char *symbol) {struct module *owner; -unsigned long value; +const struct kernel_symbol *sym;preempt_disable (); - value =find_symbol (symbol, &owner,NULL , true, true); -if (IS_ERR_VALUE (value)) - value =0 ; -else if (strong_try_module_get (owner)) - value =0 ; + sym =find_symbol (symbol, &owner,NULL , true, true); +if (sym !=NULL &&strong_try_module_get (owner)) + sym =NULL ;preempt_enable (); -return (void *)value; +return sym ==NULL ? (void *)0 : (void *)sym->value; }EXPORT_SYMBOL_GPL (__symbol_get);
@@ -1504,8 +1500,8 @@ static int verify_export_symbols(struct module *mod)for (i =0 ; i <ARRAY_SIZE (arr); i++) {for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) { -if (!IS_ERR_VALUE (find_symbol (s->name, &owner, -NULL , true, false))) { +if (find_symbol (s->name, &owner,NULL , true, false) + !=NULL ) { printk(KERN_ERR "%s: exports duplicate symbol %s" " (owned by %s)\n",
@@ -1529,6 +1525,7 @@ static int simplify_symbols(Elf_Shdr *sechdrs,unsigned long secbase;unsigned int i, n = sechdrs[symindex].sh_size /sizeof (Elf_Sym);int ret =0 ; +const struct kernel_symbol *ksym;for (i =1 ; i < n; i++) {switch (sym[i].st_shndx) {
@@ -1548,13 +1545,14 @@ static int simplify_symbols(Elf_Shdr *sechdrs,break ;case SHN_UNDEF : - sym[i].st_value - =resolve_symbol (sechdrs, versindex, - strtab + sym[i].st_name, mod); - + ksym =resolve_symbol (sechdrs, versindex, + strtab + sym[i].st_name, mod);/* Ok if resolved. */ -if (!IS_ERR_VALUE (sym[i].st_value)) +if (ksym !=NULL ) { + sym[i].st_value = ksym->value;break ; + } +/* Ok if weak. */ if (ELF_ST_BIND (sym[i].st_info) ==STB_WEAK )break ;
Signature · 1 line
1.5.6.3
RFC PATCH v3 4/7 Ksplice: Add module_data_address (the analogue of module_text_address)
From: Tim Abbott <[email protected]>
Ksplice's run-pre matching process needs to be able to determine the module that contains a particular text or data address.
--- include/linux/module.h | 2 ++ kernel/module.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-)
include/linux/module.h +2 -0
@@ -366,6 +366,8 @@ static inline int module_is_live(struct module *mod)/* Is this address in a module? (second is with no locks, for oops) */ struct module *module_text_address (unsigned long addr);struct module *__module_text_address (unsigned long addr); +struct module *module_data_address (unsigned long addr); +struct module *__module_data_address (unsigned long addr);int is_module_address (unsigned long addr);/* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
kernel/module.c +32 -0
@@ -2724,6 +2724,7 @@ struct module *__module_text_address(unsigned long addr)return mod;return NULL ; } +EXPORT_SYMBOL_GPL (__module_text_address);struct module *module_text_address (unsigned long addr) {
@@ -2735,6 +2736,37 @@ struct module *module_text_address(unsigned long addr)return mod; } +EXPORT_SYMBOL_GPL (module_text_address); + +struct module *__module_data_address (unsigned long addr) +{ +struct module *mod; + +if (addr < module_addr_min || addr > module_addr_max) +return NULL ; + +list_for_each_entry (mod, &modules, list) { +if (within (addr, mod->module_core + mod->core_text_size, + mod->core_size - mod->core_text_size) || +within (addr, mod->module_init + mod->init_text_size, + mod->init_size - mod->init_text_size)) +return mod; + } +return NULL ; +} +EXPORT_SYMBOL_GPL (__module_data_address); + +struct module *module_data_address (unsigned long addr) +{ +struct module *mod; + +preempt_disable (); + mod =__module_data_address (addr); +preempt_enable (); + +return mod; +} +EXPORT_SYMBOL_GPL (module_data_address);/* Don't grab lock, we're oopsing. */ void print_modules (void )
Signature · 1 line
1.5.6.3
RFC PATCH v3 5/7 Ksplice: Add functions for walking kallsyms symbols
From: Anders Kaseorg <[email protected]>
kallsyms_lookup_name only returns the first match that it finds. Ksplice needs information about all symbols with a given name in order to correctly resolve local symbols.
kallsyms_on_each_symbol provides a generic mechanism for iterating over the kallsyms table.
--- include/linux/kallsyms.h | 13 +++++++++++++ include/linux/module.h | 12 ++++++++++++ kernel/kallsyms.c | 19 +++++++++++++++++++ kernel/module.c | 19 +++++++++++++++++++ 4 files changed, 63 insertions(+), 0 deletions(-)
include/linux/kallsyms.h +13 -0
@@ -17,6 +17,11 @@/* Lookup the address for a symbol. Returns 0 if not found. */ unsigned long kallsyms_lookup_name (const char *name); +/* Call a function on each kallsyms symbol in the core kernel */ +int kallsyms_on_each_symbol (int (*fn)(void *,const char *,struct module *, +unsigned long ), +void *data); +extern int kallsyms_lookup_size_offset (unsigned long addr,unsigned long *symbolsize,unsigned long *offset);
@@ -43,6 +48,14 @@ static inline unsigned long kallsyms_lookup_name(const char *name)return 0 ; } +static inline int kallsyms_on_each_symbol (int (*fn)(void *,const char *, +struct module *, +unsigned long ), +void *data) +{ +return 0 ; +} +static inline int kallsyms_lookup_size_offset (unsigned long addr,unsigned long *symbolsize,unsigned long *offset)
include/linux/module.h +12 -0
@@ -378,6 +378,10 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,/* Look for this name: can be of form module:name. */ unsigned long module_kallsyms_lookup_name (const char *name); +int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *, +struct module *,unsigned long ), +void *data); +extern void __module_put_and_exit (struct module *mod,long code) __attribute__((noreturn));#define module_put_and_exit (code) __module_put_and_exit(THIS_MODULE, code);
@@ -546,6 +550,14 @@ static inline unsigned long module_kallsyms_lookup_name(const char *name)return 0 ; } +static inline int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *, +struct module *, +unsigned long ), +void *data) +{ +return 0 ; +} +static inline int register_module_notifier (struct notifier_block * nb) {/* no events will happen anyway, so this can always succeed */
kernel/kallsyms.c +19 -0
@@ -161,6 +161,25 @@ unsigned long kallsyms_lookup_name(const char *name)return module_kallsyms_lookup_name (name); } +int kallsyms_on_each_symbol (int (*fn)(void *,const char *,struct module *, +unsigned long ), +void *data) +{ +char namebuf[KSYM_NAME_LEN ]; +unsigned long i; +unsigned int off; +int ret; + +for (i =0 , off =0 ; i < kallsyms_num_syms; i++) { + off =kallsyms_expand_symbol (off, namebuf); + ret =fn (data, namebuf,NULL , kallsyms_addresses[i]); +if (ret !=0 ) +return ret; + } +return module_kallsyms_on_each_symbol (fn, data); +} +EXPORT_SYMBOL_GPL (kallsyms_on_each_symbol); +static unsigned long get_symbol_pos (unsigned long addr,unsigned long *symbolsize,unsigned long *offset)
kernel/module.c +19 -0
@@ -2554,6 +2554,25 @@ unsigned long module_kallsyms_lookup_name(const char *name)preempt_enable ();return ret; } + +int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *, +struct module *,unsigned long ), +void *data) +{ +struct module *mod; +unsigned int i; +int ret; + +list_for_each_entry (mod, &modules, list) { +for (i =0 ; i < mod->num_symtab; i++) { + ret =fn (data, mod->strtab + mod->symtab[i].st_name, + mod, mod->symtab[i].st_value); +if (ret !=0 ) +return ret; + } + } +return 0 ; +}#endif /* CONFIG_KALLSYMS */ static char *module_flags (struct module *mod,char *buf)
Signature · 1 line
1.5.6.3
RFC PATCH v3 6/7 Ksplice: Export symbols needed for Ksplice
From: Tim Abbott <[email protected]>
Ksplice uses several functions from module.c in order to resolve symbols and implement dependency handling. Calling these functions requires holding module_mutex, so it is exported.
Ksplice uses task_curr in order to confirm that no other tasks are executing during Ksplice's kernel stack check.
Ksplice uses find_bug and search_exception_tables as part of its conservative check that the user provided the correct source code for the running kernel.
Ksplice uses init_mm to get access to the ranges of addresses containing core kernel text and data. It seems that init_mm was scheduled to be unexported entirely in 2.6.26, so move it to EXPORT_SYMBOL_GPL (rather than back to EXPORT_SYMBOL).
--- arch/x86/kernel/init_task.c | 2 +- include/linux/module.h | 28 ++++++++++++++++++++++++++++ kernel/extable.c | 3 +++ kernel/module.c | 41 +++++++++++++++++------------------------ kernel/sched.c | 1 + lib/bug.c | 1 + 6 files changed, 51 insertions(+), 25 deletions(-)
arch/x86/kernel/init_task.c +1 -1
@@ -14,7 +14,7 @@ static struct fs_struct init_fs = INIT_FS;static struct signal_struct init_signals =INIT_SIGNALS (init_signals);static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand);struct mm_struct init_mm =INIT_MM (init_mm); -EXPORT_UNUSED_SYMBOL (init_mm);/* will be removed in 2.6.26 */ +EXPORT_SYMBOL_GPL (init_mm);/* * Initial thread structure.
include/linux/module.h +28 -0
@@ -355,6 +355,8 @@ struct module#define MODULE_ARCH_INIT {}#endif +extern struct mutex module_mutex; +/* FIXME: It'd be nice to isolate modules during init, too, so they aren't used before they (may) fail. But presently too much code (IDE & SCSI) require entry into the module during init.*/
@@ -370,6 +372,31 @@ struct module *module_data_address(unsigned long addr);struct module *__module_data_address (unsigned long addr);int is_module_address (unsigned long addr); +/* Search for module by name: must hold module_mutex. */ +struct module *find_module (const char *name); + +struct symsearch { +const struct kernel_symbol *start, *stop; +const unsigned long *crcs; +enum { +NOT_GPL_ONLY , +GPL_ONLY , +WILL_BE_GPL_ONLY , + } licence; +bool unused; +}; + +/* Search for an exported symbol by name. */ +const struct kernel_symbol *find_symbol (const char *name, +struct module **owner, +const unsigned long **crc, +bool gplok, +bool warn); + +/* Walk the exported symbol table */ +bool each_symbol (bool (*fn)(const struct symsearch *arr,struct module *owner, +unsigned int symnum,void *data),void *data); +/* Returns 0 and fills in value, defined and namebuf, or -ERANGE if symnum out of range. */ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
@@ -435,6 +462,7 @@ static inline void __module_get(struct module *module)#define symbol_put_addr (p) do { } while(0)#endif /* CONFIG_MODULE_UNLOAD */ +int use_module (struct module *a,struct module *b);/* This is a #define so the string doesn't get put in every .o file */ #define module_name (mod) \
kernel/extable.c +3 -0
@@ -39,6 +39,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) e =search_module_extables (addr);return e; } +EXPORT_SYMBOL_GPL (search_exception_tables);int core_kernel_text (unsigned long addr) {
@@ -59,6 +60,7 @@ int __kernel_text_address(unsigned long addr)return 1 ;return __module_text_address (addr) !=NULL ; } +EXPORT_SYMBOL_GPL (__kernel_text_address);int kernel_text_address (unsigned long addr) {
@@ -66,3 +68,4 @@ int kernel_text_address(unsigned long addr)return 1 ;return module_text_address (addr) !=NULL ; } +EXPORT_SYMBOL_GPL (kernel_text_address);
kernel/module.c +17 -24
106 lines not on this page · raw message
kernel/sched.c +1 -0
@@ -1769,6 +1769,7 @@ inline int task_curr(const struct task_struct *p) {return cpu_curr (task_cpu (p)) == p; } +EXPORT_SYMBOL_GPL (task_curr);static inline void __set_task_cpu (struct task_struct *p,unsigned int cpu) {
lib/bug.c +1 -0
@@ -113,6 +113,7 @@ const struct bug_entry *find_bug(unsigned long bugaddr)return module_find_bug (bugaddr); } +EXPORT_SYMBOL_GPL (find_bug);enum bug_trap_type report_bug (unsigned long bugaddr,struct pt_regs *regs) {
Signature · 1 line
1.5.6.3
RFC PATCH v3 7/7 Ksplice: Support updating x86-32 and x86-64
Ksplice makes it possible to apply patches to the kernel without rebooting.
--- Documentation/ksplice.txt | 282 +++++ MAINTAINERS | 10 + arch/Kconfig | 14 + arch/x86/Kconfig | 1 + arch/x86/kernel/ksplice-arch.c | 125 ++ include/linux/kernel.h | 1 + include/linux/ksplice.h | 212 ++++ kernel/Makefile | 3 + kernel/ksplice.c | 2716 ++++++++++++++++++++++++++++++++++++++++ kernel/panic.c | 1 + 10 files changed, 3365 insertions(+), 0 deletions(-) create mode 100644 Documentation/ksplice.txt create mode 100644 arch/x86/kernel/ksplice-arch.c create mode 100644 include/linux/ksplice.h create mode 100644 kernel/ksplice.c
Documentation/ksplice.txt new file +282 -0
@@ -0,0 +1,282 @@ +Ksplice +------- + +CONTENTS: + +1. Concepts: updates, packs, helper modules, primary modules +2. What changes can Ksplice handle? +3. Dependency model +4. Locking model +5. altinstructions, smplocks, and parainstructions +6. sysfs interface +7. debugfs interface +8. Hooks for running custom code during the update process + +0. Design Description +--------------------- + +For a description of the Ksplice design, please see the Ksplice technical +overview document: <http://www.ksplice.com/doc/ksplice.pdf>. For usage +examples and the Ksplice man pages, please see <http://www.ksplice.com>. + +The document below assumes familiarity with the Ksplice design and describes +notable implementation details and the interface between the Ksplice kernel +component and the Ksplice user space component. + +1. Concepts: Updates, packs, helper modules, primary modules +------------------------------------------------------------ + +A Ksplice update (struct update) contains one or more Ksplice packs, one for +each target kernel module that should be changed by the update. Ksplice packs +are grouped together into a Ksplice update in order to allow multiple +compilation units to be changed atomically. + +The contents of a Ksplice pack are documented via kernel-doc in +include/linux/ksplice.h. To construct a new Ksplice update to be performed +atomically, one needs to: + 1. Populate the fields of one or more ksplice_pack structures. + 2. Call the Ksplice function init_ksplice_pack() on each pack to register + the packs with the Ksplice kernel component. When init_ksplice_pack() + is called on a pack, that pack will be associated with the other packs + that share the same Ksplice identifier (KID) field. + 3. After all of the packs intended for a particular Ksplice update have + been loaded, that update can be applied via the sysfs interface + (described in Section 7 below). + +In order to save memory, each Ksplice pack has a "helper" module and a "primary" +module associated with it. + +The pack's "helper" module contains materials needed only for preparing for the +update. Specifically, the helper module contains a copy of the pre-patch +version of each of the compilation units changed by the Ksplice pack. The +helper module can be unloaded after the update has been applied. + +The pack's "primary" module contains the new sections to be inserted by the +update; it needs to remain loaded for as long as the update is applied. + +Here's an example: + +Let's say that the Ksplice user space component wants to update the core kernel +and the isdn module. The user space component will select a KID for this update +(let's say 123abc) and generate four modules: + +ksplice_123abc_vmlinux (the "primary" module for the vmlinux pack) +ksplice_123abc_vmlinux_helper (the "helper" module for the vmlinux pack) +ksplice_123abc_isdn (the "primary" module for the vmlinux pack) +ksplice_123abc_isdn_helper (the "helper" module for the vmlinux pack) + +Once both of the vmlinux modules have been loaded, one of the modules calls +init_ksplice_pack on a pack corresponding to the desired vmlinux changes. + +Similarly, once both of the isdn modules have been loaded, one of the modules +calls init_ksplice_pack on a pack corresponding to the desired isdn changes. + +Once all modules are loaded (in this example, four modules), the update can be +applied atomically using the Ksplice sysfs interface. Once the update has been +applied, the helper modules can be unloaded safely to save memory. + +2. What changes can Ksplice handle? +----------------------------------- + +The Ksplice user space component takes a source code patch and uses it to +construct appropriate Ksplice packs for an update. Ksplice can handle source +code patches that add new functions, modify the text or arguments of existing +functions, delete functions, move functions between compilation units, change +functions from local to global (or vice versa), add exported symbols, rename +exported symbols, and delete exported symbols. Ksplice can handle patches that +modify either C code or assembly code. + +As described in the Ksplice technical overview document, a programmer needs to +write some new code in order for Ksplice to apply a patch that makes semantic +changes to kernel data structures. Some other limitations also apply: + +Ksplice does not support changes to __init functions that been unloaded from +kernel memory. Ksplice also does not support changes to functions in +.exit.text sections since Ksplice currently requires that all Ksplice updates +affecting a module be reversed before that module can be unloaded. + +The Ksplice user space implementation does not currently support changes to +weak symbols and changes to global read-only data structures (changes to +read-only data structures that are local to a compilation unit are fine). + +Exported symbols: + +Ksplice can handle arbitrary changes to exported symbols in the source code +patch. + +Ksplice deletes exported symbols by looking up the relevant struct kernel_symbol +in the kernel's exported symbol table and replacing the name field with a +pointer to a string that begins with DISABLED. + +Ksplice adds new exported symbols through the same mechanism; the relevant +primary module will have a ksymtab entry containing a symbol with a name +beginning with DISABLED, and Ksplice will replace that with the name of the +symbol to be exported when the update is atomically applied. + +Because the struct kernel_symbol for a newly exported symbol is contained in the +Ksplice primary module, if a module using one of the newly exported symbols is +loaded, that module will correctly depend on the Ksplice primary module that +exported the symbol. + +3. Dependency model +------------------- + +Because Ksplice resolves symbols used in the post code using Ksplice +relocations, Ksplice must enforce additional dependencies. Ksplice uses the +use_module function to directly add dependencies on all the modules that the +post code references. + +4. Locking model +---------------- + +From a locking perspective, Ksplice treats applying or removing a Ksplice update +as analogous to loading or unloading a new version of the kernel modules patched +by the update. Ksplice uses module_mutex to protect against a variety of race +conditions related to modules being loaded or unloaded while Ksplice is applying +or reversing an update; this approach also protects against race conditions +involving multiple Ksplice updates being loaded or unloaded simultaneously as +well. + +5. altinstructions, smplocks, and parainstructions +-------------------------------------------------- + +There are currently several mechanisms through which the Linux kernel will +modify executable code at runtime. + +These mechanisms sometimes overwrite the storage unit of a relocation, which +would cause problems if not handled properly by Ksplice. + +Ksplice solves this problem by writing "canary" bytes (e.g., 0x77777777) in the +storage unit of the relocation in user space. Ksplice then checks whether the +canary has been overwritten before using a Ksplice relocation to detect symbol +values or to write a value to the storage unit of a Ksplice relocation. + +6. sysfs interface +------------------ + +Ksplice exports four sysfs files per Ksplice update in order to communicate with +user space. For each update, these four files are located in a directory of the +form /sys/kernel/ksplice/$kid, with $kid replaced by the KID of the Ksplice +update. + +A. /sys/kernel/ksplice/$kid/stage (mode 0600) + +This file contains one of three strings: +preparing: Indicates that this update has not yet been applied +applied: Indicates that this update has been applied and has not been reversed +reversed: Indicates that this update has been reversed + +When the stage is "preparing", the superuser can write "applied" to the stage +file in order to instruct Ksplice to apply the update. When the stage is +"applied", the superuser can write "reversed" to the stage file in order to +instruct Ksplice to reverse the update. Afterwards, the superuser can +write "cleanup" to the stage file in order to instruct Ksplice to +clean up the debugging information and sysfs directory associated with +the reversed update. Once an update is reversed, it cannot be re-applied without first +cleaning up the update. + +B. /sys/kernel/ksplice/$kid/debug (mode 0600) + +The file contains a single number: 1 if debugging is enabled for this Ksplice +update and 0 otherwise. + +The superuser can write a new value to this file to enable or disable debugging. + +C. /sys/kernel/ksplice/$kid/partial (mode 0600) + +The file contains a single number: 1 if the update should be applied even if +some of the target modules are not loaded and 0 otherwise. + +D. /sys/kernel/ksplice/$kid/abort_cause (mode 0400) + +This file contains a value indicating either 1) that Ksplice successfully +completed the most recently requested stage transition or 2) why Ksplice aborted +the most recently requested stage transition. + +Each abort_code string is described below, along with the stage transitions that +might potentially trigger each possible abort code. The stage transitions are +abbreviated as follows: preparing->applied (P->A), applied->reversed (A->R). + +ok (P->A, A->R): The most recent stage transition succeeded. + +no_match (P->A): Ksplice aborted the update because Ksplice was unable to match +the helper module's object code against the running kernel's object code. + +failed_to_find (P->A): Ksplice aborted the update because Ksplice was unable to +resolve some of the symbols used in the update. + +missing_export (P->A): Ksplice aborted the update because the symbols exported +by the kernel did not match Ksplice's expectations. + +already_reversed (P->A): Ksplice aborted the update because once an update has +been reversed, it cannot be applied again (without first being cleaned up and +reinitialized). + +module_busy (A->R): Ksplice aborted the undo operation because the target +Ksplice update is in use by another kernel module; specifically, either the +target Ksplice update exports a symbol that is in use by another module or +another Ksplice update depends on this Ksplice update. + +out_of_memory (P->A, A->R): Ksplice aborted the operation because a call to +kmalloc or vmalloc failed. + +code_busy (P->A, A->R): Ksplice aborted the operation because Ksplice was +unable to find a moment when one or more of the to-be-patched functions was not +a thread's kernel stack. + +target_not_loaded (P->A): Ksplice aborted the update because one of the target +modules is not loaded and the partial option (/sys/kernel/ksplice/$kid/partial) +is not enabled. + +call_failed (P->A, A->R): One of the calls included as part of this update +returned nonzero exit status. + +unexpected_running_task (P->A, A->R): Ksplice aborted the operation because +Ksplice observed a running task during the kernel stack check, at a time when +Ksplice expected all tasks to be stopped by stop_machine. + +unexpected (P->A, A->R): Ksplice aborted the operation because it encountered +an unspecified internal error. This condition can only be caused by an invalid +input to Ksplice or a bug in Ksplice. + +E. /sys/kernel/ksplice/$kid/conflicts (mode 0400) + +This file is empty until Ksplice aborts an operation because of a code_busy +condition (see "abort_code" above). This conflicts file then contains +information about the process(es) that caused the stack check failure. + +Specifically, each line of this file consists of three space-separated values, +describing a single conflict: + +$program_name $program_pid $conflict_label + +$program_name is the name of the program with the conflict. +$program_pid is the pid of the program with the conflict. +$conflict_label is the Ksplice label of the function with the conflict. + +7. debugfs interface +-------------------- + +Ksplice exports a single file to debugfs for each Ksplice update. The file has +a name of the form ksplice_KID, where KID is the unique identifier of the +Ksplice update. It contains debugging information in a human-readable format. + +8. Hooks for running custom code during the update process +---------------------------------------------------------- + +Ksplice allows a programmer to write custom code to be called from within the +kernel during the update process. The kernel component allows custom code to +be executed at the following times: + +pre_apply: Called before the update has been applied and before the machine has +been stopped. Allowed to fail. +check_apply: Called before the update has been applied but after the machine +has been stopped. Allowed to fail. +apply: Called when the update is definitely going to be applied and when the +machine is stopped. Not allowed to fail. +post_apply: Called when the update has been applied and the machine is no +longer stopped. Not allowed to fail. +fail_apply: Called when the update failed to apply and the machine is no longer +stopped. Not allowed to fail. + +Ksplice also provides six analagous xxx_reverse hooks.
MAINTAINERS +10 -0
@@ -2585,6 +2585,16 @@ W: http://miguelojeda.es/auxdisplay.htm W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm S: Maintained +KSPLICE: +P: Jeff Arnold +M: [email protected] +P: Anders Kaseorg +M: [email protected] +P: Tim Abbott +M: [email protected] +W: http://www.ksplice.com +S: Maintained + LAPB module L: [email protected] S: Orphan
arch/Kconfig +14 -0
@@ -41,6 +41,17 @@ config KPROBES for kernel debugging, non-intrusive instrumentation and testing. If in doubt, say "N". +config KSPLICE + tristate "Ksplice rebootless kernel updates" + depends on KALLSYMS_ALL && MODULE_UNLOAD && SYSFS && \ + FUNCTION_DATA_SECTIONS + depends on HAVE_KSPLICE + help + Say Y here if you want to be able to apply certain kinds of + patches to your running kernel, without rebooting. + + If unsure, say N. + config HAVE_EFFICIENT_UNALIGNED_ACCESS bool help
@@ -70,6 +81,9 @@ config HAVE_IOREMAP_PROT config HAVE_KPROBES bool +config HAVE_KSPLICE + def_bool n + config HAVE_KRETPROBES bool
arch/x86/Kconfig +1 -0
@@ -24,6 +24,7 @@ config X86 select HAVE_OPROFILE select HAVE_IOREMAP_PROT select HAVE_KPROBES + select HAVE_KSPLICE select ARCH_WANT_OPTIONAL_GPIOLIB select HAVE_KRETPROBES select HAVE_FTRACE_MCOUNT_RECORD
arch/x86/kernel/ksplice-arch.c new file +125 -0
125 lines not on this page · raw message
include/linux/kernel.h +1 -0
@@ -290,6 +290,7 @@ extern enum system_states {#define TAINT_OVERRIDDEN_ACPI_TABLE 8#define TAINT_WARN 9#define TAINT_CRAP 10 +#define TAINT_KSPLICE 11extern void dump_stack (void )__cold ;
include/linux/ksplice.h new file +212 -0
212 lines not on this page · raw message
kernel/Makefile +3 -0
@@ -11,6 +11,8 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ notifier.o ksysfs.o pm_qos_params.o sched_clock.o +CFLAGS_ksplice.o += -Iarch/$(SRCARCH)/kernel + ifdef CONFIG_FUNCTION_TRACER # Do not trace debug files and internal ftrace files CFLAGS_REMOVE_lockdep.o = -pg
@@ -68,6 +70,7 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o obj-$(CONFIG_AUDITSYSCALL) += auditsc.o obj-$(CONFIG_AUDIT_TREE) += audit_tree.o obj-$(CONFIG_KPROBES) += kprobes.o +obj-$(CONFIG_KSPLICE) += ksplice.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
kernel/ksplice.c new file +2716 -0
2,310 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.5.6.3
Part of the diff is not shown here. View the raw message.
Re: [RFC v3 PATCH 6/7] Ksplice: Export symbols needed for Ksplice
In reply to Jeff ArnoldQuoted 4 lines · Jeff Arnold
Ksplice uses
init_mmto get access to the ranges of addresses containing core kernel text and data. It seems thatinit_mmwas scheduled to be unexported entirely in 2.6.26, so move it toEXPORT_SYMBOL_GPL(rather than back toEXPORT_SYMBOL).
Umm, no. This is a very clear indicator that your code shouldn't be modular.
Re: [RFC v3 PATCH 6/7] Ksplice: Export symbols needed for Ksplice
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Jeff Arnold
Ksplice uses
init_mmto get access to the ranges of addresses containing core kernel text and data. It seems thatinit_mmwas scheduled to be unexported entirely in 2.6.26, so move it toEXPORT_SYMBOL_GPL(rather than back toEXPORT_SYMBOL).Umm, no. This is a very clear indicator that your code shouldn't be modular.
Well, it's easy to eliminate the use of init_mm in Ksplice by using a slightly different check for whether to use virt_to_page or vmalloc_to_page. Here is a patch:
Remove use of init_mm from Ksplice
Since the input to map_writable is guaranteed to be a core kernel address or a module address, we can use __module_text_address and __module_data_address to determine whether the address is in the core kernel or a module, and thus whether to use virt_to_page or vmalloc_to_page.
--- kernel/ksplice.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/ksplice.c +2 -3
@@ -949,11 +949,10 @@ static void *map_writable(void *addr, size_t len) {void *vaddr;int nr_pages =2 ; -unsigned long laddr = (unsigned long )addr;struct page *pages[2 ]; -if ((laddr >= init_mm.start_code && laddr < init_mm.end_code) || - (laddr >= init_mm.start_data && laddr < init_mm.end_data)) { +if (__module_text_address ((unsigned long )addr) ==NULL && +__module_data_address ((unsigned long )addr) ==NULL ) { pages[0 ] =virt_to_page (addr);WARN_ON (!PageReserved (pages[0 ])); pages[1 ] =virt_to_page (addr +PAGE_SIZE );
Signature · 1 line
1.5.6.5