11 Jan, 2020

1 commit

  • The FIELD_SIZEOF() macro was redundant, and is being removed from the
    kernel. Since commit c593642c8be0 ("treewide: Use sizeof_field() macro")
    this is one of the last users of the old macro, so replace it.

    Signed-off-by: Kees Cook
    Signed-off-by: Paul Burton
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@vger.kernel.org

    Kees Cook
     

10 Jan, 2020

1 commit

  • Commit 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32
    architecture.") enabled our eBPF JIT for MIPS32 kernels, whereas it has
    previously only been availailable for MIPS64. It was my understanding at
    the time that the BPF test suite was passing & JITing a comparable
    number of tests to our cBPF JIT [1], but it turns out that was not the
    case.

    The eBPF JIT has a number of problems on MIPS32:

    - Most notably various code paths still result in emission of MIPS64
    instructions which will cause reserved instruction exceptions & kernel
    panics when run on MIPS32 CPUs.

    - The eBPF JIT doesn't account for differences between the O32 ABI used
    by MIPS32 kernels versus the N64 ABI used by MIPS64 kernels. Notably
    arguments beyond the first 4 are passed on the stack in O32, and this
    is entirely unhandled when JITing a BPF_CALL instruction. Stack space
    must be reserved for arguments even if they all fit in registers, and
    the callee is free to assume that stack space has been reserved for
    its use - with the eBPF JIT this is not the case, so calling any
    function can result in clobbering values on the stack & unpredictable
    behaviour. Function arguments in eBPF are always 64-bit values which
    is also entirely unhandled - the JIT still uses a single (32-bit)
    register per argument. As a result all function arguments are always
    passed incorrectly when JITing a BPF_CALL instruction, leading to
    kernel crashes or strange behavior.

    - The JIT attempts to bail our on use of ALU64 instructions or 64-bit
    memory access instructions. The code doing this at the start of
    build_one_insn() incorrectly checks whether BPF_OP() equals BPF_DW,
    when it should really be checking BPF_SIZE() & only doing so when
    BPF_CLASS() is one of BPF_{LD,LDX,ST,STX}. This results in false
    positives that cause more bailouts than intended, and that in turns
    hides some of the problems described above.

    - The kernel's cBPF->eBPF translation makes heavy use of 64-bit eBPF
    instructions that the MIPS32 eBPF JIT bails out on, leading to most
    cBPF programs not being JITed at all.

    Until these problems are resolved, revert the removal of the cBPF JIT
    performed by commit 716850ab104d ("MIPS: eBPF: Initial eBPF support for
    MIPS32 architecture."). Together with commit f8fffebdea75 ("MIPS: BPF:
    Disable MIPS32 eBPF JIT") this restores MIPS32 BPF JIT behavior back to
    the same state it was prior to the introduction of the broken eBPF JIT
    support.

    [1] https://lore.kernel.org/linux-mips/MWHPR2201MB13583388481F01A422CE7D66D4410@MWHPR2201MB1358.namprd22.prod.outlook.com/

    Signed-off-by: Paul Burton
    Fixes: 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
    Cc: Daniel Borkmann
    Cc: Hassan Naveed
    Cc: Tony Ambardar
    Cc: bpf@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org

    Paul Burton
     

05 Jan, 2020

1 commit

  • Pull MIPS fixes from Paul Burton:
    "A collection of MIPS fixes:

    - Fill the struct cacheinfo shared_cpu_map field with sensible
    values, notably avoiding issues with perf which was unhappy in the
    absence of these values.

    - A boot fix for Loongson 2E & 2F machines which was fallout from
    some refactoring performed this cycle.

    - A Kconfig dependency fix for the Loongson CPU HWMon driver.

    - A couple of VDSO fixes, ensuring gettimeofday() behaves
    appropriately for kernel configurations that don't include support
    for a clocksource the VDSO can use & fixing the calling convention
    for the n32 & n64 VDSOs which would previously clobber the $gp/$28
    register.

    - A build fix for vmlinuz compressed images which were
    inappropriately building with -fsanitize-coverage despite not being
    part of the kernel proper, then failing to link due to the missing
    __sanitizer_cov_trace_pc() function.

    - A couple of eBPF JIT fixes, including disabling it for MIPS32 due
    to a large number of issues with the code generated there &
    reflecting ISA dependencies in Kconfig to enforce that systems
    which don't support the JIT must include the interpreter"

    * tag 'mips_fixes_5.5_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
    MIPS: Avoid VDSO ABI breakage due to global register variable
    MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig
    MIPS: BPF: Disable MIPS32 eBPF JIT
    MIPS: Prevent link failure with kcov instrumentation
    MIPS: Kconfig: Use correct form for 'depends on'
    mips: Fix gettimeofday() in the vdso library
    MIPS: Fix boot on Fuloong2 systems
    mips: cacheinfo: report shared CPU map

    Linus Torvalds
     

19 Dec, 2019

1 commit

  • It is completely wrong to check for compile-time MIPS ISA revision in
    the body of bpf_int_jit_compile() as it may lead to get MIPS JIT fully
    omitted by the CC while the rest system will think that the JIT is
    actually present and works [1].
    We can check if the selected CPU really supports MIPS eBPF JIT at
    configure time and avoid such situations when kernel can be built
    without both JIT and interpreter, but with CONFIG_BPF_SYSCALL=y.

    [1] https://lore.kernel.org/linux-mips/09d713a59665d745e21d021deeaebe0a@dlink.ru/

    Fixes: 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
    Cc: # v5.2+
    Signed-off-by: Alexander Lobakin
    Signed-off-by: Paul Burton
    Cc: Ralf Baechle
    Cc: James Hogan
    Cc: Hassan Naveed
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Martin KaFai Lau
    Cc: Song Liu
    Cc: Yonghong Song
    Cc: Andrii Nakryiko
    Cc: linux-mips@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: bpf@vger.kernel.org

    Alexander Lobakin
     

11 Dec, 2019

1 commit

  • All BPF JIT compilers except RISC-V's and MIPS' enforce a 33-tail calls
    limit at runtime. In addition, a test was recently added, in tailcalls2,
    to check this limit.

    This patch updates the tail call limit in MIPS' JIT compiler to allow
    33 tail calls.

    Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.")
    Reported-by: Mahshid Khezri
    Signed-off-by: Paul Chaignon
    Signed-off-by: Daniel Borkmann
    Acked-by: Martin KaFai Lau
    Link: https://lore.kernel.org/bpf/b8eb2caac1c25453c539248e56ca22f74b5316af.1575916815.git.paul.chaignon@gmail.com

    Paul Chaignon
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 of the license

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 315 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


09 May, 2019

1 commit

  • Pull MIPS updates from Paul Burton:

    - A set of memblock initialization improvements thanks to Serge Semin,
    tidying up after our conversion from bootmem to memblock back in
    v4.20.

    - Our eBPF JIT the previously supported only MIPS64r2 through MIPS64r5
    is improved to also support MIPS64r6. Support for MIPS32 systems is
    introduced, with the caveat that it only works for programs that
    don't use 64 bit registers or operations - those will bail out & need
    to be interpreted.

    - Improvements to the allocation & configuration of our exception
    vector that should fix issues seen on some platforms using recent
    versions of U-Boot.

    - Some minor improvements to code generated for jump labels, along with
    enabling them by default for generic kernels.

    * tag 'mips_5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (27 commits)
    mips: Manually call fdt_init_reserved_mem() method
    mips: Make sure dt memory regions are valid
    mips: Perform early low memory test
    mips: Dump memblock regions for debugging
    mips: Add reserve-nomap memory type support
    mips: Use memblock to reserve the __nosave memory range
    mips: Discard post-CMA-init foreach loop
    mips: Reserve memory for the kernel image resources
    MIPS: Remove duplicate EBase configuration
    MIPS: Sync icache for whole exception vector
    MIPS: Always allocate exception vector for MIPSr2+
    MIPS: Use memblock_phys_alloc() for exception vector
    mips: Combine memblock init and memory reservation loops
    mips: Discard rudiments from bootmem_init
    mips: Make sure kernel .bss exists in boot mem pool
    mips: vdso: drop unnecessary cc-ldoption
    Revert "MIPS: ralink: fix cpu clock of mt7621 and add dt clk devices"
    MIPS: generic: Enable CONFIG_JUMP_LABEL
    MIPS: jump_label: Use compact branches for >= r6
    MIPS: jump_label: Remove redundant nops
    ...

    Linus Torvalds
     

26 Apr, 2019

1 commit

  • Fix sparse warning:

    arch/mips/net/ebpf_jit.c:196:5: warning:
    symbol 'ebpf_to_mips_reg' was not declared. Should it be static?

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Acked-by: Yonghong Song
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Alexei Starovoitov

    YueHaibing
     

20 Mar, 2019

2 commits

  • Currently MIPS32 supports a JIT for classic BPF only, not extended BPF.
    This patch adds JIT support for extended BPF on MIPS32, so code is
    actually JIT'ed instead of being only interpreted. Instructions with
    64-bit operands are not supported at this point.
    We can delete classic BPF because the kernel will translate classic BPF
    programs into extended BPF and JIT them, eliminating the need for
    classic BPF.

    Signed-off-by: Hassan Naveed
    Signed-off-by: Paul Burton
    Cc: kafai@fb.com
    Cc: songliubraving@fb.com
    Cc: yhs@fb.com
    Cc: netdev@vger.kernel.org
    Cc: bpf@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: Ralf Baechle
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: open list:MIPS
    Cc: open list

    Hassan Naveed
     
  • Currently eBPF support is available on MIPS64R2 only. Use MIPS64R6
    variants of instructions like multiply, divide, movn, movz so eBPF
    can run on the newer ISA. Also, we only need to check ISA revision
    before JIT'ing code, because we know the CPU is running a 64-bit
    kernel because eBPF JIT is only included in kernels with CONFIG_64BIT=y
    due to Kconfig dependencies.

    Signed-off-by: Hassan Naveed
    Signed-off-by: Paul Burton
    Cc: kafai@fb.com
    Cc: songliubraving@fb.com
    Cc: yhs@fb.com
    Cc: netdev@vger.kernel.org
    Cc: bpf@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: Ralf Baechle
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: open list:MIPS
    Cc: open list

    Hassan Naveed
     

02 Mar, 2019

1 commit

  • The MIPS eBPF JIT calls flush_icache_range() in order to ensure the
    icache observes the code that we just wrote. Unfortunately it gets the
    end address calculation wrong due to some bad pointer arithmetic.

    The struct jit_ctx target field is of type pointer to u32, and as such
    adding one to it will increment the address being pointed to by 4 bytes.
    Therefore in order to find the address of the end of the code we simply
    need to add the number of 4 byte instructions emitted, but we mistakenly
    add the number of instructions multiplied by 4. This results in the call
    to flush_icache_range() operating on a memory region 4x larger than
    intended, which is always wasteful and can cause crashes if we overrun
    into an unmapped page.

    Fix this by correcting the pointer arithmetic to remove the bogus
    multiplication, and use braces to remove the need for a set of brackets
    whilst also making it obvious that the target field is a pointer.

    Signed-off-by: Paul Burton
    Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.")
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Martin KaFai Lau
    Cc: Song Liu
    Cc: Yonghong Song
    Cc: netdev@vger.kernel.org
    Cc: bpf@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: stable@vger.kernel.org # v4.13+
    Signed-off-by: Daniel Borkmann

    Paul Burton
     

16 Feb, 2019

2 commits

  • REG_32BIT_ZERO_EX and REG_64BIT are always handled in exactly the same
    way, and reg_val_propagate_range() never actually sets any register to
    type REG_32BIT_ZERO_EX.

    Remove the redundant & unused REG_32BIT_ZERO_EX.

    Signed-off-by: Paul Burton
    Signed-off-by: Daniel Borkmann

    Paul Burton
     
  • The function prototype used to call JITed eBPF code (ie. the type of the
    struct bpf_prog bpf_func field) returns an unsigned int. The MIPS n64
    ABI that MIPS64 kernels target defines that 32 bit integers should
    always be sign extended when passed in registers as either arguments or
    return values.

    This means that when returning any value which may not already be sign
    extended (ie. of type REG_64BIT or REG_32BIT_ZERO_EX) we need to perform
    that sign extension in order to comply with the n64 ABI. Without this we
    see strange looking test failures from test_bpf.ko, such as:

    test_bpf: #65 ALU64_MOV_X:
    dst = 4294967295 jited:1 ret -1 != -1 FAIL (1 times)

    Although the return value printed matches the expected value, this is
    only because printf is only examining the least significant 32 bits of
    the 64 bit register value we returned. The register holding the expected
    value is sign extended whilst the v0 register was set to a zero extended
    value by our JITed code, so when compared by a conditional branch
    instruction the values are not equal.

    We already handle this when the return value register is of type
    REG_32BIT_ZERO_EX, so simply extend this to also cover REG_64BIT.

    Signed-off-by: Paul Burton
    Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.")
    Cc: stable@vger.kernel.org # v4.13+
    Signed-off-by: Daniel Borkmann

    Paul Burton
     

08 Dec, 2018

1 commit


17 Nov, 2018

2 commits


15 May, 2018

1 commit


04 May, 2018

1 commit

  • Since LD_ABS/LD_IND instructions are now removed from the core and
    reimplemented through a combination of inlined BPF instructions and
    a slow-path helper, we can get rid of the complexity from mips64 JIT.

    Signed-off-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: Alexei Starovoitov

    Daniel Borkmann
     

09 Mar, 2018

1 commit


27 Jan, 2018

2 commits


20 Jan, 2018

1 commit

  • Having a pure_initcall() callback just to permanently enable BPF
    JITs under CONFIG_BPF_JIT_ALWAYS_ON is unnecessary and could leave
    a small race window in future where JIT is still disabled on boot.
    Since we know about the setting at compilation time anyway, just
    initialize it properly there. Also consolidate all the individual
    bpf_jit_enable variables into a single one and move them under one
    location. Moreover, don't allow for setting unspecified garbage
    values on them.

    Signed-off-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: Alexei Starovoitov

    Daniel Borkmann
     

18 Dec, 2017

1 commit

  • global bpf_jit_enable variable is tested multiple times in JITs,
    blinding and verifier core. The malicious root can try to toggle
    it while loading the programs. This race condition was accounted
    for and there should be no issues, but it's safer to avoid
    this race condition.

    Signed-off-by: Alexei Starovoitov
    Acked-by: Daniel Borkmann
    Signed-off-by: Daniel Borkmann

    Alexei Starovoitov
     

01 Nov, 2017

1 commit


09 Oct, 2017

1 commit

  • Compiling ebpf_jit.c with gcc 4.9 results in a (likely spurious)
    compiler warning, as gcc has detected that the variable "target" may be
    used uninitialised. Since -Werror is active, this is treated as an error
    and causes a kernel build failure whenever CONFIG_MIPS_EBPF_JIT is
    enabled.

    arch/mips/net/ebpf_jit.c: In function 'build_one_insn':
    arch/mips/net/ebpf_jit.c:1118:80: error: 'target' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
    emit_instr(ctx, j, target);
    ^
    cc1: all warnings being treated as errors

    Fix this by initialising "target" to 0. If it really is used
    uninitialised this would result in a jump to 0 and a detectable run time
    failure.

    Signed-off-by: Matt Redfearn
    Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.")
    Cc: James Hogan
    Cc: David Daney
    Cc: David S. Miller
    Cc: Colin Ian King
    Cc: Daniel Borkmann
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: # v4.13+
    Patchwork: https://patchwork.linux-mips.org/patch/17375/
    Signed-off-by: Ralf Baechle

    Matt Redfearn
     

23 Aug, 2017

1 commit

  • There is a missing break causing a fall-through and setting
    ctx.use_bbit_insns to the wrong value. Fix this by adding the
    missing break.

    Detected with cppcheck:
    "Variable 'ctx.use_bbit_insns' is reassigned a value before the old
    one has been used. 'break;' missing?"

    Fixes: 8d8d18c3283f ("MIPS,bpf: Fix using smp_processor_id() in preemptible splat.")
    Signed-off-by: Colin Ian King
    Acked-by: David Daney
    Signed-off-by: David S. Miller

    Colin Ian King
     

22 Aug, 2017

3 commits


05 Aug, 2017

1 commit

  • Inexplicably, commit f381bf6d82f0 ("MIPS: Add support for eBPF JIT.")
    lost a file somewhere on its path to Linus' tree. Add back the
    missing ebpf_jit.c so that we can build with CONFIG_BPF_JIT selected.

    This version of ebpf_jit.c is identical to the original except for two
    minor change need to resolve conflicts with changes merged from the
    BPF branch:

    A) Set prog->jited_len = image_size;
    B) Use BPF_TAIL_CALL instead of BPF_CALL | BPF_X

    Fixes: f381bf6d82f0 ("MIPS: Add support for eBPF JIT.")
    Signed-off-by: David Daney
    Acked-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    David Daney
     

