Skip to content
  1. Jun 11, 2016
  2. Jun 10, 2016
  3. Jun 09, 2016
  4. Jun 06, 2016
  5. May 29, 2016
    • George Spelvin's avatar
      h8300: Add <asm/hash.h> · 4684fe95
      George Spelvin authored
      
      
      This will improve the performance of hash_32() and hash_64(), but due
      to complete lack of multi-bit shift instructions on H8, performance will
      still be bad in surrounding code.
      
      Designing H8-specific hash algorithms to work around that is a separate
      project.  (But if the maintainers would like to get in touch...)
      
      Signed-off-by: default avatarGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      4684fe95
    • George Spelvin's avatar
      microblaze: Add <asm/hash.h> · 7b13277b
      George Spelvin authored
      
      
      Microblaze is an FPGA soft core that can be configured various ways.
      
      If it is configured without a multiplier, the standard __hash_32()
      will require a call to __mulsi3, which is a slow software loop.
      
      Instead, use a shift-and-add sequence for the constant multiply.
      GCC knows how to do this, but it's not as clever as some.
      
      Signed-off-by: default avatarGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      7b13277b
    • George Spelvin's avatar
      m68k: Add <asm/hash.h> · 14c44b95
      George Spelvin authored
      This provides a multiply by constant GOLDEN_RATIO_32 = 0x61C88647
      for the original mc68000, which lacks a 32x32-bit multiply instruction.
      
      Yes, the amount of optimization effort put in is excessive. :-)
      
      Shift-add chain found by Yevgen Voronenko's Hcub algorithm at
      http://spiral.ece.cmu.edu/mcm/gen.html
      
      
      
      Signed-off-by: default avatarGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Philippe De Muyter <phdm@macq.eu>
      Cc: linux-m68k@lists.linux-m68k.org
      14c44b95
    • George Spelvin's avatar
      <linux/hash.h>: Add support for architecture-specific functions · 468a9428
      George Spelvin authored
      
      
      This is just the infrastructure; there are no users yet.
      
      This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
      the existence of <asm/hash.h>.
      
      That file may define its own versions of various functions, and define
      HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.
      
      Included is a self-test (in lib/test_hash.c) that verifies the basics.
      It is NOT in general required that the arch-specific functions compute
      the same thing as the generic, but if a HAVE_* symbol is defined with
      the value 1, then equality is tested.
      
      Signed-off-by: default avatarGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Philippe De Muyter <phdm@macq.eu>
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: Alistair Francis <alistai@xilinx.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      468a9428
  6. May 28, 2016
    • Anna-Maria Gleixner's avatar
      MIPS: Add missing FROZEN hotplug notifier transitions · a8c5ddf0
      Anna-Maria Gleixner authored
      
      
      The corresponding FROZEN hotplug notifier transitions used on
      suspend/resume are ignored. Therefore the switch case action argument
      is masked with the frozen hotplug notifier transition mask.
      
      Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: rt@linutronix.de
      Patchwork: https://patchwork.linux-mips.org/patch/13351/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      a8c5ddf0
    • James Hogan's avatar
      MIPS: Build microMIPS VDSO for microMIPS kernels · bb93078e
      James Hogan authored
      MicroMIPS kernels may be expected to run on microMIPS only cores which
      don't support the normal MIPS instruction set, so be sure to pass the
      -mmicromips flag through to the VDSO cflags.
      
      Fixes: ebb5e78c
      
       ("MIPS: Initial implementation of a VDSO")
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 4.4.x-
      Patchwork: https://patchwork.linux-mips.org/patch/13349/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      bb93078e
    • James Hogan's avatar
      MIPS: Fix sigreturn via VDSO on microMIPS kernel · 13eb192d
      James Hogan authored
      In microMIPS kernels, handle_signal() sets the isa16 mode bit in the
      vdso address so that the sigreturn trampolines (which are offset from
      the VDSO) get executed as microMIPS.
      
      However commit ebb5e78c ("MIPS: Initial implementation of a VDSO")
      changed the offsets to come from the VDSO image, which already have the
      isa16 mode bit set correctly since they're extracted from the VDSO
      shared library symbol table.
      
      Drop the isa16 mode bit handling from handle_signal() to fix sigreturn
      for cores which support both microMIPS and normal MIPS. This doesn't fix
      microMIPS only cores, since the VDSO is still built for normal MIPS, but
      thats a separate problem.
      
      Fixes: ebb5e78c
      
       ("MIPS: Initial implementation of a VDSO")
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 4.4.x-
      Patchwork: https://patchwork.linux-mips.org/patch/13348/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      13eb192d
    • Antony Pavlov's avatar
      MIPS: devicetree: fix cpu interrupt controller node-names · 5214cae7
      Antony Pavlov authored
      
      
      Here is the quote from [1]:
      
          The unit-address must match the first address specified
          in the reg property of the node. If the node has no reg property,
          the @ and unit-address must be omitted and the node-name alone
          differentiates the node from other nodes at the same level
      
      This patch adjusts MIPS dts-files and devicetree binding
      documentation in accordance with [1].
      
          [1] Power.org(tm) Standard for Embedded Power Architecture(tm)
              Platform Requirements (ePAPR). Version 1.1 – 08 April 2011.
              Chapter 2.2.1.1 Node Name Requirements
      
      Signed-off-by: default avatarAntony Pavlov <antonynpavlov@gmail.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Kumar Gala <galak@codeaurora.org>
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/13345/
      
      
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5214cae7
    • Maciej W. Rozycki's avatar
      MIPS: VDSO: Build with `-fno-strict-aliasing' · 94cc36b8
      Maciej W. Rozycki authored
      Avoid an aliasing issue causing a build error in VDSO:
      
      In file included from include/linux/srcu.h:34:0,
                       from include/linux/notifier.h:15,
                       from ./arch/mips/include/asm/uprobes.h:9,
                       from include/linux/uprobes.h:61,
                       from include/linux/mm_types.h:13,
                       from ./arch/mips/include/asm/vdso.h:14,
                       from arch/mips/vdso/vdso.h:27,
                       from arch/mips/vdso/gettimeofday.c:11:
      include/linux/workqueue.h: In function 'work_static':
      include/linux/workqueue.h:186:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
        return *work_data_bits(work) & WORK_STRUCT_STATIC;
        ^
      cc1: all warnings being treated as errors
      make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1
      
      with a CONFIG_DEBUG_OBJECTS_WORK configuration and GCC 5.2.0.  Include
      `-fno-strict-aliasing' along with compiler options used, as required for
      kernel code, fixing a problem present since the introduction of VDSO
      with commit ebb5e78c
      
       ("MIPS: Initial implementation of a VDSO").
      
      Thanks to Tejun for diagnosing this properly!
      
      Signed-off-by: default avatarMaciej W. Rozycki <macro@imgtec.com>
      Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Fixes: ebb5e78c ("MIPS: Initial implementation of a VDSO")
      Cc: Tejun Heo <tj@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org # v4.3+
      Patchwork: https://patchwork.linux-mips.org/patch/13357/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      94cc36b8
    • Matt Redfearn's avatar
      MIPS: Pistachio: Enable KASLR · 41cc07be
      Matt Redfearn authored
      
      
      Allow KASLR to be selected on Pistachio based systems. Tested on a
      Creator Ci40.
      
      Signed-off-by: default avatarMatt Redfearn <matt.redfearn@imgtec.com>
      Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Jonas Gorski <jogo@openwrt.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13356/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      41cc07be
    • Harvey Hunt's avatar
      MIPS: lib: Mark intrinsics notrace · aedcfbe0
      Harvey Hunt authored
      
      
      On certain MIPS32 devices, the ftrace tracer "function_graph" uses
      __lshrdi3() during the capturing of trace data. ftrace then attempts to
      trace __lshrdi3() which leads to infinite recursion and a stack overflow.
      Fix this by marking __lshrdi3() as notrace. Mark the other compiler
      intrinsics as notrace in case the compiler decides to use them in the
      ftrace path.
      
      Signed-off-by: default avatarHarvey Hunt <harvey.hunt@imgtec.com>
      Cc: <linux-mips@linux-mips.org>
      Cc: <linux-kernel@vger.kernel.org>
      Cc: <stable@vger.kernel.org> # 4.2.x-
      Patchwork: https://patchwork.linux-mips.org/patch/13354/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      aedcfbe0
    • James Hogan's avatar
      MIPS: Fix 64-bit HTW configuration · aa76042a
      James Hogan authored
      The Hardware page Table Walker (HTW) is being misconfigured on 64-bit
      kernels. The PWSize.PS (pointer size) bit determines whether pointers
      within directories are loaded as 32-bit or 64-bit addresses, but was
      never being set to 1 for 64-bit kernels where the unsigned long in pgd_t
      is 64-bits wide.
      
      This actually reduces rather than improves performance when the HTW is
      enabled on P6600 since the HTW is initiated lots, but walks are all
      aborted due I think to bad intermediate pointers.
      
      Since we were already taking the width of the PTEs into account by
      setting PWSize.PTEW, which is the left shift applied to the page table
      index *in addition to* the native pointer size, we also need to reduce
      PTEW by 1 when PS=1. This is done by calculating PTEW based on the
      relative size of pte_t compared to pgd_t.
      
      Finally in order for the HTW to be used when PS=1, the appropriate
      XK/XS/XU bits corresponding to the different 64-bit segments need to be
      set in PWCtl. We enable only XU for now to enable walking for XUSeg.
      
      Supporting walking for XKSeg would be a bit more involved so is left for
      a future patch. It would either require the use of a per-CPU top level
      base directory if supported by the HTW (a bit like pgd_current but with
      a second entry pointing at swapper_pg_dir), or the HTW would prepend bit
      63 of the address to the global directory index which doesn't really
      match how we split user and kernel page directories.
      
      Fixes: cab25bc7
      
       ("MIPS: Extend hardware table walking support to MIPS64")
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13364/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      aa76042a
    • James Hogan's avatar
      MIPS: Add 64-bit HTW fields · 6446e6cf
      James Hogan authored
      
      
      Add field definitions for some of the 64-bit specific Hardware page
      Table Walker (HTW) register fields in PWSize and PWCtl, in preparation
      for fixing the 64-bit HTW configuration.
      
      Also print these fields out along with the others in print_htw_config().
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13363/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      6446e6cf
    • James Hogan's avatar
      MIPS: Simplify DSP instruction encoding macros · 5aadab0c
      James Hogan authored
      
      
      Simplify the DSP instruction wrapper macros which use explicit encodings
      for microMIPS and normal MIPS by using the new encoding macros and
      removing duplication.
      
      To me this makes it easier to read since it is much shorter, but it also
      ensures .insn is used, preventing objdump disassembling the microMIPS
      code as normal MIPS.
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13314/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5aadab0c
    • James Hogan's avatar
      MIPS: Add missing tlbinvf/XPA microMIPS encodings · c84700cc
      James Hogan authored
      
      
      Hardcoded MIPS instruction encodings are provided for tlbinvf, mfhc0 &
      mthc0 instructions, but microMIPS encodings are missing. I doubt any
      microMIPS cores exist at present which support these instructions, but
      the microMIPS encodings exist, and microMIPS cores may support them in
      the future. Add the missing microMIPS encodings using the new macros.
      
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13313/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      c84700cc