1. 10 4月, 2017 1 次提交
  2. 09 2月, 2017 1 次提交
  3. 31 1月, 2017 1 次提交
  4. 27 1月, 2017 1 次提交
    • C
      powerpc/8xx: Perf events on PPC 8xx · 75b82472
      Christophe Leroy 提交于
      This patch has been reworked since RFC version. In the RFC, this patch
      was preceded by a patch clearing MSR RI for all PPC32 at all time at
      exception prologs. Now MSR RI clearing is done only when this 8xx perf
      events functionality is compiled in, it is therefore limited to 8xx
      and merged inside this patch.
      Other main changes have been to take into account detailed review from
      Peter Zijlstra. The instructions counter has been reworked to behave
      as a free running counter like the three other counters.
      
      The 8xx has no PMU, however some events can be emulated by other means.
      
      This patch implements the following events (as reported by 'perf list'):
        cpu-cycles OR cycles				[Hardware event]
        instructions					[Hardware event]
        dTLB-load-misses				[Hardware cache event]
        iTLB-load-misses				[Hardware cache event]
      
      'cycles' event is implemented using the timebase clock. Timebase clock
      corresponds to CPU clock divided by 16, so number of cycles is
      approximatly 16 times the number of TB ticks
      
      On the 8xx, TLB misses are handled by software. It is therefore
      easy to count all TLB misses each time the TLB miss exception is
      called.
      
      'instructions' is calculated by using instruction watchpoint counter.
      This patch sets counter A to count instructions at address greater
      than 0, hence we count all instructions executed while MSR RI bit is
      set. The counter is set to the maximum which is 0xffff. Every 65535
      instructions, debug instruction breakpoint exception fires. The
      exception handler increments a counter in memory which then
      represent the upper part of the instruction counter. We therefore
      end up with a 48 bits counter. In order to avoid unnecessary overhead
      while no perf event is active, this counter is started when the first
      event referring to this counter is added, and the counter is stopped
      when the last event referring to it is deleted. In order to properly
      support breakpoint exceptions, MSR RI bit has to be unset in exception
      epilogs in order to avoid breakpoint exceptions during critical
      sections during changes to SRR0 and SRR1 would be problematic.
      
      All counters are handled as free running counters.
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NScott Wood <oss@buserror.net>
      75b82472
  5. 25 1月, 2017 1 次提交
  6. 23 11月, 2016 3 次提交
  7. 22 11月, 2016 2 次提交
  8. 14 11月, 2016 1 次提交
  9. 04 10月, 2016 1 次提交
  10. 27 9月, 2016 1 次提交
    • T
      KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2 register · fa73c3b2
      Thomas Huth 提交于
      The MMCR2 register is available twice, one time with number 785
      (privileged access), and one time with number 769 (unprivileged,
      but it can be disabled completely). In former times, the Linux
      kernel was using the unprivileged register 769 only, but since
      commit 8dd75ccb ("powerpc: Use privileged SPR number
      for MMCR2"), it uses the privileged register 785 instead.
      The KVM-PR code then of course also switched to use the SPR 785,
      but this is causing older guest kernels to crash, since these
      kernels still access 769 instead. So to support older kernels
      with KVM-PR again, we have to support register 769 in KVM-PR, too.
      
      Fixes: 8dd75ccb
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      fa73c3b2
  11. 25 9月, 2016 1 次提交
    • C
      powerpc/8xx: use SPRN_EIE and SPRN_EID to enable/disable interrupts · 834e5a69
      Christophe Leroy 提交于
      The 8xx has two special registers called EID (External Interrupt
      Disable) and EIE (External Interrupt Enable) for clearing/setting
      EE in MSR. It avoids the three instructions set mfmsr/ori/mtmsr or
      mfmsr/rlwinm/mtmsr and it avoids using a general register.
      
      We just have to write something in the special register to change MSR EE
      bit. So we write r0 into the register, regardless of r0 value.
      
      Writing to one of those two special registers also set the MSR RI bit,
      but this bit is only unset during beginning of exception prolog and end
      of exception epilog. When executing C-functions MSR RI is always set.
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NScott Wood <oss@buserror.net>
      834e5a69
  12. 13 9月, 2016 1 次提交
  13. 01 8月, 2016 1 次提交
  14. 19 7月, 2016 1 次提交
  15. 17 7月, 2016 2 次提交
  16. 15 7月, 2016 1 次提交
    • S
      powerpc/powernv: Add platform support for stop instruction · bcef83a0
      Shreyas B. Prabhu 提交于
      POWER ISA v3 defines a new idle processor core mechanism. In summary,
       a) new instruction named stop is added. This instruction replaces
      	instructions like nap, sleep, rvwinkle.
       b) new per thread SPR named Processor Stop Status and Control Register
      	(PSSCR) is added which controls the behavior of stop instruction.
      
      PSSCR layout:
      ----------------------------------------------------------
      | PLS | /// | SD | ESL | EC | PSLL | /// | TR | MTL | RL |
      ----------------------------------------------------------
      0      4     41   42    43   44     48    54   56    60
      
      PSSCR key fields:
      	Bits 0:3  - Power-Saving Level Status. This field indicates the lowest
      	power-saving state the thread entered since stop instruction was last
      	executed.
      
      	Bit 42 - Enable State Loss
      	0 - No state is lost irrespective of other fields
      	1 - Allows state loss
      
      	Bits 44:47 - Power-Saving Level Limit
      	This limits the power-saving level that can be entered into.
      
      	Bits 60:63 - Requested Level
      	Used to specify which power-saving level must be entered on executing
      	stop instruction
      
      This patch adds support for stop instruction and PSSCR handling.
      Reviewed-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: NShreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bcef83a0
  17. 14 7月, 2016 1 次提交
  18. 09 7月, 2016 1 次提交
  19. 05 7月, 2016 1 次提交
    • O
      powerpc/timer: Large Decrementer support · 79901024
      Oliver O'Halloran 提交于
      Power ISAv3 adds a large decrementer (LD) mode which increases the size
      of the decrementer register. The size of the enlarged decrementer
      register is between 32 and 64 bits with the exact size being dependent
      on the implementation. When in LD mode, reads are sign extended to 64
      bits and a decrementer exception is raised when the high bit is set (i.e
      the value goes below zero). Writes however are truncated to the physical
      register width so some care needs to be taken to ensure that the high
      bit is not set when reloading the decrementer. This patch adds support
      for using the LD inside the host kernel on processors that support it.
      
      When LD mode is supported firmware will supply the ibm,dec-bits property
      for CPU nodes to allow the kernel to determine the maximum decrementer
      value. Enabling LD mode is a hypervisor privileged operation so the kernel
      can only enable it manually when running in hypervisor mode. Guests that
      support LD mode can request it using the "ibm,client-architecture-support"
      firmware call (not implemented in this patch) or some other platform
      specific method. If this property is not supplied then the traditional
      decrementer width of 32 bit is assumed and LD mode will not be enabled.
      
      This patch was based on initial work by Jack Miller.
      Signed-off-by: NOliver O'Halloran <oohall@gmail.com>
      Signed-off-by: NBalbir Singh <bsingharora@gmail.com>
      Acked-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      79901024
  20. 21 6月, 2016 1 次提交
    • J
      powerpc: Load Monitor Register Support · bd3ea317
      Jack Miller 提交于
      This enables new registers, LMRR and LMSER, that can trigger an EBB in
      userspace code when a monitored load (via the new ldmx instruction)
      loads memory from a monitored space. This facility is controlled by a
      new FSCR bit, LM.
      
      This patch disables the FSCR LM control bit on task init and enables
      that bit when a load monitor facility unavailable exception is taken
      for using it. On context switch, this bit is then used to determine
      whether the two relevant registers are saved and restored. This is
      done lazily for performance reasons.
      Signed-off-by: NJack Miller <jack@codezen.org>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bd3ea317
  21. 31 5月, 2016 2 次提交
  22. 01 5月, 2016 2 次提交
  23. 11 4月, 2016 1 次提交
  24. 12 3月, 2016 1 次提交
  25. 02 3月, 2016 1 次提交
  26. 01 3月, 2016 1 次提交
  27. 01 12月, 2015 2 次提交
  28. 23 11月, 2015 1 次提交
  29. 21 10月, 2015 1 次提交
    • P
      powerpc: Revert "Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8" · 23316316
      Paul Mackerras 提交于
      This reverts commit 9678cdaa ("Use the POWER8 Micro Partition
      Prefetch Engine in KVM HV on POWER8") because the original commit had
      multiple, partly self-cancelling bugs, that could cause occasional
      memory corruption.
      
      In fact the logmpp instruction was incorrectly using register r0 as the
      source of the buffer address and operation code, and depending on what
      was in r0, it would either do nothing or corrupt the 64k page pointed to
      by r0.
      
      The logmpp instruction encoding and the operation code definitions could
      be corrected, but then there is the problem that there is no clearly
      defined way to know when the hardware has finished writing to the
      buffer.
      
      The original commit attempted to work around this by aborting the
      write-out before starting the prefetch, but this is ineffective in the
      case where the virtual core is now executing on a different physical
      core from the one where the write-out was initiated.
      
      These problems plus advice from the hardware designers not to use the
      function (since the measured performance improvement from using the
      feature was actually mostly negative), mean that reverting the code is
      the best option.
      
      Fixes: 9678cdaa ("Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8")
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      23316316
  30. 14 8月, 2015 1 次提交
  31. 13 7月, 2015 1 次提交
  32. 20 3月, 2015 1 次提交
    • P
      powerpc/powernv: Fixes for hypervisor doorbell handling · 755563bc
      Paul Mackerras 提交于
      Since we can now use hypervisor doorbells for host IPIs, this makes
      sure we clear the host IPI flag when taking a doorbell interrupt, and
      clears any pending doorbell IPI in pnv_smp_cpu_kill_self() (as we
      already do for IPIs sent via the XICS interrupt controller).  Otherwise
      if there did happen to be a leftover pending doorbell interrupt for
      an offline CPU thread for any reason, it would prevent that thread from
      going into a power-saving mode; it would instead keep waking up because
      of the interrupt.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      755563bc
  33. 15 12月, 2014 1 次提交
    • S
      powernv/powerpc: Add winkle support for offline cpus · 77b54e9f
      Shreyas B. Prabhu 提交于
      Winkle is a deep idle state supported in power8 chips. A core enters
      winkle when all the threads of the core enter winkle. In this state
      power supply to the entire chiplet i.e core, private L2 and private L3
      is turned off. As a result it gives higher powersavings compared to
      sleep.
      
      But entering winkle results in a total hypervisor state loss. Hence the
      hypervisor context has to be preserved before entering winkle and
      restored upon wake up.
      
      Power-on Reset Engine (PORE) is a dedicated engine which is responsible
      for powering on the chiplet during wake up. It can be programmed to
      restore the register contests of a few specific registers. This patch
      uses PORE to restore register state wherever possible and uses stack to
      save and restore rest of the necessary registers.
      
      With hypervisor state restore things fall under three categories-
      per-core state, per-subcore state and per-thread state. To manage this,
      extend the infrastructure introduced for sleep. Mainly we add a paca
      variable subcore_sibling_mask. Using this and the core_idle_state we can
      distingush first thread in core and subcore.
      Signed-off-by: NShreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      77b54e9f