28 Jun, 2017

1 commit

  • Since the eBPF machine has 64-bit registers, we only support this in
    64-bit kernels. As of the writing of this commit log test-bpf is showing:

    test_bpf: Summary: 316 PASSED, 0 FAILED, [308/308 JIT'ed]

    All current test cases are successfully compiled.

    Many examples in samples/bpf are usable, specifically tracex5 which
    uses tail calls works.

    Signed-off-by: David Daney
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Markos Chandras
    Cc: Matt Redfearn
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/16369/
    Signed-off-by: Ralf Baechle

    David Daney
     

10 Apr, 2017

4 commits

  • o Socket data is unsigned, so use unsigned accessors instructions.

    o Fix path result pointer generation arithmetic.

    o Fix half-word byte swapping code for unsigned semantics.

    Signed-off-by: David Daney
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15747/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • If bpf_needs_clear_a() returns true, only actually clear it if it is
    ever used. If it is not used, we don't save and restore it, so the
    clearing has the nasty side effect of clobbering caller state.

    Also, don't emit stack pointer adjustment instructions if the
    adjustment amount is zero.

    Signed-off-by: David Daney
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15745/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • The SKB vlan_tci and queue_mapping fields are unsigned, don't sign
    extend these in the BPF JIT. In the vlan_tci case, the value gets
    masked so the change is not needed for correctness, but do it anyway
    for agreement with the types defined in struct sk_buff.

    Signed-off-by: David Daney
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15746/
    Signed-off-by: Ralf Baechle

    David Daney
     
  • This let's us pass some additional "modprobe test-bpf" tests with JIT
    enabled.

    Reuse the code for SKF_AD_IFINDEX, but substitute the offset and size
    of the "type" field.

    Signed-off-by: David Daney
    Cc: James Hogan
    Cc: Alexei Starovoitov
    Cc: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15744/
    Signed-off-by: Ralf Baechle

    David Daney
     

12 Oct, 2016

1 commit

  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

06 Aug, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.8. Also includes is a
    minor SSB cleanup as SSB code traditionally is merged through the MIPS
    tree:

    ATH25:
    - MIPS: Add default configuration for ath25

    Boot:
    - For zboot, copy appended dtb to the end of the kernel
    - store the appended dtb address in a variable

    BPF:
    - Fix off by one error in offset allocation

    Cobalt code:
    - Fix typos

    Core code:
    - debugfs_create_file returns NULL on error, so don't use IS_ERR for
    testing for errors.
    - Fix double locking issue in RM7000 S-cache code. This would only
    affect RM7000 ARC systems on reboot.
    - Fix page table corruption on THP permission changes.
    - Use compat_sys_keyctl for 32 bit userspace on 64 bit kernels.
    David says, there are no compatibility issues raised by this fix.
    - Move some signal code around.
    - Rewrite r4k count/compare clockevent device registration such that
    min_delta_ticks/max_delta_ticks files are guaranteed to be
    initialized.
    - Only register r4k count/compare as clockevent device if we can
    assume the clock to be constant.
    - Fix MSA asm warnings in control reg accessors
    - uasm and tlbex fixes and tweaking.
    - Print segment physical address when EU=1.
    - Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO.
    - CP: Allow booting by VP other than VP 0
    - Cache handling fixes and optimizations for r4k class caches
    - Add hotplug support for R6 processors
    - Cleanup hotplug bits in kconfig
    - traps: return correct si code for accessing nonmapped addresses
    - Remove cpu_has_safe_index_cacheops

    Lantiq:
    - Register IRQ handler for virtual IRQ number
    - Fix EIU interrupt loading code
    - Use the real EXIN count
    - Fix build error.

    Loongson 3:
    - Increase HPET_MIN_PROG_DELTA and decrease HPET_MIN_CYCLES

    Octeon:
    - Delete built-in DTB pruning code for D-Link DSR-1000N.
    - Clean up GPIO definitions in dlink_dsr-1000n.dts.
    - Add more LEDs to the DSR-100n DTS
    - Fix off by one in octeon_irq_gpio_map()
    - Typo fixes
    - Enable SATA by default in cavium_octeon_defconfig
    - Support readq/writeq()
    - Remove forced mappings of USB interrupts.
    - Ensure DMA descriptors are always in the low 4GB
    - Improve USB reset code for OCTEON II.

    Pistachio:
    - Add maintainers entry for pistachio SoC Support
    - Remove plat_setup_iocoherency

    Ralink:
    - Fix pwm UART in spis group pinmux.

    SSB:
    - Change bare unsigned to unsigned int to suit coding style

    Tools:
    - Fix reloc tool compiler warnings.

    Other:
    - Delete use of ARCH_WANT_OPTIONAL_GPIOLIB"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (61 commits)
    MIPS: mm: Fix definition of R6 cache instruction
    MIPS: tools: Fix relocs tool compiler warnings
    MIPS: Cobalt: Fix typo
    MIPS: Octeon: Fix typo
    MIPS: Lantiq: Fix build failure
    MIPS: Use CPHYSADDR to implement mips32 __pa
    MIPS: Octeon: Dlink_dsr-1000n.dts: add more leds.
    MIPS: Octeon: Clean up GPIO definitions in dlink_dsr-1000n.dts.
    MIPS: Octeon: Delete built-in DTB pruning code for D-Link DSR-1000N.
    MIPS: store the appended dtb address in a variable
    MIPS: ZBOOT: copy appended dtb to the end of the kernel
    MIPS: ralink: fix spis group pinmux
    MIPS: Factor o32 specific code into signal_o32.c
    MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present
    MIPS: Use per-mm page to execute branch delay slot instructions
    MIPS: Modify error handling
    MIPS: c-r4k: Use SMP calls for CM indexed cache ops
    MIPS: c-r4k: Avoid small flush_icache_range SMP calls
    MIPS: c-r4k: Local flush_icache_range cache op override
    MIPS: c-r4k: Split r4k_flush_kernel_vmap_range()
    ...

    Linus Torvalds
     

04 Aug, 2016

1 commit

  • The use of config_enabled() against config options is ambiguous. In
    practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
    author might have used it for the meaning of IS_ENABLED(). Using
    IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc. makes the intention
    clearer.

    This commit replaces config_enabled() with IS_ENABLED() where possible.
    This commit is only touching bool config options.

    I noticed two cases where config_enabled() is used against a tristate
    option:

    - config_enabled(CONFIG_HWMON)
    [ drivers/net/wireless/ath/ath10k/thermal.c ]

    - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
    [ drivers/gpu/drm/gma500/opregion.c ]

    I did not touch them because they should be converted to IS_BUILTIN()
    in order to keep the logic, but I was not sure it was the authors'
    intention.

    Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Kees Cook
    Cc: Stas Sergeev
    Cc: Matt Redfearn
    Cc: Joshua Kinard
    Cc: Jiri Slaby
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Markos Chandras
    Cc: "Dmitry V. Levin"
    Cc: yu-cheng yu
    Cc: James Hogan
    Cc: Brian Gerst
    Cc: Johannes Berg
    Cc: Peter Zijlstra
    Cc: Al Viro
    Cc: Will Drewry
    Cc: Nikolay Martynov
    Cc: Huacai Chen
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Daniel Borkmann
    Cc: Leonid Yegoshin
    Cc: Rafal Milecki
    Cc: James Cowgill
    Cc: Greg Kroah-Hartman
    Cc: Ralf Baechle
    Cc: Alex Smith
    Cc: Adam Buchbinder
    Cc: Qais Yousef
    Cc: Jiang Liu
    Cc: Mikko Rapeli
    Cc: Paul Gortmaker
    Cc: Denys Vlasenko
    Cc: Brian Norris
    Cc: Hidehiro Kawai
    Cc: "Luis R. Rodriguez"
    Cc: Andy Lutomirski
    Cc: Ingo Molnar
    Cc: Dave Hansen
    Cc: "Kirill A. Shutemov"
    Cc: Roland McGrath
    Cc: Paul Burton
    Cc: Kalle Valo
    Cc: Viresh Kumar
    Cc: Tony Wu
    Cc: Huaitong Han
    Cc: Sumit Semwal
    Cc: Alexei Starovoitov
    Cc: Juergen Gross
    Cc: Jason Cooper
    Cc: "David S. Miller"
    Cc: Oleg Nesterov
    Cc: Andrea Gelmini
    Cc: David Woodhouse
    Cc: Marc Zyngier
    Cc: Rabin Vincent
    Cc: "Maciej W. Rozycki"
    Cc: David Daney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

21 Jul, 2016

1 commit

  • Dan Carpenter reported [1] a static checker warning that ctx->offsets[]
    may be accessed off by one from build_body(), since it's allocated with
    fp->len * sizeof(*ctx.offsets) as length. The cBPF arm and ppc code
    doesn't have this issue as claimed, so only mips seems to be affected and
    should like most other JITs allocate with fp->len + 1. A few number of
    JITs (x86, sparc, arm64) handle this differently, where they only require
    fp->len array elements.

    [1] http://www.spinics.net/lists/mips/msg64193.html

    Fixes: c6610de353da ("MIPS: net: Add BPF JIT")
    Reported-by: Dan Carpenter
    Signed-off-by: Daniel Borkmann
    Cc: Alexei Starovoitov
    Cc: ast@kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/13814/
    Signed-off-by: Ralf Baechle

    Daniel Borkmann