1. 24 4月, 2014 1 次提交
    • M
      kprobes: Introduce NOKPROBE_SYMBOL() macro to maintain kprobes blacklist · 376e2424
      Masami Hiramatsu 提交于
      Introduce NOKPROBE_SYMBOL() macro which builds a kprobes
      blacklist at kernel build time.
      
      The usage of this macro is similar to EXPORT_SYMBOL(),
      placed after the function definition:
      
        NOKPROBE_SYMBOL(function);
      
      Since this macro will inhibit inlining of static/inline
      functions, this patch also introduces a nokprobe_inline macro
      for static/inline functions. In this case, we must use
      NOKPROBE_SYMBOL() for the inline function caller.
      
      When CONFIG_KPROBES=y, the macro stores the given function
      address in the "_kprobe_blacklist" section.
      
      Since the data structures are not fully initialized by the
      macro (because there is no "size" information),  those
      are re-initialized at boot time by using kallsyms.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Link: http://lkml.kernel.org/r/20140417081705.26341.96719.stgit@ltc230.yrl.intra.hitachi.co.jp
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christopher Li <sparse@chrisli.org>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jan-Simon Möller <dl9pf@gmx.de>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Cc: linux-sparse@vger.kernel.org
      Cc: virtualization@lists.linux-foundation.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      376e2424
  2. 12 3月, 2014 1 次提交
  3. 12 2月, 2014 1 次提交
    • S
      ARM: Introduce CPU_METHOD_OF_DECLARE() for cpu hotplug/smp · 6c3ff8b1
      Stephen Boyd 提交于
      The goal of multi-platform kernels is to remove the need for mach
      directories and machine descriptors. To further that goal,
      introduce CPU_METHOD_OF_DECLARE() to allow cpu hotplug/smp
      support to be separated from the machine descriptors.
      Implementers should specify an enable-method property in their
      cpus node and then implement a matching set of smp_ops in their
      hotplug/smp code, wiring it up with the CPU_METHOD_OF_DECLARE()
      macro. When the kernel is compiled we'll collect all the
      enable-method smp_ops into one section for use at boot.
      
      At boot time we'll look for an enable-method in each cpu node and
      try to match that against all known CPU enable methods in the
      kernel. If there are no enable-methods in the cpu nodes we
      fallback to the cpus node and try to use any enable-method found
      there. If that doesn't work we fall back to the old way of using
      the machine descriptor.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: <devicetree@vger.kernel.org>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NKumar Gala <galak@codeaurora.org>
      6c3ff8b1
  4. 17 10月, 2013 1 次提交
  5. 27 7月, 2013 1 次提交
    • S
      tracing: Add __tracepoint_string() to export string pointers · 102c9323
      Steven Rostedt (Red Hat) 提交于
      There are several tracepoints (mostly in RCU), that reference a string
      pointer and uses the print format of "%s" to display the string that
      exists in the kernel, instead of copying the actual string to the
      ring buffer (saves time and ring buffer space).
      
      But this has an issue with userspace tools that read the binary buffers
      that has the address of the string but has no access to what the string
      itself is. The end result is just output that looks like:
      
       rcu_dyntick:          ffffffff818adeaa 1 0
       rcu_dyntick:          ffffffff818adeb5 0 140000000000000
       rcu_dyntick:          ffffffff818adeb5 0 140000000000000
       rcu_utilization:      ffffffff8184333b
       rcu_utilization:      ffffffff8184333b
      
      The above is pretty useless when read by the userspace tools. Ideally
      we would want something that looks like this:
      
       rcu_dyntick:          Start 1 0
       rcu_dyntick:          End 0 140000000000000
       rcu_dyntick:          Start 140000000000000 0
       rcu_callback:         rcu_preempt rhp=0xffff880037aff710 func=put_cred_rcu 0/4
       rcu_callback:         rcu_preempt rhp=0xffff880078961980 func=file_free_rcu 0/5
       rcu_dyntick:          End 0 1
      
      The trace_printk() which also only stores the address of the string
      format instead of recording the string into the buffer itself, exports
      the mapping of kernel addresses to format strings via the printk_format
      file in the debugfs tracing directory.
      
      The tracepoint strings can use this same method and output the format
      to the same file and the userspace tools will be able to decipher
      the address without any modification.
      
      The tracepoint strings need its own section to save the strings because
      the trace_printk section will cause the trace_printk() buffers to be
      allocated if anything exists within the section. trace_printk() is only
      used for debugging and should never exist in the kernel, we can not use
      the trace_printk sections.
      
      Add a new tracepoint_str section that will also be examined by the output
      of the printk_format file.
      
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      102c9323
  6. 04 7月, 2013 1 次提交
    • A
      rapidio: convert switch drivers to modules · 2ec3ba69
      Alexandre Bounine 提交于
      Rework RapidIO switch drivers to add an option to build them as loadable
      kernel modules.
      
      This patch removes RapidIO-specific vmlinux section and converts switch
      drivers to be compatible with LDM driver registration method.  To simplify
      registration of device-specific callback routines this patch introduces
      rio_switch_ops data structure.  The sw_sysfs() callback is removed from
      the list of device-specific operations because under the new structure its
      functions can be handled by switch driver's probe() and remove() routines.
      
      If a specific switch device driver is not loaded the RapidIO subsystem
      core will use default standard-based operations to configure a switch.
      Because the current implementation of RapidIO enumeration/discovery method
      relies on availability of device-specific operations for error management,
      switch device drivers must be loaded before the RapidIO
      enumeration/discovery starts.
      
      This patch also moves several common routines from enumeration/discovery
      module into the RapidIO core code to make switch-specific operations
      accessible to all components of RapidIO subsystem.
      Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
      Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
      Cc: Stef van Os <stef.van.os@Prodrive.nl>
      Cc: Jean Delvare <jdelvare@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2ec3ba69
  7. 27 6月, 2013 1 次提交
  8. 04 6月, 2013 1 次提交
  9. 15 3月, 2013 1 次提交
    • R
      CONFIG_SYMBOL_PREFIX: cleanup. · b92021b0
      Rusty Russell 提交于
      We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
      "_".  But Al Viro broke this in "consolidate cond_syscall and
      SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
      do so.
      
      Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
      prefix it so something.  So various places define helpers which are
      defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:
      
      1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
      2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
      3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
      4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
      5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
      6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
      7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
         CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
         for pasting.
      
      (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).
      
      Let's solve this properly:
      1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
      2) Make linux/export.h usable from asm.
      3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
      4) Make everyone use them.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
      b92021b0
  10. 25 1月, 2013 1 次提交
  11. 11 1月, 2013 1 次提交
    • T
      irqchip: add basic infrastructure · f6e916b8
      Thomas Petazzoni 提交于
      With the recent creation of the drivers/irqchip/ directory, it is
      desirable to move irq controller drivers here. At the moment, the only
      driver here is irq-bcm2835, the driver for the irq controller found in
      the ARM BCM2835 SoC, present in Rasberry Pi systems. This irq
      controller driver was exporting its initialization function and its
      irq handling function through a header file in
      <linux/irqchip/bcm2835.h>.
      
      When proposing to also move another irq controller driver in
      drivers/irqchip, Rob Herring raised the very valid point that moving
      things to drivers/irqchip was good in order to remove more stuff from
      arch/arm, but if it means adding gazillions of headers files in
      include/linux/irqchip/, it would not be very nice.
      
      So, upon the suggestion of Rob Herring and Arnd Bergmann, this commit
      introduces a small infrastructure that defines a central
      irqchip_init() function in drivers/irqchip/irqchip.c, which is meant
      to be called as the ->init_irq() callback of ARM platforms. This
      function calls of_irq_init() with an array of match strings and init
      functions generated from a special linker section.
      
      Note that the irq controller driver initialization function is
      responsible for setting the global handle_arch_irq() variable, so that
      ARM platforms no longer have to define the ->handle_irq field in their
      DT_MACHINE structure.
      
      A global header, <linux/irqchip.h> is also added to expose the single
      irqchip_init() function to the reset of the kernel.
      
      A further commit moves the BCM2835 irq controller driver to this new
      small infrastructure, therefore removing the include/linux/irqchip/
      directory.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NStephen Warren <swarren@wwwdotorg.org>
      Reviewed-by: NRob Herring <rob.herring@calxeda.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      [rob.herring: reword commit message to reflect use of linker sections.]
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      f6e916b8
  12. 03 1月, 2013 1 次提交
    • S
      clocksource: add common of_clksrc_init() function · ae278a93
      Stephen Warren 提交于
      It is desirable to move all clocksource drivers to drivers/clocksource,
      yet each requires its own initialization function. We'd rather not
      pollute <linux/> with a header for each function. Instead, create a
      single of_clksrc_init() function which will determine which clocksource
      driver to initialize based on device tree.
      
      Based on a similar patch for drivers/irqchip by Thomas Petazzoni.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      ae278a93
  13. 11 10月, 2012 1 次提交
  14. 17 5月, 2012 1 次提交
  15. 26 3月, 2012 1 次提交
    • P
      params: <level>_initcall-like kernel parameters · 026cee00
      Pawel Moll 提交于
      This patch adds a set of macros that can be used to declare
      kernel parameters to be parsed _before_ initcalls at a chosen
      level are executed.  We rename the now-unused "flags" field of
      struct kernel_param as the level.  It's signed, for when we
      use this for early params as well, in future.
      
      Linker macro collating init calls had to be modified in order
      to add additional symbols between levels that are later used
      by the init code to split the calls into blocks.
      Signed-off-by: NPawel Moll <pawel.moll@arm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      026cee00
  16. 24 3月, 2012 1 次提交
  17. 25 10月, 2011 1 次提交
  18. 19 5月, 2011 1 次提交
    • A
      module: Sort exported symbols · f02e8a65
      Alessio Igor Bogani 提交于
      This patch places every exported symbol in its own section
      (i.e. "___ksymtab+printk").  Thus the linker will use its SORT() directive
      to sort and finally merge all symbol in the right and final section
      (i.e. "__ksymtab").
      
      The symbol prefixed archs use an underscore as prefix for symbols.
      To avoid collision we use a different character to create the temporary
      section names.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      Signed-off-by: NAlessio Igor Bogani <abogani@kernel.org>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (folded in '+' fixup)
      Tested-by: NDirk Behme <dirk.behme@googlemail.com>
      f02e8a65
  19. 05 4月, 2011 1 次提交
    • J
      jump label: Introduce static_branch() interface · d430d3d7
      Jason Baron 提交于
      Introduce:
      
      static __always_inline bool static_branch(struct jump_label_key *key);
      
      instead of the old JUMP_LABEL(key, label) macro.
      
      In this way, jump labels become really easy to use:
      
      Define:
      
              struct jump_label_key jump_key;
      
      Can be used as:
      
              if (static_branch(&jump_key))
                      do unlikely code
      
      enable/disale via:
      
              jump_label_inc(&jump_key);
              jump_label_dec(&jump_key);
      
      that's it!
      
      For the jump labels disabled case, the static_branch() becomes an
      atomic_read(), and jump_label_inc()/dec() are simply atomic_inc(),
      atomic_dec() operations. We show testing results for this change below.
      
      Thanks to H. Peter Anvin for suggesting the 'static_branch()' construct.
      
      Since we now require a 'struct jump_label_key *key', we can store a pointer into
      the jump table addresses. In this way, we can enable/disable jump labels, in
      basically constant time. This change allows us to completely remove the previous
      hashtable scheme. Thanks to Peter Zijlstra for this re-write.
      
      Testing:
      
      I ran a series of 'tbench 20' runs 5 times (with reboots) for 3
      configurations, where tracepoints were disabled.
      
      jump label configured in
      avg: 815.6
      
      jump label *not* configured in (using atomic reads)
      avg: 800.1
      
      jump label *not* configured in (regular reads)
      avg: 803.4
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20110316212947.GA8792@redhat.com>
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Suggested-by: NH. Peter Anvin <hpa@linux.intel.com>
      Tested-by: NDavid Daney <ddaney@caviumnetworks.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      d430d3d7
  20. 04 4月, 2011 1 次提交
  21. 31 3月, 2011 1 次提交
  22. 25 3月, 2011 1 次提交
    • T
      percpu: Always align percpu output section to PAGE_SIZE · 0415b00d
      Tejun Heo 提交于
      Percpu allocator honors alignment request upto PAGE_SIZE and both the
      percpu addresses in the percpu address space and the translated kernel
      addresses should be aligned accordingly.  The calculation of the
      former depends on the alignment of percpu output section in the kernel
      image.
      
      The linker script macros PERCPU_VADDR() and PERCPU() are used to
      define this output section and the latter takes @align parameter.
      Several architectures are using @align smaller than PAGE_SIZE breaking
      percpu memory alignment.
      
      This patch removes @align parameter from PERCPU(), renames it to
      PERCPU_SECTION() and makes it always align to PAGE_SIZE.  While at it,
      add PCPU_SETUP_BUG_ON() checks such that alignment problems are
      reliably detected and remove percpu alignment comment recently added
      in workqueue.c as the condition would trigger BUG way before reaching
      there.
      
      For um, this patch raises the alignment of percpu area.  As the area
      is in .init, there shouldn't be any noticeable difference.
      
      This problem was discovered by David Howells while debugging boot
      failure on mn10300.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Cc: uclinux-dist-devel@blackfin.uclinux.org
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: user-mode-linux-devel@lists.sourceforge.net
      0415b00d
  23. 09 3月, 2011 1 次提交
    • J
      x86: Separate out entry text section · ea714547
      Jiri Olsa 提交于
      Put x86 entry code into a separate link section: .entry.text.
      
      Separating the entry text section seems to have performance
      benefits - caused by more efficient instruction cache usage.
      
      Running hackbench with perf stat --repeat showed that the change
      compresses the icache footprint. The icache load miss rate went
      down by about 15%:
      
       before patch:
               19417627  L1-icache-load-misses      ( +-   0.147% )
      
       after patch:
               16490788  L1-icache-load-misses      ( +-   0.180% )
      
      The motivation of the patch was to fix a particular kprobes
      bug that relates to the entry text section, the performance
      advantage was discovered accidentally.
      
      Whole perf output follows:
      
       - results for current tip tree:
      
        Performance counter stats for './hackbench/hackbench 10' (500 runs):
      
               19417627  L1-icache-load-misses      ( +-   0.147% )
             2676914223  instructions             #      0.497 IPC     ( +- 0.079% )
             5389516026  cycles                     ( +-   0.144% )
      
            0.206267711  seconds time elapsed   ( +-   0.138% )
      
       - results for current tip tree with the patch applied:
      
        Performance counter stats for './hackbench/hackbench 10' (500 runs):
      
               16490788  L1-icache-load-misses      ( +-   0.180% )
             2717734941  instructions             #      0.502 IPC     ( +- 0.079% )
             5414756975  cycles                     ( +-   0.148% )
      
            0.206747566  seconds time elapsed   ( +-   0.137% )
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: masami.hiramatsu.pt@hitachi.com
      Cc: ananth@in.ibm.com
      Cc: davem@davemloft.net
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20110307181039.GB15197@jolsa.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea714547
  24. 03 2月, 2011 3 次提交
    • S
      tracing: Replace syscall_meta_data struct array with pointer array · 3d56e331
      Steven Rostedt 提交于
      Currently the syscall_meta structures for the syscall tracepoints are
      placed in the __syscall_metadata section, and at link time, the linker
      makes one large array of all these syscall metadata structures. On boot
      up, this array is read (much like the initcall sections) and the syscall
      data is processed.
      
      The problem is that there is no guarantee that gcc will place complex
      structures nicely together in an array format. Two structures in the
      same file may be placed awkwardly, because gcc has no clue that they
      are suppose to be in an array.
      
      A hack was used previous to force the alignment to 4, to pack the
      structures together. But this caused alignment issues with other
      architectures (sparc).
      
      Instead of packing the structures into an array, the structures' addresses
      are now put into the __syscall_metadata section. As pointers are always the
      natural alignment, gcc should always pack them tightly together
      (otherwise initcall, extable, etc would also fail).
      
      By having the pointers to the structures in the section, we can still
      iterate the trace_events without causing unnecessary alignment problems
      with other architectures, or depending on the current behaviour of
      gcc that will likely change in the future just to tick us kernel developers
      off a little more.
      
      The __syscall_metadata section is also moved into the .init.data section
      as it is now only needed at boot up.
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3d56e331
    • M
      tracepoints: Fix section alignment using pointer array · 65498646
      Mathieu Desnoyers 提交于
      Make the tracepoints more robust, making them solid enough to handle compiler
      changes by not relying on anything based on compiler-specific behavior with
      respect to structure alignment. Implement an approach proposed by David Miller:
      use an array of const pointers to refer to the individual structures, and export
      this pointer array through the linker script rather than the structures per se.
      It will consume 32 extra bytes per tracepoint (24 for structure padding and 8
      for the pointers), but are less likely to break due to compiler changes.
      
      History:
      
      commit 7e066fb8 tracepoints: add DECLARE_TRACE() and DEFINE_TRACE()
      added the aligned(32) type and variable attribute to the tracepoint structures
      to deal with gcc happily aligning statically defined structures on 32-byte
      multiples.
      
      One attempt was to use a 8-byte alignment for tracepoint structures by applying
      both the variable and type attribute to tracepoint structures definitions and
      declarations. It worked fine with gcc 4.5.1, but broke with gcc 4.4.4 and 4.4.5.
      
      The reason is that the "aligned" attribute only specify the _minimum_ alignment
      for a structure, leaving both the compiler and the linker free to align on
      larger multiples. Because tracepoint.c expects the structures to be placed as an
      array within each section, up-alignment cause NULL-pointer exceptions due to the
      extra unexpected padding.
      
      (this patch applies on top of -tip)
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      LKML-Reference: <20110126222622.GA10794@Krystal>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Peter Zijlstra <peterz@infradead.org>
      CC: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      65498646
    • S
      tracing: Replace trace_event struct array with pointer array · e4a9ea5e
      Steven Rostedt 提交于
      Currently the trace_event structures are placed in the _ftrace_events
      section, and at link time, the linker makes one large array of all
      the trace_event structures. On boot up, this array is read (much like
      the initcall sections) and the events are processed.
      
      The problem is that there is no guarantee that gcc will place complex
      structures nicely together in an array format. Two structures in the
      same file may be placed awkwardly, because gcc has no clue that they
      are suppose to be in an array.
      
      A hack was used previous to force the alignment to 4, to pack the
      structures together. But this caused alignment issues with other
      architectures (sparc).
      
      Instead of packing the structures into an array, the structures' addresses
      are now put into the _ftrace_event section. As pointers are always the
      natural alignment, gcc should always pack them tightly together
      (otherwise initcall, extable, etc would also fail).
      
      By having the pointers to the structures in the section, we can still
      iterate the trace_events without causing unnecessary alignment problems
      with other architectures, or depending on the current behaviour of
      gcc that will likely change in the future just to tick us kernel developers
      off a little more.
      
      The _ftrace_event section is also moved into the .init.data section
      as it is now only needed at boot up.
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      e4a9ea5e
  25. 25 1月, 2011 1 次提交
    • T
      percpu: align percpu readmostly subsection to cacheline · 19df0c2f
      Tejun Heo 提交于
      Currently percpu readmostly subsection may share cachelines with other
      percpu subsections which may result in unnecessary cacheline bounce
      and performance degradation.
      
      This patch adds @cacheline parameter to PERCPU() and PERCPU_VADDR()
      linker macros, makes each arch linker scripts specify its cacheline
      size and use it to align percpu subsections.
      
      This is based on Shaohua's x86 only patch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Shaohua Li <shaohua.li@intel.com>
      19df0c2f
  26. 24 1月, 2011 1 次提交
    • D
      module: show version information for built-in modules in sysfs · e94965ed
      Dmitry Torokhov 提交于
      Currently only drivers that are built as modules have their versions
      shown in /sys/module/<module_name>/version, but this information might
      also be useful for built-in drivers as well. This especially important
      for drivers that do not define any parameters - such drivers, if
      built-in, are completely invisible from userspace.
      
      This patch changes MODULE_VERSION() macro so that in case when we are
      compiling built-in module, version information is stored in a separate
      section. Kernel then uses this data to create 'version' sysfs attribute
      in the same fashion it creates attributes for module parameters.
      Signed-off-by: NDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e94965ed
  27. 14 1月, 2011 1 次提交
  28. 24 12月, 2010 1 次提交
    • D
      of: Add support for linking device tree blobs into vmlinux · aab94339
      Dirk Brandewie 提交于
      This patch adds support for linking device tree blob(s) into
      vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking
      .dtb sections into vmlinux. To maintain compatiblity with the of/fdt
      driver code platforms MUST copy the blob to a non-init memory location
      before the kernel frees the .init.* sections in the image.
      
      Modifies scripts/Makefile.lib to add a kbuild command to
      compile DTS files to device tree blobs and a rule to create objects to
      wrap the blobs for linking.
      
      STRUCT_ALIGNMENT is defined in vmlinux.lds.h for use in the rule to
      create wrapper objects for the dtb in Makefile.lib.  The
      STRUCT_ALIGN() macro in vmlinux.lds.h is modified to use the
      STRUCT_ALIGNMENT definition.
      
      The DTB's are placed on 32 byte boundries to allow parsing the blob
      with driver/of/fdt.c during early boot without having to copy the blob
      to get the structure alignment GCC expects.
      
      A DTB is linked in by adding the DTB object to the list of objects to
      be linked into vmlinux in the archtecture specific Makefile using
         obj-y += foo.dtb.o
      Signed-off-by: NDirk Brandewie <dirk.brandewie@gmail.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      [grant.likely@secretlab.ca: cleaned up whitespace inconsistencies]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      aab94339
  29. 27 10月, 2010 2 次提交
    • M
      vmlinux.lds.h: lower init ramfs alignment to 4 · d8826262
      Mike Frysinger 提交于
      The new init ramfs format (cpio based) requires an alignment of 4 (per the
      documentation and per the source files themselves).  As for compressed
      sources, the decompressors can all deal with unaligned buffers.
      
      The cpio source is also found in the __init sections of the kernel, so
      once they are read and expanded into a tmpfs, the source is freed.  That
      means there is no need to force page alignment here either.
      
      This has been used on Blackfin systems for many releases without issue.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d8826262
    • M
      vmlinux.lds.h: gather .data..shared_aligned sections in DATA_DATA · d356c0b6
      Mike Frysinger 提交于
      With the recent change "net: remove time limit in process_backlog()", the
      softnet_data variable changed from "DEFINE_PER_CPU()" to
      "DEFINE_PER_CPU_ALIGNED()" which moved it from the .data section to the
      .data.shared_align section.  I'm not saying this patch is wrong, just that
      is what caused me to notice this larger problem.  No one else in the
      kernel is using this aligned macro variant, so I imagine that's why no one
      has noticed yet.
      
      Since .data..shared_align isn't declared in any vmlinux files that I can
      see, the linker just places it last.  This "just works" for most people,
      but when building a ROM kernel on Blackfin systems, it causes section
      overlap errors:
      
      bfin-uclinux-ld.real:
      	section .init.data [00000000202e06b8 -> 00000000202e48b7] overlaps
      	section .data.shared_aligned [00000000202e06b8 -> 00000000202e0723]
      
      I imagine other arches which support the ROM config option and thus do
      funky placement would see similar issues ...
      
      On x86, it is stuck in a dedicated section at the end:
       [8] .data             PROGBITS ffffffff810ec000 2ec0000303a8 00 WA 0 0 4096
       [9] .data.shared_alig PROGBITS ffffffff8111c3c0 31c3c00000c8 00 WA 0 0 64
      
      So make sure we include this section in the DATA_DATA macro so that it is
      placed in the right location.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
      Cc: Greg Ungerer <gerg@snapgear.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d356c0b6
  30. 21 10月, 2010 2 次提交
    • H
      x86-32, percpu: Correct the ordering of the percpu readmostly section · 2aeb66d3
      H. Peter Anvin 提交于
      Checkin c957ef2c had inconsistent
      ordering of .data..percpu..page_aligned and .data..percpu..readmostly;
      the still-broken version affected x86-32 at least.
      
      The page aligned version really must be page aligned...
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      LKML-Reference: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      2aeb66d3
    • S
      percpu: Introduce a read-mostly percpu API · c957ef2c
      Shaohua Li 提交于
      Add a new readmostly percpu section and API.  This can be used to
      avoid dirtying data lines which are generally not written to, which is
      especially important for data which may be accessed by processors
      other than the one for which the percpu area belongs to.
      
      [ hpa: moved it *after* the page-aligned section, for obvious
        reasons. ]
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      LKML-Reference: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      c957ef2c
  31. 29 9月, 2010 1 次提交
    • H
      initramfs: fix initramfs size calculation · ffe8018c
      Hendrik Brueckner 提交于
      The size of a built-in initramfs is calculated in init/initramfs.c by
      "__initramfs_end - __initramfs_start".  Those symbols are defined in the
      linker script include/asm-generic/vmlinux.lds.h:
      
      #define INIT_RAM_FS                                                     \
              . = ALIGN(PAGE_SIZE);                                           \
              VMLINUX_SYMBOL(__initramfs_start) = .;                          \
              *(.init.ramfs)                                                  \
              VMLINUX_SYMBOL(__initramfs_end) = .;
      
      If the initramfs file has an odd number of bytes, the "__initramfs_end"
      symbol points to an odd address, for example, the symbols in the
      System.map might look like:
      
          0000000000572000 T __initramfs_start
          00000000005bcd05 T __initramfs_end	  <-- odd address
      
      At least on s390 this causes a problem:
      
      Certain s390 instructions, especially instructions for loading addresses
      (larl) or branch addresses must be on even addresses.  The compiler loads
      the symbol addresses with the "larl" instruction.  This instruction sets
      the last bit to 0 and, therefore, for odd size files, the calculated size
      is one byte less than it should be:
      
          0000000000540a9c <populate_rootfs>:
            540a9c:     eb cf f0 78 00 24       stmg    %r12,%r15,120(%r15),
            540aa2:     c0 10 00 01 8a af       larl    %r1,572000 <__initramfs_start>
            540aa8:     c0 c0 00 03 e1 2e       larl    %r12,5bcd04 <initramfs_end>
                                                        (Instead of  5bcd05)
            ...
            540abe:     1b c1                   sr      %r12,%r1
      
      To fix the problem, this patch introduces the global variable
      __initramfs_size, which is calculated in the "usr/initramfs_data.S" file.
      The populate_rootfs() function can then use the start marker of the
      .init.ramfs section and the value of __initramfs_size for loading the
      initramfs.  Because the start marker and size is sufficient, the
      __initramfs_end symbol is no longer needed and is removed.
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Acked-by: N"H. Peter Anvin" <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      ffe8018c
  32. 23 9月, 2010 1 次提交
    • J
      jump label: Base patch for jump label · bf5438fc
      Jason Baron 提交于
      base patch to implement 'jump labeling'. Based on a new 'asm goto' inline
      assembly gcc mechanism, we can now branch to labels from an 'asm goto'
      statment. This allows us to create a 'no-op' fastpath, which can subsequently
      be patched with a jump to the slowpath code. This is useful for code which
      might be rarely used, but which we'd like to be able to call, if needed.
      Tracepoints are the current usecase that these are being implemented for.
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      LKML-Reference: <ee8b3595967989fdaf84e698dc7447d315ce972a.1284733808.git.jbaron@redhat.com>
      
      [ cleaned up some formating ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      bf5438fc
  33. 28 7月, 2010 1 次提交
  34. 23 7月, 2010 1 次提交
  35. 21 7月, 2010 1 次提交
    • S
      tracing: Properly align linker defined symbols · 07fca0e5
      Sam Ravnborg 提交于
      We define a number of symbols in the linker scipt like this:
      
          __start_syscalls_metadata = .;
          *(__syscalls_metadata)
      
      But we do not know the alignment of "." when we assign
      the __start_syscalls_metadata symbol.
      gcc started to uses bigger alignment for structs (32 bytes),
      so we saw situations where the linker due to alignment
      constraints increased the value of "." after the symbol assignment.
      
      This resulted in boot fails.
      
      Fix this by forcing a 32 byte alignment of "." before the
      assignment.
      
      This patch introduces the forced alignment for
      ftrace_events and syscalls_metadata.
      It may be required in more places.
      Reported-by: NZeev Tarantov <zeev.tarantov@gmail.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      07fca0e5
  36. 16 7月, 2010 1 次提交