Skip to content
  1. Nov 20, 2021
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.16-2021-11-19' of... · 8b98436a
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.16-2021-11-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix the 'local_weight', 'weight' (memory access latency),
         'local_ins_lat', 'ins_lat' (instruction latency) and 'pstage_cyc'
         (pipeline stage cycles) sort key sample aggregation.
      
       - Fix 'perf test' entry for watchpoints on s/390.
      
       - Fix branch_stack entry endianness check in the 'perf test' sample
         parsing test.
      
       - Fix ARM SPE handling on 'perf inject'.
      
       - Fix memory leaks detected with ASan.
      
       - Fix build on arm64 related to reallocarray() availability.
      
       - Sync copies of kernel headers: cpufeatures, kvm, MIPS syscalltable
         (futex_waitv).
      
      * tag 'perf-tools-fixes-for-v5.16-2021-11-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf evsel: Fix memory leaks relating to unit
        perf report: Fix memory leaks around perf_tip()
        perf hist: Fix memory leak of a perf_hpp_fmt
        tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
        tools build: Fix removal of feature-sync-compare-and-swap feature detection
        perf inject: Fix ARM SPE handling
        perf bench: Fix two memory leaks detected with ASan
        perf test sample-parsing: Fix branch_stack entry endianness check
        tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
        perf sort: Fix the 'p_stage_cyc' sort key behavior
        perf sort: Fix the 'ins_lat' sort key behavior
        perf sort: Fix the 'weight' sort key behavior
        perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
        perf tests wp: Remove unused functions on s390
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
      8b98436a
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 9539ba43
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
       "I have two patches for 5.16:
      
         - allow external modules to be built against read-only source trees
      
         - turn KVM on in the defconfigs
      
        The second one isn't technically a fix, but it got tied up pending
        some defconfig cleanups that ended up finding some larger issues. I
        figured it'd be better to get the config changes some more testing,
        but didn't want to hold up turning KVM on for that"
      
      * tag 'riscv-for-linus-5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: fix building external modules
        RISC-V: Enable KVM in RV64 and RV32 defconfigs as a module
      9539ba43
    • Linus Torvalds's avatar
      Merge branch 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of... · 7af959b5
      Linus Torvalds authored
      Merge branch 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull exit-vs-signal handling fixes from Eric Biederman:
       "This is a small set of changes where debuggers were no longer able to
        intercept synchronous SIGTRAP and SIGSEGV, introduced by the exit
        cleanups.
      
        This is essentially the change you suggested with all of i's dotted
        and the t's crossed so that ptrace can intercept all of the cases it
        has been able to intercept the past, and all of the cases that made it
        to exit without giving ptrace a chance still don't give ptrace a
        chance"
      
      * 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        signal: Replace force_fatal_sig with force_exit_sig when in doubt
        signal: Don't always set SA_IMMUTABLE for forced signals
      7af959b5
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ecd510d2
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Six fixes, five in drivers (ufs, qla2xxx, iscsi) and one core change
        to fix a regression in user space device state setting, which is used
        by the iscsi daemons to effect device recovery"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix mailbox direction flags in qla2xxx_get_adapter_id()
        scsi: ufs: core: Fix another task management completion race
        scsi: ufs: core: Fix task management completion timeout race
        scsi: core: sysfs: Fix hang when device state is set via sysfs
        scsi: iscsi: Unblock session then wake up error handler
        scsi: ufs: core: Improve SCSI abort handling
      ecd510d2
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · a8b5f8f2
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "There are a few big regression items from the merge window suggesting
        that people are testing rc1's but not testing the for-next branches:
      
         - Warnings fixes
      
         - Crash in hf1 when creating QPs and setting counters
      
         - Some old mlx4 cards fail to probe due to missing counters
      
         - Syzkaller crash in the new counters code"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        MAINTAINERS: Update for VMware PVRDMA driver
        RDMA/nldev: Check stat attribute before accessing it
        RDMA/mlx4: Do not fail the registration on port stats
        IB/hfi1: Properly allocate rdma counter desc memory
        RDMA/core: Set send and receive CQ before forwarding to the driver
        RDMA/netlink: Add __maybe_unused to static inline in C file
      a8b5f8f2
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 44791698
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix a coccicheck warning in gpio-virtio
      
       - fix gpio selftests build issues
      
       - fix a Kconfig issue in gpio-rockchip
      
      * tag 'gpio-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: rockchip: needs GENERIC_IRQ_CHIP to fix build errors
        selftests: gpio: restore CFLAGS options
        selftests: gpio: fix uninitialised variable warning
        selftests: gpio: fix gpio compiling error
        gpio: virtio: remove unneeded semicolon
      44791698
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-11-19' of git://anongit.freedesktop.org/drm/drm · ad44518a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This week's fixes, pretty quiet, about right for rc2. amdgpu is the
        bulk of them but the scheduler ones have been reported in a few places
        I think.
      
        Otherwise just some minor i915 fixes and a few other scattered around:
      
        scheduler:
         - two refcounting fixes
      
        cma-helper:
         - use correct free path for noncoherent
      
        efifb:
         - probing fix
      
        amdgpu:
         - Better debugging info for SMU msgs
         - Better error reporting when adding IP blocks
         - Fix UVD powergating regression on CZ
         - Clock reporting fix for navi1x
         - OLED panel backlight fix
         - Fix scaling on VGA/DVI for non-DC display code
         - Fix GLFCLK handling for RGP on some APUs
         - fix potential memory leak
      
        amdkfd:
         - GPU reset fix
      
        i915:
         - return error handling fix
         - ADL-P display fix
         - TGL DSI display clocks fix
      
        nouveau:
         - infoframe corruption fix
      
        sun4i:
         - Kconfig fix"
      
      * tag 'drm-fixes-2021-11-19' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/amdgpu: fix potential memleak
        drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again
        drm/amd/pm: add GFXCLK/SCLK clocks level print support for APUs
        drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors
        drm/amd/display: Fix OLED brightness control on eDP
        drm/amd/pm: Remove artificial freq level on Navi1x
        drm/amd/pm: avoid duplicate powergate/ungate setting
        drm/amdgpu: add error print when failing to add IP block(v2)
        drm/amd/pm: Enhanced reporting also for a stuck command
        drm/i915/guc: fix NULL vs IS_ERR() checking
        drm/i915/dsi/xelpd: Fix the bit mask for wakeup GB
        Revert "drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping"
        fbdev: Prevent probing generic drivers if a FB is already registered
        drm/scheduler: fix drm_sched_job_add_implicit_dependencies harder
        drm/scheduler: fix drm_sched_job_add_implicit_dependencies
        drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY
        drm/cma-helper: Release non-coherent memory with dma_free_noncoherent()
        drm/nouveau: hdmigv100.c: fix corrupted HDMI Vendor InfoFrame
      ad44518a
    • Peter Zijlstra's avatar
      x86: Pin task-stack in __get_wchan() · 0dc636b3
      Peter Zijlstra authored
      When commit 5d1ceb39
      
       ("x86: Fix __get_wchan() for !STACKTRACE")
      moved from stacktrace to native unwind_*() usage, the
      try_get_task_stack() got lost, leading to use-after-free issues for
      dying tasks.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Fixes: 5d1ceb39 ("x86: Fix __get_wchan() for !STACKTRACE")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215031
      Link: https://lore.kernel.org/stable/YZV02RCRVHIa144u@fedora64.linuxtx.org/
      
      
      Reported-by: default avatarJustin Forbes <jmforbes@linuxtx.org>
      Reported-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
      Cc: Qi Zheng <zhengqi.arch@bytedance.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0dc636b3
  2. Nov 19, 2021
  3. Nov 18, 2021
    • Ian Rogers's avatar
      perf evsel: Fix memory leaks relating to unit · b194c9cd
      Ian Rogers authored
      
      
      unit may have a strdup pointer or be to a literal, consequently memory
      assocciated with it isn't freed. Change it so the unit is always strdup
      and so the memory can be safely freed.
      
      Fix related issue in perf_event__process_event_update() for name and
      own_cpus. Leaks were spotted by leak sanitizer.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20211118084749.2191447-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b194c9cd
    • Ian Rogers's avatar
      perf report: Fix memory leaks around perf_tip() · d9fc7061
      Ian Rogers authored
      
      
      perf_tip() may allocate memory or use a literal, this means memory
      wasn't freed if allocated. Change the API so that literals aren't used.
      
      At the same time add missing frees for system_path. These issues were
      spotted using leak sanitizer.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20211118073804.2149974-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9fc7061
    • Ian Rogers's avatar
      perf hist: Fix memory leak of a perf_hpp_fmt · 0ca1f534
      Ian Rogers authored
      
      
      perf_hpp__column_unregister() removes an entry from a list but doesn't
      free the memory causing a memory leak spotted by leak sanitizer.
      
      Add the free while at the same time reducing the scope of the function
      to static.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20211118071247.2140392-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0ca1f534
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall · 8b8dcc37
      Arnaldo Carvalho de Melo authored
      To pick the changes in these csets:
      
        b3ff2881 ("MIPS: syscalls: Wire up futex_waitv syscall")
      
      That add support for this new syscall in tools such as 'perf trace'.
      
      For instance, this is now possible (adapted from the x86_64 test output):
      
        # perf trace -e futex_waitv
        ^C#
        # perf trace -v -e futex_waitv
        event qualifier tracepoint filter: (common_pid != 807333 && common_pid != 3564) && (id == 449)
        ^C#
        # perf trace -v -e futex* --max-events 10
        event qualifier tracepoint filter: (common_pid != 812168 && common_pid != 3564) && (id == 202 || id == 449)
        mmap size 528384B
                 ? (         ): Timer/219310  ... [continued]: futex())                                            = -1 ETIMEDOUT (Connection timed out)
             0.012 ( 0.002 ms): Timer/219310 futex(uaddr: 0x7fd0b152d3c8, op: WAKE|PRIVATE_FLAG, val: 1)           = 0
             0.024 ( 0.060 ms): Timer/219310 futex(uaddr: 0x7fd0b152d420, op: WAIT_BITSET|PRIVATE_FLAG, utime: 0x7fd0b1657840, val3: MATCH_ANY) = 0
             0.086 ( 0.001 ms): Timer/219310 futex(uaddr: 0x7fd0b152d3c8, op: WAKE|PRIVATE_FLAG, val: 1)           = 0
             0.088 (         ): Timer/219310 futex(uaddr: 0x7fd0b152d424, op: WAIT_BITSET|PRIVATE_FLAG, utime: 0x7fd0b1657840, val3: MATCH_ANY) ...
             0.075 ( 0.005 ms): Web Content/219299 futex(uaddr: 0x7fd0b152d420, op: WAKE|PRIVATE_FLAG, val: 1)     = 1
             0.169 ( 0.004 ms): Web Content/219299 futex(uaddr: 0x7fd0b152d424, op: WAKE|PRIVATE_FLAG, val: 1)     = 1
             0.088 ( 0.089 ms): Timer/219310  ... [continued]: futex())                                            = 0
             0.179 ( 0.001 ms): Timer/219310 futex(uaddr: 0x7fd0b152d3c8, op: WAKE|PRIVATE_FLAG, val: 1)           = 0
             0.181 (         ): Timer/219310 futex(uaddr: 0x7fd0b152d420, op: WAIT_BITSET|PRIVATE_FLAG, utime: 0x7fd0b1657840, val3: MATCH_ANY) ...
        #
      
      That is the filter expression attached to the raw_syscalls:sys_{enter,exit}
      tracepoints.
      
        $ grep futex_waitv tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
        449	n64	futex_waitv			sys_futex_waitv
        $
      
      This addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl'
        diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
      
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Wang Haojun <jiangliuer01@gmail.com>
      Link: https://lore.kernel.org/lkml/YZZRxuIyvSGLZhM4@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8b8dcc37
    • Arnaldo Carvalho de Melo's avatar
      tools build: Fix removal of feature-sync-compare-and-swap feature detection · e8c04ea0
      Arnaldo Carvalho de Melo authored
      The patch removing the feature-sync-compare-and-swap feature detection
      didn't remove the call to main_test_sync_compare_and_swap(), making the
      'test-all' case fail an all the feature tests to be performed
      individually:
      
        $ cat /tmp/build/perf/feature/test-all.make.output
        In file included from test-all.c:18:
        test-libpython-version.c:5:10: error: #error
            5 |         #error
              |          ^~~~~
        test-all.c: In function ‘main’:
        test-all.c:203:9: error: implicit declaration of function ‘main_test_sync_compare_and_swap’ [-Werror=implicit-function-declaration]
          203 |         main_test_sync_compare_and_swap(argc, argv);
              |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
        $
      
      Fix it, now to figure out what is that test-libpython-version.c
      problem...
      
      Fixes: 60fa754b ("tools: Remove feature-sync-compare-and-swap feature detection")
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/YZU9Fe0sgkHSXeC2@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e8c04ea0