1. 13 8月, 2014 1 次提交
  2. 28 7月, 2014 2 次提交
  3. 05 6月, 2014 1 次提交
    • M
      powerpc/xmon: Fix up xmon format strings · 736256e4
      Michael Ellerman 提交于
      There are a couple of places where xmon is using %x to print values that
      are unsigned long.
      
      I found this out the hard way recently:
      
       0:mon> p c000000000d0e7c8 c00000033dc90000 00000000a0000089 c000000000000000
       return value is 0x96300500
      
      Which is calling find_linux_pte_or_hugepte(), the result should be a
      kernel pointer. After decoding the page tables by hand I discovered the
      correct value was c000000396300500.
      
      So fix up that case and a few others.
      
      We also use a mix of 0x%x, %x and %u to print cpu numbers. So
      standardise on 0x%x.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      736256e4
  4. 20 5月, 2014 1 次提交
    • P
      powerpc: Fix smp_processor_id() in preemptible splat in set_breakpoint · 21f58507
      Paul Gortmaker 提交于
      Currently, on 8641D, which doesn't set CONFIG_HAVE_HW_BREAKPOINT
      we get the following splat:
      
      BUG: using smp_processor_id() in preemptible [00000000] code: login/1382
      caller is set_breakpoint+0x1c/0xa0
      CPU: 0 PID: 1382 Comm: login Not tainted 3.15.0-rc3-00041-g2aafe1a4 #1
      Call Trace:
      [decd5d80] [c0008dc4] show_stack+0x50/0x158 (unreliable)
      [decd5dc0] [c03c6fa0] dump_stack+0x7c/0xdc
      [decd5de0] [c01f8818] check_preemption_disabled+0xf4/0x104
      [decd5e00] [c00086b8] set_breakpoint+0x1c/0xa0
      [decd5e10] [c00d4530] flush_old_exec+0x2bc/0x588
      [decd5e40] [c011c468] load_elf_binary+0x2ac/0x1164
      [decd5ec0] [c00d35f8] search_binary_handler+0xc4/0x1f8
      [decd5ef0] [c00d4ee8] do_execve+0x3d8/0x4b8
      [decd5f40] [c001185c] ret_from_syscall+0x0/0x38
       --- Exception: c01 at 0xfeee554
          LR = 0xfeee7d4
      
      The call path in this case is:
      
      	flush_thread
      	   --> set_debug_reg_defaults
      	     --> set_breakpoint
      	       --> __get_cpu_var
      
      Since preemption is enabled in the cleanup of flush thread, and
      there is no need to disable it, introduce the distinction between
      set_breakpoint and __set_breakpoint, leaving only the flush_thread
      instance as the current user of set_breakpoint.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      21f58507
  5. 07 3月, 2014 1 次提交
  6. 11 2月, 2014 3 次提交
    • M
      powerpc/xmon: Don't signal we've entered until we're finished printing · d2b496e5
      Michael Ellerman 提交于
      Currently we set our cpu's bit in cpus_in_xmon, and then we take the
      output lock and print the exception information.
      
      This can race with the master cpu entering the command loop and printing
      the backtrace. The result is that the backtrace gets garbled with
      another cpu's exception print out.
      
      Fix it by delaying the set of cpus_in_xmon until we are finished
      printing.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d2b496e5
    • M
      powerpc/xmon: Fix timeout loop in get_output_lock() · 15075897
      Michael Ellerman 提交于
      As far as I can tell, our 70s era timeout loop in get_output_lock() is
      generating no code.
      
      This leads to the hostile takeover happening more or less simultaneously
      on all cpus. The result is "interesting", some example output that is
      more readable than most:
      
          cpu 0x1: Vector: 100 (Scypsut e0mx bR:e setV)e catto xc0p:u[ c 00
          c0:0  000t0o0V0erc0td:o5 rfc28050000]0c00 0 0  0 6t(pSrycsV1ppuot
          uxe 1m 2 0Rx21e3:0s0ce000c00000t00)00 60602oV2SerucSayt0y 0p 1sxs
      
      Fix it by using udelay() in the timeout loop. The wait time and check
      frequency are arbitrary, but seem to work OK. We already rely on
      udelay() working so this is not a new dependency.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      15075897
    • M
      powerpc/xmon: Don't loop forever in get_output_lock() · 730efb61
      Michael Ellerman 提交于
      If we enter with xmon_speaker != 0 we skip the first cmpxchg(), we also
      skip the while loop because xmon_speaker != last_speaker (0) - meaning we
      skip the second cmpxchg() also.
      
      Following that code path the compiler sees no memory barriers and so is
      within its rights to never reload xmon_speaker. The end result is we loop
      forever.
      
      This manifests as all cpus being in xmon ('c' command), but they refuse
      to take control when you switch to them ('c x' for cpu # x).
      
      I have seen this deadlock in practice and also checked the generated code to
      confirm this is what's happening.
      
      The simplest fix is just to always try the cmpxchg().
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      730efb61
  7. 05 12月, 2013 1 次提交
  8. 05 9月, 2013 1 次提交
    • P
      powerpc/xmon: Fix printing of set of CPUs in xmon · fd3bb912
      Paul Mackerras 提交于
      Commit 24ec2125f3 ("powerpc/xmon: Use cpumask iterator to avoid warning")
      replaced a loop from 0 to NR_CPUS-1 with a for_each_possible_cpu() loop,
      which means that if the last possible cpu is in xmon, we print the
      wrong value for the end of the range.  For example, if 4 cpus are
      possible, NR_CPUS is 128, and all cpus are in xmon, we print "0-7f"
      rather than "0-3".  The code also assumes that the set of possible
      cpus is contiguous, which may not necessarily be true.
      
      This fixes the code to check explicitly for contiguity, and to print
      the ending value correctly.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fd3bb912
  9. 27 8月, 2013 1 次提交
  10. 01 5月, 2013 1 次提交
  11. 30 4月, 2013 1 次提交
  12. 16 1月, 2013 1 次提交
  13. 10 1月, 2013 1 次提交
  14. 15 11月, 2012 5 次提交
  15. 18 9月, 2012 1 次提交
    • M
      powerpc: Add an xmon command to dump one or all pacas · ddadb6b8
      Michael Ellerman 提交于
      This was originally motivated by a desire to see the mapping between
      logical and hardware cpu numbers.
      
      But it seemed that it made more sense to just add a command to dump
      (most of) the paca.
      
      With no arguments "dp" will dump the paca for the current cpu.
      
      It also takes an argument, eg. "dp 3" which is the logical cpu number
      in hex. This form does not check if the cpu is possible, but displays
      the paca regardless, as well as the cpu's state in the possible, present
      and online masks.
      
      Thirdly, "dpa" will display the paca for all possible cpus. If there are
      no possible cpus, like early in boot, it will tell you that.
      
      Sample output, number in brackets is the offset into the struct:
      
      2:mon> dp 3
      paca for cpu 0x3 @ c00000000ff20a80:
       possible         = yes
       present          = yes
       online           = yes
       lock_token       = 0x8000            	(0x8)
       paca_index       = 0x3               	(0xa)
       kernel_toc       = 0xc00000000144f990	(0x10)
       kernelbase       = 0xc000000000000000	(0x18)
       kernel_msr       = 0xb000000000001032	(0x20)
       stab_real        = 0x0               	(0x28)
       stab_addr        = 0x0               	(0x30)
       emergency_sp     = 0xc00000003ffe4000	(0x38)
       data_offset      = 0xa40000          	(0x40)
       hw_cpu_id        = 0x9               	(0x50)
       cpu_start        = 0x1               	(0x52)
       kexec_state      = 0x0               	(0x53)
       __current        = 0xc00000007e568680	(0x218)
       kstack           = 0xc00000007e5a3e30	(0x220)
       stab_rr          = 0x1a              	(0x228)
       saved_r1         = 0xc00000007e7cb450	(0x230)
       trap_save        = 0x0               	(0x240)
       soft_enabled     = 0x0               	(0x242)
       irq_happened     = 0x0               	(0x243)
       io_sync          = 0x0               	(0x244)
       irq_work_pending = 0x0               	(0x245)
       nap_state_lost   = 0x0               	(0x246)
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ddadb6b8
  16. 10 9月, 2012 1 次提交
  17. 24 8月, 2012 2 次提交
  18. 02 7月, 2012 1 次提交
    • A
      powerpc/xmon: Use cpumask iterator to avoid warning · bc1d7702
      Anton Blanchard 提交于
      We have a bug report where the kernel hits a warning in the cpumask
      code:
      
      WARNING: at include/linux/cpumask.h:107
      
      Which is:
              WARN_ON_ONCE(cpu >= nr_cpumask_bits);
      
      The backtrace is:
              cpu_cmd
              cmds
              xmon_core
              xmon
              die
      
      xmon is iterating through 0 to NR_CPUS. I'm not sure why we are still
      open coding this but iterating above nr_cpu_ids is definitely a bug.
      
      This patch iterates through all possible cpus, in case we issue a
      system reset and CPUs in an offline state call in.
      
      Perhaps the old code was trying to handle CPUs that were in the
      partition but were never started (eg kexec into a kernel with an
      nr_cpus= boot option). They are going to die way before we get into
      xmon since we haven't set any kernel state up for them.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      CC: <stable@kernel.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bc1d7702
  19. 29 3月, 2012 1 次提交
  20. 21 3月, 2012 1 次提交
  21. 09 3月, 2012 2 次提交
    • B
      powerpc: Rework lazy-interrupt handling · 7230c564
      Benjamin Herrenschmidt 提交于
      The current implementation of lazy interrupts handling has some
      issues that this tries to address.
      
      We don't do the various workarounds we need to do when re-enabling
      interrupts in some cases such as when returning from an interrupt
      and thus we may still lose or get delayed decrementer or doorbell
      interrupts.
      
      The current scheme also makes it much harder to handle the external
      "edge" interrupts provided by some BookE processors when using the
      EPR facility (External Proxy) and the Freescale Hypervisor.
      
      Additionally, we tend to keep interrupts hard disabled in a number
      of cases, such as decrementer interrupts, external interrupts, or
      when a masked decrementer interrupt is pending. This is sub-optimal.
      
      This is an attempt at fixing it all in one go by reworking the way
      we do the lazy interrupt disabling from the ground up.
      
      The base idea is to replace the "hard_enabled" field with a
      "irq_happened" field in which we store a bit mask of what interrupt
      occurred while soft-disabled.
      
      When re-enabling, either via arch_local_irq_restore() or when returning
      from an interrupt, we can now decide what to do by testing bits in that
      field.
      
      We then implement replaying of the missed interrupts either by
      re-using the existing exception frame (in exception exit case) or via
      the creation of a new one from an assembly trampoline (in the
      arch_local_irq_enable case).
      
      This removes the need to play with the decrementer to try to create
      fake interrupts, among others.
      
      In addition, this adds a few refinements:
      
       - We no longer  hard disable decrementer interrupts that occur
      while soft-disabled. We now simply bump the decrementer back to max
      (on BookS) or leave it stopped (on BookE) and continue with hard interrupts
      enabled, which means that we'll potentially get better sample quality from
      performance monitor interrupts.
      
       - Timer, decrementer and doorbell interrupts now hard-enable
      shortly after removing the source of the interrupt, which means
      they no longer run entirely hard disabled. Again, this will improve
      perf sample quality.
      
       - On Book3E 64-bit, we now make the performance monitor interrupt
      act as an NMI like Book3S (the necessary C code for that to work
      appear to already be present in the FSL perf code, notably calling
      nmi_enter instead of irq_enter). (This also fixes a bug where BookE
      perfmon interrupts could clobber r14 ... oops)
      
       - We could make "masked" decrementer interrupts act as NMIs when doing
      timer-based perf sampling to improve the sample quality.
      
      Signed-off-by-yet: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      ---
      
      v2:
      
      - Add hard-enable to decrementer, timer and doorbells
      - Fix CR clobber in masked irq handling on BookE
      - Make embedded perf interrupt act as an NMI
      - Add a PACA_HAPPENED_EE_EDGE for use by FSL if they want
        to retrigger an interrupt without preventing hard-enable
      
      v3:
      
       - Fix or vs. ori bug on Book3E
       - Fix enabling of interrupts for some exceptions on Book3E
      
      v4:
      
       - Fix resend of doorbells on return from interrupt on Book3E
      
      v5:
      
       - Rebased on top of my latest series, which involves some significant
      rework of some aspects of the patch.
      
      v6:
       - 32-bit compile fix
       - more compile fixes with various .config combos
       - factor out the asm code to soft-disable interrupts
       - remove the C wrapper around preempt_schedule_irq
      
      v7:
       - Fix a bug with hard irq state tracking on native power7
      7230c564
    • B
      powerpc/xmon: Add display of soft & hard irq states · 7ac21cd4
      Benjamin Herrenschmidt 提交于
      Also use local_paca instead of get_paca() to avoid getting into
      the smp_processor_id() debugging code from the debugger
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7ac21cd4
  22. 25 11月, 2011 2 次提交
  23. 01 11月, 2011 1 次提交
  24. 29 9月, 2011 1 次提交
    • J
      powerpc: Fix xmon for systems without MSR[RI] · 66857b3a
      Jimi Xenidis 提交于
      Based on patch by David Gibson <dwg@au1.ibm.com>
      
      xmon has a longstanding bug on systems which are SMP-capable but lack
      the MSR[RI] bit.  In these cases, xmon invoked by IPI on secondary
      CPUs will not properly keep quiet, but will print stuff, thereby
      garbling the primary xmon's output.  This patch fixes it, by ignoring
      the RI bit if the processor does not support it.
      
      There's already a version of this for 4xx upstream, which we'll need
      to extend to other RI-lacking CPUs at some point.  For now this adds
      Book3e processors to the mix.
      Signed-off-by: NJimi Xenidis <jimix@pobox.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      66857b3a
  25. 19 5月, 2011 1 次提交
    • M
      powerpc: Remove call sites of MSG_ALL_BUT_SELF · e0476371
      Milton Miller 提交于
      The only user of MSG_ALL_BUT_SELF in the whole kernel tree is powerpc,
      and it only uses it to start the debugger. Both debuggers always call
      smp_send_debugger_break with MSG_ALL_BUT_SELF, and only mpic can do
      anything more optimal than a loop over all online cpus, but all message
      passing implementations have to code for this special delivery target.
      
      Convert smp_send_debugger_break to take void and loop calling the smp_ops
      message_pass function for each of the other cpus in the online cpumask.
      
      Use raw_smp_processor_id() because we are either entering the debugger
      or trying to start kdump and the additional warning it not useful were
      it to trigger.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e0476371
  26. 04 5月, 2011 2 次提交
  27. 27 4月, 2011 2 次提交
  28. 25 3月, 2011 1 次提交