1. 23 6月, 2016 2 次提交
    • T
      ARM: OMAP4+: Prevent CPU1 related hang with kexec · 0573b957
      Tony Lindgren 提交于
      Kexec booted kernels on omap4 will hang early during the boot if the
      booted kernel is different version from the previous kernel.
      
      This is because the previous kernel may have configured low-power mode
      using CPU1_WAKEUP_NS_PA_ADDR. In that case it points to the previous
      kernel's omap4_secondary_startup(), and CPU1 can be in low power mode
      from the previous kernel. When the new kernel configures the CPU1
      clockdomain, CPU1 can wake from low power state prematurely during
      omap44xx_clockdomains_init() running random code.
      
      Let's fix the issue by configuring CPU1_WAKEUP_NS_PA_ADDR before we
      call omap44xx_clockdomains_init(). Note that this is very early during
      the init, and we will do proper CPU1 reset during SMP init a bit later
      on in omap4_smp_prepare_cpus(). And we need to do this when SMP is
      not enabled as the previous kernel may have had it enabled.
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      0573b957
    • T
      ARM: OMAP4+: Initialize SAR RAM base early for proper CPU1 reset for kexec · f4b9f40a
      Tony Lindgren 提交于
      Prepare things for making kexec work on SMP omap variants by initializing
      SARM RAM base early. This allows us to configure CPU1 for kexec in case
      the previous kernel has put CPU1 in low power mode.
      
      Note that this should not prevent moving other SAR RAM code to live
      under drivers. However for kexec, we will need this very early.
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      f4b9f40a
  2. 22 6月, 2016 3 次提交
  3. 10 6月, 2016 14 次提交
  4. 03 6月, 2016 3 次提交
  5. 29 5月, 2016 4 次提交
    • G
      h8300: Add <asm/hash.h> · 4684fe95
      George Spelvin 提交于
      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: NGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      4684fe95
    • G
      microblaze: Add <asm/hash.h> · 7b13277b
      George Spelvin 提交于
      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: NGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      7b13277b
    • G
      m68k: Add <asm/hash.h> · 14c44b95
      George Spelvin 提交于
      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.htmlSigned-off-by: NGeorge 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
    • G
      <linux/hash.h>: Add support for architecture-specific functions · 468a9428
      George Spelvin 提交于
      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: NGeorge 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. 28 5月, 2016 14 次提交
    • A
      MIPS: Add missing FROZEN hotplug notifier transitions · a8c5ddf0
      Anna-Maria Gleixner 提交于
      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: NAnna-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: NRalf Baechle <ralf@linux-mips.org>
      a8c5ddf0
    • J
      MIPS: Build microMIPS VDSO for microMIPS kernels · bb93078e
      James Hogan 提交于
      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: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      bb93078e
    • J
      MIPS: Fix sigreturn via VDSO on microMIPS kernel · 13eb192d
      James Hogan 提交于
      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: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      13eb192d
    • A
      MIPS: devicetree: fix cpu interrupt controller node-names · 5214cae7
      Antony Pavlov 提交于
      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: NAntony 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: NRob Herring <robh@kernel.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5214cae7
    • M
      MIPS: VDSO: Build with `-fno-strict-aliasing' · 94cc36b8
      Maciej W. Rozycki 提交于
      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: NMaciej W. Rozycki <macro@imgtec.com>
      Reviewed-by: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      94cc36b8
    • M
      MIPS: Pistachio: Enable KASLR · 41cc07be
      Matt Redfearn 提交于
      Allow KASLR to be selected on Pistachio based systems. Tested on a
      Creator Ci40.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Reviewed-by: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      41cc07be
    • H
      MIPS: lib: Mark intrinsics notrace · aedcfbe0
      Harvey Hunt 提交于
      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: NHarvey 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: NRalf Baechle <ralf@linux-mips.org>
      aedcfbe0
    • J
      MIPS: Fix 64-bit HTW configuration · aa76042a
      James Hogan 提交于
      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: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      aa76042a
    • J
      MIPS: Add 64-bit HTW fields · 6446e6cf
      James Hogan 提交于
      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: NJames 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: NRalf Baechle <ralf@linux-mips.org>
      6446e6cf
    • J
      MIPS: Simplify DSP instruction encoding macros · 5aadab0c
      James Hogan 提交于
      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: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13314/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5aadab0c
    • J
      MIPS: Add missing tlbinvf/XPA microMIPS encodings · c84700cc
      James Hogan 提交于
      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: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13313/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c84700cc
    • J
      MIPS: Fix little endian microMIPS MSA encodings · 6e1b29c3
      James Hogan 提交于
      When the toolchain doesn't support MSA we encode MSA instructions
      explicitly in assembly. Unfortunately we use .word for both MIPS and
      microMIPS encodings which is wrong, since 32-bit microMIPS instructions
      are made up from a pair of halfwords.
      
      - The most significant halfword always comes first, so for little endian
        builds the halves will be emitted in the wrong order.
      
      - 32-bit alignment isn't guaranteed, so the assembler may insert a
        16-bit nop instruction to pad the instruction stream to a 32-bit
        boundary.
      
      Use the new instruction encoding macros to encode microMIPS MSA
      instructions correctly.
      
      Fixes: d96cc3d1 ("MIPS: Add microMIPS MSA support.")
      Signed-off-by: NJames 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/13312/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6e1b29c3
    • J
      MIPS: Add missing VZ accessor microMIPS encodings · 1c48a177
      James Hogan 提交于
      Toolchains may be used which support microMIPS but not VZ instructions
      (i.e. binutis 2.22 & 2.23), so extend the explicitly encoded versions of
      the guest COP0 register & guest TLB access macros to support microMIPS
      encodings too, using the new macros.
      
      This prevents non-microMIPS instructions being executed in microMIPS
      mode during CPU probe on cores supporting VZ (e.g. M5150), which cause
      reserved instruction exceptions early during boot.
      
      Fixes: bad50d79 ("MIPS: Fix VZ probe gas errors with binutils <2.24")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13311/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1c48a177
    • J
      MIPS: Add inline asm encoding helpers · 0dfa1c12
      James Hogan 提交于
      To allow simplification of macros which use inline assembly to
      explicitly encode instructions, add a few simple abstractions to
      mipsregs.h which expand to specific microMIPS or normal MIPS encodings
      depending on what type of kernel is being built:
      
      _ASM_INSN_IF_MIPS(_enc) : Emit a 32bit MIPS instruction if microMIPS is
                                not enabled.
      _ASM_INSN32_IF_MM(_enc) : Emit a 32bit microMIPS instruction if enabled.
      _ASM_INSN16_IF_MM(_enc) : Emit a 16bit microMIPS instruction if enabled.
      
      The macros can be used one after another since the MIPS / microMIPS
      macros are mutually exclusive, for example:
      
      __asm__ __volatile__(
              ".set push\n\t"
              ".set noat\n\t"
              "# mfgc0 $1, $%1, %2\n\t"
              _ASM_INSN_IF_MIPS(0x40610000 | %1 << 11 | %2)
              _ASM_INSN32_IF_MM(0x002004fc | %1 << 16 | %2 << 11)
              "move %0, $1\n\t"
              ".set pop"
              : "=r" (__res)
              : "i" (source), "i" (sel));
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13310/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0dfa1c12