26 Sep, 2018

1 commit


10 Sep, 2018

2 commits

  • commit fec3259c9f747c039f90e99570540114c8d81a14 upstream.

    Cache invalidation macros use cache line size to iterate over
    invalidated cache lines, assuming that all cache ways are invalidated by
    single instruction, but xtensa ISA recommends to not assume that for
    future compatibility:
    In some implementations all ways at index Addry-1..z are invalidated
    regardless of the specified way, but for future compatibility this
    behavior should not be assumed.

    Iterate over all cache ways in ___invalidate_icache_all and
    ___invalidate_dcache_all.

    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     
  • commit be75de25251f7cf3e399ca1f584716a95510d24a upstream.

    When building kernel for xtensa cores with big cache lines (e.g. 128
    bytes or more) __loop_cache_all and __loop_cache_page may generate
    assembly instructions with immediate fields that are too big. This
    results in the following build errors:

    arch/xtensa/mm/misc.S: Assembler messages:
    arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '256'
    arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '384'
    arch/xtensa/kernel/head.S: Assembler messages:
    arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '256'
    arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '384'
    arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '256'
    arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '384'
    arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '256'
    arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '384'

    Add parameter max_immed to these macros and use it to limit values of
    immediate operands. Extract common code of these macros into the new
    macro __loop_cache_unroll.

    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     

03 Jul, 2018

1 commit

  • commit 7de712ccc096b81d23cc0a941cd9b8cb3956605d upstream.

    While working on changing this code to use force_sig_fault I
    discovered that do_unaliged_user is sets si_signo to SIGBUS and passes
    SIGSEGV to force_sig_info. Which is just b0rked.

    The code is reporting a SIGBUS error so replace the SIGSEGV with SIGBUS.

    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: linux-xtensa@linux-xtensa.org
    Cc: stable@vger.kernel.org
    Acked-by: Max Filippov
    Fixes: 5a0015d62668 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3")
    Signed-off-by: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     

28 Feb, 2018

1 commit

  • commit 6ac5a11dc674bc5016ea716e8082fff61f524dc1 upstream.

    Xtensa memory initialization code frees high memory pages without
    checking whether they are in the reserved memory regions or not. That
    results in invalid value of totalram_pages and duplicate page usage by
    CMA and highmem. It produces a bunch of BUGs at startup looking like
    this:

    BUG: Bad page state in process swapper pfn:70800
    page:be60c000 count:0 mapcount:-127 mapping: (null) index:0x1
    flags: 0x80000000()
    raw: 80000000 00000000 00000001 ffffff80 00000000 be60c014 be60c014 0000000a
    page dumped because: nonzero mapcount
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Tainted: G B 4.16.0-rc1-00015-g7928b2cbe55b-dirty #23
    Stack:
    bd839d33 00000000 00000018 ba97b64c a106578c bd839d70 be60c000 00000000
    a1378054 bd86a000 00000003 ba97b64c a1066166 bd839da0 be60c000 ffe00000
    a1066b58 bd839dc0 be504000 00000000 000002f4 bd838000 00000000 0000001e
    Call Trace:
    [] bad_page+0xac/0xd0
    [] free_pages_check_bad+0x34/0x4c
    [] __free_pages_ok+0xae/0x14c
    [] __free_pages+0x30/0x64
    [] init_cma_reserved_pageblock+0x35/0x44
    [] cma_init_reserved_areas+0xf4/0x148
    [] do_one_initcall+0x80/0xf8
    [] kernel_init_freeable+0xda/0x13c
    [] kernel_init+0x9/0xd0
    [] ret_from_kernel_thread+0xc/0x18

    Only free high memory pages that are not reserved.

    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     

17 Feb, 2018

1 commit

  • commit ca47480921587ae30417dd234a9f79af188e3666 upstream.

    Return 0 if the operation was successful, not the userspace memory
    value. Check that userspace value equals passed oldval, not itself.
    Don't update *uval if the value wasn't read from userspace memory.

    This fixes process hang due to infinite loop in futex_lock_pi.
    It also fixes a bunch of glibc tests nptl/tst-mutexpi*.

    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     

13 Feb, 2018

