1. 09 Feb, 2021 1 commit
  2. 04 Feb, 2021 9 commits
  3. 03 Feb, 2021 4 commits
  4. 27 Jan, 2021 6 commits
  5. 25 Jan, 2021 6 commits
  6. 22 Jan, 2021 7 commits
  7. 19 Jan, 2021 2 commits
  8. 18 Jan, 2021 4 commits
    • Alexander Lobakin's avatar
      MIPS: relocatable: optimize the relocation process · d9e84fb1
      Alexander Lobakin authored
      For now, vmlinux relocation functions for relocatable kernel are
      implemented as an array of handlers of a particular type.
      
      Convert that array into a single switch-case function to:
       - remove unused arguments;
       - change the return type of simple handlers to void;
       - remove the array and don't use any data at all;
       - avoid using indirect calls;
       - allow the compiler to inline and greatly optimize
         the relocation function[s];
      
      and also mark do_relocations() and show_kernel_relocation() static
      as they aren't used anywhere else.
      
      The result on MIPS32 R2 with GCC 10.2 -O2 is:
      
      scripts/bloat-o-meter -c arch/mips/kernel/__relocate.o arch/mips/kernel/relocate.o
      add/remove: 0/6 grow/shrink: 1/0 up/down: 356/-640 (-284)
      Function                                     old     new   delta
      relocate_kernel                              852    1208    +356
      apply_r_mips_32_rel                           20       -     -20
      apply_r_mips_hi16_rel                         40       -     -40
      apply_r_mips_64_rel                           44       -     -44
      apply_r_mips_26_rel                          144       -    -144
      show_kernel_relocation                       164       -    -164
      do_relocations                               228       -    -228
      Total: Before=1780, After=1496, chg -15.96%
      add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-76 (-76)
      Data                                         old     new   delta
      reloc_handlers_rel                            76       -     -76
      Total: Before=92, After=16, chg -82.61%
      add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
      RO Data                                      old     new   delta
      Total: Before=0, After=0, chg +0.00%
      
      All functions were collapsed into the main one, relocate_kernel().
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      d9e84fb1
    • Alexander Lobakin's avatar
      MIPS: module: optimize module relocations processing · 049a68ef
      Alexander Lobakin authored
      For now, module relocation functions are implemented as an array
      of handlers of type reloc_handler_t.
      
      Convert that array into a single switch-case function to:
       - remove unused arguments;
       - change the return type of simple handlers to void;
       - remove the array and don't use any data at all;
       - avoid using indirect calls;
       - allow the compiler to inline and greatly optimize
         the relocation function[s].
      
      The result on MIPS32 R2 with GCC 10.2 -O2 is:
      
      scripts/bloat-o-meter -c arch/mips/kernel/__module.o arch/mips/kernel/module.o
      add/remove: 1/11 grow/shrink: 1/0 up/down: 876/-1436 (-560)
      Function                                     old     new   delta
      apply_relocate                               456    1148    +692
      apply_r_mips_pc                                -     184    +184
      apply_r_mips_none                              8       -      -8
      apply_r_mips_32                               16       -     -16
      apply_r_mips_64                               76       -     -76
      apply_r_mips_highest                          88       -     -88
      apply_r_mips_higher                          108       -    -108
      apply_r_mips_26                              132       -    -132
      apply_r_mips_pc26                            160       -    -160
      apply_r_mips_pc21                            160       -    -160
      apply_r_mips_pc16                            160       -    -160
      apply_r_mips_hi16                            172       -    -172
      apply_r_mips_lo16                            356       -    -356
      Total: Before=2608, After=2048, chg -21.47%
      add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
      Data                                         old     new   delta
      Total: Before=12, After=12, chg +0.00%
      add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-248 (-248)
      RO Data                                      old     new   delta
      reloc_handlers                               248       -    -248
      Total: Before=248, After=0, chg -100.00%
      
      All functions were collapsed into a single one that is called
      directly by $(srctree)/kernel/module.c.
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      049a68ef
    • Nathan Chancellor's avatar
      MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target=' · 76d7fff2
      Nathan Chancellor authored
      Commit ee67855e ("MIPS: vdso: Allow clang's --target flag in VDSO
      cflags") allowed the '--target=' flag from the main Makefile to filter
      through to the vDSO. However, it did not bring any of the other clang
      specific flags for controlling the integrated assembler and the GNU
      tools locations (--prefix=, --gcc-toolchain=, and -no-integrated-as).
      Without these, we will get a warning (visible with tinyconfig):
      
      arch/mips/vdso/elf.S:14:1: warning: DWARF2 only supports one section per
      compilation unit
      .pushsection .note.Linux, "a",@note ; .balign 4 ; .long 2f - 1f ; .long
      4484f - 3f ; .long 0 ; 1:.asciz "Linux" ; 2:.balign 4 ; 3:
      ^
      arch/mips/vdso/elf.S:34:2: warning: DWARF2 only supports one section per
      compilation unit
       .section .mips_abiflags, "a"
       ^
      
      All of these flags are bundled up under CLANG_FLAGS in the main Makefile
      and exported so that they can be added to Makefiles that set their own
      CFLAGS. Use this value instead of filtering out '--target=' so there is
      no warning and all of the tools are properly used.
      
      Cc: stable@vger.kernel.org
      Fixes: ee67855e ("MIPS: vdso: Allow clang's --target flag in VDSO cflags")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1256Reported-by: default avatarAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Tested-by: default avatarAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      76d7fff2
    • Paul Cercueil's avatar
      MIPS: Ingenic: Disable HPTLB for D0 XBurst CPUs too · a5360958
      Paul Cercueil authored
      The JZ4760 has the HPTLB as well, but has a XBurst CPU with a D0 CPUID.
      
      Disable the HPTLB for all XBurst CPUs with a D0 CPUID. In the case where
      there is no HPTLB (e.g. for older SoCs), this won't have any side
      effect.
      
      Fixes: b02efeb0 ("MIPS: Ingenic: Disable abandoned HPTLB function.")
      Cc: <stable@vger.kernel.org> # 5.4
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Reviewed-by: default avatar周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      a5360958
  9. 15 Jan, 2021 1 commit
    • Aurelien Jarno's avatar
      MIPS: Support binutils configured with --enable-mips-fix-loongson3-llsc=yes · 5373ae67
      Aurelien Jarno authored
      From version 2.35, binutils can be configured with
      --enable-mips-fix-loongson3-llsc=yes, which means it defaults to
      -mfix-loongson3-llsc. This breaks labels which might then point at the
      wrong instruction.
      
      The workaround to explicitly pass -mno-fix-loongson3-llsc has been
      added in Linux version 5.1, but is only enabled when building a Loongson
      64 kernel. As vendors might use a common toolchain for building Loongson
      and non-Loongson kernels, just move that workaround to
      arch/mips/Makefile. At the same time update the comments to reflect the
      current status.
      
      Cc: stable@vger.kernel.org # 5.1+
      Cc: YunQiang Su <syq@debian.org>
      Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      5373ae67