1. 31 8月, 2017 2 次提交
  2. 14 8月, 2017 2 次提交
  3. 03 7月, 2017 1 次提交
  4. 30 5月, 2017 1 次提交
  5. 01 5月, 2017 1 次提交
  6. 28 4月, 2017 3 次提交
    • N
      powerpc/xmon: Wait for secondaries before IPI'ing on system reset · 1cd6ed7c
      Nicholas Piggin 提交于
      An externally triggered system reset (e.g., via QEMU nmi command, or pseries
      reset button) can cause system reset interrupts on all CPUs. In case this causes
      xmon to be entered, it is undesirable for the primary (first) CPU into xmon to
      trigger an NMI IPI to others, because this may cause a nested system reset
      interrupt.
      
      So spin for a time waiting for secondaries to join xmon before performing the
      NMI IPI, similarly to what the crash dump code does.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      [mpe: Only do it when we come in from system reset, not via sysrq etc.]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1cd6ed7c
    • N
      powerpc/64s: Dedicated system reset interrupt stack · b1ee8a3d
      Nicholas Piggin 提交于
      The system reset interrupt is used for crash/debug situations, so it is
      desirable to have as little impact on the normal state of the system as
      possible.
      
      Currently it uses the current kernel stack to process the exception.
      This stores into the stack which may be involved with the crash. The
      stack pointer may be corrupted, or it may have overflowed.
      
      Avoid or minimise these problems by creating a dedicated NMI stack for
      the system reset interrupt to use.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b1ee8a3d
    • N
      powerpc/64s: Disallow system reset vs system reset reentrancy · c4f3b52c
      Nicholas Piggin 提交于
      In preparation for using a dedicated stack for system reset interrupts,
      prevent a nested system reset from recovering, in order to simplify
      code that is called in crash/debug path. This allows a system reset
      interrupt to just use the base stack pointer.
      
      Keep an in_nmi nesting counter similarly to the in_mce counter. Consider
      the interrrupt non-recoverable if it is taken inside another system
      reset.
      
      Interrupt nesting could be allowed similarly to MCE, but system reset
      is a special case that's not for normal operation, so simplicity wins
      until there is requirement for nested system reset interrupts.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c4f3b52c
  7. 24 4月, 2017 1 次提交
  8. 11 4月, 2017 1 次提交
  9. 10 4月, 2017 1 次提交
    • B
      powerpc/xive: Native exploitation of the XIVE interrupt controller · 243e2511
      Benjamin Herrenschmidt 提交于
      The XIVE interrupt controller is the new interrupt controller
      found in POWER9. It supports advanced virtualization capabilities
      among other things.
      
      Currently we use a set of firmware calls that simulate the old
      "XICS" interrupt controller but this is fairly inefficient.
      
      This adds the framework for using XIVE along with a native
      backend which OPAL for configuration. Later, a backend allowing
      the use in a KVM or PowerVM guest will also be provided.
      
      This disables some fast path for interrupts in KVM when XIVE is
      enabled as these rely on the firmware emulation code which is no
      longer available when the XIVE is used natively by Linux.
      
      A latter patch will make KVM also directly exploit the XIVE, thus
      recovering the lost performance (and more).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [mpe: Fixup pr_xxx("XIVE:"...), don't split pr_xxx() strings,
       tweak Kconfig so XIVE_NATIVE selects XIVE and depends on POWERNV,
       fix build errors when SMP=n, fold in fixes from Ben:
         Don't call cpu_online() on an invalid CPU number
         Fix irq target selection returning out of bounds cpu#
         Extra sanity checks on cpu numbers
       ]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      243e2511
  10. 28 3月, 2017 3 次提交
    • G
      powerpc/xmon: add debugfs entry for xmon · de78ae6c
      Guilherme G. Piccoli 提交于
      Currently the xmon debugger is set only via kernel boot command-line.
      It's disabled by default, and can be enabled with "xmon=on" on the
      command-line. Also, xmon may be accessed via sysrq mechanism.
      But we cannot enable/disable xmon in runtime, it needs kernel reload.
      
      This patch introduces a debugfs entry for xmon, allowing user to query
      its current state and change it if desired. Basically, the "xmon" file
      to read from/write to is under the debugfs mount point, on powerpc
      directory. It's a simple attribute, value 0 meaning xmon is disabled
      and value 1 the opposite. Writing these states to the file will take
      immediate effect in the debugger.
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      de78ae6c
    • G
      powerpc/xmon: drop the nobt option from xmon plus minor fixes · b561783c
      Guilherme G. Piccoli 提交于
      The xmon parameter nobt was added long time ago, by commit 26c8af5f
      ("[POWERPC] print backtrace when entering xmon"). The problem that time
      was that during a crash in a machine with USB keyboard, xmon wouldn't
      respond to commands from the keyboard, so printing the backtrace wouldn't
      be possible.
      
      Idea then was to show automatically the backtrace on xmon crash for the
      first time it's invoked (if it recovers, next time xmon won't show
      backtrace automatically). The nobt parameter was added _only_ to prevent
      this automatic trace show. Seems long time ago USB keyboards didn't work
      that well!
      
      We don't need this parameter anymore, the feature of auto showing the
      backtrace is interesting (imagine a case of auto-reboot script),
      so this patch extends the functionality, by always showing the backtrace
      automatically when xmon is invoked; it removes the nobt parameter too.
      
      Also, this patch fixes __initdata placement on xmon_early and replaces
      __initcall() with modern device_initcall() on sysrq handler.
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b561783c
    • P
      powerpc/xmon: Fix an unexpected xmon on/off state change · 3b5bf42b
      Pan Xinhui 提交于
      Once xmon is triggered by sysrq-x, it is enabled always afterwards even
      if it is disabled during boot. This will cause a system reset interrupt
      fail to dump. So keep xmon in its original state after exit.
      
      We have several ways to set xmon on or off.
      1) by a build config CONFIG_XMON_DEFAULT.
      2) by a boot cmdline with xmon or xmon=early or xmon=on to enable xmon
      and xmon=off to disable xmon. This value will override that in step 1.
      3) by a debugfs interface, as proposed in this patchset.
      And this value can override those in step 1 and 2.
      Signed-off-by: NPan Xinhui <xinhui.pan@linux.vnet.ibm.com>
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      3b5bf42b
  11. 02 3月, 2017 1 次提交
  12. 23 2月, 2017 1 次提交
  13. 21 2月, 2017 1 次提交
  14. 02 2月, 2017 1 次提交
  15. 14 1月, 2017 2 次提交
  16. 25 11月, 2016 1 次提交
    • M
      powerpc/xmon: Add 'dt' command to dump trace buffers · 56144ec7
      Michael Ellerman 提交于
      There is a nice interface for asking ftrace to dump all its tracing
      buffers. The only down side for use in xmon is that it uses printk.
      Depending on circumstances printk may not work when in xmon, but it also
      may, so add a 'dt' command which dumps the ftrace buffers, and add a
      note to the help to mentiont that it uses printk.
      
      Calling this routine also disables tracing, which is problematic if you
      return from xmon and expect the system to keep operating normally. So
      after we do the dump turn tracing back on.
      
      Both functions already have nop versions defined for when ftrace is not
      enabled, so we don't need any extra #ifdefs.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      56144ec7
  17. 14 7月, 2016 5 次提交
  18. 09 7月, 2016 1 次提交
  19. 11 5月, 2016 2 次提交
    • P
      powerpc/xmon: Fix SPR read/write commands and add command to dump SPRs · 31cdd0c3
      Paul Mackerras 提交于
      xmon has commands for reading and writing SPRs, but they don't work
      currently for several reasons. They attempt to synthesize a small
      function containing an mfspr or mtspr instruction and call it. However,
      the instructions are on the stack, which is usually not executable.
      Also, for 64-bit we set up a procedure descriptor, which is fine for the
      big-endian ABIv1, but not correct for ABIv2. Finally, the code uses the
      infrastructure for catching memory errors, but that only catches data
      storage interrupts and machine check interrupts, but a failed
      mfspr/mtspr can generate a program interrupt or a hypervisor emulation
      assist interrupt, or be a no-op.
      
      Instead of trying to synthesize a function on the fly, this adds two new
      functions, xmon_mfspr() and xmon_mtspr(), which take an SPR number as an
      argument and read or write the SPR. Because there is no Power ISA
      instruction which takes an SPR number in a register, we have to generate
      one of each possible mfspr and mtspr instruction, for all 1024 possible
      SPRs. Thus we get just over 8k bytes of code for each of xmon_mfspr()
      and xmon_mtspr(). However, this 16kB of code pales in comparison to the
      > 130kB of PPC opcode tables used by the xmon disassembler.
      
      To catch interrupts caused by the mfspr/mtspr instructions, we add a new
      'catch_spr_faults' flag. If an interrupt occurs while it is set, we come
      back into xmon() via program_check_interrupt(), _exception() and die(),
      see that catch_spr_faults is set and do a longjmp to bus_error_jmp, back
      into read_spr() or write_spr().
      
      This adds a couple of other nice features: first, a "Sa" command that
      attempts to read and print out the value of all 1024 SPRs. If any mfspr
      instruction acts as a no-op, then the SPR is not implemented and not
      printed.
      
      Secondly, the Sr and Sw commands detect when an SPR is not
      implemented (i.e. mfspr is a no-op) and print a message to that effect
      rather than printing a bogus value.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      31cdd0c3
    • A
      powerpc/mm/radix: Use STD_MMU_64 to properly isolate hash related code · caca285e
      Aneesh Kumar K.V 提交于
      We also use MMU_FTR_RADIX to branch out from code path specific to
      hash.
      
      No functionality change.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      caca285e
  20. 10 2月, 2016 1 次提交
  21. 09 2月, 2016 1 次提交
  22. 08 2月, 2016 1 次提交
  23. 17 12月, 2015 1 次提交
  24. 14 12月, 2015 1 次提交
    • R
      powerpc/xmon: Append linux_banner to exception information in xmon. · eb925d64
      Rashmica Gupta 提交于
      Currently if you are in xmon without an oops etc. to view the kernel
      version you have to type "d $linux_banner" - not necessarily obvious. As
      this is useful information, append to the output of "e" command.
      
      Example output:
        $mon> e
        cpu 0x1: Vector: 0  at [c0000000f879ba80]
            pc: c000000000081718: sysrq_handle_xmon+0x68/0x80
            lr: c000000000081718: sysrq_handle_xmon+0x68/0x80
            sp: c0000000f879bbe0
           msr: 8000000000009033
          current = 0xc0000000f604d5c0
          paca    = 0xc00000000fdc0480	 softe: 0	 irq_happened: 0x01
            pid   = 2467, comm = bash
        Linux version 4.4.0-rc2-00008-gc51af91c3ab3-dirty (rashmica@circle) (gcc
        version 5.1.1 20150629 (GCC) ) #45 SMP Wed Nov 25 10:25:12 AEDT 2015
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      eb925d64
  25. 15 10月, 2015 3 次提交
    • M
      powerpc/xmon: Add some more elements to the existing PACA dump list · ad987fc8
      Michael Ellerman 提交于
      This patch adds a set of new elements to the existing PACA dump list
      inside an xmon session which can be listed below improving the overall
      xmon debug support.
      
      With this patch, a typical xmon PACA dump looks something like this.
      
      paca for cpu 0x0 @ c00000000fdc0000:
       possible             = yes
       present              = yes
       online               = yes
       lock_token           = 0x8000            	(0xa)
       paca_index           = 0x0               	(0x8)
       kernel_toc           = 0xc000000001393200	(0x10)
       kernelbase           = 0xc000000000000000	(0x18)
       kernel_msr           = 0xb000000000001033	(0x20)
       emergency_sp         = 0xc00000003fff0000	(0x28)
       mc_emergency_sp      = 0xc00000003ffec000	(0x2e0)
       in_mce               = 0x0               	(0x2e8)
       hmi_event_available  = 0x0               	(0x2ea)
       data_offset          = 0x1fe7b0000       	(0x30)
       hw_cpu_id            = 0x0               	(0x38)
       cpu_start            = 0x1               	(0x3a)
       kexec_state          = 0x0               	(0x3b)
       slb_shadow[0]:       = 0xc000000008000000 0x40016e7779000510
       slb_shadow[1]:       = 0xd000000008000001 0x400142add1000510
       vmalloc_sllp         = 0x510             	(0x1b8)
       slb_cache_ptr        = 0x4               	(0x1ba)
       slb_cache[0]:        = 0x000000000003f000
       slb_cache[1]:        = 0x0000000000000001
       slb_cache[2]:        = 0x0000000000000003
       slb_cache[3]:        = 0x0000000000001000
       slb_cache[4]:        = 0x0000000000001000
       slb_cache[5]:        = 0x0000000000000000
       slb_cache[6]:        = 0x0000000000000000
       slb_cache[7]:        = 0x0000000000000000
       dscr_default         = 0x0               	(0x58)
       __current            = 0xc000000001331e80	(0x290)
       kstack               = 0xc000000001393e30	(0x298)
       stab_rr              = 0x11              	(0x2a0)
       saved_r1             = 0xc0000001fffef5e0	(0x2a8)
       trap_save            = 0x0               	(0x2b8)
       soft_enabled         = 0x0               	(0x2ba)
       irq_happened         = 0x1               	(0x2bb)
       io_sync              = 0x0               	(0x2bc)
       irq_work_pending     = 0x0               	(0x2bd)
       nap_state_lost       = 0x0               	(0x2be)
       sprg_vdso            = 0x0               	(0x2c0)
       tm_scratch           = 0x8000000100009033	(0x2c8)
       core_idle_state_ptr  = (null)            	(0x2d0)
       thread_idle_state    = 0x0               	(0x2d8)
       thread_mask          = 0x0               	(0x2d9)
       subcore_sibling_mask = 0x0               	(0x2da)
       user_time            = 0x0               	(0x2f0)
       system_time          = 0x0               	(0x2f8)
       user_time_scaled     = 0x0               	(0x300)
       starttime            = 0x3f462418b5cf4   	(0x308)
       starttime_user       = 0x3f4622a57092a   	(0x310)
       startspurr           = 0xd62a5718        	(0x318)
       utime_sspurr         = 0x0               	(0x320)
       stolen_time          = 0x0               	(0x328)
      Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
      [mpe: Endian swap slb_shadow before display, minor formatting]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ad987fc8
    • S
      powerpc/xmon: Paginate kernel log buffer display · 0c23a88c
      Sam bobroff 提交于
      The kernel log buffer is often much longer than the size of a terminal
      so paginate it's output.
      Signed-off-by: NSam Bobroff <sam.bobroff@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      0c23a88c
    • S
      powerpc/xmon: Paged output for paca display · 958b7c80
      Sam bobroff 提交于
      The paca display is already more than 24 lines, which can be problematic
      if you have an old school 80x24 terminal, or more likely you are on a
      virtual terminal which does not scroll for whatever reason.
      
      This patch adds a new command "#", which takes a single (hex) numeric
      argument: lines per page. It will cause the output of "dp" and "dpa"
      to be broken into pages, if necessary.
      
      Sample output:
      
      0:mon> # 10
      0:mon> dp1
      paca for cpu 0x1 @ c00000000fdc0480:
       possible         = yes
       present          = yes
       online           = yes
       lock_token       = 0x8000            	(0x8)
       paca_index       = 0x1               	(0xa)
       kernel_toc       = 0xc000000000eb2400	(0x10)
       kernelbase       = 0xc000000000000000	(0x18)
       kernel_msr       = 0xb000000000001032	(0x20)
       emergency_sp     = 0xc00000003ffe8000	(0x28)
       mc_emergency_sp  = 0xc00000003ffe4000	(0x2e0)
       in_mce           = 0x0               	(0x2e8)
       data_offset      = 0x7f170000        	(0x30)
       hw_cpu_id        = 0x8               	(0x38)
       cpu_start        = 0x1               	(0x3a)
       kexec_state      = 0x0               	(0x3b)
      [Hit a key (a:all, q:truncate, any:next page)]
      0:mon>
       __current        = 0xc00000007e696620	(0x290)
       kstack           = 0xc00000007e6ebe30	(0x298)
       stab_rr          = 0xb               	(0x2a0)
       saved_r1         = 0xc00000007ef37860	(0x2a8)
       trap_save        = 0x0               	(0x2b8)
       soft_enabled     = 0x0               	(0x2ba)
       irq_happened     = 0x1               	(0x2bb)
       io_sync          = 0x0               	(0x2bc)
       irq_work_pending = 0x0               	(0x2bd)
       nap_state_lost   = 0x0               	(0x2be)
      0:mon>
      Signed-off-by: NSam Bobroff <sam.bobroff@au1.ibm.com>
      [mpe: Use bool, make some variables static]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      958b7c80
  26. 12 8月, 2015 1 次提交