1 commit

  • commit 10b62a2f785ab55857380f0c63d9fa468fd8c676 upstream.

    Most of DT files are compiled under arch/*/boot/dts/, but we have some
    other directories, like drivers/of/unittest-data/. We often miss to
    add gitignore patterns per directory. Since there are no source files
    that end with .dtb or .dtb.S, we can ignore the patterns globally.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     

02 Nov, 2017

3 commits

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many user space API headers are missing licensing information, which
    makes it hard for compliance tools to determine the correct license.

    By default are files without license information under the default
    license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
    them from being included in non GPLV2 code, which is obviously not
    intended. The user space API headers fall under the syscall exception
    which is in the kernels COPYING file:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    otherwise syscall usage would not be possible.

    Update the files which contain no license information with an SPDX
    license identifier. The chosen identifier is 'GPL-2.0 WITH
    Linux-syscall-note' which is the officially assigned identifier for the
    Linux syscall exception. SPDX license identifiers are a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

23 Sep, 2017

1 commit


07 Sep, 2017

4 commits

  • Merge updates from Andrew Morton:

    - various misc bits

    - DAX updates

    - OCFS2

    - most of MM

    * emailed patches from Andrew Morton : (119 commits)
    mm,fork: introduce MADV_WIPEONFORK
    x86,mpx: make mpx depend on x86-64 to free up VMA flag
    mm: add /proc/pid/smaps_rollup
    mm: hugetlb: clear target sub-page last when clearing huge page
    mm: oom: let oom_reap_task and exit_mmap run concurrently
    swap: choose swap device according to numa node
    mm: replace TIF_MEMDIE checks by tsk_is_oom_victim
    mm, oom: do not rely on TIF_MEMDIE for memory reserves access
    z3fold: use per-cpu unbuddied lists
    mm, swap: don't use VMA based swap readahead if HDD is used as swap
    mm, swap: add sysfs interface for VMA based swap readahead
    mm, swap: VMA based swap readahead
    mm, swap: fix swap readahead marking
    mm, swap: add swap readahead hit statistics
    mm/vmalloc.c: don't reinvent the wheel but use existing llist API
    mm/vmstat.c: fix wrong comment
    selftests/memfd: add memfd_create hugetlbfs selftest
    mm/shmem: add hugetlbfs support to memfd_create()
    mm, devm_memremap_pages: use multi-order radix for ZONE_DEVICE lookups
    mm/vmalloc.c: halve the number of comparisons performed in pcpu_get_vm_areas()
    ...

    Linus Torvalds
     
  • Introduce MADV_WIPEONFORK semantics, which result in a VMA being empty
    in the child process after fork. This differs from MADV_DONTFORK in one
    important way.

    If a child process accesses memory that was MADV_WIPEONFORK, it will get
    zeroes. The address ranges are still valid, they are just empty.

    If a child process accesses memory that was MADV_DONTFORK, it will get a
    segmentation fault, since those address ranges are no longer valid in
    the child after fork.

    Since MADV_DONTFORK also seems to be used to allow very large programs
    to fork in systems with strict memory overcommit restrictions, changing
    the semantics of MADV_DONTFORK might break existing programs.

    MADV_WIPEONFORK only works on private, anonymous VMAs.

    The use case is libraries that store or cache information, and want to
    know that they need to regenerate it in the child process after fork.

    Examples of this would be:
    - systemd/pulseaudio API checks (fail after fork) (replacing a getpid
    check, which is too slow without a PID cache)
    - PKCS#11 API reinitialization check (mandated by specification)
    - glibc's upcoming PRNG (reseed after fork)
    - OpenSSL PRNG (reseed after fork)

    The security benefits of a forking server having a re-inialized PRNG in
    every child process are pretty obvious. However, due to libraries
    having all kinds of internal state, and programs getting compiled with
    many different versions of each library, it is unreasonable to expect
    calling programs to re-initialize everything manually after fork.

    A further complication is the proliferation of clone flags, programs
    bypassing glibc's functions to call clone directly, and programs calling
    unshare, causing the glibc pthread_atfork hook to not get called.

    It would be better to have the kernel take care of this automatically.

    The patch also adds MADV_KEEPONFORK, to undo the effects of a prior
    MADV_WIPEONFORK.

    This is similar to the OpenBSD minherit syscall with MAP_INHERIT_ZERO:

    https://man.openbsd.org/minherit.2

    [akpm@linux-foundation.org: numerically order arch/parisc/include/uapi/asm/mman.h #defines]
    Link: http://lkml.kernel.org/r/20170811212829.29186-3-riel@redhat.com
    Signed-off-by: Rik van Riel
    Reported-by: Florian Weimer
    Reported-by: Colm MacCártaigh
    Reviewed-by: Mike Kravetz
    Cc: "H. Peter Anvin"
    Cc: "Kirill A. Shutemov"
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Ingo Molnar
    Cc: Helge Deller
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Thomas Gleixner
    Cc: Will Drewry
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rik van Riel
     
  • A non-default huge page size can be encoded in the flags argument of the
    mmap system call. The definitions for these encodings are in arch
    specific header files. However, all architectures use the same values.

    Consolidate all the definitions in the primary user header file
    (uapi/linux/mman.h). Include definitions for all known huge page sizes.
    Use the generic encoding definitions in hugetlb_encode.h as the basis
    for these definitions.

    Link: http://lkml.kernel.org/r/1501527386-10736-3-git-send-email-mike.kravetz@oracle.com
    Signed-off-by: Mike Kravetz
    Acked-by: Michal Hocko
    Cc: Andi Kleen
    Cc: Andrea Arcangeli
    Cc: Aneesh Kumar K.V
    Cc: Anshuman Khandual
    Cc: Arnd Bergmann
    Cc: Davidlohr Bueso
    Cc: Matthew Wilcox
    Cc: Michael Kerrisk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Kravetz
     
  • Pull networking updates from David Miller:

    1) Support ipv6 checksum offload in sunvnet driver, from Shannon
    Nelson.

    2) Move to RB-tree instead of custom AVL code in inetpeer, from Eric
    Dumazet.

    3) Allow generic XDP to work on virtual devices, from John Fastabend.

    4) Add bpf device maps and XDP_REDIRECT, which can be used to build
    arbitrary switching frameworks using XDP. From John Fastabend.

    5) Remove UFO offloads from the tree, gave us little other than bugs.

    6) Remove the IPSEC flow cache, from Florian Westphal.

    7) Support ipv6 route offload in mlxsw driver.

    8) Support VF representors in bnxt_en, from Sathya Perla.

    9) Add support for forward error correction modes to ethtool, from
    Vidya Sagar Ravipati.

    10) Add time filter for packet scheduler action dumping, from Jamal Hadi
    Salim.

    11) Extend the zerocopy sendmsg() used by virtio and tap to regular
    sockets via MSG_ZEROCOPY. From Willem de Bruijn.

    12) Significantly rework value tracking in the BPF verifier, from Edward
    Cree.

    13) Add new jump instructions to eBPF, from Daniel Borkmann.

    14) Rework rtnetlink plumbing so that operations can be run without
    taking the RTNL semaphore. From Florian Westphal.

    15) Support XDP in tap driver, from Jason Wang.

    16) Add 32-bit eBPF JIT for ARM, from Shubham Bansal.

    17) Add Huawei hinic ethernet driver.

    18) Allow to report MD5 keys in TCP inet_diag dumps, from Ivan
    Delalande.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1780 commits)
    i40e: point wb_desc at the nvm_wb_desc during i40e_read_nvm_aq
    i40e: avoid NVM acquire deadlock during NVM update
    drivers: net: xgene: Remove return statement from void function
    drivers: net: xgene: Configure tx/rx delay for ACPI
    drivers: net: xgene: Read tx/rx delay for ACPI
    rocker: fix kcalloc parameter order
    rds: Fix non-atomic operation on shared flag variable
    net: sched: don't use GFP_KERNEL under spin lock
    vhost_net: correctly check tx avail during rx busy polling
    net: mdio-mux: add mdio_mux parameter to mdio_mux_init()
    rxrpc: Make service connection lookup always check for retry
    net: stmmac: Delete dead code for MDIO registration
    gianfar: Fix Tx flow control deactivation
    cxgb4: Ignore MPS_TX_INT_CAUSE[Bubble] for T6
    cxgb4: Fix pause frame count in t4_get_port_stats
    cxgb4: fix memory leak
    tun: rename generic_xdp to skb_xdp
    tun: reserve extra headroom only when XDP is set
    net: dsa: bcm_sf2: Configure IMP port TC2QOS mapping
    net: dsa: bcm_sf2: Advertise number of egress queues
    ...

    Linus Torvalds
     

05 Sep, 2017

1 commit

  • Pull locking updates from Ingo Molnar:

    - Add 'cross-release' support to lockdep, which allows APIs like
    completions, where it's not the 'owner' who releases the lock, to be
    tracked. It's all activated automatically under
    CONFIG_PROVE_LOCKING=y.

    - Clean up (restructure) the x86 atomics op implementation to be more
    readable, in preparation of KASAN annotations. (Dmitry Vyukov)

    - Fix static keys (Paolo Bonzini)

    - Add killable versions of down_read() et al (Kirill Tkhai)

    - Rework and fix jump_label locking (Marc Zyngier, Paolo Bonzini)

    - Rework (and fix) tlb_flush_pending() barriers (Peter Zijlstra)

    - Remove smp_mb__before_spinlock() and convert its usages, introduce
    smp_mb__after_spinlock() (Peter Zijlstra)

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits)
    locking/lockdep/selftests: Fix mixed read-write ABBA tests
    sched/completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK()
    acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse
    locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures
    smp: Avoid using two cache lines for struct call_single_data
    locking/lockdep: Untangle xhlock history save/restore from task independence
    locking/refcounts, x86/asm: Disable CONFIG_ARCH_HAS_REFCOUNT for the time being
    futex: Remove duplicated code and fix undefined behaviour
    Documentation/locking/atomic: Finish the document...
    locking/lockdep: Fix workqueue crossrelease annotation
    workqueue/lockdep: 'Fix' flush_work() annotation
    locking/lockdep/selftests: Add mixed read-write ABBA tests
    mm, locking/barriers: Clarify tlb_flush_pending() barriers
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS truly non-interactive
    locking/lockdep: Explicitly initialize wq_barrier::done::map
    locking/lockdep: Rename CONFIG_LOCKDEP_COMPLETE to CONFIG_LOCKDEP_COMPLETIONS
    locking/lockdep: Reword title of LOCKDEP_CROSSRELEASE config
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE part of CONFIG_PROVE_LOCKING
    locking/refcounts, x86/asm: Implement fast refcount overflow protection
    locking/lockdep: Fix the rollback and overwrite detection logic in crossrelease
    ...

    Linus Torvalds
     

04 Sep, 2017

1 commit

  • Pull perf updates from Ingo Molnar:
    "Kernel side changes:

    - Add branch type profiling/tracing support. (Jin Yao)

    - Add the PERF_SAMPLE_PHYS_ADDR ABI to allow the tracing/profiling of
    physical memory addresses, where the PMU supports it. (Kan Liang)

    - Export some PMU capability details in the new
    /sys/bus/event_source/devices/cpu/caps/ sysfs directory. (Andi
    Kleen)

    - Aux data fixes and updates (Will Deacon)

    - kprobes fixes and updates (Masami Hiramatsu)

    - AMD uncore PMU driver fixes and updates (Janakarajan Natarajan)

    On the tooling side, here's a (limited!) list of highlights - there
    were many other changes that I could not list, see the shortlog and
    git history for details:

    UI improvements:

    - Implement a visual marker for fused x86 instructions in the
    annotate TUI browser, available now in 'perf report', more work
    needed to have it available as well in 'perf top' (Jin Yao)

    Further explanation from one of Jin's patches:

    │ ┌──cmpl $0x0,argp_program_version_hook
    81.93 │ ├──je 20
    │ │ lock cmpxchg %esi,0x38a9a4(%rip)
    │ │↓ jne 29
    │ │↓ jmp 43
    11.47 │20:└─→cmpxch %esi,0x38a999(%rip)

    That means the cmpl+je is a fused instruction pair and they should
    be considered together.

    - Record the branch type and then show statistics and info about in
    callchain entries (Jin Yao)

    Example from one of Jin's patches:

    # perf record -g -j any,save_type
    # perf report --branch-history --stdio --no-children

    38.50% div.c:45 [.] main div
    |
    ---main div.c:42 (RET CROSS_2M cycles:2)
    compute_flag div.c:28 (cycles:2)
    compute_flag div.c:27 (RET CROSS_2M cycles:1)
    rand rand.c:28 (cycles:1)
    rand rand.c:28 (RET CROSS_2M cycles:1)
    __random random.c:298 (cycles:1)
    __random random.c:297 (COND_BWD CROSS_2M cycles:1)
    __random random.c:295 (cycles:1)
    __random random.c:295 (COND_BWD CROSS_2M cycles:1)
    __random random.c:295 (cycles:1)
    __random random.c:295 (RET CROSS_2M cycles:9)

    namespaces support:

    - Add initial support for namespaces, using setns to access files in
    namespaces, grabbing their build-ids, etc. (Krister Johansen)

    perf trace enhancements:

    - Beautify pkey_{alloc,free,mprotect} arguments in 'perf trace'
    (Arnaldo Carvalho de Melo)

    - Add initial 'clone' syscall args beautifier in 'perf trace'
    (Arnaldo Carvalho de Melo)

    - Ignore 'fd' and 'offset' args for MAP_ANONYMOUS in 'perf trace'
    (Arnaldo Carvalho de Melo)

    - Beautifiers for the 'cmd' arg of several ioctl types, including:
    sound, DRM, KVM, vhost virtio and perf_events. (Arnaldo Carvalho de
    Melo)

    - Add PERF_SAMPLE_CALLCHAIN and PERF_RECORD_MMAP[2] to 'perf data'
    CTF conversion, allowing CTF trace visualization tools to show
    callchains and to resolve symbols (Geneviève Bastien)

    - Beautify the fcntl syscall, which is an interesting one in the
    sense that infrastructure had to be put in place to change the
    formatters of some arguments according to the value in a previous
    one, i.e. cmd dictates how arg and the syscall return will be
    formatted. (Arnaldo Carvalho de Melo

    perf stat enhancements:

    - Use group read for event groups in 'perf stat', reducing overhead
    when groups are defined in the event specification, i.e. when using
    {} to enclose a list of events, asking them to be read at the same
    time, e.g.: "perf stat -e '{cycles,instructions}'" (Jiri Olsa)

    pipe mode improvements:

    - Process tracing data in 'perf annotate' pipe mode (David
    Carrillo-Cisneros)

    - Add header record types to pipe-mode, now this command:

    $ perf record -o - -e cycles sleep 1 | perf report --stdio --header

    Will show the same as in non-pipe mode, i.e. involving a perf.data
    file (David Carrillo-Cisneros)

    Vendor specific hardware event support updates/enhancements:

    - Update POWER9 vendor events tables (Sukadev Bhattiprolu)

    - Add POWER9 PMU events Sukadev (Bhattiprolu)

    - Support additional POWER8+ PVR in PMU mapfile (Shriya)

    - Add Skylake server uncore JSON vendor events (Andi Kleen)

    - Support exporting Intel PT data to sqlite3 with python perf
    scripts, this is in addition to the postgresql support that was
    already there (Adrian Hunter)"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (253 commits)
    perf symbols: Fix plt entry calculation for ARM and AARCH64
    perf probe: Fix kprobe blacklist checking condition
    perf/x86: Fix caps/ for !Intel
    perf/core, x86: Add PERF_SAMPLE_PHYS_ADDR
    perf/core, pt, bts: Get rid of itrace_started
    perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments
    tools headers: Sync cpu features kernel ABI headers with tooling headers
    perf tools: Pass full path of FEATURES_DUMP
    perf tools: Robustify detection of clang binary
    tools lib: Allow external definition of CC, AR and LD
    perf tools: Allow external definition of flex and bison binary names
    tools build tests: Don't hardcode gcc name
    perf report: Group stat values on global event id
    perf values: Zero value buffers
    perf values: Fix allocation check
    perf values: Fix thread index bug
    perf report: Add dump_read function
    perf record: Set read_format for inherit_stat
    perf c2c: Fix remote HITM detection for Skylake
    perf tools: Fix static build with newer toolchains
    ...

    Linus Torvalds
     

26 Aug, 2017

1 commit

  • There is code duplicated over all architecture's headers for
    futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr,
    and comparison of the result.

    Remove this duplication and leave up to the arches only the needed
    assembly which is now in arch_futex_atomic_op_inuser.

    This effectively distributes the Will Deacon's arm64 fix for undefined
    behaviour reported by UBSAN to all architectures. The fix was done in
    commit 5f16a046f8e1 (arm64: futex: Fix undefined behaviour with
    FUTEX_OP_OPARG_SHIFT usage). Look there for an example dump.

    And as suggested by Thomas, check for negative oparg too, because it was
    also reported to cause undefined behaviour report.

    Note that s390 removed access_ok check in d12a29703 ("s390/uaccess:
    remove pointless access_ok() checks") as access_ok there returns true.
    We introduce it back to the helper for the sake of simplicity (it gets
    optimized away anyway).

    Signed-off-by: Jiri Slaby
    Signed-off-by: Thomas Gleixner
    Acked-by: Russell King
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Heiko Carstens [s390]
    Acked-by: Chris Metcalf [for tile]
    Reviewed-by: Darren Hart (VMware)
    Reviewed-by: Will Deacon [core/arm64]
    Cc: linux-mips@linux-mips.org
    Cc: Rich Felker
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: peterz@infradead.org
    Cc: Benjamin Herrenschmidt
    Cc: Max Filippov
    Cc: Paul Mackerras
    Cc: sparclinux@vger.kernel.org
    Cc: Jonas Bonn
    Cc: linux-s390@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: Yoshinori Sato
    Cc: linux-hexagon@vger.kernel.org
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Cc: Catalin Marinas
    Cc: Matt Turner
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: linux-xtensa@linux-xtensa.org
    Cc: Stefan Kristiansson
    Cc: openrisc@lists.librecores.org
    Cc: Ivan Kokshaysky
    Cc: Stafford Horne
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Richard Henderson
    Cc: Chris Zankel
    Cc: Michal Simek
    Cc: Tony Luck
    Cc: linux-parisc@vger.kernel.org
    Cc: Vineet Gupta
    Cc: Ralf Baechle
    Cc: Richard Kuo
    Cc: linux-alpha@vger.kernel.org
    Cc: Martin Schwidefsky
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: "David S. Miller"
    Link: http://lkml.kernel.org/r/20170824073105.3901-1-jslaby@suse.cz

    Jiri Slaby
     

21 Aug, 2017

1 commit


17 Aug, 2017

1 commit

  • There is no agreed-upon definition of spin_unlock_wait()'s semantics,
    and it appears that all callers could do just as well with a lock/unlock
    pair. This commit therefore removes the underlying arch-specific
    arch_spin_unlock_wait() for all architectures providing them.

    Signed-off-by: Paul E. McKenney
    Cc:
    Cc: Peter Zijlstra
    Cc: Alan Stern
    Cc: Andrea Parri
    Cc: Linus Torvalds
    Acked-by: Will Deacon
    Acked-by: Boqun Feng

    Paul E. McKenney
     

10 Aug, 2017

2 commits

  • Mark _stext and _end as character arrays instead of single
    character variables, like include/asm-generic/sections.h does.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Chris Zankel
    Cc: David S . Miller
    Cc: Francis Deslauriers
    Cc: Jesper Nilsson
    Cc: Linus Torvalds
    Cc: Max Filippov
    Cc: Mikael Starvik
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yoshinori Sato
    Cc: linux-arch@vger.kernel.org
    Cc: linux-cris-kernel@axis.com
    Cc: mathieu.desnoyers@efficios.com
    Link: http://lkml.kernel.org/r/150172775958.27216.12951305461398200544.stgit@devbox
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • The UDP offload conflict is dealt with by simply taking what is
    in net-next where we have removed all of the UFO handling code
    entirely.

    The TCP conflict was a case of local variables in a function
    being removed from both net and net-next.

    In netvsc we had an assignment right next to where a missing
    set of u64 stats sync object inits were added.

    Signed-off-by: David S. Miller

    David S. Miller
     

08 Aug, 2017

1 commit

  • Pull Xtensa fixes from Max Filippov:

    - use asm-generic instances of asm/param.h and asm/device.h instead of
    exact copies in arch/xtensa/include/asm;

    - fix build error for xtensa cores with aliasing WT cache: define cache
    flushing functions and copy_{to,from}_user_page;

    - add missing EXPORT_SYMBOLs for clear_user_highpage, copy_user_highpage,
    flush_dcache_page, local_flush_cache_range, local_flush_cache_page,
    csum_partial and csum_partial_copy_generic.

    * tag 'xtensa-20170807' of git://github.com/jcmvbkbc/linux-xtensa:
    xtensa: mm/cache: add missing EXPORT_SYMBOLs
    xtensa: don't limit csum_partial export by CONFIG_NET
    xtensa: fix cache aliasing handling code for WT cache
    xtensa: remove wrapper header for asm/param.h
    xtensa: remove wrapper header for asm/device.h

    Linus Torvalds
     

04 Aug, 2017

1 commit

  • The send call ignores unknown flags. Legacy applications may already
    unwittingly pass MSG_ZEROCOPY. Continue to ignore this flag unless a
    socket opts in to zerocopy.

    Introduce socket option SO_ZEROCOPY to enable MSG_ZEROCOPY processing.
    Processes can also query this socket option to detect kernel support
    for the feature. Older kernels will return ENOPROTOOPT.

    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

02 Aug, 2017

2 commits


29 Jul, 2017

1 commit

  • Currently building kernel for xtensa core with aliasing WT cache fails
    with the following messages:

    mm/memory.c:2152: undefined reference to `flush_dcache_page'
    mm/memory.c:2332: undefined reference to `local_flush_cache_page'
    mm/memory.c:1919: undefined reference to `local_flush_cache_range'
    mm/memory.c:4179: undefined reference to `copy_to_user_page'
    mm/memory.c:4183: undefined reference to `copy_from_user_page'

    This happens because implementation of these functions is only compiled
    when data cache is WB, which looks wrong: even when data cache doesn't
    need flushing it still needs invalidation. The functions like
    __flush_[invalidate_]dcache_* are correctly defined for both WB and WT
    caches (and even if they weren't that'd still be ok, just slower).

    Fix this by providing the same implementation of the above functions for
    both WB and WT cache.

    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov

    Max Filippov
     

21 Jul, 2017

2 commits


17 Jul, 2017

1 commit

  • This ioctl does nothing to justify an _IOC_READ or _IOC_WRITE flag
    because it doesn't copy anything from/to userspace to access the
    argument.

    Fixes: 54ebbfb16034 ("tty: add TIOCGPTPEER ioctl")
    Signed-off-by: Gleb Fotengauer-Malinovskiy
    Acked-by: Aleksa Sarai
    Acked-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Gleb Fotengauer-Malinovskiy
     

16 Jul, 2017

1 commit


15 Jul, 2017

1 commit

  • The arch uses a verbatim copy of the asm-generic version and does not
    add any own implementations to the header, so use asm-generic/fb.h
    instead of duplicating code.

    Link: http://lkml.kernel.org/r/20170517083545.2115-1-tklauser@distanz.ch
    Signed-off-by: Tobias Klauser
    Acked-by: Max Filippov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

11 Jul, 2017

1 commit

  • Since commit fcc8487d477a ("uapi: export all headers under uapi
    directories"), all (and only) headers under uapi directories are
    exported, but asm-generic wrappers are still exceptions.

    To complete de-coupling the uapi from kernel headers, move generic-y
    of exported headers to uapi/asm/Kbuild.

    With this change, "make headers_install" will just need to parse
    uapi/asm/Kbuild to build up exported headers.

    Also, move "generic-y += kprobes.h" up in order to keep the entries
    sorted.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 Jul, 2017

2 commits

  • Pull user access str* updates from Al Viro:
    "uaccess str...() dead code removal"

    * 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    s390 keyboard.c: don't open-code strndup_user()
    mips: get rid of unused __strnlen_user()
    get rid of unused __strncpy_from_user() instances
    kill strlen_user()

    Linus Torvalds
     
  • Pull dma-mapping infrastructure from Christoph Hellwig:
    "This is the first pull request for the new dma-mapping subsystem

    In this new subsystem we'll try to properly maintain all the generic
    code related to dma-mapping, and will further consolidate arch code
    into common helpers.

    This pull request contains:

    - removal of the DMA_ERROR_CODE macro, replacing it with calls to
    ->mapping_error so that the dma_map_ops instances are more self
    contained and can be shared across architectures (me)

    - removal of the ->set_dma_mask method, which duplicates the
    ->dma_capable one in terms of functionality, but requires more
    duplicate code.

    - various updates for the coherent dma pool and related arm code
    (Vladimir)

    - various smaller cleanups (me)"

    * tag 'dma-mapping-4.13' of git://git.infradead.org/users/hch/dma-mapping: (56 commits)
    ARM: dma-mapping: Remove traces of NOMMU code
    ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
    ARM: NOMMU: Introduce dma operations for noMMU
    drivers: dma-mapping: allow dma_common_mmap() for NOMMU
    drivers: dma-coherent: Introduce default DMA pool
    drivers: dma-coherent: Account dma_pfn_offset when used with device tree
    dma: Take into account dma_pfn_offset
    dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs
    dma-mapping: remove dmam_free_noncoherent
    crypto: qat - avoid an uninitialized variable warning
    au1100fb: remove a bogus dma_free_nonconsistent call
    MAINTAINERS: add entry for dma mapping helpers
    powerpc: merge __dma_set_mask into dma_set_mask
    dma-mapping: remove the set_dma_mask method
    powerpc/cell: use the dma_supported method for ops switching
    powerpc/cell: clean up fixed mapping dma_ops initialization
    tile: remove dma_supported and mapping_error methods
    xen-swiotlb: remove xen_swiotlb_set_dma_mask
    arm: implement ->dma_supported instead of ->set_dma_mask
    mips/loongson64: implement ->dma_supported instead of ->set_dma_mask
    ...

    Linus Torvalds
     

06 Jul, 2017

1 commit

  • Pull networking updates from David Miller:
    "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
    merge window:

    1) Several optimizations for UDP processing under high load from
    Paolo Abeni.

    2) Support pacing internally in TCP when using the sch_fq packet
    scheduler for this is not practical. From Eric Dumazet.

    3) Support mutliple filter chains per qdisc, from Jiri Pirko.

    4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

    5) Add batch dequeueing to vhost_net, from Jason Wang.

    6) Flesh out more completely SCTP checksum offload support, from
    Davide Caratti.

    7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
    Neira Ayuso, and Matthias Schiffer.

    8) Add devlink support to nfp driver, from Simon Horman.

    9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
    Prabhu.

    10) Add stack depth tracking to BPF verifier and use this information
    in the various eBPF JITs. From Alexei Starovoitov.

    11) Support XDP on qed device VFs, from Yuval Mintz.

    12) Introduce BPF PROG ID for better introspection of installed BPF
    programs. From Martin KaFai Lau.

    13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

    14) For loads, allow narrower accesses in bpf verifier checking, from
    Yonghong Song.

    15) Support MIPS in the BPF selftests and samples infrastructure, the
    MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
    Daney.

    16) Support kernel based TLS, from Dave Watson and others.

    17) Remove completely DST garbage collection, from Wei Wang.

    18) Allow installing TCP MD5 rules using prefixes, from Ivan
    Delalande.

    19) Add XDP support to Intel i40e driver, from Björn Töpel

    20) Add support for TC flower offload in nfp driver, from Simon
    Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
    Kicinski, and Bert van Leeuwen.

    21) IPSEC offloading support in mlx5, from Ilan Tayari.

    22) Add HW PTP support to macb driver, from Rafal Ozieblo.

    23) Networking refcount_t conversions, From Elena Reshetova.

    24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
    for tuning the TCP sockopt settings of a group of applications,
    currently via CGROUPs"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
    net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
    dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
    cxgb4: Support for get_ts_info ethtool method
    cxgb4: Add PTP Hardware Clock (PHC) support
    cxgb4: time stamping interface for PTP
    nfp: default to chained metadata prepend format
    nfp: remove legacy MAC address lookup
    nfp: improve order of interfaces in breakout mode
    net: macb: remove extraneous return when MACB_EXT_DESC is defined
    bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
    bpf: fix return in load_bpf_file
    mpls: fix rtm policy in mpls_getroute
    net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
    net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
    ...

    Linus Torvalds
     

04 Jul, 2017

3 commits

  • Pull tty/serial updates from Greg KH:
    "Here is the large tty/serial patchset for 4.13-rc1.

    A lot of tty and serial driver updates are in here, along with some
    fixups for some __get/put_user usages that were reported. Nothing
    huge, just lots of development by a number of different developers,
    full details in the shortlog.

    All of these have been in linux-next for a while"

    * tag 'tty-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (71 commits)
    tty: serial: lpuart: add a more accurate baud rate calculation method
    tty: serial: lpuart: add earlycon support for imx7ulp
    tty: serial: lpuart: add imx7ulp support
    dt-bindings: serial: fsl-lpuart: add i.MX7ULP support
    tty: serial: lpuart: add little endian 32 bit register support
    tty: serial: lpuart: refactor lpuart32_{read|write} prototype
    tty: serial: lpuart: introduce lpuart_soc_data to represent SoC property
    serial: imx-serial - move DMA buffer configuration to DT
    serial: imx: Enable RTSD only when needed
    serial: imx: Remove unused members from imx_port struct
    serial: 8250: 8250_omap: Fix race b/w dma completion and RX timeout
    serial: 8250: Fix THRE flag usage for CAP_MINI
    tty/serial: meson_uart: update to stable bindings
    dt-bindings: serial: Add bindings for the Amlogic Meson UARTs
    serial: Delete dead code for CIR serial ports
    serial: sirf: make of_device_ids const
    serial/mpsc: switch to dma_alloc_attrs
    tty: serial: Add Actions Semi Owl UART earlycon
    dt-bindings: serial: Document Actions Semi Owl UARTs
    tty/serial: atmel: make the driver DT only
    ...

    Linus Torvalds
     
  • Pull timer updates from Thomas Gleixner:
    "A rather large update for timers/timekeeping:

    - compat syscall consolidation (Al Viro)

    - Posix timer consolidation (Christoph Helwig / Thomas Gleixner)

    - Cleanup of the device tree based initialization for clockevents and
    clocksources (Daniel Lezcano)

    - Consolidation of the FTTMR010 clocksource/event driver (Linus
    Walleij)

    - The usual set of small fixes and updates all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (93 commits)
    timers: Make the cpu base lock raw
    clocksource/drivers/mips-gic-timer: Fix an error code in 'gic_clocksource_of_init()'
    clocksource/drivers/fsl_ftm_timer: Unmap region obtained by of_iomap
    clocksource/drivers/tcb_clksrc: Make IO endian agnostic
    clocksource/drivers/sun4i: Switch to the timer-of common init
    clocksource/drivers/timer-of: Fix invalid iomap check
    Revert "ktime: Simplify ktime_compare implementation"
    clocksource/drivers: Fix uninitialized variable use in timer_of_init
    kselftests: timers: Add test for frequency step
    kselftests: timers: Fix inconsistency-check to not ignore first timestamp
    time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD
    time: Clean up CLOCK_MONOTONIC_RAW time handling
    posix-cpu-timers: Make timespec to nsec conversion safe
    itimer: Make timeval to nsec conversion range limited
    timers: Fix parameter description of try_to_del_timer_sync()
    ktime: Simplify ktime_compare implementation
    clocksource/drivers/fttmr010: Factor out clock read code
    clocksource/drivers/fttmr010: Implement delay timer
    clocksource/drivers: Add timer-of common init routine
    clocksource/drivers/tcb_clksrc: Save timer context on suspend/resume
    ...

    Linus Torvalds
     
  • on MMU targets EFAULT is possible here. Make both return 0 or error,
    passing what used to be the return value of flat_get_addr_from_rp()
    by reference.

    Signed-off-by: Al Viro

    Al Viro
     

01 Jul, 2017

1 commit

  • Currently, internals of dma_common_mmap() is compiled out if build is
    done for either NOMMU or target which explicitly says it does not
    have/want coherent DMA mmap. It turned out that dma_common_mmap() can
    be handy in NOMMU setup (at least for ARM).

    This patch converts exitent NOMMU targets to use ARCH_NO_COHERENT_DMA_MMAP,
    thus when CONFIG_MMU is gone from dma_common_mmap() their behaviour stays
    unchanged.

    ARM is not converted to ARCH_NO_COHERENT_DMA_MMAP because it 1)
    already has mmap callback which can handle (at some extent) NOMMU 2)
    already defines dummy pgprot_noncached() for NOMMU build.

    c6x and frv stay untouched since they already have ARCH_NO_COHERENT_DMA_MMAP.

    Cc: Steven Miao
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: Chris Zankel
    Cc: Max Filippov
    Suggested-by: Christoph Hellwig
    Signed-off-by: Vladimir Murzin
    Tested-by: Benjamin Gaignard

    Vladimir Murzin