1. 02 8月, 2017 5 次提交
  2. 01 8月, 2017 3 次提交
    • V
      powerpc/kernel: Avoid preemption check in iommu_range_alloc() · 75f327c6
      Victor Aoqui 提交于
      Replace the __this_cpu_read() with raw_cpu_read() in
      iommu_range_alloc(). Otherwise we get a warning about using
      __this_cpu_read() in preemptible code:
      
        BUG: using __this_cpu_read() in preemptible
        caller is iommu_range_alloc+0xa8/0x3d0
      
      Preemption doesn't need to be disabled since according to the comment
      any CPU can safely use any IOMMU pool.
      Signed-off-by: NVictor Aoqui <victora@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      75f327c6
    • G
      powerpc/powernv: Clear PECE1 in LPCR via stop-api only on Hotplug · 24be85a2
      Gautham R. Shenoy 提交于
      Currently we use the stop-api provided by the firmware to program the
      SLW engine to restore the values of hypervisor resources that get lost
      on deeper idle states (such as winkle). Since the deep states were
      only used for CPU-Hotplug on POWER8 systems, we would program the LPCR
      to have the PECE1 bit since Hotplugged CPUs shouldn't be spuriously
      woken up by decrementer.
      
      On POWER9, some of the deep platform idle states such as stop4 can be
      used in cpuidle as well. In this case, we want the CPU in stop4 to be
      woken up by the decrementer when some timer on the CPU expires.
      
      In this patch, we program the stop-api for LPCR with PECE1
      bit cleared only when we are offlining the CPU and set it
      back once the CPU is online.
      Signed-off-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Reviewed-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      24be85a2
    • G
      powerpc/powernv: Save/Restore additional SPRs for stop4 cpuidle · e1c1cfed
      Gautham R. Shenoy 提交于
      The stop4 idle state on POWER9 is a deep idle state which loses
      hypervisor resources, but whose latency is low enough that it can be
      exposed via cpuidle.
      
      Until now, the deep idle states which lose hypervisor resources (eg:
      winkle) were only exposed via CPU-Hotplug.  Hence currently on wakeup
      from such states, barring a few SPRs which need to be restored to
      their older value, rest of the SPRS are reinitialized to their values
      corresponding to that at boot time.
      
      When stop4 is used in the context of cpuidle, we want these additional
      SPRs to be restored to their older value, to ensure that the context
      on the CPU coming back from idle is same as it was before going idle.
      
      In this patch, we define a SPR save area in PACA (since we have used
      up the volatile register space in the stack) and on POWER9, we restore
      SPRN_PID, SPRN_LDBAR, SPRN_FSCR, SPRN_HFSCR, SPRN_MMCRA, SPRN_MMCR1,
      SPRN_MMCR2 to the values they had before entering stop.
      Signed-off-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Reviewed-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e1c1cfed
  3. 31 7月, 2017 2 次提交
  4. 25 7月, 2017 4 次提交
  5. 24 7月, 2017 8 次提交
  6. 20 7月, 2017 1 次提交
  7. 18 7月, 2017 5 次提交
  8. 17 7月, 2017 2 次提交
  9. 13 7月, 2017 8 次提交
  10. 12 7月, 2017 2 次提交
    • M
      powerpc/64: Fix atomic64_inc_not_zero() to return an int · 01e6a61a
      Michael Ellerman 提交于
      Although it's not documented anywhere, there is an expectation that
      atomic64_inc_not_zero() returns a result which fits in an int. This is
      the behaviour implemented on all arches except powerpc.
      
      This has caused at least one bug in practice, in the percpu-refcount
      code, where the long result from our atomic64_inc_not_zero() was
      truncated to an int leading to lost references and stuck systems. That
      was worked around in that code in commit 966d2b04 ("percpu-refcount:
      fix reference leak during percpu-atomic transition").
      
      To the best of my grepping abilities there are no other callers
      in-tree which truncate the value, but we should fix it anyway. Because
      the breakage is subtle and potentially very harmful I'm also tagging
      it for stable.
      
      Code generation is largely unaffected because in most cases the
      callers are just using the result for a test anyway. In particular the
      case of fget() that was mentioned in commit a6cf7ed5
      ("powerpc/atomic: Implement atomic*_inc_not_zero") generates exactly
      the same code.
      
      Fixes: a6cf7ed5 ("powerpc/atomic: Implement atomic*_inc_not_zero")
      Cc: stable@vger.kernel.org # v3.4
      Noticed-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      01e6a61a
    • A
      powerpc: Fix emulation of mfocrf in emulate_step() · 64e756c5
      Anton Blanchard 提交于
      From POWER4 onwards, mfocrf() only places the specified CR field into
      the destination GPR, and the rest of it is set to 0. The PowerPC AS
      from version 3.0 now requires this behaviour.
      
      The emulation code currently puts the entire CR into the destination GPR.
      Fix it.
      
      Fixes: 6888199f ("[POWERPC] Emulate more instructions in software")
      Cc: stable@vger.kernel.org # v2.6.22+
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      64e756c5