1. 10 4月, 2017 8 次提交
  2. 29 3月, 2017 1 次提交
  3. 22 3月, 2017 7 次提交
    • M
      MIPS: IRQ Stack: Unwind IRQ stack onto task stack · db8466c5
      Matt Redfearn 提交于
      When the separate IRQ stack was introduced, stack unwinding only
      proceeded as far as the top of the IRQ stack, leading to kernel
      backtraces being less useful, lacking the trace of what was interrupted.
      
      Fix this by providing a means for the kernel to unwind the IRQ stack
      onto the interrupted task stack. The processor state is saved to the
      kernel task stack on interrupt. The IRQ_STACK_START macro reserves an
      unsigned long at the top of the IRQ stack where the interrupted task
      stack pointer can be saved. After the active stack is switched to the
      IRQ stack, save the interrupted tasks stack pointer to the reserved
      location.
      
      Fix the stack unwinding code to look for the frame being the top of the
      IRQ stack and if so get the next frame from the saved location. The
      existing test does not work with the separate stack since the ra is no
      longer pointed at ret_from_{irq,exception}.
      
      The test to stop unwinding the stack 32 bytes from the top of a stack
      must be modified to allow unwinding to continue up to the location of
      the saved task stack pointer when on the IRQ stack. The low / high marks
      of the stack are set depending on whether the sp is on an irq stack or
      not.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Masanari Iida <standby24x7@gmail.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jason A. Donenfeld <jason@zx2c4.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15788/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      db8466c5
    • H
      MIPS: c-r4k: Fix Loongson-3's vcache/scache waysize calculation · 0be032c1
      Huacai Chen 提交于
      If scache.waysize is 0, r4k___flush_cache_all() will do nothing and
      then cause bugs. BTW, though vcache.waysize isn't being used by now,
      we also fix its calculation.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15756/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0be032c1
    • H
      MIPS: Flush wrong invalid FTLB entry for huge page · 0115f6cb
      Huacai Chen 提交于
      On VTLB+FTLB platforms (such as Loongson-3A R2), FTLB's pagesize is
      usually configured the same as PAGE_SIZE. In such a case, Huge page
      entry is not suitable to write in FTLB.
      
      Unfortunately, when a huge page is created, its page table entries
      haven't created immediately. Then the TLB refill handler will fetch an
      invalid page table entry which has no "HUGE" bit, and this entry may be
      written to FTLB. Since it is invalid, TLB load/store handler will then
      use tlbwi to write the valid entry at the same place. However, the
      valid entry is a huge page entry which isn't suitable for FTLB.
      
      Our solution is to modify build_huge_handler_tail. Flush the invalid
      old entry (whether it is in FTLB or VTLB, this is in order to reduce
      branches) and use tlbwr to write the valid new entry.
      Signed-off-by: NRui Wang <wangr@lemote.com>
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15754/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0115f6cb
    • H
      MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3 · 5a341331
      Huacai Chen 提交于
      Loongson-3's micro TLB (ITLB) is not strictly a subset of JTLB. That
      means: when a JTLB entry is replaced by hardware, there may be an old
      valid entry exists in ITLB. So, a TLB miss exception may occur while
      handle_ri_rdhwr() is running because it try to access EPC's content.
      However, handle_ri_rdhwr() doesn't clear EXL, which makes a TLB Refill
      exception be treated as a TLB Invalid exception and tlbp may fail. In
      this case, if FTLB (which is usually set-associative instead of set-
      associative) is enabled, a tlbp failure will cause an invalid tlbwi,
      which will hang the whole system.
      
      This patch rename handle_ri_rdhwr_vivt to handle_ri_rdhwr_tlbp and use
      it for Loongson-3. It try to solve the same problem described as below,
      but more straightforwards.
      
      https://patchwork.linux-mips.org/patch/12591/
      
      I think Loongson-2 has the same problem, but it has no FTLB, so we just
      keep it as is.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: Rui Wang <wangr@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15753/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5a341331
    • H
      MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2 · 033cffee
      Huacai Chen 提交于
      Loongson-3A R2 and newer CPU have FTLB, but Config0.MT is 1, so add
      MIPS_CPU_FTLB to the CPU options.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15752/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      033cffee
    • H
      MIPS: Lantiq: fix missing xbar kernel panic · 6ef90877
      Hauke Mehrtens 提交于
      Commit 08b3c894 ("MIPS: lantiq: Disable xbar fpi burst mode")
      accidentally requested the resources from the pmu address region
      instead of the xbar registers region, but the check for the return
      value of request_mem_region() was wrong. Commit 98ea51cb ("MIPS:
      Lantiq: Fix another request_mem_region() return code check") fixed the
      check of the return value of request_mem_region() which made the kernel
      panics.
      This patch now makes use of the correct memory region for the cross bar.
      
      Fixes: 08b3c894 ("MIPS: lantiq: Disable xbar fpi burst mode")
      Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
      Cc: John Crispin <john@phrozen.org>
      Cc: james.hogan@imgtec.com
      Cc: arnd@arndb.de
      Cc: sergei.shtylyov@cogentembedded.com
      Cc: john@phrozen.org
      Cc: <stable@vger.kernel.org> # 4.4.x-
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15751Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6ef90877
    • M
      MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs · fb2155e3
      Matt Redfearn 提交于
      The vpe_mask member of struct core_boot_config is of type atomic_t,
      which is a 32bit type. In cps-vec.S this member was being retrieved by a
      PTR_L macro, which on 64bit systems is a 64bit load. On little endian
      systems this is OK, since the double word that is retrieved will have
      the required less significant word in the correct position. However, on
      big endian systems the less significant word of the load is retrieved
      from address+4, and the more significant from address+0. The destination
      register therefore ends up with the required word in the more
      significant word
      e.g. when starting the second VP of a big endian 64bit system, the load
      
      PTR_L    ta2, COREBOOTCFG_VPEMASK(a0)
      
      ends up setting register ta2 to 0x0000000300000000
      
      When this value is written to the CPC it is ignored, since it is
      invalid to write anything larger than 4 bits. This results in any VP
      other than VP0 in a core failing to start in 64bit big endian systems.
      
      Change the load to a 32bit load word instruction to fix the bug.
      
      Fixes: f12401d7 ("MIPS: smp-cps: Pull boot config retrieval out of mips_cps_boot_vpes")
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15787/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fb2155e3
  4. 10 3月, 2017 1 次提交
  5. 08 3月, 2017 6 次提交
  6. 03 3月, 2017 3 次提交
    • I
      sched/headers: Remove the <linux/topology.h> include from <linux/sched.h> · ee6a3d19
      Ingo Molnar 提交于
      It's used only by a single (rarely used) inline function (task_node(p)),
      which we can move to <linux/sched/topology.h>.
      
      ( Add <linux/nodemask.h>, because we rely on that. )
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ee6a3d19
    • I
      sched/headers: Move task-stack related APIs from <linux/sched.h> to <linux/sched/task_stack.h> · f3ac6067
      Ingo Molnar 提交于
      Split out the task->stack related functionality, which is not really
      part of the core scheduler APIs.
      
      Only keep task_thread_info() because it's used by sched.h.
      
      Update the code that uses those facilities.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f3ac6067
    • I
      sched/headers: Move task->mm handling methods to <linux/sched/mm.h> · 68e21be2
      Ingo Molnar 提交于
      Move the following task->mm helper APIs into a new header file,
      <linux/sched/mm.h>, to further reduce the size and complexity
      of <linux/sched.h>.
      
      Here are how the APIs are used in various kernel files:
      
        # mm_alloc():
        arch/arm/mach-rpc/ecard.c
        fs/exec.c
        include/linux/sched/mm.h
        kernel/fork.c
      
        # __mmdrop():
        arch/arc/include/asm/mmu_context.h
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmdrop():
        arch/arm/mach-rpc/ecard.c
        arch/m68k/sun3/mmu_emu.c
        arch/x86/mm/tlb.c
        drivers/gpu/drm/amd/amdkfd/kfd_process.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/hw/hfi1/file_ops.c
        drivers/vfio/vfio_iommu_spapr_tce.c
        fs/exec.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/mmu_notifier.h
        include/linux/sched/mm.h
        kernel/fork.c
        kernel/futex.c
        kernel/sched/core.c
        mm/khugepaged.c
        mm/ksm.c
        mm/mmu_context.c
        mm/mmu_notifier.c
        mm/oom_kill.c
        virt/kvm/kvm_main.c
      
        # mmdrop_async_fn():
        include/linux/sched/mm.h
      
        # mmdrop_async():
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmget_not_zero():
        fs/userfaultfd.c
        include/linux/sched/mm.h
        mm/oom_kill.c
      
        # mmput():
        arch/arc/include/asm/mmu_context.h
        arch/arc/kernel/troubleshoot.c
        arch/frv/mm/mmu-context.c
        arch/powerpc/platforms/cell/spufs/context.c
        arch/sparc/include/asm/mmu_context_32.h
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/core/uverbs_main.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/exec.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/events/uprobes.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/oom_kill.c
        mm/process_vm_access.c
        mm/rmap.c
        mm/swapfile.c
        mm/util.c
        virt/kvm/async_pf.c
      
        # mmput_async():
        include/linux/sched/mm.h
        kernel/fork.c
        mm/oom_kill.c
      
        # get_task_mm():
        arch/arc/kernel/troubleshoot.c
        arch/powerpc/platforms/cell/spufs/context.c
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/util.c
      
        # mm_access():
        fs/proc/base.c
        include/linux/sched/mm.h
        kernel/fork.c
        mm/process_vm_access.c
      
        # mm_release():
        arch/arc/include/asm/mmu_context.h
        fs/exec.c
        include/linux/sched/mm.h
        include/uapi/linux/sched.h
        kernel/exit.c
        kernel/fork.c
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      68e21be2
  7. 02 3月, 2017 11 次提交
  8. 28 2月, 2017 2 次提交
  9. 25 2月, 2017 1 次提交