06 Jan, 2020

20 commits

  • Disable a couple of compilation warnings (which are treated as errors)
    on strlcpy() definition and declaration, allowing users to compile perf
    and kernel (objtool) when:

    1. glibc have strlcpy() (such as in ALT Linux since 2004) objtool and
    perf build fails with this (in gcc):

    In file included from exec-cmd.c:3:
    tools/include/linux/string.h:20:15: error: redundant redeclaration of ‘strlcpy’ [-Werror=redundant-decls]
    20 | extern size_t strlcpy(char *dest, const char *src, size_t size);

    2. clang ignores `-Wredundant-decls', but produces another warning when
    building perf:

    CC util/string.o
    ../lib/string.c:99:8: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
    size_t __weak strlcpy(char *dest, const char *src, size_t size)
    ../../tools/include/linux/compiler.h:66:34: note: expanded from macro '__weak'
    # define __weak __attribute__((weak))
    /usr/include/bits/string_fortified.h:151:8: note: previous definition is here
    __NTH (strlcpy (char *__restrict __dest, const char *__restrict __src,

    Committer notes:

    The

    #pragma GCC diagnostic

    directive was introduced in gcc 4.6, so check for that as well.

    Fixes: ce99091 ("perf tools: Move strlcpy() from perf to tools/lib/string.c")
    Fixes: 0215d59 ("tools lib: Reinstate strlcpy() header guard with __UCLIBC__")
    Resolves: https://bugzilla.kernel.org/show_bug.cgi?id=118481
    Signed-off-by: Vitaly Chikunov
    Reviewed-by: Dmitry Levin
    Cc: Dmitry Levin
    Cc: Josh Poimboeuf
    Cc: kbuild test robot
    Cc: Peter Zijlstra
    Cc: stable@vger.kernel.org
    Cc: Vineet Gupta
    Link: http://lore.kernel.org/lkml/20191224172029.19690-1-vt@altlinux.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Vitaly Chikunov
     
  • The 'e' and 'c' hotkeys were present for a long time, but not documented
    in the help window, change 'e' to be a toggle so that it gets consistent
    with other toggles like '+' and document it in the help window.

    Keep 'c' as is for people used to it but don't document, as it is easier
    to just use 'e' to show/hide all the callchains for a top level
    histogram entry.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-pmyi5x34stlqmyu81rci94x9@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • This can happen in the --children mode, i.e. the default mode when
    callchains are present, where one of the main entries may be a callchain
    entry with no samples.

    So far we were not providing any information about why an annotation
    couldn't be provided even offering the Annotation option in the popup
    menu.

    Work is needed to allow for no-samples "annotation', i.e. to show the
    disassembly anyway and allow for navigation, etc.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-0hhzj2de15o88cguy7h66zre@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When the users presses ENTER in the main 'perf report/top' screen a
    popup menu is presented, in it some hotkeys are suggested as
    alternatives to using the menu, or for additional features.

    At that point the user may try those hotkeys, so allow for that by
    recording the key used and exiting, the caller then can check for that
    possibility and process the hotkey.

    I.e. try pressing ENTER, and then 'k' to exit and zoom into the kernel
    map, using ESC then zooms out, etc.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-ujfq3fw44kf6qrtfajl5dcsp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • With this patch if an optional pointer is passed to ui__popup_menu()
    then when any key that is not being handled (ENTER, ESC, etc) is typed,
    it'll record that key in the pointer and return, allowing for hotkey
    processing on the caller.

    If NULL is passed, no change in logic, unhandled keys continue to be
    ignored.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-6ojn19mqzgmrdm8kdoigic0m@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Sometimes we're in an outer code, like the main hists browser popup menu
    and the user follows a suggestion about using some hotkey, and that
    hotkey is really handled by hists_browser__run(), so allow for calling
    it with that hotkey, making it handle it instead of waiting for the user
    to press one.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-xv2l7i6o4urn37nv1h40ryfs@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • As a convenience, equivalent to pressing Enter in a line with a kernel
    symbol and then selecting "Zoom" into the kernel DSO.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-vbnlnrpyfvz9deqoobtc3dz7@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We'll use it to provide a top level hotkey to zoom into the kernel dso
    directly.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-ae9cjel6v05wjnz9r6z77b6x@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Taking into account the current status of the callchain, i.e. if folded,
    show "Expand", otherwise "Collapse", also show the name of the entry
    that will be affected and mention the hotkeys for expanding/collapsing
    all callchains below the main entry, the one that appears with/without
    callchains.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Linus Torvalds
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-03arm6poo8463k5tfcfp7gkk@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since previously pressing ENTER toggled expansion/collapse of callchain
    entries and now brings up the same menu used when callchains are not
    present, add an entry so that users can quickly figure out the change in
    behaviour.

    Its worth mentioning that we also always had 'e'/'c' to expand/collapse
    all entries in a hist entry and 'E'/'C' for all hist entries.

    Suggested-by: Linus Torvalds
    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-f9o03jo29fypvd8ly3j49d36@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When callchains are present the ENTER key switches from bringing up the
    menu that offers Annotation, Zoom by DSO, etc to expanding/collapsing
    one callchain level, causing confusion, fix it by making it consistently
    bring up the menu and use '+' to expand/collapse one callchain level.

    Next patch will also add an entry to the menu to allow
    expanding/collapsing, so that people used to ENTER expanding one
    callchain level can quickly find it and use it instead.

    Reported-by: Linus Torvalds
    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-bjz35omktig8cwn6lbj1ifns@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We need to set actions->ms.map since 599a2f38a989 ("perf hists browser:
    Check sort keys before hot key actions"), as in that patch we bail out
    if map is NULL.

    Reviewed-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Namhyung Kim
    Fixes: 599a2f38a989 ("perf hists browser: Check sort keys before hot key actions")
    Link: https://lkml.kernel.org/n/tip-wp1ssoewy6zihwwexqpohv0j@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • GCC9 introduced string hardening mechanisms, which exhibits the error
    during fs api compilation:

    error: '__builtin_strncpy' specified bound 4096 equals destination size
    [-Werror=stringop-truncation]

    This comes when the length of copy passed to strncpy is is equal to
    destination size, which could potentially lead to buffer overflow.

    There is a need to mitigate this potential issue by limiting the size of
    destination by 1 and explicitly terminate the destination with NULL.

    Signed-off-by: Andrey Zhizhikin
    Reviewed-by: Petr Mladek
    Acked-by: Jiri Olsa
    Cc: Alexei Starovoitov
    Cc: Andrii Nakryiko
    Cc: Daniel Borkmann
    Cc: Kefeng Wang
    Cc: Martin KaFai Lau
    Cc: Petr Mladek
    Cc: Sergey Senozhatsky
    Cc: Song Liu
    Cc: Yonghong Song
    Cc: bpf@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Link: http://lore.kernel.org/lkml/20191211080109.18765-1-andrey.zhizhikin@leica-geosystems.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Andrey Zhizhikin
     
  • Change the man page generation to asciidoc, because it's easier to use
    and has been more commonly used in related projects. Remove the current
    rst pages.

    Add 3 man pages to have a base for more additions:

    libperf.3 - overall description
    libperf-counting.7 - counting basics explained on simple example
    libperf-sampling.7 - sampling basics explained on simple example

    The plan is to add more man pages to cover the basic API.

    The build generates html and man pages:

    $ cd tools/lib/perf/Documentation
    $ make
    ASCIIDOC libperf.xml
    XMLTO libperf.3
    ASCIIDOC libperf-counting.xml
    XMLTO libperf-counting.7
    ASCIIDOC libperf-sampling.xml
    XMLTO libperf-sampling.7
    ASCIIDOC libperf.html
    ASCIIDOC libperf-counting.html
    ASCIIDOC libperf-sampling.html

    Add the following install targets:

    install-man - man pages
    install-html - html version of man pages
    install-examples - examples mentioned in the man pages

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Michael Petlan
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/20191206210612.8676-3-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Move libperf from its current location under tools/perf to a separate
    directory under tools/lib/.

    Also change various paths (mainly includes) to reflect the libperf move
    to a separate directory and add a new directory under MANIFEST.

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Michael Petlan
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/20191206210612.8676-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • To help understand failures.

    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: https://lkml.kernel.org/n/tip-c951j3gvrgnrsyg7ki7pwkiz@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Allow user to limit output to one or more CPUs. Really helpful on
    systems with a large number of cpus.

    Committer testing:

    # perf sched record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 1.765 MB perf.data (1412 samples) ]
    [root@quaco ~]# perf sched timehist | head
    Samples do not have callchains.
    time cpu task name wait time sch delay run time
    [tid/pid] (msec) (msec) (msec)
    --------------- ------ ------------------------------ --------- --------- ---------
    66307.802686 [0000] perf[13086] 0.000 0.000 0.000
    66307.802700 [0000] migration/0[12] 0.000 0.001 0.014
    66307.802766 [0001] perf[13086] 0.000 0.000 0.000
    66307.802774 [0001] migration/1[15] 0.000 0.001 0.007
    66307.802841 [0002] perf[13086] 0.000 0.000 0.000
    66307.802849 [0002] migration/2[20] 0.000 0.001 0.008
    66307.802913 [0003] perf[13086] 0.000 0.000 0.000
    #
    # perf sched timehist --cpu 2 | head
    Samples do not have callchains.
    time cpu task name wait time sch delay run time
    [tid/pid] (msec) (msec) (msec)
    --------------- ------ ------------------------------ --------- --------- ---------
    66307.802841 [0002] perf[13086] 0.000 0.000 0.000
    66307.802849 [0002] migration/2[20] 0.000 0.001 0.008
    66307.964485 [0002] 0.000 0.000 161.635
    66307.964811 [0002] CPU 0/KVM[3589/3561] 0.000 0.056 0.325
    66307.965477 [0002] 0.325 0.000 0.666
    66307.965553 [0002] CPU 0/KVM[3589/3561] 0.666 0.024 0.076
    66307.966456 [0002] 0.076 0.000 0.903
    #

    Signed-off-by: David Ahern
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lore.kernel.org/lkml/20191204173925.66976-1-dsahern@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Use struct mmap_cpu_mask type for the tool's thread and mmap data
    buffers to overcome current 1024 CPUs mask size limitation of cpu_set_t
    type.

    Currently glibc's cpu_set_t type has an internal mask size limit of 1024
    CPUs.

    Moving to the 'struct mmap_cpu_mask' type allows overcoming that limit.

    The tools bitmap API is used to manipulate objects of 'struct mmap_cpu_mask'
    type.

    Committer notes:

    To print the 'nbits' struct member we must use %zd, since it is a
    size_t, this fixes the build in some toolchains/arches.

    Reported-by: Andi Kleen
    Signed-off-by: Alexey Budankov
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/96d7e2ff-ce8b-c1e0-d52c-aa59ea96f0ea@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Budankov
     
  • Declare a dedicated struct map_cpu_mask type for cpu masks of arbitrary
    length.

    The mask is available thru bits pointer and the mask length is kept in
    nbits field. MMAP_CPU_MASK_BYTES() macro returns mask storage size in
    bytes.

    The mmap_cpu_mask__scnprintf() function can be used to log text
    representation of the mask.

    Committer notes:

    To print the 'nbits' struct member we must use %zd, since it is a
    size_t, this fixes the build in some toolchains/arches.

    Signed-off-by: Alexey Budankov
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/0fd2454f-477f-d15a-f4ee-79bcbd2585ff@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Budankov
     
  • Extend tools bitmap API with bitmap_equal() implementation.

    The implementation has been derived from the kernel.

    Extend tools bitmap API with bitmap_free() implementation for symmetry
    with bitmap_alloc() function.

    Signed-off-by: Alexey Budankov
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/43757993-0b28-d8af-a6c7-ede12e3a6877@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Alexey Budankov
     

24 Dec, 2019

1 commit

  • …inux/kernel/git/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    perf report/top:

    Arnaldo Carvalho de Melo:

    - Fix popup menu for entries in main kernel maps other than the main one,
    e.g. ".init.text", where a non-initialized pointer was causing segfaults.

    Jin Yao:

    - Fix incorrectly added dimensions when switching perf.data file to another
    via the popup menu.

    libtraceevent:

    Hewenliang:

    - Fix memory leakage in filter_event().

    perf hists:

    Yuya Fujita:

    - Fix variable name's inconsistency in hists__for_each() macro.

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

23 Dec, 2019

9 commits

  • Linus Torvalds
     
  • Pull vfs fixes from Al Viro:
    "Eric's s_inodes softlockup fixes + Jan's fix for recent regression
    from pipe rework"

    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    fs: call fsnotify_sb_delete after evict_inodes
    fs: avoid softlockups in s_inodes iterators
    pipe: Fix bogus dereference in iov_iter_alignment()

    Linus Torvalds
     
  • Pull xfs fixes from Darrick Wong:
    "Fix a few bugs that could lead to corrupt files, fsck complaints, and
    filesystem crashes:

    - Minor documentation fixes

    - Fix a file corruption due to read racing with an insert range
    operation.

    - Fix log reservation overflows when allocating large rt extents

    - Fix a buffer log item flags check

    - Don't allow administrators to mount with sunit= options that will
    cause later xfs_repair complaints about the root directory being
    suspicious because the fs geometry appeared inconsistent

    - Fix a non-static helper that should have been static"

    * tag 'xfs-5.5-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
    xfs: Make the symbol 'xfs_rtalloc_log_count' static
    xfs: don't commit sunit/swidth updates to disk if that would cause repair failures
    xfs: split the sunit parameter update into two parts
    xfs: refactor agfl length computation function
    libxfs: resync with the userspace libxfs
    xfs: use bitops interface for buf log item AIL flag check
    xfs: fix log reservation overflows when allocating large rt extents
    xfs: stabilize insert range start boundary to avoid COW writeback race
    xfs: fix Sphinx documentation warning

    Linus Torvalds
     
  • Pull ext4 bug fixes from Ted Ts'o:
    "Ext4 bug fixes, including a regression fix"

    * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: clarify impact of 'commit' mount option
    ext4: fix unused-but-set-variable warning in ext4_add_entry()
    jbd2: fix kernel-doc notation warning
    ext4: use RCU API in debug_print_tree
    ext4: validate the debug_want_extra_isize mount option at parse time
    ext4: reserve revoke credits in __ext4_new_inode
    ext4: unlock on error in ext4_expand_extra_isize()
    ext4: optimize __ext4_check_dir_entry()
    ext4: check for directory entries too close to block end
    ext4: fix ext4_empty_dir() for directories with holes

    Linus Torvalds
     
  • Pull block fixes from Jens Axboe:
    "Let's try this one again, this time without the compat_ioctl changes.
    We've got those fixed up, but that can go out next week.

    This contains:

    - block queue flush lockdep annotation (Bart)

    - Type fix for bsg_queue_rq() (Bart)

    - Three dasd fixes (Stefan, Jan)

    - nbd deadlock fix (Mike)

    - Error handling bio user map fix (Yang)

    - iocost fix (Tejun)

    - sbitmap waitqueue addition fix that affects the kyber IO scheduler
    (David)"

    * tag 'block-5.5-20191221' of git://git.kernel.dk/linux-block:
    sbitmap: only queue kyber's wait callback if not already active
    block: fix memleak when __blk_rq_map_user_iov() is failed
    s390/dasd: fix typo in copyright statement
    s390/dasd: fix memleak in path handling error case
    s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly
    block: Fix a lockdep complaint triggered by request queue flushing
    block: Fix the type of 'sts' in bsg_queue_rq()
    block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT
    nbd: fix shutdown and recv work deadlock v2
    iocost: over-budget forced IOs should schedule async delay

    Linus Torvalds
     
  • Pull KVM fixes from Paolo Bonzini:
    "PPC:
    - Fix a bug where we try to do an ultracall on a system without an
    ultravisor

    KVM:
    - Fix uninitialised sysreg accessor
    - Fix handling of demand-paged device mappings
    - Stop spamming the console on IMPDEF sysregs
    - Relax mappings of writable memslots
    - Assorted cleanups

    MIPS:
    - Now orphan, James Hogan is stepping down

    x86:
    - MAINTAINERS change, so long Radim and thanks for all the fish
    - supported CPUID fixes for AMD machines without SPEC_CTRL"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    MAINTAINERS: remove Radim from KVM maintainers
    MAINTAINERS: Orphan KVM for MIPS
    kvm: x86: Host feature SSBD doesn't imply guest feature AMD_SSBD
    kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
    KVM: PPC: Book3S HV: Don't do ultravisor calls on systems without ultravisor
    KVM: arm/arm64: Properly handle faulting of device mappings
    KVM: arm64: Ensure 'params' is initialised when looking up sys register
    KVM: arm/arm64: Remove excessive permission check in kvm_arch_prepare_memory_region
    KVM: arm64: Don't log IMP DEF sysreg traps
    KVM: arm64: Sanely ratelimit sysreg messages
    KVM: arm/arm64: vgic: Use wrapper function to lock/unlock all vcpus in kvm_vgic_create()
    KVM: arm/arm64: vgic: Fix potential double free dist->spis in __kvm_vgic_destroy()
    KVM: arm/arm64: Get rid of unused arg in cpu_init_hyp_mode()

    Linus Torvalds
     
  • Pull RISC-V fixes from Paul Walmsley:
    "Several fixes, and one cleanup, for RISC-V.

    Fixes:

    - Fix an error in a Kconfig file that resulted in an undefined
    Kconfig option "CONFIG_CONFIG_MMU"

    - Fix undefined Kconfig option "CONFIG_CONFIG_MMU"

    - Fix scratch register clearing in M-mode (affects nommu users)

    - Fix a mismerge on my part that broke the build for
    CONFIG_SPARSEMEM_VMEMMAP users

    Cleanup:

    - Move SiFive L2 cache-related code to drivers/soc, per request"

    * tag 'riscv/for-v5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
    riscv: move sifive_l2_cache.c to drivers/soc
    riscv: define vmemmap before pfn_to_page calls
    riscv: fix scratch register clearing in M-mode.
    riscv: Fix use of undefined config option CONFIG_CONFIG_MMU

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Several nf_flow_table_offload fixes from Pablo Neira Ayuso,
    including adding a missing ipv6 match description.

    2) Several heap overflow fixes in mwifiex from qize wang and Ganapathi
    Bhat.

    3) Fix uninit value in bond_neigh_init(), from Eric Dumazet.

    4) Fix non-ACPI probing of nxp-nci, from Stephan Gerhold.

    5) Fix use after free in tipc_disc_rcv(), from Tuong Lien.

    6) Enforce limit of 33 tail calls in mips and riscv JIT, from Paul
    Chaignon.

    7) Multicast MAC limit test is off by one in qede, from Manish Chopra.

    8) Fix established socket lookup race when socket goes from
    TCP_ESTABLISHED to TCP_LISTEN, because there lacks an intervening
    RCU grace period. From Eric Dumazet.

    9) Don't send empty SKBs from tcp_write_xmit(), also from Eric Dumazet.

    10) Fix active backup transition after link failure in bonding, from
    Mahesh Bandewar.

    11) Avoid zero sized hash table in gtp driver, from Taehee Yoo.

    12) Fix wrong interface passed to ->mac_link_up(), from Russell King.

    13) Fix DSA egress flooding settings in b53, from Florian Fainelli.

    14) Memory leak in gmac_setup_txqs(), from Navid Emamdoost.

    15) Fix double free in dpaa2-ptp code, from Ioana Ciornei.

    16) Reject invalid MTU values in stmmac, from Jose Abreu.

    17) Fix refcount leak in error path of u32 classifier, from Davide
    Caratti.

    18) Fix regression causing iwlwifi firmware crashes on boot, from Anders
    Kaseorg.

    19) Fix inverted return value logic in llc2 code, from Chan Shu Tak.

    20) Disable hardware GRO when XDP is attached to qede, frm Manish
    Chopra.

    21) Since we encode state in the low pointer bits, dst metrics must be
    at least 4 byte aligned, which is not necessarily true on m68k. Add
    annotations to fix this, from Geert Uytterhoeven.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (160 commits)
    sfc: Include XDP packet headroom in buffer step size.
    sfc: fix channel allocation with brute force
    net: dst: Force 4-byte alignment of dst_metrics
    selftests: pmtu: fix init mtu value in description
    hv_netvsc: Fix unwanted rx_table reset
    net: phy: ensure that phy IDs are correctly typed
    mod_devicetable: fix PHY module format
    qede: Disable hardware gro when xdp prog is installed
    net: ena: fix issues in setting interrupt moderation params in ethtool
    net: ena: fix default tx interrupt moderation interval
    net/smc: unregister ib devices in reboot_event
    net: stmmac: platform: Fix MDIO init for platforms without PHY
    llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
    net: hisilicon: Fix a BUG trigered by wrong bytes_compl
    net: dsa: ksz: use common define for tag len
    s390/qeth: don't return -ENOTSUPP to userspace
    s390/qeth: fix promiscuous mode after reset
    s390/qeth: handle error due to unsupported transport mode
    cxgb4: fix refcount init for TC-MQPRIO offload
    tc-testing: initial tdc selftests for cls_u32
    ...

    Linus Torvalds
     
  • LTP pipeio_1 test is hanging with v5.5-rc2-385-gb8e382a185eb,
    with read side observing empty pipe and sleeping and write
    side running out of space and then sleeping as well. In this
    scenario there are 5 writers and 1 reader.

    Problem is that after pipe_write() reacquires pipe lock, it
    re-checks for empty pipe with potentially stale 'head' and
    doesn't wake up read side anymore. pipe->tail can advance
    beyond 'head', because there are multiple writers.

    Use pipe->head for empty pipe check after reacquiring lock
    to observe current state.

    Testing: With patch, LTP pipeio_1 ran successfully in loop for 1 hour.
    Without patch it hanged within a minute.

    Fixes: 1b6b26ae7053 ("pipe: fix and clarify pipe write wakeup logic")
    Reported-by: Rachel Sibley
    Signed-off-by: Jan Stancek
    Signed-off-by: Linus Torvalds

    Jan Stancek
     

22 Dec, 2019

10 commits

  • …/paulus/powerpc into kvm-master

    PPC KVM fix for 5.5

    - Fix a bug where we try to do an ultracall on a system without an
    ultravisor.

    Paolo Bonzini
     
  • Radim's kernel.org email is bouncing, which I take as a signal that
    he is not really able to deal with KVM at this time. Make MAINTAINERS
    match the effective value of KVM's bus factor.

    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     
  • I haven't been active for 18 months, and don't have the hardware set up
    to test KVM for MIPS, so mark it as orphaned and remove myself as
    maintainer. Hopefully somebody from MIPS can pick this up.

    Signed-off-by: James Hogan
    Cc: Paolo Bonzini
    Cc: "Radim Krčmář"
    Cc: Paul Burton
    Cc: Ralf Baechle
    Cc: kvm@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Signed-off-by: Paolo Bonzini

    James Hogan
     
  • The description of 'commit' mount option dates back to ext3 times.
    Update the description to match current meaning for ext4.

    Reported-by: Paul Richards
    Signed-off-by: Jan Kara
    Link: https://lore.kernel.org/r/20191218111210.14161-1-jack@suse.cz
    Signed-off-by: Theodore Ts'o

    Jan Kara
     
  • Warning is found when compile with "-Wunused-but-set-variable":

    fs/ext4/namei.c: In function ‘ext4_add_entry’:
    fs/ext4/namei.c:2167:23: warning: variable ‘sbi’ set but not used
    [-Wunused-but-set-variable]
    struct ext4_sb_info *sbi;
    ^~~
    Fix this by moving the variable @sbi under CONFIG_UNICODE.

    Signed-off-by: Yunfeng Ye
    Reviewed-by: Ritesh Harjani
    Link: https://lore.kernel.org/r/cb5eb904-224a-9701-c38f-cb23514b1fff@huawei.com
    Signed-off-by: Theodore Ts'o

    Yunfeng Ye
     
  • Pull tracing fixes from Steven Rostedt:

    - Fix memory leak on error path of process_system_preds()

    - Lock inversion fix with updating tgid recording option

    - Fix histogram compare function on big endian machines

    - Fix histogram trigger function on big endian machines

    - Make trace_printk() irq sync on init for kprobe selftest correctness

    * tag 'trace-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Fix endianness bug in histogram trigger
    samples/trace_printk: Wait for IRQ work to finish
    tracing: Fix lock inversion in trace_event_enable_tgid_record()
    tracing: Have the histogram compare functions convert to u64 first
    tracing: Avoid memory leak in process_system_preds()

    Linus Torvalds
     
  • Pull libnvdimm fix from Dan Williams:
    "A minor regression fix.

    The libnvdimm unit tests were expecting to mock calls to
    ioremap_nocache() which disappeared in v5.5-rc1. This fix has appeared
    in -next and collided with some cleanups that Christoph has planned
    for v5.6, but he will fix up his branch once this goes in.

    Summary:

    - Restore the operation of the libnvdimm unit tests after the removal
    of ioremap_nocache()"

    * tag 'libnvdimm-fix-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    tools/testing/nvdimm: Fix mock support for ioremap

    Linus Torvalds
     
  • At least on PA-RISC and s390 synthetic histogram triggers are failing
    selftests because trace_event_raw_event_synth() always writes a 64 bit
    values, but the reader expects a field->size sized value. On little endian
    machines this doesn't hurt, but on big endian this makes the reader always
    read zero values.

    Link: http://lore.kernel.org/linux-trace-devel/20191218074427.96184-4-svens@linux.ibm.com

    Cc: stable@vger.kernel.org
    Fixes: 4b147936fa509 ("tracing: Add support for 'synthetic' events")
    Acked-by: Tom Zanussi
    Signed-off-by: Sven Schnelle
    Signed-off-by: Steven Rostedt (VMware)

    Sven Schnelle
     
  • trace_printk schedules work via irq_work_queue(), but doesn't
    wait until it was processed. The kprobe_module.tc testcase does:

    :;: "Load module again, which means the event1 should be recorded";:
    modprobe trace-printk
    grep "event1:" trace

    so the grep which checks the trace file might run before the irq work
    was processed. Fix this by adding a irq_work_sync().

    Link: http://lore.kernel.org/linux-trace-devel/20191218074427.96184-3-svens@linux.ibm.com

    Cc: stable@vger.kernel.org
    Fixes: af2a0750f3749 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module")
    Signed-off-by: Sven Schnelle
    Signed-off-by: Steven Rostedt (VMware)

    Sven Schnelle
     
  • Task T2 Task T3
    trace_options_core_write() subsystem_open()

    mutex_lock(trace_types_lock) mutex_lock(event_mutex)

    set_tracer_flag()

    trace_event_enable_tgid_record() mutex_lock(trace_types_lock)

    mutex_lock(event_mutex)

    This gives a circular dependency deadlock between trace_types_lock and
    event_mutex. To fix this invert the usage of trace_types_lock and
    event_mutex in trace_options_core_write(). This keeps the sequence of
    lock usage consistent.

    Link: http://lkml.kernel.org/r/0101016eef175e38-8ca71caf-a4eb-480d-a1e6-6f0bbc015495-000000@us-west-2.amazonses.com

    Cc: stable@vger.kernel.org
    Fixes: d914ba37d7145 ("tracing: Add support for recording tgid of tasks")
    Signed-off-by: Prateek Sood
    Signed-off-by: Steven Rostedt (VMware)

    Prateek Sood