23 Jun, 2016

5 commits

  • Herbert wants the sha1-mb algorithm to have an async implementation:
    https://lkml.org/lkml/2016/4/5/286.
    Currently, sha1-mb uses an async interface for the outer algorithm
    and a sync interface for the inner algorithm. This patch introduces
    a async interface for even the inner algorithm.

    Signed-off-by: Megha Dey
    Signed-off-by: Tim Chen
    Signed-off-by: Herbert Xu

    Megha Dey
     
  • This patch fixes an old bug where requests can be reordered because
    some are processed by cryptd while others are processed directly
    in softirq context.

    The fix is to always postpone to cryptd if there are currently
    requests outstanding from the same tfm.

    This patch also removes the redundant use of cryptd in the async
    init function as init never touches the FPU.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch fixes an old bug where requests can be reordered because
    some are processed by cryptd while others are processed directly
    in softirq context.

    The fix is to always postpone to cryptd if there are currently
    requests outstanding from the same tfm.

    This patch also removes the redundant use of cryptd in the async
    init function as init never touches the FPU.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch fixes an old bug where gcm requests can be reordered
    because some are processed by cryptd while others are processed
    directly in softirq context.

    The fix is to always postpone to cryptd if there are currently
    requests outstanding from the same tfm.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • On 16-byte requests the optimised version is actually slower than
    the generic code, so we should simply use that instead.

    Signed-off-by: Herbert Xu

    Cheers,

    Herbert Xu
     

07 Jun, 2016

1 commit


02 Jun, 2016

1 commit

  • Currently there are several checkpatch warnings in the sha1_mb.c file:
    'WARNING: line over 80 characters' in the sha1_mb.c file. Also, the
    syntax of some multi-line comments are not correct. This patch fixes
    these issues.

    Signed-off-by: Megha Dey
    Signed-off-by: Herbert Xu

    Megha Dey
     

31 May, 2016

5 commits


29 May, 2016

