1. 23 5月, 2013 1 次提交
    • S
      ARM: 7727/1: remove the .vm_mm value from gate_vma · 4ca46c5e
      Steven Capper 提交于
      If one reads /proc/$PID/smaps, the mmap_sem belonging to the
      address space of the task being examined is locked for reading.
      All the pages of the vmas belonging to the task's address space
      are then walked with this lock held.
      
      If a gate_vma is present in the architecture, it too is examined
      by the fs/proc/task_mmu.c code. As gate_vma doesn't belong to the
      address space of the task though, its pages are not walked.
      
      A recent cleanup (commit f6604efe) of the gate_vma initialisation
      code set the vm_mm value to &init_mm. Unfortunately a non-NULL
      vm_mm value in the gate_vma will cause the task_mmu code to attempt
      to walk the pages of the gate_vma (with no mmap-sem lock held). If
      one enables Transparent Huge Page support and vm debugging, this
      will then cause OOPses as pmd_trans_huge_lock is called without
      mmap_sem being locked.
      
      This patch removes the .vm_mm value from gate_vma, restoring the
      original behaviour of the task_mmu code.
      Signed-off-by: NSteve Capper <steve.capper@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4ca46c5e
  2. 01 5月, 2013 1 次提交
    • T
      dump_stack: unify debug information printed by show_regs() · a43cb95d
      Tejun Heo 提交于
      show_regs() is inherently arch-dependent but it does make sense to print
      generic debug information and some archs already do albeit in slightly
      different forms.  This patch introduces a generic function to print debug
      information from show_regs() so that different archs print out the same
      information and it's much easier to modify what's printed.
      
      show_regs_print_info() prints out the same debug info as dump_stack()
      does plus task and thread_info pointers.
      
      * Archs which didn't print debug info now do.
      
        alpha, arc, blackfin, c6x, cris, frv, h8300, hexagon, ia64, m32r,
        metag, microblaze, mn10300, openrisc, parisc, score, sh64, sparc,
        um, xtensa
      
      * Already prints debug info.  Replaced with show_regs_print_info().
        The printed information is superset of what used to be there.
      
        arm, arm64, avr32, mips, powerpc, sh32, tile, unicore32, x86
      
      * s390 is special in that it used to print arch-specific information
        along with generic debug info.  Heiko and Martin think that the
        arch-specific extra isn't worth keeping s390 specfic implementation.
        Converted to use the generic version.
      
      Note that now all archs print the debug info before actual register
      dumps.
      
      An example BUG() dump follows.
      
       kernel BUG at /work/os/work/kernel/workqueue.c:4841!
       invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
       Modules linked in:
       CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #7
       Hardware name: empty empty/S3992, BIOS 080011  10/26/2007
       task: ffff88007c85e040 ti: ffff88007c860000 task.ti: ffff88007c860000
       RIP: 0010:[<ffffffff8234a07e>]  [<ffffffff8234a07e>] init_workqueues+0x4/0x6
       RSP: 0000:ffff88007c861ec8  EFLAGS: 00010246
       RAX: ffff88007c861fd8 RBX: ffffffff824466a8 RCX: 0000000000000001
       RDX: 0000000000000046 RSI: 0000000000000001 RDI: ffffffff8234a07a
       RBP: ffff88007c861ec8 R08: 0000000000000000 R09: 0000000000000000
       R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8234a07a
       R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
       FS:  0000000000000000(0000) GS:ffff88007dc00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
       CR2: ffff88015f7ff000 CR3: 00000000021f1000 CR4: 00000000000007f0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
       Stack:
        ffff88007c861ef8 ffffffff81000312 ffffffff824466a8 ffff88007c85e650
        0000000000000003 0000000000000000 ffff88007c861f38 ffffffff82335e5d
        ffff88007c862080 ffffffff8223d8c0 ffff88007c862080 ffffffff81c47760
       Call Trace:
        [<ffffffff81000312>] do_one_initcall+0x122/0x170
        [<ffffffff82335e5d>] kernel_init_freeable+0x9b/0x1c8
        [<ffffffff81c47760>] ? rest_init+0x140/0x140
        [<ffffffff81c4776e>] kernel_init+0xe/0xf0
        [<ffffffff81c6be9c>] ret_from_fork+0x7c/0xb0
        [<ffffffff81c47760>] ? rest_init+0x140/0x140
        ...
      
      v2: Typo fix in x86-32.
      
      v3: CPU number dropped from show_regs_print_info() as
          dump_stack_print_info() has been updated to print it.  s390
          specific implementation dropped as requested by s390 maintainers.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Acked-by: Chris Metcalf <cmetcalf@tilera.com>		[tile bits]
      Acked-by: Richard Kuo <rkuo@codeaurora.org>		[hexagon bits]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a43cb95d
  3. 08 4月, 2013 2 次提交
  4. 13 3月, 2013 1 次提交
  5. 24 2月, 2013 1 次提交
  6. 18 2月, 2013 1 次提交
  7. 29 11月, 2012 2 次提交
  8. 13 11月, 2012 1 次提交
  9. 18 10月, 2012 1 次提交
    • F
      ARM: 7544/1: Add BUG_ON when hlt counter is wrongly used · 871df85a
      fwu 提交于
      1. On ARM platform, "nohlt" can be used to prevent core from idle
         process, returning immediately.
      2. There are two interfaces, exported for other modules, named
         "disable_hlt" and "enable_hlt" are used to enable/disable the
         cpuidle mechanism by increasing/decreasing "hlt_counter".
         Disable_hlt and enable_hlt are paired operation,
         when you first call disable_hlt and then enable_hlt, the
         semantics are right.
      3. There is no obvious constraint to prevent user(driver/module)
         code to prevent the case that enable_hlt is ahead of disable_hlt,
         which is a fatal operation on kernel state change from user,
         and there is no any WARNING or notification if the case happens
         in current kernel code.
         This patch aims to report BUG when the case happens, just like
         what the kernel do when enable_irq is ahead of disable_irq.
      
      Link: https://patchwork.kernel.org/patch/1527881/Signed-off-by: Nfwu <fwu@marvell.com>
      Signed-off-by: NYiLu Mao <ylmao@marvell.com>
      Signed-off-by: NNing Jiang <ning.jiang@marvell.com>
      Acked-by: Nicolas Pitre
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      871df85a
  10. 13 10月, 2012 1 次提交
  11. 01 10月, 2012 1 次提交
  12. 01 8月, 2012 1 次提交
  13. 31 7月, 2012 1 次提交
  14. 08 5月, 2012 1 次提交
  15. 29 3月, 2012 1 次提交
  16. 24 3月, 2012 2 次提交
    • W
      ARM: 7294/1: vectors: use gate_vma for vectors user mapping · f9d4861f
      Will Deacon 提交于
      The current user mapping for the vectors page is inserted as a `horrible
      hack vma' into each task via arch_setup_additional_pages. This causes
      problems with the MM subsystem and vm_normal_page, as described here:
      
      https://lkml.org/lkml/2012/1/14/55
      
      Following the suggestion from Hugh in the above thread, this patch uses
      the gate_vma for the vectors user mapping, therefore consolidating
      the horrible hack VMAs into one.
      Acked-and-Tested-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      f9d4861f
    • J
      coredump: remove VM_ALWAYSDUMP flag · 909af768
      Jason Baron 提交于
      The motivation for this patchset was that I was looking at a way for a
      qemu-kvm process, to exclude the guest memory from its core dump, which
      can be quite large.  There are already a number of filter flags in
      /proc/<pid>/coredump_filter, however, these allow one to specify 'types'
      of kernel memory, not specific address ranges (which is needed in this
      case).
      
      Since there are no more vma flags available, the first patch eliminates
      the need for the 'VM_ALWAYSDUMP' flag.  The flag is used internally by
      the kernel to mark vdso and vsyscall pages.  However, it is simple
      enough to check if a vma covers a vdso or vsyscall page without the need
      for this flag.
      
      The second patch then replaces the 'VM_ALWAYSDUMP' flag with a new
      'VM_NODUMP' flag, which can be set by userspace using new madvise flags:
      'MADV_DONTDUMP', and unset via 'MADV_DODUMP'.  The core dump filters
      continue to work the same as before unless 'MADV_DONTDUMP' is set on the
      region.
      
      The qemu code which implements this features is at:
      
        http://people.redhat.com/~jbaron/qemu-dump/qemu-dump.patch
      
      In my testing the qemu core dump shrunk from 383MB -> 13MB with this
      patch.
      
      I also believe that the 'MADV_DONTDUMP' flag might be useful for
      security sensitive apps, which might want to select which areas are
      dumped.
      
      This patch:
      
      The VM_ALWAYSDUMP flag is currently used by the coredump code to
      indicate that a vma is part of a vsyscall or vdso section.  However, we
      can determine if a vma is in one these sections by checking it against
      the gate_vma and checking for a non-NULL return value from
      arch_vma_name().  Thus, freeing a valuable vma bit.
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Acked-by: NRoland McGrath <roland@hack.frob.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Avi Kivity <avi@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      909af768
  17. 01 3月, 2012 1 次提交
  18. 21 1月, 2012 2 次提交
  19. 05 1月, 2012 1 次提交
  20. 13 12月, 2011 1 次提交
    • W
      ARM: reset: implement soft_restart for jumping to a physical address · 290130a1
      Will Deacon 提交于
      Tools such as kexec and CPU hotplug require a way to reset the processor
      and branch to some code in physical space. This requires various bits of
      jiggery pokery with the caches and MMU which, when it goes wrong, tends
      to lock up the system.
      
      This patch fleshes out the soft_restart implementation so that it
      branches to the reset code using the identity mapping. This requires us
      to change to a temporary stack, held within the kernel image as a static
      array, to avoid conflicting with the new view of memory.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      290130a1
  21. 12 12月, 2011 3 次提交
    • F
      nohz: Remove tick_nohz_idle_enter_norcu() / tick_nohz_idle_exit_norcu() · 1268fbc7
      Frederic Weisbecker 提交于
      Those two APIs were provided to optimize the calls of
      tick_nohz_idle_enter() and rcu_idle_enter() into a single
      irq disabled section. This way no interrupt happening in-between would
      needlessly process any RCU job.
      
      Now we are talking about an optimization for which benefits
      have yet to be measured. Let's start simple and completely decouple
      idle rcu and dyntick idle logics to simplify.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      1268fbc7
    • F
      nohz: Allow rcu extended quiescent state handling seperately from tick stop · 2bbb6817
      Frederic Weisbecker 提交于
      It is assumed that rcu won't be used once we switch to tickless
      mode and until we restart the tick. However this is not always
      true, as in x86-64 where we dereference the idle notifiers after
      the tick is stopped.
      
      To prepare for fixing this, add two new APIs:
      tick_nohz_idle_enter_norcu() and tick_nohz_idle_exit_norcu().
      
      If no use of RCU is made in the idle loop between
      tick_nohz_enter_idle() and tick_nohz_exit_idle() calls, the arch
      must instead call the new *_norcu() version such that the arch doesn't
      need to call rcu_idle_enter() and rcu_idle_exit().
      
      Otherwise the arch must call tick_nohz_enter_idle() and
      tick_nohz_exit_idle() and also call explicitly:
      
      - rcu_idle_enter() after its last use of RCU before the CPU is put
      to sleep.
      - rcu_idle_exit() before the first use of RCU after the CPU is woken
      up.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: David Miller <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      2bbb6817
    • F
      nohz: Separate out irq exit and idle loop dyntick logic · 280f0677
      Frederic Weisbecker 提交于
      The tick_nohz_stop_sched_tick() function, which tries to delay
      the next timer tick as long as possible, can be called from two
      places:
      
      - From the idle loop to start the dytick idle mode
      - From interrupt exit if we have interrupted the dyntick
      idle mode, so that we reprogram the next tick event in
      case the irq changed some internal state that requires this
      action.
      
      There are only few minor differences between both that
      are handled by that function, driven by the ts->inidle
      cpu variable and the inidle parameter. The whole guarantees
      that we only update the dyntick mode on irq exit if we actually
      interrupted the dyntick idle mode, and that we enter in RCU extended
      quiescent state from idle loop entry only.
      
      Split this function into:
      
      - tick_nohz_idle_enter(), which sets ts->inidle to 1, enters
      dynticks idle mode unconditionally if it can, and enters into RCU
      extended quiescent state.
      
      - tick_nohz_irq_exit() which only updates the dynticks idle mode
      when ts->inidle is set (ie: if tick_nohz_idle_enter() has been called).
      
      To maintain symmetry, tick_nohz_restart_sched_tick() has been renamed
      into tick_nohz_idle_exit().
      
      This simplifies the code and micro-optimize the irq exit path (no need
      for local_irq_save there). This also prepares for the split between
      dynticks and rcu extended quiescent state logics. We'll need this split to
      further fix illegal uses of RCU in extended quiescent states in the idle
      loop.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: David Miller <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      280f0677
  22. 21 11月, 2011 2 次提交
  23. 11 11月, 2011 2 次提交
  24. 01 11月, 2011 1 次提交
    • P
      arm: convert core files from module.h to export.h · ecea4ab6
      Paul Gortmaker 提交于
      Many of the core ARM kernel files are not modules, but just
      including module.h for exporting symbols.  Now these files can
      use the lighter footprint export.h for this role.
      
      There are probably lots more, but ARM files of mach-* and plat-*
      don't get coverage via a simple yesconfig build.  They will have
      to be cleaned up and tested via using their respective configs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      ecea4ab6
  25. 17 10月, 2011 1 次提交
  26. 05 8月, 2011 1 次提交
  27. 04 8月, 2011 1 次提交
    • L
      cpuidle: stop depending on pm_idle · a0bfa137
      Len Brown 提交于
      cpuidle users should call cpuidle_call_idle() directly
      rather than via (pm_idle)() function pointer.
      
      Architecture may choose to continue using (pm_idle)(),
      but cpuidle need not depend on it:
      
        my_arch_cpu_idle()
      	...
      	if(cpuidle_call_idle())
      		pm_idle();
      
      cc: Kevin Hilman <khilman@deeprootsystems.com>
      cc: Paul Mundt <lethal@linux-sh.org>
      cc: x86@kernel.org
      Acked-by: NH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      a0bfa137
  28. 11 4月, 2011 1 次提交
  29. 12 1月, 2011 1 次提交
  30. 08 10月, 2010 1 次提交
  31. 02 10月, 2010 1 次提交
    • N
      ARM: add a vma entry for the user accessible vector page · ec706dab
      Nicolas Pitre 提交于
      The kernel makes the high vector page visible to user space. This page
      contains (amongst others) small code segments that can be executed in
      user space.  Make this page visible through ptrace and /proc/<pid>/mem
      in order to let gdb perform code parsing needed for proper unwinding.
      
      For example, the ERESTART_RESTARTBLOCK handler actually has a stack
      frame -- it returns to a PC value stored on the user's stack.   To
      unwind after a "sleep" system call was interrupted twice, GDB would
      have to recognize this situation and understand that stack frame
      layout -- which it currently cannot do.
      
      We could fix this by hard-coding addresses in the vector page range into
      GDB, but that isn't really portable as not all of those addresses are
      guaranteed to remain stable across kernel releases.  And having the gdb
      process make an exception for this page and get  content from its own
      address space for it looks strange, and it is not future proof either.
      
      Being located above PAGE_OFFSET, this vma cannot be deleted by
      user space code.
      Signed-off-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      ec706dab
  32. 08 9月, 2010 1 次提交