1. 21 6月, 2016 1 次提交
  2. 13 4月, 2016 1 次提交
  3. 26 3月, 2016 1 次提交
  4. 22 2月, 2016 1 次提交
    • K
      arch: Introduce post-init read-only memory · c74ba8b3
      Kees Cook 提交于
      One of the easiest ways to protect the kernel from attack is to reduce
      the internal attack surface exposed when a "write" flaw is available. By
      making as much of the kernel read-only as possible, we reduce the
      attack surface.
      
      Many things are written to only during __init, and never changed
      again. These cannot be made "const" since the compiler will do the wrong
      thing (we do actually need to write to them). Instead, move these items
      into a memory region that will be made read-only during mark_rodata_ro()
      which happens after all kernel __init code has finished.
      
      This introduces __ro_after_init as a way to mark such memory, and adds
      some documentation about the existing __read_mostly marking.
      
      This improves the security of the Linux kernel by marking formerly
      read-write memory regions as read-only on a fully booted up system.
      
      Based on work by PaX Team and Brad Spengler.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brad Spengler <spender@grsecurity.net>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: David Brown <david.brown@linaro.org>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Emese Revfy <re.emese@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mathias Krause <minipli@googlemail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: PaX Team <pageexec@freemail.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: kernel-hardening@lists.openwall.com
      Cc: linux-arch <linux-arch@vger.kernel.org>
      Link: http://lkml.kernel.org/r/1455748879-21872-5-git-send-email-keescook@chromium.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c74ba8b3
  5. 07 2月, 2016 1 次提交
    • P
      earlycon: Use common framework for earlycon declarations · 2eaa7909
      Peter Hurley 提交于
      Use a single common table of struct earlycon_id for both command line
      and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
      unique earlycon declaration (the declaration is only guaranteed to be
      unique within a compilation unit; separate compilation units must still
      use unique earlycon names).
      
      The semantics of OF_EARLYCON_DECLARE() is different; it declares an
      earlycon which can matched either on the command line or by devicetree.
      EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
      which is matched by command line only. Remove redundant instances of
      EARLYCON_DECLARE().
      
      This enables all earlycons to properly initialize struct console
      with the appropriate name and index, which improves diagnostics and
      enables direct earlycon-to-console handoff.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2eaa7909
  6. 01 10月, 2015 3 次提交
  7. 20 8月, 2015 1 次提交
    • A
      kbuild: Fix .text.unlikely placement · 9bebe9e5
      Andi Kleen 提交于
      When building a kernel with .text.unlikely text the unlikely text for
      each translation unit was put next to the main .text code in the
      final vmlinux.
      
      The problem is that the linker doesn't allow more specific submatches
      of a section name in a different linker script statement after the
      main match.
      
      So we need to move them all into one line. With that change
      .text.unlikely is at the end of everything again.
      
      I also moved .text.hot into the same statement though, even though
      that's not strictly needed.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      9bebe9e5
  8. 10 4月, 2015 1 次提交
  9. 08 4月, 2015 1 次提交
    • S
      tracing: Add TRACE_DEFINE_ENUM() macro to map enums to their values · 0c564a53
      Steven Rostedt (Red Hat) 提交于
      Several tracepoints use the helper functions __print_symbolic() or
      __print_flags() and pass in enums that do the mapping between the
      binary data stored and the value to print. This works well for reading
      the ASCII trace files, but when the data is read via userspace tools
      such as perf and trace-cmd, the conversion of the binary value to a
      human string format is lost if an enum is used, as userspace does not
      have access to what the ENUM is.
      
      For example, the tracepoint trace_tlb_flush() has:
      
       __print_symbolic(REC->reason,
          { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" },
          { TLB_REMOTE_SHOOTDOWN, "remote shootdown" },
          { TLB_LOCAL_SHOOTDOWN, "local shootdown" },
          { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" })
      
      Which maps the enum values to the strings they represent. But perf and
      trace-cmd do no know what value TLB_LOCAL_MM_SHOOTDOWN is, and would
      not be able to map it.
      
      With TRACE_DEFINE_ENUM(), developers can place these in the event header
      files and ftrace will convert the enums to their values:
      
      By adding:
      
       TRACE_DEFINE_ENUM(TLB_FLUSH_ON_TASK_SWITCH);
       TRACE_DEFINE_ENUM(TLB_REMOTE_SHOOTDOWN);
       TRACE_DEFINE_ENUM(TLB_LOCAL_SHOOTDOWN);
       TRACE_DEFINE_ENUM(TLB_LOCAL_MM_SHOOTDOWN);
      
       $ cat /sys/kernel/debug/tracing/events/tlb/tlb_flush/format
      [...]
       __print_symbolic(REC->reason,
          { 0, "flush on task switch" },
          { 1, "remote shootdown" },
          { 2, "local shootdown" },
          { 3, "local mm shootdown" })
      
      The above is what userspace expects to see, and tools do not need to
      be modified to parse them.
      
      Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org
      
      Cc: Guilherme Cox <cox@computer.org>
      Cc: Tony Luck <tony.luck@gmail.com>
      Cc: Xie XiuQi <xiexiuqi@huawei.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Tested-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0c564a53
  10. 30 3月, 2015 1 次提交
  11. 27 3月, 2015 1 次提交
    • P
      serial: earlycon: Enable earlycon without command line param · 470ca0de
      Peter Hurley 提交于
      Earlycon matching can only be triggered if 'earlycon=...' has been
      specified on the kernel command line. To workaround this limitation
      requires tight coupling between arches and specific serial drivers
      in order to start an earlycon. Devicetree avoids this limitation
      with a link table that contains the required data to match earlycons.
      
      Mirror this approach for earlycon match by name. Re-purpose
      EARLYCON_DECLARE to generate a table entry which associates name with
      setup() function. Re-purpose setup_earlycon() to scan this table for
      an earlycon match, which is registered if found.
      
      Declare one "earlycon" early_param, which calls setup_earlycon().
      
      This design allows setup_earlycon() to be called directly with a
      param string (as if 'earlycon=...' had been set on the command line).
      Re-registration (either directly or by early_param) is prevented.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      470ca0de
  12. 24 3月, 2015 1 次提交
  13. 14 2月, 2015 1 次提交
    • A
      kernel: add support for .init_array.* constructors · 9ddf8252
      Andrey Ryabinin 提交于
      KASan uses constructors for initializing redzones for global variables.
      Globals instrumentation in GCC 4.9.2 produces constructors with priority
      (.init_array.00099)
      
      Currently kernel ignores such constructors.  Only constructors with
      default priority supported (.init_array)
      
      This patch adds support for constructors with priorities.  For kernel
      image we put pointers to constructors between __ctors_start/__ctors_end
      and do_ctors() will call them on start up.  For modules we merge
      .init_array.* sections into resulting .init_array.  Module code properly
      handles constructors in .init_array section.
      Signed-off-by: NAndrey Ryabinin <a.ryabinin@samsung.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Konstantin Serebryany <kcc@google.com>
      Cc: Dmitry Chernenkov <dmitryc@google.com>
      Signed-off-by: NAndrey Konovalov <adech.fo@gmail.com>
      Cc: Yuri Gribov <tetra2005@gmail.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ddf8252
  14. 02 12月, 2014 1 次提交
    • W
      iommu: provide early initialisation hook for IOMMU drivers · 1cd076bf
      Will Deacon 提交于
      IOMMU drivers must be initialised before any of their upstream devices,
      otherwise the relevant iommu_ops won't be configured for the bus in
      question. To solve this, a number of IOMMU drivers use initcalls to
      initialise the driver before anything has a chance to be probed.
      
      Whilst this solves the immediate problem, it leaves the job of probing
      the IOMMU completely separate from the iommu_ops to configure the IOMMU,
      which are called on a per-bus basis and require the driver to figure out
      exactly which instance of the IOMMU is being requested. In particular,
      the add_device callback simply passes a struct device to the driver,
      which then has to parse firmware tables or probe buses to identify the
      relevant IOMMU instance.
      
      This patch takes the first step in addressing this problem by adding an
      early initialisation pass for IOMMU drivers, giving them the ability to
      store some per-instance data in their iommu_ops structure and store that
      in their of_node. This can later be used when parsing OF masters to
      identify the IOMMU instance in question.
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      1cd076bf
  15. 03 10月, 2014 1 次提交
  16. 02 7月, 2014 1 次提交
    • Z
      core: fix typo in percpu read_mostly section · 330d2822
      Zhengyu He 提交于
      This fixes a typo that named the read_mostly section of percpu as
      readmostly. It works fine with SMP because the linker script specifies
      .data..percpu..readmostly. However, UP kernel builds don't have percpu
      sections defined and the non-percpu version of the section is called
      data..read_mostly, so .data..readmostly will float around and may break
      things unexpectedly.
      
      Looking at the original change that introduced data..percpu..readmostly
      (commit c957ef2c), it looks like this
      was the original intention.
      
      Tested: Built UP kernel and confirmed the sections got merged.
      
      - Before the patch:
      $ objdump -h vmlinux.o  | grep '\.data\.\.read.*mostly'
      38 .data..read_mostly 00004418  0000000000000000  0000000000000000  00431ac0  2**6
      50 .data..readmostly 00000014  0000000000000000  0000000000000000  00444000  2**3
      
      - After the patch:
      $ objdump -h vmlinux.o  | grep '\.data\.\.read.*mostly'
      38 .data..read_mostly 00004438  0000000000000000  0000000000000000  00431ac0  2**6
      Signed-off-by: NZhengyu He <hzy@google.com>
      Signed-off-by: NFilipe Brandenburger <filbranden@google.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      330d2822
  17. 20 6月, 2014 1 次提交
  18. 21 5月, 2014 4 次提交
  19. 08 5月, 2014 1 次提交
    • V
      kprobes: Ensure blacklist data is aligned · 69902c71
      Vineet Gupta 提交于
      ARC Linux (not supporting native unaligned access) was failing
      to boot because __start_kprobe_blacklist was not aligned.
      
      This was because per generated vmlinux.lds it was emitted right
      next to .rodata with strings etc hence could be randomly
      unaligned.
      
      Fix that by ensuring a word alignment. While 4 would suffice for
      32bit arches and problem at hand, it is probably better to put 8.
      
      | Path: (null) CPU: 0 PID: 1 Comm: swapper Not tainted
      | 3.15.0-rc3-next-20140430 #2
      | task: 8f044000 ti: 8f01e000 task.ti: 8f01e000
      |
      | [ECR   ]: 0x00230400 => Misaligned r/w from 0x800fb0d3
      | [EFA   ]: 0x800fb0d3
      | [BLINK ]: do_one_initcall+0x86/0x1bc
      | [ERET  ]: init_kprobes+0x52/0x120
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: <torvalds@linux-foundation.org>
      Cc: <rusty@rustcorp.com.au>
      Cc: <rdunlap@infradead.org>
      Cc: <jeremy@goop.org>
      Cc: <arnd@arndb.de>
      Cc: <dl9pf@gmx.de>
      Cc: <sparse@chrisli.org>
      Cc: <anil.s.keshavamurthy@intel.com>
      Cc: <davem@davemloft.net>
      Cc: <ananth@in.ibm.com>
      Cc: <masami.hiramatsu.pt@hitachi.com>
      Cc: <chrisw@sous-sol.org>
      Cc: <akataria@vmware.com>
      Cc: anton Kolesov <Anton.Kolesov@synopsys.com>
      Link: http://lkml.kernel.org/r/5361DB14.7010406@synopsys.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      69902c71
  20. 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
  21. 12 3月, 2014 1 次提交
  22. 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
  23. 17 10月, 2013 1 次提交
  24. 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
  25. 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
  26. 27 6月, 2013 1 次提交
  27. 04 6月, 2013 1 次提交
  28. 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
  29. 25 1月, 2013 1 次提交
  30. 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
  31. 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
  32. 11 10月, 2012 1 次提交
  33. 17 5月, 2012 1 次提交
  34. 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
  35. 24 3月, 2012 1 次提交