1. 19 Feb, 2008 1 commit
    • Sam Ravnborg's avatar
      Add missing init section definitions · 37c514e3
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      37c514e3
  2. 30 Jan, 2008 1 commit
    • Arjan van de Ven's avatar
      x86: add testcases for RODATA and NX protections/attributes · edeed305
      Arjan van de Ven authored
      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 <arjan@linux.intel.com>
      
      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: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      edeed305
  3. 28 Jan, 2008 4 commits
    • Sam Ravnborg's avatar
      Introduce new section reference annotations tags: __ref, __refdata, __refconst · 312b1485
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      312b1485
    • Adrian Bunk's avatar
      asm-generic/vmlix.lds.h: simplify __mem{init,exit}* dependencies · 1a3fb6d4
      Adrian Bunk authored
      Simplify the dependencies on __mem{init,exit}* (ACPI_HOTPLUG_MEMORY requires
      MEMORY_HOTPLUG).
      Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      1a3fb6d4
    • Sam Ravnborg's avatar
      Use separate sections for __dev/__cpu/__mem code/data · eb8f6890
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Adrian Bunk <bunk@kernel.org>
      eb8f6890
    • Sam Ravnborg's avatar
      all archs: consolidate init and exit sections in vmlinux.lds.h · 01ba2bdc
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      01ba2bdc
  4. 19 Oct, 2007 1 commit
  5. 13 Oct, 2007 1 commit
  6. 19 Jul, 2007 2 commits
    • Roland McGrath's avatar
      i386: Put allocated ELF notes in read-only data segment · cbe87121
      Roland McGrath authored
      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: default avatarRoland McGrath <roland@redhat.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cbe87121
    • Fenghua Yu's avatar
      define new percpu interface for shared data · 5fb7dc37
      Fenghua Yu authored
      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: default avatarFenghua Yu <fenghua.yu@intel.com>
      Acked-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5fb7dc37
  7. 29 May, 2007 1 commit
    • Sam Ravnborg's avatar
      sparc64: fix alignment bug in linker definition script · 4096b46f
      Sam Ravnborg authored
      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: default avatarSam Ravnborg <sam@ravnborg.org>
      4096b46f
  8. 19 May, 2007 3 commits
  9. 02 May, 2007 1 commit
  10. 20 Dec, 2006 1 commit
    • Alan Cox's avatar
      PCI: Fix multiple problems with VIA hardware · 1597cacb
      Alan Cox authored
      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 <khali@linux-fr.org>
      
      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: default avatarAlan Cox <alan@redhat.com>
      Cc: Jean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1597cacb
  11. 15 Dec, 2006 1 commit
    • Linus Torvalds's avatar
      Remove stack unwinder for now · d1526e2c
      Linus Torvalds authored
      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: default avatarLinus Torvalds <torvalds@osdl.org>
      d1526e2c
  12. 11 Dec, 2006 1 commit
  13. 08 Dec, 2006 1 commit
    • Jeremy Fitzhardinge's avatar
      [PATCH] Generic BUG implementation · 7664c5a1
      Jeremy Fitzhardinge authored
      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 <linux/module.h]
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Hugh Dickens <hugh@veritas.com>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7664c5a1
  14. 06 Dec, 2006 2 commits
    • Jan Beulich's avatar
      [PATCH] unwinder: move .eh_frame to RODATA · b65780e1
      Jan Beulich authored
      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: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      b65780e1
    • Vivek Goyal's avatar
      [PATCH] i386: Distinguish absolute symbols · 6569580d
      Vivek Goyal authored
      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: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      6569580d
  15. 20 Nov, 2006 1 commit
    • Linus Torvalds's avatar
      Add "pure_initcall" for static variable initialization · b3438f82
      Linus Torvalds authored
      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 b4dfdbb3 ("[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 <tglx@timesys.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Andrew Morton <akpm@osdl.org>,
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b3438f82
  16. 27 Oct, 2006 2 commits
  17. 21 Oct, 2006 1 commit
    • Jan Beulich's avatar
      [PATCH] x86-64: Speed up dwarf2 unwinder · 690a973f
      Jan Beulich authored
      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: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      690a973f
  18. 27 Sep, 2006 1 commit
  19. 26 Sep, 2006 1 commit
    • Jeremy Fitzhardinge's avatar
      [PATCH] x86: put .note.* sections into a PT_NOTE segment in vmlinux · 9c9b8b38
      Jeremy Fitzhardinge authored
      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 <linux/elfnote.h>, which defines C and Assembler macros
      for actually creating ELF notes.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Hollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9c9b8b38
  20. 28 Jun, 2006 1 commit
  21. 20 Mar, 2006 1 commit
  22. 06 Jan, 2006 1 commit
  23. 07 Nov, 2005 1 commit
  24. 10 Sep, 2005 1 commit
    • Paolo 'Blaisorblade' Giarrusso's avatar
      [PATCH] i386 / uml: add dwarf sections to static link script · a7d0c210
      Paolo 'Blaisorblade' Giarrusso authored
      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 <sam@ravnborg.org>, 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: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a7d0c210
  25. 07 Sep, 2005 1 commit
    • Prasanna S Panchamukhi's avatar
      [PATCH] Kprobes: prevent possible race conditions generic · d0aaff97
      Prasanna S Panchamukhi authored
      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: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d0aaff97
  26. 14 Jul, 2005 1 commit
    • Sam Ravnborg's avatar
      kbuild: Avoid inconsistent kallsyms data · 6d30e3a8
      Sam Ravnborg authored
      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 <pmarques@grupopie.com>
      Tested by: Alexander Stohr <Alexander.Stohr@gmx.de>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      6d30e3a8
  27. 25 Jun, 2005 1 commit
  28. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      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!
      1da177e4