1. 13 3月, 2018 3 次提交
  2. 23 1月, 2018 1 次提交
    • N
      powerpc/64s: Improve RFI L1-D cache flush fallback · bdcb1aef
      Nicholas Piggin 提交于
      The fallback RFI flush is used when firmware does not provide a way
      to flush the cache. It's a "displacement flush" that evicts useful
      data by displacing it with an uninteresting buffer.
      
      The flush has to take care to work with implementation specific cache
      replacment policies, so the recipe has been in flux. The initial
      slow but conservative approach is to touch all lines of a congruence
      class, with dependencies between each load. It has since been
      determined that a linear pattern of loads without dependencies is
      sufficient, and is significantly faster.
      
      Measuring the speed of a null syscall with RFI fallback flush enabled
      gives the relative improvement:
      
      P8 - 1.83x
      P9 - 1.75x
      
      The flush also becomes simpler and more adaptable to different cache
      geometries.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bdcb1aef
  3. 19 1月, 2018 1 次提交
  4. 10 1月, 2018 2 次提交
  5. 06 12月, 2017 1 次提交
    • M
      powerpc/xmon: Don't print hashed pointers in xmon · d8104182
      Michael Ellerman 提交于
      Since commit ad67b74d ("printk: hash addresses printed with %p")
      pointers printed with %p are hashed, ie. you don't see the actual
      pointer value but rather a cryptographic hash of its value.
      
      In xmon we want to see the actual pointer values, because xmon is a
      debugger, so replace %p with %px which prints the actual pointer
      value.
      
      We justify doing this in xmon because 1) xmon is a kernel crash
      debugger, it's only accessible via the console 2) xmon doesn't print
      to dmesg, so the pointers it prints are not able to be leaked that
      way.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      d8104182
  6. 08 11月, 2017 1 次提交
    • B
      powerpc/xmon: Support dumping software pagetables · 80eff6c4
      Balbir Singh 提交于
      It would be nice to be able to dump page tables in a particular
      context.
      
      eg: dumping vmalloc space:
      
        0:mon> dv 0xd00037fffff00000
        pgd  @ 0xc0000000017c0000
        pgdp @ 0xc0000000017c00d8 = 0x00000000f10b1000
        pudp @ 0xc0000000f10b13f8 = 0x00000000f10d0000
        pmdp @ 0xc0000000f10d1ff8 = 0x00000000f1102000
        ptep @ 0xc0000000f1102780 = 0xc0000000f1ba018e
        Maps physical address = 0x00000000f1ba0000
        Flags = Accessed Dirty Read Write
      
      This patch does not replicate the complex code of dump_pagetable and
      has no support for bolted linear mapping, thats why I've it's called
      dump virtual page table support. The format of the PTE can be expanded
      even further to add more useful information about the flags in the PTE
      if required.
      Signed-off-by: NBalbir Singh <bsingharora@gmail.com>
      [mpe: Bike shed the output format, show the pgdir, fix build failures]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      80eff6c4
  7. 06 11月, 2017 1 次提交
    • M
      powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with CONFIG_PPC_BOOK3S_64 · 4e003747
      Michael Ellerman 提交于
      CONFIG_PPC_STD_MMU_64 indicates support for the "standard" powerpc MMU
      on 64-bit CPUs. The "standard" MMU refers to the hash page table MMU
      found in "server" processors, from IBM mainly.
      
      Currently CONFIG_PPC_STD_MMU_64 is == CONFIG_PPC_BOOK3S_64. While it's
      annoying to have two symbols that always have the same value, it's not
      quite annoying enough to bother removing one.
      
      However with the arrival of Power9, we now have the situation where
      CONFIG_PPC_STD_MMU_64 is enabled, but the kernel is running using the
      Radix MMU - *not* the "standard" MMU. So it is now actively confusing
      to use it, because it implies that code is disabled or inactive when
      the Radix MMU is in use, however that is not necessarily true.
      
      So s/CONFIG_PPC_STD_MMU_64/CONFIG_PPC_BOOK3S_64/, and do some minor
      formatting updates of some of the affected lines.
      
      This will be a pain for backports, but c'est la vie.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4e003747
  8. 22 10月, 2017 2 次提交
  9. 06 10月, 2017 1 次提交
  10. 04 10月, 2017 1 次提交
  11. 31 8月, 2017 4 次提交
  12. 14 8月, 2017 2 次提交
  13. 03 7月, 2017 1 次提交
  14. 30 5月, 2017 1 次提交
  15. 01 5月, 2017 1 次提交
  16. 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
  17. 24 4月, 2017 1 次提交
  18. 11 4月, 2017 1 次提交
  19. 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
  20. 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
  21. 02 3月, 2017 1 次提交
  22. 23 2月, 2017 1 次提交
  23. 21 2月, 2017 1 次提交
  24. 02 2月, 2017 1 次提交
  25. 14 1月, 2017 2 次提交
  26. 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
  27. 14 7月, 2016 1 次提交