6 commits

  • Pull more MIPS updates from Ralf Baechle:
    "This is the secondnd batch of MIPS patches for 4.7. Summary:

    CPS:
    - Copy EVA configuration when starting secondary VPs.

    EIC:
    - Clear Status IPL.

    Lasat:
    - Fix a few off by one bugs.

    lib:
    - Mark intrinsics notrace. Not only are the intrinsics
    uninteresting, it would cause infinite recursion.

    MAINTAINERS:
    - Add file patterns for MIPS BRCM device tree bindings.
    - Add file patterns for mips device tree bindings.

    MT7628:
    - Fix MT7628 pinmux typos.
    - wled_an pinmux gpio.
    - EPHY LEDs pinmux support.

    Pistachio:
    - Enable KASLR

    VDSO:
    - Build microMIPS VDSO for microMIPS kernels.
    - Fix aliasing warning by building with `-fno-strict-aliasing' for
    debugging but also tracing them might result in recursion.

    Misc:
    - Add missing FROZEN hotplug notifier transitions.
    - Fix clk binding example for varioius PIC32 devices.
    - Fix cpu interrupt controller node-names in the DT files.
    - Fix XPA CPU feature separation.
    - Fix write_gc0_* macros when writing zero.
    - Add inline asm encoding helpers.
    - Add missing VZ accessor microMIPS encodings.
    - Fix little endian microMIPS MSA encodings.
    - Add 64-bit HTW fields and fix its configuration.
    - Fix sigreturn via VDSO on microMIPS kernel.
    - Lots of typo fixes.
    - Add definitions of SegCtl registers and use them"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (49 commits)
    MIPS: Add missing FROZEN hotplug notifier transitions
    MIPS: Build microMIPS VDSO for microMIPS kernels
    MIPS: Fix sigreturn via VDSO on microMIPS kernel
    MIPS: devicetree: fix cpu interrupt controller node-names
    MIPS: VDSO: Build with `-fno-strict-aliasing'
    MIPS: Pistachio: Enable KASLR
    MIPS: lib: Mark intrinsics notrace
    MIPS: Fix 64-bit HTW configuration
    MIPS: Add 64-bit HTW fields
    MAINTAINERS: Add file patterns for mips device tree bindings
    MAINTAINERS: Add file patterns for mips brcm device tree bindings
    MIPS: Simplify DSP instruction encoding macros
    MIPS: Add missing tlbinvf/XPA microMIPS encodings
    MIPS: Fix little endian microMIPS MSA encodings
    MIPS: Add missing VZ accessor microMIPS encodings
    MIPS: Add inline asm encoding helpers
    MIPS: Spelling fix lets -> let's
    MIPS: VR41xx: Fix typo
    MIPS: oprofile: Fix typo
    MIPS: math-emu: Fix typo
    ...

    Linus Torvalds
     
  • Pull string hash improvements from George Spelvin:
    "This series does several related things:

    - Makes the dcache hash (fs/namei.c) useful for general kernel use.

    (Thanks to Bruce for noticing the zero-length corner case)

    - Converts the string hashes in to use the
    above.

    - Avoids 64-bit multiplies in hash_64() on 32-bit platforms. Two
    32-bit multiplies will do well enough.

    - Rids the world of the bad hash multipliers in hash_32.

    This finishes the job started in commit 689de1d6ca95 ("Minimal
    fix-up of bad hashing behavior of hash_64()")

    The vast majority of Linux architectures have hardware support for
    32x32-bit multiply and so derive no benefit from "simplified"
    multipliers.

    The few processors that do not (68000, h8/300 and some models of
    Microblaze) have arch-specific implementations added. Those
    patches are last in the series.

    - Overhauls the dcache hash mixing.

    The patch in commit 0fed3ac866ea ("namei: Improve hash mixing if
    CONFIG_DCACHE_WORD_ACCESS") was an off-the-cuff suggestion.
    Replaced with a much more careful design that's simultaneously
    faster and better. (My own invention, as there was noting suitable
    in the literature I could find. Comments welcome!)

    - Modify the hash_name() loop to skip the initial HASH_MIX(). This
    would let us salt the hash if we ever wanted to.

    - Sort out partial_name_hash().

    The hash function is declared as using a long state, even though
    it's truncated to 32 bits at the end and the extra internal state
    contributes nothing to the result. And some callers do odd things:

    - fs/hfs/string.c only allocates 32 bits of state
    - fs/hfsplus/unicode.c uses it to hash 16-bit unicode symbols not bytes

    - Modify bytemask_from_count to handle inputs of 1..sizeof(long)
    rather than 0..sizeof(long)-1. This would simplify users other
    than full_name_hash"

    Special thanks to Bruce Fields for testing and finding bugs in v1. (I
    learned some humbling lessons about "obviously correct" code.)

    On the arch-specific front, the m68k assembly has been tested in a
    standalone test harness, I've been in contact with the Microblaze
    maintainers who mostly don't care, as the hardware multiplier is never
    omitted in real-world applications, and I haven't heard anything from
    the H8/300 world"

    * 'hash' of git://ftp.sciencehorizons.net/linux:
    h8300: Add
    microblaze: Add
    m68k: Add
    : Add support for architecture-specific functions
    fs/namei.c: Improve dcache hash function
    Eliminate bad hash multipliers from hash_32() and hash_64()
    Change hash_64() return value to 32 bits
    : Define hash_str() in terms of hashlen_string()
    fs/namei.c: Add hashlen_string() function
    Pull out string hash to

    Linus Torvalds
     
  • 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: George Spelvin
    Cc: Yoshinori Sato
    Cc: uclinux-h8-devel@lists.sourceforge.jp

    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: George Spelvin
    Cc: Alistair Francis
    Cc: Michal Simek

    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.html

    Signed-off-by: George Spelvin
    Cc: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc: Andreas Schwab
    Cc: Philippe De Muyter
    Cc: linux-m68k@lists.linux-m68k.org

    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 .

    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: George Spelvin
    Cc: Geert Uytterhoeven
    Cc: Greg Ungerer
    Cc: Andreas Schwab
    Cc: Philippe De Muyter
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: Alistair Francis
    Cc: Michal Simek
    Cc: Yoshinori Sato
    Cc: uclinux-h8-devel@lists.sourceforge.jp

    George Spelvin
     

28 May, 2016

22 commits

  • 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: Anna-Maria Gleixner
    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: Ralf Baechle

    Anna-Maria Gleixner
     
  • 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: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
    Signed-off-by: James Hogan
    Cc: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: # 4.4.x-
    Patchwork: https://patchwork.linux-mips.org/patch/13349/
    Signed-off-by: Ralf Baechle

    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 ebb5e78cc634 ("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: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
    Signed-off-by: James Hogan
    Cc: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: # 4.4.x-
    Patchwork: https://patchwork.linux-mips.org/patch/13348/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • 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: Antony Pavlov
    Cc: Paul Burton
    Cc: Zubair Lutfullah Kakakhel
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    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: Rob Herring
    Signed-off-by: Ralf Baechle

    Antony Pavlov
     
  • 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 ebb5e78cc634 ("MIPS: Initial implementation of a VDSO").

    Thanks to Tejun for diagnosing this properly!

    Signed-off-by: Maciej W. Rozycki
    Reviewed-by: James Hogan
    Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
    Cc: Tejun Heo
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org # v4.3+
    Patchwork: https://patchwork.linux-mips.org/patch/13357/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     
  • Allow KASLR to be selected on Pistachio based systems. Tested on a
    Creator Ci40.

    Signed-off-by: Matt Redfearn
    Reviewed-by: James Hogan
    Cc: Andrew Bresticker
    Cc: Jonas Gorski
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13356/
    Signed-off-by: Ralf Baechle

    Matt Redfearn
     
  • 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: Harvey Hunt
    Cc:
    Cc:
    Cc: # 4.2.x-
    Patchwork: https://patchwork.linux-mips.org/patch/13354/
    Signed-off-by: Ralf Baechle

    Harvey Hunt
     
  • 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: cab25bc7537b ("MIPS: Extend hardware table walking support to MIPS64")
    Signed-off-by: James Hogan
    Cc: Paul Burton
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13364/
    Signed-off-by: Ralf Baechle

    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: James Hogan
    Cc: Paul Burton
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13363/
    Signed-off-by: Ralf Baechle

    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: James Hogan
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13314/
    Signed-off-by: Ralf Baechle

    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: James Hogan
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13313/
    Signed-off-by: Ralf Baechle

    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: d96cc3d1ec5d ("MIPS: Add microMIPS MSA support.")
    Signed-off-by: James Hogan
    Cc: Paul Burton
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13312/
    Signed-off-by: Ralf Baechle

    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: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13311/
    Signed-off-by: Ralf Baechle

    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: James Hogan
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13310/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • As noticed by Sergei in the discussion of Andrea Gelmini's patch series.

    Signed-off-by: Ralf Baechle
    Reported-by: Sergei Shtylyov

    Ralf Baechle
     
  • Signed-off-by: Andrea Gelmini
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13338/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: rric@kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: trivial@kernel.org
    Cc: oprofile-list@lists.sf.net
    Patchwork: https://patchwork.linux-mips.org/patch/13334/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: macro@imgtec.com
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13333/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13331/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: paul.burton@imgtec.com
    Cc: macro@imgtec.com
    Cc: james.hogan@imgtec.com
    Cc: jslaby@suse.cz
    Cc: adam.buchbinder@gmail.com
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13330/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: macro@imgtec.com
    Cc: paul.burton@imgtec.com
    Cc: Leonid.Yegoshin@imgtec.com
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13329/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini
     
  • Signed-off-by: Andrea Gelmini
    Cc: adam.buchbinder@gmail.com
    Cc: trivial@kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13328/
    Signed-off-by: Ralf Baechle

    Andrea Gelmini