1. 13 11月, 2019 26 次提交
  2. 10 11月, 2019 11 次提交
  3. 06 11月, 2019 3 次提交
    • N
      powerpc/powernv: Fix CPU idle to be called with IRQs disabled · 8f560302
      Nicholas Piggin 提交于
      [ Upstream commit 7d6475051fb3d9339c5c760ed9883bc0a9048b21 ]
      
      Commit e78a7614f3876 ("idle: Prevent late-arriving interrupts from
      disrupting offline") changes arch_cpu_idle_dead to be called with
      interrupts disabled, which triggers the WARN in pnv_smp_cpu_kill_self.
      
      Fix this by fixing up irq_happened after hard disabling, rather than
      requiring there are no pending interrupts, similarly to what was done
      done until commit 2525db04 ("powerpc/powernv: Simplify lazy IRQ
      handling in CPU offline").
      
      Fixes: e78a7614f3876 ("idle: Prevent late-arriving interrupts from disrupting offline")
      Reported-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      [mpe: Add unexpected_mask rather than checking for known bad values,
            change the WARN_ON() to a WARN_ON_ONCE()]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20191022115814.22456-1-npiggin@gmail.comSigned-off-by: NSasha Levin <sashal@kernel.org>
      8f560302
    • C
      arm64: Ensure VM_WRITE|VM_SHARED ptes are clean by default · a8166916
      Catalin Marinas 提交于
      commit aa57157be69fb599bd4c38a4b75c5aad74a60ec0 upstream.
      
      Shared and writable mappings (__S.1.) should be clean (!dirty) initially
      and made dirty on a subsequent write either through the hardware DBM
      (dirty bit management) mechanism or through a write page fault. A clean
      pte for the arm64 kernel is one that has PTE_RDONLY set and PTE_DIRTY
      clear.
      
      The PAGE_SHARED{,_EXEC} attributes have PTE_WRITE set (PTE_DBM) and
      PTE_DIRTY clear. Prior to commit 73e86cb0 ("arm64: Move PTE_RDONLY
      bit handling out of set_pte_at()"), it was the responsibility of
      set_pte_at() to set the PTE_RDONLY bit and mark the pte clean if the
      software PTE_DIRTY bit was not set. However, the above commit removed
      the pte_sw_dirty() check and the subsequent setting of PTE_RDONLY in
      set_pte_at() while leaving the PAGE_SHARED{,_EXEC} definitions
      unchanged. The result is that shared+writable mappings are now dirty by
      default
      
      Fix the above by explicitly setting PTE_RDONLY in PAGE_SHARED{,_EXEC}.
      In addition, remove the superfluous PTE_DIRTY bit from the kernel PROT_*
      attributes.
      
      Fixes: 73e86cb0 ("arm64: Move PTE_RDONLY bit handling out of set_pte_at()")
      Cc: <stable@vger.kernel.org> # 4.14.x-
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8166916
    • H
      s390/idle: fix cpu idle time calculation · 8dd60660
      Heiko Carstens 提交于
      commit 3d7efa4edd07be5c5c3ffa95ba63e97e070e1f3f upstream.
      
      The idle time reported in /proc/stat sometimes incorrectly contains
      huge values on s390. This is caused by a bug in arch_cpu_idle_time().
      
      The kernel tries to figure out when a different cpu entered idle by
      accessing its per-cpu data structure. There is an ordering problem: if
      the remote cpu has an idle_enter value which is not zero, and an
      idle_exit value which is zero, it is assumed it is idle since
      "now". The "now" timestamp however is taken before the idle_enter
      value is read.
      
      Which in turn means that "now" can be smaller than idle_enter of the
      remote cpu. Unconditionally subtracting idle_enter from "now" can thus
      lead to a negative value (aka large unsigned value).
      
      Fix this by moving the get_tod_clock() invocation out of the
      loop. While at it also make the code a bit more readable.
      
      A similar bug also exists for show_idle_time(). Fix this is as well.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8dd60660