1. 29 10月, 2013 1 次提交
  2. 15 7月, 2013 1 次提交
    • P
      arm: delete __cpuinit/__CPUINIT usage from all ARM users · 8bd26e3a
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      Note that some harmless section mismatch warnings may result, since
      notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
      and are flagged as __cpuinit  -- so if we remove the __cpuinit from
      the arch specific callers, we will also get section mismatch warnings.
      As an intermediate step, we intend to turn the linux/init.h cpuinit
      related content into no-ops as early as possible, since that will get
      rid of these warnings.  In any case, they are temporary and harmless.
      
      This removes all the ARM uses of the __cpuinit macros from C code,
      and all __CPUINIT from assembly code.  It also had two ".previous"
      section statements that were paired off against __CPUINIT
      (aka .section ".cpuinit.text") that also get removed here.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      8bd26e3a
  3. 17 4月, 2013 1 次提交
  4. 23 3月, 2013 1 次提交
  5. 04 3月, 2013 1 次提交
  6. 11 1月, 2013 3 次提交
    • D
      ARM: hw_breakpoint: Debug powerdown support for self-hosted debug · 9a6eb310
      Dietmar Eggemann 提交于
      This patch introduces debug powerdown support for self-hosted debug for v7
      and v7.1 debug architecture for a SinglePower system, i.e. a system without a
      separate core and debug power domain. On a SinglePower system the OS Lock is
      lost over a powerdown.
      
      If CONFIG_CPU_PM is set the new function pm_init() registers hw_breakpoint
      with CPU PM for a system supporting OS Save and Restore.
      
      Receiving a CPU PM EXIT notifier indicates that a single CPU has exited a low
      power state. A call to reset_ctrl_regs() is hooked into the CPU PM EXIT
      notifier chain. This function makes sure that the sticky power-down is clear
      (only v7 debug), the OS Double Lock is clear (only v7.1 debug) and it clears
      the OS Lock for v7 debug (for a system supporting OS Save and Restore) and
      v7.1 debug. Furthermore, it clears any vector-catch events and all
      breakpoint/watchpoint control/value registers for v7 and v7.1 debug.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      [will: removed redundant has_ossr check]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9a6eb310
    • D
      ARM: hw_breakpoint: Check function for OS Save and Restore mechanism · 57ba8997
      Dietmar Eggemann 提交于
      v7 debug introduced OS Save and Restore mechanism. On a v7 debug SinglePower
      system, i.e a system without a separate core and debug power domain, which does
      not support external debug over powerdown, it is implementation defined whether
      OS Save and Restore is implemented.
      v7.1 debug requires OS Save and Restore mechanism. v6 debug and v6.1 debug do
      not implement it.
      
      A new global variable bool has_ossr is introduced and is determined in
      arch_hw_breakpoint_init() like debug_arch or the number of BRPs/WRPs.
      
      The logic how to check if OS Save and Restore is supported has changed with
      this patch. In reset_ctrl_regs() a mask consisting of OSLM[1] (OSLSR.3) and
      OSLM[0] (OSLSR.0) was used to check if the system supports OS Save and
      Restore. In the new function core_has_os_save_restore() only OSLM[0] is used.
      It is not necessary to check OSLM[1] too since it is v7.1 debug specific and
      v7.1 debug requires OS Save and Restore and thus OS Lock.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      57ba8997
    • D
      ARM: coresight: common definition for (OS) Lock Access Register key value · 02051ead
      Dietmar Eggemann 提交于
      Coresight components and debug are using a common lock control mechansim.
      Writing 0xC5ACCE55 to the Lock Access Register (LAR) in case of a coresight
      components enables further access to the coresight device registers. Writing
      any other value to it removes the write access.
      Writing 0xC5ACCE55 to the OS Lock Access Register (OSLAR) in case of debug
      locks the debug register for further access to the debug registers. Writing
      any other value to it unlocks the debug registers.
      
      Unfortunately, the existing coresight code uses the terms lock and unlock the
      other way around. Unlocking stands for enabling write access and locking for
      removing write access.
      
      That is why the definition of the LAR and OSLAR key value has been changed to
      CS_LAR_KEY.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      02051ead
  7. 09 11月, 2012 8 次提交
  8. 25 8月, 2012 2 次提交
  9. 29 3月, 2012 1 次提交
  10. 08 12月, 2011 1 次提交
  11. 08 10月, 2011 1 次提交
  12. 31 8月, 2011 5 次提交
  13. 02 7月, 2011 1 次提交
  14. 11 4月, 2011 1 次提交
  15. 10 3月, 2011 1 次提交
  16. 26 2月, 2011 1 次提交
  17. 12 2月, 2011 2 次提交
  18. 15 12月, 2010 1 次提交
  19. 06 12月, 2010 7 次提交
    • W
      ARM: hw_breakpoint: fix warnings generated by sparse · 4a55c18e
      Will Deacon 提交于
      sparse doesn't like per-cpu accesses such as:
      
      static DEFINE_PER_CPU(struct perf_event *, foo[MAXLEN]);
      struct perf_event **bar = __get_cpu_var(foo);
      
      and shouts quite loudly about it:
      
      | warning: incorrect type in assignment (different modifiers)
      |    expected struct perf_event **slots
      |    got struct perf_event *[noderef] *<noident>
      
      This patch adds casts to these sorts of assignments in hw_breakpoint.c
      in order to silence the warnings.
      Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      4a55c18e
    • W
      ARM: hw_breakpoint: disallow per-cpu breakpoints without overflow handler · 3ce70b2e
      Will Deacon 提交于
      Single-stepping a breakpoint requires us to disable it temporarily so that
      we don't get stuck in a recursive debug trap. With per-cpu breakpoints this
      presents a problem where an interrupt can be taken before the single-step has
      completed and a new task is eventually scheduled. This new task will not
      hit the breakpoint because it will have been disabled during the previous
      handling code.
      
      This patch disallows per-cpu breakpoints on ARM when an overflow handler
      is not present. A similar effect can be created by placing breakpoints on
      a shell and then running applications there.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      3ce70b2e
    • W
      ARM: hw_breakpoint: unify single-stepping code for watchpoints and breakpoints · 9ebb3cbc
      Will Deacon 提交于
      The single-stepping code is currently different depending on whether
      we are stepping over a breakpoint or a watchpoint. There is no good
      reason for this, so let's sort it out.
      
      This patch adds functions for enabling/disabling single-step for
      a particular hw_breakpoint and integrates this with the exception
      handling code.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9ebb3cbc
    • W
      ARM: hw_breakpoint: do not allocate new breakpoints with preemption disabled · 93a04a34
      Will Deacon 提交于
      The watchpoint single-stepping code calls register_user_hw_breakpoint to
      register a mismatch breakpoint for stepping over the watchpoint. This is
      performed with preemption disabled, which is unsafe as we may end up scheduling
      whilst in_atomic(). Furthermore, using the perf API is rather overkill since
      we are already in the hw-breakpoint backend and only require access to reserved
      breakpoints anyway.
      
      This patch reworks the watchpoint stepping code so that we don't require
      another perf_event for the mismatch breakpoint. Instead, we hold a separate
      arch_hw_breakpoint_ctrl struct inside the watchpoint which is used exclusively
      for stepping. We can check whether or not stepping is enabled when installing
      or uninstalling the watchpoint and operate on the breakpoint accordingly.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      93a04a34
    • W
      ARM: hw_breakpoint: don't advertise reserved breakpoints · 0017ff42
      Will Deacon 提交于
      To permit handling of watchpoint exceptions without signalling a
      debugger, it is necessary to reserve breakpoint registers for in-kernel
      use only.
      
      This patch ensures that we record and subtract the number of reserved
      breakpoints from the number of usable breakpoint registers that we
      advertise to userspace via the ptrace API.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0017ff42
    • W
      ARM: hw_breakpoint: disable preemption during debug exception handling · 7e202696
      Will Deacon 提交于
      On ARM, debug exceptions occur in the form of data or prefetch aborts.
      One difference is that debug exceptions require access to per-cpu banked
      registers and data structures which are not saved in the low-level exception
      code. For kernels built with CONFIG_PREEMPT, there is an unlikely scenario
      that the debug handler ends up running on a different CPU from the one
      that originally signalled the event, resulting in random data being read
      from the wrong registers.
      
      This patch adds a debug_entry macro to the low-level exception handling
      code which checks whether the taken exception is a debug exception. If
      it is, the preempt count for the faulting process is incremented. After
      the debug handler has finished, the count is decremented.
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      7e202696
    • W
      ARM: hw_breakpoint: correct and simplify alignment fixup code · 6ee33c27
      Will Deacon 提交于
      The current hw_breakpoint code tries to fix up the alignment of
      breakpoints so that we can make use of sparse byte-address-select
      bits in the control register and give the illusion that we can
      set breakpoints on unaligned addresses.
      
      Although this works on v6 cores, v7 forbids this behaviour, instead
      requiring breakpoints to be set on aligned addresses and have contiguous
      byte-address-select ranges depending on the instruction set in use.
      For ARM the only supported size is 4 bytes, whilst Thumb-2 also permits
      2 byte breakpoints (watchpoints can be of 1, 2, 4 or 8 bytes long).
      
      This patch simplifies the alignment fixup code so that we require
      addresses to be aligned to the size of the corresponding breakpoint.
      This allows us to handle the common case of breaking on a half-word
      aligned Thumb-2 instruction and also allows us to set byte watchpoints
      on arbitrary addresses.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6ee33c27