1. 15 10月, 2014 3 次提交
    • A
      powerpc/pseries: Use dump_stack instead of show_stack · 4ff52b4d
      Anton Blanchard 提交于
      We can use the simpler dump_stack() instead of
      show_stack(current, __get_SP())
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4ff52b4d
    • A
      powerpc: Rename __get_SP() to current_stack_pointer() · acf620ec
      Anton Blanchard 提交于
      Michael points out that __get_SP() is a pretty horrible
      function name. Let's give it a better name.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      acf620ec
    • A
      powerpc: Reimplement __get_SP() as a function not a define · bfe9a2cf
      Anton Blanchard 提交于
      Li Zhong points out an issue with our current __get_SP()
      implementation. If ftrace function tracing is enabled (ie -pg
      profiling using _mcount) we spill a stack frame on 64bit all the
      time.
      
      If a function calls __get_SP() and later calls a function that is
      tail call optimised, we will pop the stack frame and the value
      returned by __get_SP() is no longer valid. An example from Li can
      be found in save_stack_trace -> save_context_stack:
      
      c0000000000432c0 <.save_stack_trace>:
      c0000000000432c0:       mflr    r0
      c0000000000432c4:       std     r0,16(r1)
      c0000000000432c8:       stdu    r1,-128(r1) <-- stack frame for _mcount
      c0000000000432cc:       std     r3,112(r1)
      c0000000000432d0:       bl      <._mcount>
      c0000000000432d4:       nop
      
      c0000000000432d8:       mr      r4,r1 <-- __get_SP()
      
      c0000000000432dc:       ld      r5,632(r13)
      c0000000000432e0:       ld      r3,112(r1)
      c0000000000432e4:       li      r6,1
      
      c0000000000432e8:       addi    r1,r1,128 <-- pop stack frame
      
      c0000000000432ec:       ld      r0,16(r1)
      c0000000000432f0:       mtlr    r0
      c0000000000432f4:       b       <.save_context_stack> <-- tail call optimized
      
      save_context_stack ends up with a stack pointer below the current
      one, and it is likely to be scribbled over.
      
      Fix this by making __get_SP() a function which returns the
      callers stack frame. Also replace inline assembly which grabs
      the stack pointer in save_stack_trace and show_stack with
      __get_SP().
      
      This also fixes an issue with perf_arch_fetch_caller_regs().
      It currently unwinds the stack once, which will skip a
      valid stack frame on a leaf function. With the __get_SP() fixes
      in this patch, we never need to unwind the stack frame to get
      to the first interesting frame.
      
      We have to export __get_SP() because perf_arch_fetch_caller_regs()
      (which is used in modules) calls it from a header file.
      Reported-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bfe9a2cf
  2. 13 10月, 2014 3 次提交
  3. 10 10月, 2014 2 次提交
    • M
      powerpc/book3s: Don't clear MSR_RI in hmi handler. · c675c7db
      Mahesh Salgaonkar 提交于
      In HMI interrupt handler we don't touch SRR0/SRR1, instead we touch
      HSRR0/HSRR1. Hence we don't need to clear MSR_RI bit.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c675c7db
    • R
      powerpc: Fix sys_call_table declaration to enable syscall tracing · 1028ccf5
      Romeo Cane 提交于
      Declaring sys_call_table as a pointer causes the compiler to generate
      the wrong lookup code in arch_syscall_addr().
      
           <arch_syscall_addr>:
              lis     r9,-16384
              rlwinm  r3,r3,2,0,29
        -     lwz     r11,30640(r9)
        -     lwzx    r3,r11,r3
        +     addi    r9,r9,30640
        +     lwzx    r3,r9,r3
              blr
      
      The actual sys_call_table symbol, declared in assembler, is an
      array. If we lie about that to the compiler we get the wrong code
      generated, as above.
      
      This definition seems only to be used by the syscall tracing code in
      kernel/trace/trace_syscalls.c. With this patch I can successfully use
      the syscall tracepoints:
      
        bash-3815  [002] ....   333.239082: sys_write -> 0x2
        bash-3815  [002] ....   333.239087: sys_dup2(oldfd: a, newfd: 1)
        bash-3815  [002] ....   333.239088: sys_dup2 -> 0x1
        bash-3815  [002] ....   333.239092: sys_fcntl(fd: a, cmd: 1, arg: 0)
        bash-3815  [002] ....   333.239093: sys_fcntl -> 0x1
        bash-3815  [002] ....   333.239094: sys_close(fd: a)
        bash-3815  [002] ....   333.239094: sys_close -> 0x0
      Signed-off-by: NRomeo Cane <romeo.cane.ext@coriant.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1028ccf5
  4. 08 10月, 2014 10 次提交
  5. 07 10月, 2014 4 次提交
  6. 03 10月, 2014 5 次提交
  7. 02 10月, 2014 8 次提交
  8. 01 10月, 2014 1 次提交
  9. 30 9月, 2014 4 次提交
    • G
      powerpc/powernv: Override dma_get_required_mask() · fe7e85c6
      Gavin Shan 提交于
      The dma_get_required_mask() function is used by some drivers to
      query the platform about what DMA mask is needed to cover all of
      memory. This is a bit of a strange semantic when we have to choose
      between IOMMU translation or bypass, but essentially what it means
      is "what DMA mask will give best performances".
      
      Currently, our IOMMU backend always returns a 32-bit mask here, we
      don't do anything special to it when we have bypass available. This
      causes some drivers to choose a 32-bit mask, thus losing the ability
      to use the bypass window, thinking this is more efficient. The problem
      was reported from the driver of following device:
      
      0004:03:00.0 0107: 1000:0087 (rev 05)
      0004:03:00.0 Serial Attached SCSI controller: LSI Logic / Symbios \
                   Logic SAS2308 PCI-Express Fusion-MPT SAS-2 (rev 05)
      
      This patch adds an override of that function in order to, instead,
      return a 64-bit mask whenever a bypass window is available in order
      for drivers to prefer this configuration.
      Reported-by: NMurali N. Iyer <mniyer@us.ibm.com>
      Suggested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      fe7e85c6
    • G
      powerpc/powernv: Fetch frozen PE on top level · 372fb80d
      Gavin Shan 提交于
      It should have been part of commit 1ad7a72c ("powerpc/eeh: Report
      frozen parent PE prior to child PE"). There are 2 ways to report
      EEH errors: proactively polling because of 0xFF's returned from
      PCI config or IO read, or interrupt driven event. We missed to
      report and handle parent frozen PE prior to child frozen PE for
      the later case on PowerNV platform.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      372fb80d
    • G
      powerpc/eeh: Dump PCI config space for all child devices · f2e0be5e
      Gavin Shan 提交于
      The PEs can be organized as nested. Current implementation doesn't
      dump PCI config space for subordinate devices of child PEs. However,
      the frozen PE could be caused by those subordinate devices of its
      child PEs.
      
      The patch dumps PCI config space for all subordinate devices of the
      problematic PE.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f2e0be5e
    • G
      powerpc/eeh: Emulate EEH recovery for VFIO devices · 5cfb20b9
      Gavin Shan 提交于
      When enabling EEH functionality on passed through devices (PE)
      with VFIO, the devices in the PE would be removed permanently
      from guest side. In that case, the PE remains frozen state.
      When returning PE to host, or restarting the guest again, we
      had mechanism unfreezing the PE by clearing PESTA/B frozen
      bits. However, that's not enough for some adapters, which are
      indicated as following "lspci" shows. Those adapters require
      hot reset on the parent bus to bring their firmware back to
      workable state. Otherwise, those adaptrs won't be operative
      and the host (for returning case) or the guest will fail to
      load the drivers for those adapters without exception.
      
      0000:01:00.0 Ethernet controller: Emulex Corporation OneConnect \
                   10Gb NIC (be3) (rev 02)
      0000:01:00.0 0200: 19a2:0710 (rev 02)
      0001:03:00.0 Ethernet controller: Emulex Corporation OneConnect \
                   NIC (Lancer) (rev 10)
      0001:03:00.0 0200: 10df:e220 (rev 10)
      
      The patch adds mechanism to emulate EEH recovery (for hot reset
      on parent PCI bus) on 3 gates to fix the issue: open/release one
      adapter of the PE, enable EEH functionality on one adapter of the
      PE.
      Reported-by: NMurilo Fossa Vicentini <muvic@br.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5cfb20b9