1. 09 7月, 2015 4 次提交
    • M
      MIPS: kernel: smp-cps: Fix 64-bit compatibility errors due to pointer casting · fd5ed306
      Markos Chandras 提交于
      Commit 1d8f1f5a ("MIPS: smp-cps: hotplug support") added hotplug
      support in the SMP/CPS implementation but it introduced a few build problems
      on 64-bit kernels due to pointer being casted to and from 'int' C types. We
      fix this problem by using 'unsigned long' instead which should match the size
      of the pointers in 32/64-bit kernels. Finally, we fix the comment since the
      CM base address is loaded to v1($3) instead of v0.
      
      Fixes the following build problems:
      
      arch/mips/kernel/smp-cps.c: In function 'wait_for_sibling_halt':
      arch/mips/kernel/smp-cps.c:366:17: error: cast from pointer to integer of
      different size [-Werror=pointer-to-int-cast]
      [...]
      arch/mips/kernel/smp-cps.c: In function 'cps_cpu_die':
      arch/mips/kernel/smp-cps.c:427:13: error: cast to pointer
      from integer of different size [-Werror=int-to-pointer-cast]
      
      cc1: all warnings being treated as errors
      
      Fixes: 1d8f1f5a ("MIPS: smp-cps: hotplug support")
      Cc: <stable@vger.kernel.org> # 3.16+
      Reviewed-by: NPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/10586/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fd5ed306
    • M
      MIPS: Fix branch emulation for BLTC and BGEC instructions · e9d92d22
      Markos Chandras 提交于
      Commits f1b44067 ("MIPS: Emulate the
      new MIPS R6 B{L,G}T{Z,}{AL,}C instructions") and commit
      a8ff66f5 ("MIPS: Emulate the new MIPS
      R6 B{L,G}E{Z,}{AL,}C instructions") added support for emulating various
      branch compact instructions. However, it missed the case for those which
      use the old BLEZL and BGTZL opcodes leading to random crashes when the R6
      emulator is disabled. We fix this by ensuring that the 'rt' field is not
      zero which is always true for these branch compact instructions.
      
      Fixes: f1b44067 ("MIPS: Emulate the new MIPS R6 B{L,G}T{Z,}{AL,}C instructions")
      Fixes: a8ff66f5 ("MIPS: Emulate the new MIPS R6 B{L,G}E{Z,}{AL,}C instructions")
      Cc: <stable@vger.kernel.org> # 4.0+
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/10582/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e9d92d22
    • M
      MIPS: kernel: traps: Fix broken indentation · 761b4493
      Markos Chandras 提交于
      Fix broken indentation caused by the SMTC removal
      commit b633648c
      ("MIPS: MT: Remove SMTC support")
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Fixes: b633648c ("MIPS: MT: Remove SMTC support")
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10581/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      761b4493
    • A
      MIPS: bootmem: Don't use memory holes for page bitmap · a6335fa1
      Alexander Sverdlin 提交于
      Commit f9a7febd leads to a fact that mapstart and therefore a page bitmap for
      bootmem allocator immediately follows initrd_end. This doesn't always work
      well on Octeon, where there are holes in PFN ranges (refer to 5b3b1688 and
      4MB-aligned PFN allocation). Depending on the inird location it could happen,
      that mapstart would be in an area not allocated by plat_mem_setup() in
      arch/mips/cavium-octeon/setup.c, but in the alignment hole between initrd and
      the next PFN area. Later on this memory will be unconditionally made available
      to buddy allocator at the end of free_all_bootmem_core() (mm/bootmem.c).
      All of this results in Linux using the memory not designated for Linux in
      Octeon's plat_mem_setup(), which in turn means corruption of the memory used
      by another OS/baremetal code on the same SoC.
      
      It doesn't look to me as a problem of Octeon platform code, but rather as an
      inability of f9a7febd to deal correctly with the fragmented memory-mappings.
      Proposed fix moves the check for initrd address to the same calculation-loop
      in bootmem_init() (arch/mips/kernel/setup.c), which also accounts for kernel
      code location. This should result in mapstart located starting from the first
      PFN area after kernel code AND initrd.
      Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Yusuf Khan <yusuf.khan@nokia.com>
      Cc: Michael Kreuzer <michael.kreuzer@nokia.com>
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Patchwork: https://patchwork.linux-mips.org/patch/10594/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a6335fa1
  2. 08 7月, 2015 1 次提交
    • R
      MIPS: O32: Do not handle require 32 bytes from the stack to be readable. · 7928eb03
      Ralf Baechle 提交于
      Commit 46e12c07 (MIPS: O32 / 32-bit:
      Always copy 4 stack arguments.) change the O32 syscall handler to always
      load four arguments from the userspace stack even for syscalls that
      require fewer or no arguments to be copied.  This removes a large table
      from kernel space and need to maintain it.  It appeared that it was ok
      the implementation chosen requires 16 bytes of readable stack space
      above the user stack pointer.
      
      Turned out a few threading implementations munmap the user stack before
      the thread exits resulting in errors due to the unreadable stack.
      
      We now treat any failed load as a if the loaded value was zero and let
      the actual syscall deal with the situation.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7928eb03
  3. 22 6月, 2015 10 次提交
  4. 06 6月, 2015 1 次提交
  5. 05 6月, 2015 1 次提交
  6. 03 6月, 2015 1 次提交
  7. 30 5月, 2015 1 次提交
  8. 26 5月, 2015 1 次提交
    • J
      MIPS: irq: Use DECLARE_BITMAP · 884e7e5e
      Joe Perches 提交于
      Use the generic mechanism to declare a bitmap instead of unsigned long.
      
      This could fix an overwrite defect of whatever follows irq_map.
      
      Not all "#define NR_IRQS <value>" are a multiple of BITS_PER_LONG so
      using DECLARE_BITMAP allocates the proper number of longs required
      for the possible bits.
      
      For instance:
      
      arch/mips/include/asm/mach-ath79/irq.h:#define NR_IRQS                  51
      arch/mips/include/asm/mach-db1x00/irq.h:#define NR_IRQS 152
      arch/mips/include/asm/mach-lantiq/falcon/irq.h:#define NR_IRQS 328
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: linux-mips <linux-mips@linux-mips.org>
      Cc: LKML <linux-kernel@vger.kernel.org>
      Cc: Gabor Juhos <juhosg@openwrt.org>
      Cc: Manuel Lauss <manuel.lauss@googlemail.com>
      Cc: John Crispin <blogic@openwrt.org>
      Patchwork: https://patchwork.linux-mips.org/patch/10091/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      884e7e5e
  9. 19 5月, 2015 1 次提交
  10. 16 5月, 2015 1 次提交
  11. 13 5月, 2015 3 次提交
    • P
      MIPS: traps: remove extra Tainted: line from __show_regs() output · 2d2ec2f7
      Petri Gynther 提交于
      __show_regs() calls show_regs_print_info(), which already outputs
      the Tainted: information. So, no need to output it twice.
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9997/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      2d2ec2f7
    • M
      MIPS: Fix a preemption issue with thread's FPU defaults · 03dce595
      Maciej W. Rozycki 提交于
      Fix "BUG: using smp_processor_id() in preemptible" reported in accesses
      to thread's FPU defaults: the value to initialise FSCR to at program
      startup, the FCSR r/w mask and the contents of FIR in full FPU
      emulation, removing a regression introduced with 9b26616c [MIPS: Respect
      the ISA level in FCSR handling] and f6843626 [MIPS: math-emu: Set FIR
      feature flags for full emulation].
      
      Use `boot_cpu_data' to obtain the data from, following the approach that
      `cpu_has_*' macros take and avoiding the call to `smp_processor_id' made
      in the reference to `current_cpu_data'.  The contents of FSCR have to be
      consistent across processors in an SMP system, the settings there must
      not change as a thread is migrated across processors.  And the contents
      of FIR are guaranteed to be consistent in FPU emulation, by definition.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Tested-by: NEzequiel Garcia <ezequiel.garcia@imgtec.com>
      Tested-by: NPaul Martin <paul.martin@codethink.co.uk>
      Cc: Markos Chandras <Markos.Chandras@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10030/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      03dce595
    • P
      MIPS: fix FP mode selection in lieu of .MIPS.abiflags data · 620b1550
      Paul Burton 提交于
      Commit 46490b57 ("MIPS: kernel: elf: Improve the overall ABI and FPU
      mode checks") reworked the ELF FP ABI mode selection logic, but when
      CONFIG_MIPS_O32_FP64_SUPPORT is enabled it breaks the use of binaries
      which have no PT_MIPS_ABIFLAGS program header & associated
      .MIPS.abiflags section.
      
      A default mode is selected based upon whether the ELF contains MIPS32 or
      MIPS64 code, but that selection is made in arch_elf_pt_proc.
      arch_elf_pt_proc only executes when a PT_MIPS_ABIFLAGS program header is
      found. If one is not found then arch_elf_pt_proc is never called, and no
      default overall_fp_mode value is selected. When arch_check_elf is
      called, both abi0 & abi1 are MIPS_ABI_FP_UNKNOWN which leads to both
      prog_req & interp_req being set to none_req. none_req matches none of
      the conditions for mode selection at the end of arch_check_elf, so
      overall_fp_mode is left untouched. Finally once mips_set_personality_fp
      is called the BUG() in the default case is then hit & the kernel likely
      panics.
      
      Fix this by moving the selection of a default overall mode to the start
      of arch_check_elf, which runs once per ELF executed regardless of
      whether it has a PT_MIPS_ABIFLAGS program header.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org # v4.0+
      Patchwork: http://patchwork.linux-mips.org/patch/9978/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      620b1550
  12. 12 5月, 2015 1 次提交
    • R
      MIPS: SMP: Fix build error. · cafb45b2
      Ralf Baechle 提交于
        CC      arch/mips/kernel/smp.o
      arch/mips/kernel/smp.c: In function ‘start_secondary’:
      arch/mips/kernel/smp.c:149:2: error: passing argument 2 of ‘cpumask_set_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        cpumask_set_cpu(cpu, &cpu_callin_map);
        ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:272:91: note: expected ‘struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
                                                                                                 ^
      arch/mips/kernel/smp.c: In function ‘smp_prepare_boot_cpu’:
      arch/mips/kernel/smp.c:211:2: error: passing argument 2 of ‘cpumask_set_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        cpumask_set_cpu(0, &cpu_callin_map);
        ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:272:91: note: expected ‘struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
                                                                                                 ^
      arch/mips/kernel/smp.c: In function ‘__cpu_up’:
      arch/mips/kernel/smp.c:221:10: error: passing argument 2 of ‘cpumask_test_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        while (!cpumask_test_cpu(cpu, &cpu_callin_map))
                ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:294:90: note: expected ‘const struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
                                                                                                ^
      cc1: all warnings being treated as errors
      make[2]: *** [arch/mips/kernel/smp.o] Error 1
      make[1]: *** [arch/mips/kernel] Error 2
      make: *** [arch/mips] Error 2
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cafb45b2
  13. 13 4月, 2015 1 次提交
  14. 10 4月, 2015 5 次提交
  15. 08 4月, 2015 8 次提交