20 Feb, 2008

1 commit

  • When adding __devinitconst etc. the __initconst variant
    were missed.
    Add this one and proper definitions for .head.text for use
    in .S files.
    The naming .head.text is preferred over .text.head as the
    latter will conflict for a function named head when introducing
    -ffunctions-sections.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

30 Jan, 2008

1 commit

  • Latest update; I now have 4 NX tests, but 2 fail so they're #if 0'd.
    I also cleaned up the NX test code quite a bit, and got rid of the ugly
    exception table sorting stuff.

    From: Arjan van de Ven

    This patch adds testcases for the CONFIG_DEBUG_RODATA configuration option
    as well as the NX CPU feature/mappings. Both testcases can move to tests/
    once that patch gets merged into mainline.
    (I'm half considering moving the rodata test into mm/init.c but I'll
    wait with that until init.c is unified)

    As part of this I had to fix a not-quite-right alignment in the vmlinux.lds.h
    for the RODATA sections, which lead to 1 page less being marked read only.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Arjan van de Ven
     

29 Jan, 2008

4 commits

  • Today we have the following annotations for functions/data
    referencing __init/__exit functions / data:

    __init_refok => for init functions
    __initdata_refok => for init data
    __exit_refok => for exit functions

    There is really no difference between the __init and __exit
    versions and simplify it and to introduce a shorter annotation
    the following new annotations are introduced:

    __ref => for functions (code) that
    references __*init / __*exit
    __refdata => for variables
    __refconst => for const variables

    Whit this annotation is it more obvious what the annotation
    is for and there is no longer the arbitary division
    between __init and __exit code.

    The mechanishm is the same as before - a special section
    is created which is made part of the usual sections
    in the linker script.

    We will start to see annotations like this:

    -static struct pci_serial_quirk pci_serial_quirks[] = {
    +static const struct pci_serial_quirk pci_serial_quirks[] __refconst = {
    -----------------
    -static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
    +static struct notifier_block cpuid_class_cpu_notifier __refdata =
    ----------------
    -static int threshold_cpu_callback(struct notifier_block *nfb,
    +static int __ref threshold_cpu_callback(struct notifier_block *nfb,

    [The above is just random samples].

    Note: No modifications were needed in modpost
    to support the new sections due to the newly introduced
    blacklisting.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Simplify the dependencies on __mem{init,exit}* (ACPI_HOTPLUG_MEMORY requires
    MEMORY_HOTPLUG).

    Signed-off-by: Adrian Bunk
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     
  • Introducing separate sections for __dev* (HOTPLUG),
    __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
    allows us to do a much more reliable Section mismatch
    check in modpost. We are no longer dependent on the actual
    configuration of for example HOTPLUG.

    This has the effect that all users see much more
    Section mismatch warnings than before because they
    were almost all hidden when HOTPLUG was enabled.
    The advantage of this is that when building a piece
    of code then it is much more likely that the Section
    mismatch errors are spotted and the warnings will be
    felt less random of nature.

    Signed-off-by: Sam Ravnborg
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Adrian Bunk

    Sam Ravnborg
     
  • This patch consolidate all definitions of .init.text, .init.data
    and .exit.text, .exit.data section definitions in
    the generic vmlinux.lds.h.

    This is a preparational patch - alone it does not buy
    us much good.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

20 Oct, 2007

1 commit

  • The marker activation functions sits in kernel/marker.c. A hash table is used
    to keep track of the registered probes and armed markers, so the markers
    within a newly loaded module that should be active can be activated at module
    load time.

    marker_query has been removed. marker_get_first, marker_get_next and
    marker_release should be used as iterators on the markers.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mathieu Desnoyers
    Acked-by: "Frank Ch. Eigler"
    Cc: Christoph Hellwig
    Cc: Rusty Russell
    Cc: Mike Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

14 Oct, 2007

1 commit

  • In commit 4665079cbb2a3e17de82f2ab2940b9f97f37d65e ("[NETNS]: Move some
    code into __init section when CONFIG_NET_NS=n") we got a new section -
    .exit.text.refok (more of 'let's tell modpost that some bogus calls are
    not bogus', a-la text.init.refok).

    Unfortunately, the commit in question forgot to add it to TEXT_TEXT,
    with rather amusing results.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

20 Jul, 2007

2 commits

  • This changes the i386 linker script and the asm-generic macro it uses so that
    ELF note sections with SHF_ALLOC set are linked into the kernel image along
    with other read-only data. The PT_NOTE also points to their location.

    This paves the way for putting useful build-time information into ELF notes
    that can be found easily later in a kernel memory dump.

    Signed-off-by: Roland McGrath
    Cc: Andi Kleen
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • per cpu data section contains two types of data. One set which is
    exclusively accessed by the local cpu and the other set which is per cpu,
    but also shared by remote cpus. In the current kernel, these two sets are
    not clearely separated out. This can potentially cause the same data
    cacheline shared between the two sets of data, which will result in
    unnecessary bouncing of the cacheline between cpus.

    One way to fix the problem is to cacheline align the remotely accessed per
    cpu data, both at the beginning and at the end. Because of the padding at
    both ends, this will likely cause some memory wastage and also the
    interface to achieve this is not clean.

    This patch:

    Moves the remotely accessed per cpu data (which is currently marked
    as ____cacheline_aligned_in_smp) into a different section, where all the data
    elements are cacheline aligned. And as such, this differentiates the local
    only data and remotely accessed data cleanly.

    Signed-off-by: Fenghua Yu
    Acked-by: Suresh Siddha
    Cc: Rusty Russell
    Cc: Christoph Lameter
    Cc:
    Cc: "Luck, Tony"
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fenghua Yu
     

30 May, 2007

1 commit

  • The RO_DATA section were hardcoded to a specific
    alignment in include/asm-generic/vmlinux.h.
    But for sparc64 this did not match the PAGE_SIZE.

    Introduce a new section definition named:
    RO_DATA that takes actual alignment as parameter.
    RODATA are provided for backward compatibility.

    On top of this avoid hardcoding alignment for
    sparc64 in reset of the script
    Fix is build-tested on sparc64 + x86_64.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

19 May, 2007

3 commits


03 May, 2007

1 commit

  • Three cleanups:

    1: ELF notes are never mapped, so there's no need to have any access
    flags in their phdr.

    2: When generating them from asm, tell the assembler to use a SHT_NOTE
    section type. There doesn't seem to be a way to do this from C.

    3: Use ANSI rather than traditional cpp behaviour to stringify the
    macro argument.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Andi Kleen
    Cc: Eric W. Biederman

    Jeremy Fitzhardinge
     

21 Dec, 2006

1 commit

  • This patch is designed to fix:
    - Disk eating corruptor on KT7 after resume from RAM
    - VIA IRQ handling
    - VIA fixups for bus lockups after resume from RAM

    The core of this is to add a table of resume fixups run at resume time.
    We need to do this for a variety of boards and features, but particularly
    we need to do this to get various critical VIA fixups done on resume.

    The second part of the problem is to handle VIA IRQ number rules which
    are a bit odd and need special handling for PIC interrupts. Various
    patches broke various boxes and while this one may not be perfect
    (hopefully it is) it ensures the workaround is applied to the right
    devices only.

    From: Jean Delvare

    Now that PCI quirks are replayed on software resume, we can safely
    re-enable the Asus SMBus unhiding quirk even when software suspend support
    is enabled.

    [akpm@osdl.org: fix const warning]
    Signed-off-by: Alan Cox
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

16 Dec, 2006

1 commit

  • It has caused more problems than it ever really solved, and is
    apparently not getting cleaned up and fixed. We can put it back when
    it's stable and isn't likely to make warning or bug events worse.

    In the meantime, enable frame pointers for more readable stack traces.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

12 Dec, 2006

1 commit


09 Dec, 2006

1 commit

  • This patch adds common handling for kernel BUGs, for use by architectures as
    they wish. The code is derived from arch/powerpc.

    The advantages of having common BUG handling are:
    - consistent BUG reporting across architectures
    - shared implementation of out-of-line file/line data
    - implement CONFIG_DEBUG_BUGVERBOSE consistently

    This means that in inline impact of BUG is just the illegal instruction
    itself, which is an improvement for i386 and x86-64.

    A BUG is represented in the instruction stream as an illegal instruction,
    which has file/line information associated with it. This extra information is
    stored in the __bug_table section in the ELF file.

    When the kernel gets an illegal instruction, it first confirms it might
    possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
    It then calls report_bug(). This searches __bug_table for a matching
    instruction pointer, and if found, prints the corresponding file/line
    information. If report_bug() determines that it wasn't a BUG which caused the
    trap, it returns BUG_TRAP_TYPE_NONE.

    Some architectures (powerpc) implement WARN using the same mechanism; if the
    illegal instruction was the result of a WARN, then report_bug(Q) returns
    CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.

    lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
    entries. The architecture must call
    module_bug_finalize()/module_bug_cleanup() from its corresponding
    module_finalize/cleanup functions.

    Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
    At the very least, filename and line information will not be recorded for each
    but, but architectures may decide to store no extra information per BUG at
    all.

    Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
    architectures will generally have to include an infinite loop (or similar) in
    the BUG code, so that gcc knows execution won't continue beyond that point.
    gcc does have a __builtin_trap() operator which may be useful to achieve the
    same effect, unfortunately it cannot be used to actually implement the BUG
    itself, because there's no way to get the instruction's address for use in
    generating the __bug_table entry.

    [randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
    [bunk@stusta.de: include/linux/bug.h must always #include
    Cc: Andi Kleen
    Cc: Hugh Dickens
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Rusty Russell
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     

07 Dec, 2006

2 commits

  • The .eh_frame section contents is never written to, so it can as well
    benefit from CONFIG_DEBUG_RODATA.

    Diff-ed against firstfloor tree.

    Signed-off-by: Jan Beulich
    Signed-off-by: Andi Kleen

    Jan Beulich
     
  • Ld knows about 2 kinds of symbols, absolute and section
    relative. Section relative symbols symbols change value
    when a section is moved and absolute symbols do not.

    Currently in the linker script we have several labels
    marking the beginning and ending of sections that
    are outside of sections, making them absolute symbols.
    Having a mixture of absolute and section relative
    symbols refereing to the same data is currently harmless
    but it is confusing.

    This must be done carefully as newer revs of ld do not place
    symbols that appear in sections without data and instead
    ld makes those symbols global :(

    My ultimate goal is to build a relocatable kernel. The
    safest and least intrusive technique is to generate
    relocation entries so the kernel can be relocated at load
    time. The only penalty would be an increase in the size
    of the kernel binary. The problem is that if absolute and
    relocatable symbols are not properly specified absolute symbols
    will be relocated or section relative symbols won't be, which
    is fatal.

    The practical motivation is that when generating kernels that
    will run from a reserved area for analyzing what caused
    a kernel panic, it is simpler if you don't need to hard code
    the physical memory location they will run at, especially
    for the distributions.

    [AK: and merged:]

    o Also put a message so that in future people can be aware of it and
    avoid introducing absolute symbols.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Vivek Goyal
    Signed-off-by: Andi Kleen

    Vivek Goyal
     

21 Nov, 2006

1 commit

  • This is a quick hack to overcome the fact that SRCU currently does not
    allow static initializers, and we need to sometimes initialize those
    things before any other initializers (even "core" ones) can do so.

    Currently we don't allow this at all for modules, and the only user that
    needs is right now is cpufreq. As reported by Thomas Gleixner:

    "Commit b4dfdbb3c707474a2254c5b4d7e62be31a4b7da9 ("[PATCH] cpufreq:
    make the transition_notifier chain use SRCU breaks cpu frequency
    notification users, which register the callback > on core_init
    level."

    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Arjan van de Ven
    Cc: Andrew Morton ,
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

28 Oct, 2006

2 commits

  • The multithreaded-probing code has a problem: after one initcall level (eg,
    core_initcall) has been processed, we will then start processing the next
    level (postcore_initcall) while the kernel threads which are handling
    core_initcall are still executing. This breaks the guarantees which the
    layered initcalls previously gave us.

    IOW, we want to be multithreaded _within_ an initcall level, but not between
    different levels.

    Fix that up by causing the probing code to wait for all outstanding probes at
    one level to complete before we start processing the next level.

    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Add a vmlinux.lds.h helper macro for defining the eight-level initcall table,
    teach all the architectures to use it.

    This is a prerequisite for a patch which performs initcall synchronisation for
    multithreaded-probing.

    Cc: Greg KH
    Signed-off-by: Andrew Morton
    [ Added AVR32 as well ]
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

22 Oct, 2006

1 commit

  • This changes the dwarf2 unwinder to do a binary search for CIEs
    instead of a linear work. The linker is unfortunately not
    able to build a proper lookup table at link time, instead it creates
    one at runtime as soon as the bootmem allocator is usable (so you'll continue
    using the linear lookup for the first [hopefully] few calls).
    The code should be ready to utilize a build-time created table once
    a fixed linker becomes available.

    Signed-off-by: Jan Beulich
    Signed-off-by: Andi Kleen

    Jan Beulich
     

27 Sep, 2006

1 commit

  • The param section is an array of "kernel_param" structures, storing only
    constant data: pointer to name, permission of the variable pointed to by
    (void *)arg and pointers to set/get methods.

    Move end_rodata down to include __param section in the read-only range used
    by CONFIG_DEBUG_RODATA.

    Signed-off-by: Marcelo Tosatti
    Acked-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcelo Tosatti
     

26 Sep, 2006

1 commit

  • This patch will pack any .note.* section into a PT_NOTE segment in the output
    file.

    To do this, we tell ld that we need a PT_NOTE segment. This requires us to
    start explicitly mapping sections to segments, so we also need to explicitly
    create PT_LOAD segments for text and data, and map the sections to them
    appropriately. Fortunately, each section will default to its previous
    section's segment, so it doesn't take many changes to vmlinux.lds.S.

    This only changes i386 for now, but I presume the corresponding changes for
    other architectures will be as simple.

    This change also adds , which defines C and Assembler macros
    for actually creating ELF notes.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Eric W. Biederman
    Cc: Hollis Blanchard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     

29 Jun, 2006

1 commit

  • Temporarily add EXPORT_UNUSED_SYMBOL and EXPORT_UNUSED_SYMBOL_GPL. These
    will be used as a transition measure for symbols that aren't used in the
    kernel and are on the way out. When a module uses such a symbol, a warning
    is printk'd at modprobe time.

    The main reason for removing unused exports is size: eacho export takes
    roughly between 100 and 150 bytes of kernel space in the binary. This
    patch gives users the option to immediately get this size gain via a config
    option.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

21 Mar, 2006

1 commit


07 Jan, 2006

1 commit


07 Nov, 2005

1 commit

  • Adds a RapidIO subsystem to the kernel. RIO is a switched fabric interconnect
    used in higher-end embedded applications. The curious can look at the specs
    over at http://www.rapidio.org

    The core code implements enumeration/discovery, management of
    devices/resources, and interfaces for RIO drivers.

    There's a lot more to do to take advantages of all the hardware features.
    However, this should provide a good base for folks with RIO hardware to start
    contributing.

    Signed-off-by: Matt Porter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Porter
     

11 Sep, 2005

1 commit

  • Inside the linker script, insert the code for DWARF debug info sections. This
    may help GDB'ing a Uml binary. Actually, it seems that ld is able to guess
    what I added correctly, but normal linker scripts include this section so it
    should be correct anyway adding it.

    On request by Sam Ravnborg , I've added it to
    asm-generic/vmlinux.lds.s. I've also moved there the stabs debug section,
    used the new macro in i386 linker script and added DWARF debug section to
    that.

    In the truth, I've not been able to verify the difference in GDB behaviour
    after this change (I've seen large improvements with another patch). This
    may depend on my binutils version, older one may have worse defaults.

    However, this section is present in normal linker script, so add it at
    least for the sake of cleanness.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

08 Sep, 2005

1 commit

  • There are possible race conditions if probes are placed on routines within the
    kprobes files and routines used by the kprobes. For example if you put probe
    on get_kprobe() routines, the system can hang while inserting probes on any
    routine such as do_fork(). Because while inserting probes on do_fork(),
    register_kprobes() routine grabs the kprobes spin lock and executes
    get_kprobe() routine and to handle probe of get_kprobe(), kprobes_handler()
    gets executed and tries to grab kprobes spin lock, and spins forever. This
    patch avoids such possible race conditions by preventing probes on routines
    within the kprobes file and routines used by kprobes.

    I have modified the patches as per Andi Kleen's suggestion to move kprobes
    routines and other routines used by kprobes to a seperate section
    .kprobes.text.

    Also moved page fault and exception handlers, general protection fault to
    .kprobes.text section.

    These patches have been tested on i386, x86_64 and ppc64 architectures, also
    compiled on ia64 and sparc64 architectures.

    Signed-off-by: Prasanna S Panchamukhi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prasanna S Panchamukhi
     

15 Jul, 2005

1 commit

  • Several reports on inconsistent kallsyms data has been caused by the aliased symbols
    __sched_text_start and __down to shift places in the output of nm.
    The root cause was that on second pass ld aligned __sched_text_start to a 4 byte boundary
    which is the function alignment on i386.
    sched.text and spinlock.text is now aligned to an 8 byte boundary to make sure they
    are aligned to a function alignemnt on most (all?) archs.

    Tested by: Paulo Marques
    Tested by: Alexander Stohr

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

26 Jun, 2005

1 commit

  • In vmlinux.lds.h the code is carefull to define every section so vmlinux
    properly reports the correct physical load address of code, as well as
    it's virtual address.

    The new SECURITY_INIT definition fails to follow that convention and
    and causes incorrect physical address to appear in the vmlinux if
    there are any security initcalls.

    This patch updates the SECURITY_INIT to follow the convention in the rest of
    the file.

    Signed-off-by: Eric Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds