1. 13 Apr, 2022 3 commits
    • Chen Yu's avatar
      cpufreq: intel_pstate: Handle no_turbo in frequency invariance · addca285
      Chen Yu authored
      Problem statement:
      
      Once the user has disabled turbo frequency by
      
      # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
      
      the cfs_rq's util_avg becomes quite small when compared with
      CPU capacity.
      
      Step to reproduce:
      
      # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
      
      # ./x86_cpuload --count 1 --start 3 --timeout 100 --busy 99
      
      would launch 1 thread and bind it to CPU3, lasting for 100 seconds,
      with a CPU utilization of 99%. [1]
      
      top result:
      %Cpu3  : 98.4 us,  0.0 sy,  0.0 ni,  1.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
      
      check util_avg:
      cat /sys/kernel/debug/sched/debug | grep "cfs_rq\[3\]" -A 20 | grep util_avg
        .util_avg                      : 611
      
      So the util_avg/cpu capacity is 611/1024, which is much smaller than
      98.4% shown in the top result.
      
      This might impact some logic in the scheduler. For example,
      group_is_overloaded() would compare the group_capacity and group_util
      in the sched group, to check if this sched group is overloaded or not.
      With this gap, even when there is a nearly 100% workload, the sched
      group will not be regarded as overloaded. Besides group_is_overloaded(),
      there are also other victims. There is a ongoing work that aims to
      optimize the task wakeup in a LLC domain. The main idea is to stop
      searching idle CPUs if the sched domain is overloaded[2]. This proposal
      also relies on the util_avg/CPU capacity to decide whether the LLC
      domain is overloaded.
      
      Analysis:
      
      CPU frequency invariance has caused this difference. In summary,
      the util_sum of cfs rq would decay quite fast when the CPU is in
      idle, when the CPU frequency invariance is enabled.
      
      The detail is as followed:
      
      As depicted in update_rq_clock_pelt(), when the frequency invariance
      is enabled, there would be two clock variables on each rq, clock_task
      and clock_pelt:
      
         The clock_pelt scales the time to reflect the effective amount of
         computation done during the running delta time but then syncs back to
         clock_task when rq is idle.
      
         absolute time    | 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16
         @ max frequency  ------******---------------******---------------
         @ half frequency ------************---------************---------
         clock pelt       | 1| 2|    3|    4| 7| 8| 9|   10|   11|14|15|16
      
      The fast decay of util_sum during idle is due to:
      
       1. rq->clock_pelt is always behind rq->clock_task
       2. rq->last_update is updated to rq->clock_pelt' after invoking
          ___update_load_sum()
       3. Then the CPU becomes idle, the rq->clock_pelt' would be suddenly
          increased a lot to rq->clock_task
       4. Enters ___update_load_sum() again, the idle period is calculated by
          rq->clock_task - rq->last_update, AKA, rq->clock_task - rq->clock_pelt'.
          The lower the CPU frequency is, the larger the delta =
          rq->clock_task - rq->clock_pelt' will be. Since the idle period will be
          used to decay the util_sum only, the util_sum drops significantly during
          idle period.
      
      Proposal:
      
      This symptom is not only caused by disabling turbo frequency, but it
      would also appear if the user limits the max frequency at runtime.
      
      Because, if the frequency is always lower than the max frequency,
      CPU frequency invariance would decay the util_sum quite fast during
      idle.
      
      As some end users would disable turbo after boot up, this patch aims to
      present this symptom and deals with turbo scenarios for now.
      
      It might be ideal if CPU frequency invariance is aware of the max CPU
      frequency (user specified) at runtime in the future.
      
      Link: https://github.com/yu-chen-surf/x86_cpuload.git #1
      Link: https://lore.kernel.org/lkml/20220310005228.11737-1-yu.c.chen@intel.com/ #2
      Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarGiovanni Gherdovich <ggherdovich@suse.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      addca285
    • Christophe Leroy's avatar
      cpufreq: Prepare cleanup of powerpc's asm/prom.h · 95996a67
      Christophe Leroy authored
      powerpc's asm/prom.h brings some headers that it doesn't
      need itself.
      
      In order to clean it up, first add missing headers in
      users of asm/prom.h
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      95996a67
    • Kevin Hao's avatar
      cpufreq: governor: Use kobject release() method to free dbs_data · a85ee640
      Kevin Hao authored
      The struct dbs_data embeds a struct gov_attr_set and
      the struct gov_attr_set embeds a kobject. Since every kobject must have
      a release() method and we can't use kfree() to free it directly,
      so introduce cpufreq_dbs_data_release() to release the dbs_data via
      the kobject::release() method. This fixes the calltrace like below:
      
        ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x34
        WARNING: CPU: 12 PID: 810 at lib/debugobjects.c:505 debug_print_object+0xb8/0x100
        Modules linked in:
        CPU: 12 PID: 810 Comm: sh Not tainted 5.16.0-next-20220120-yocto-standard+ #536
        Hardware name: Marvell OcteonTX CN96XX board (DT)
        pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
        pc : debug_print_object+0xb8/0x100
        lr : debug_print_object+0xb8/0x100
        sp : ffff80001dfcf9a0
        x29: ffff80001dfcf9a0 x28: 0000000000000001 x27: ffff0001464f0000
        x26: 0000000000000000 x25: ffff8000090e3f00 x24: ffff80000af60210
        x23: ffff8000094dfb78 x22: ffff8000090e3f00 x21: ffff0001080b7118
        x20: ffff80000aeb2430 x19: ffff800009e8f5e0 x18: 0000000000000000
        x17: 0000000000000002 x16: 00004d62e58be040 x15: 013590470523aff8
        x14: ffff8000090e1828 x13: 0000000001359047 x12: 00000000f5257d14
        x11: 0000000000040591 x10: 0000000066c1ffea x9 : ffff8000080d15e0
        x8 : ffff80000a1765a8 x7 : 0000000000000000 x6 : 0000000000000001
        x5 : ffff800009e8c000 x4 : ffff800009e8c760 x3 : 0000000000000000
        x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0001474ed040
        Call trace:
         debug_print_object+0xb8/0x100
         __debug_check_no_obj_freed+0x1d0/0x25c
         debug_check_no_obj_freed+0x24/0xa0
         kfree+0x11c/0x440
         cpufreq_dbs_governor_exit+0xa8/0xac
         cpufreq_exit_governor+0x44/0x90
         cpufreq_set_policy+0x29c/0x570
         store_scaling_governor+0x110/0x154
         store+0xb0/0xe0
         sysfs_kf_write+0x58/0x84
         kernfs_fop_write_iter+0x12c/0x1c0
         new_sync_write+0xf0/0x18c
         vfs_write+0x1cc/0x220
         ksys_write+0x74/0x100
         __arm64_sys_write+0x28/0x3c
         invoke_syscall.constprop.0+0x58/0xf0
         do_el0_svc+0x70/0x170
         el0_svc+0x54/0x190
         el0t_64_sync_handler+0xa4/0x130
         el0t_64_sync+0x1a0/0x1a4
        irq event stamp: 189006
        hardirqs last  enabled at (189005): [<ffff8000080849d0>] finish_task_switch.isra.0+0xe0/0x2c0
        hardirqs last disabled at (189006): [<ffff8000090667a4>] el1_dbg+0x24/0xa0
        softirqs last  enabled at (188966): [<ffff8000080106d0>] __do_softirq+0x4b0/0x6a0
        softirqs last disabled at (188957): [<ffff80000804a618>] __irq_exit_rcu+0x108/0x1a4
      
      [ rjw: Because can be freed by the gov_attr_set_put() in
        cpufreq_dbs_governor_exit() now, it is also necessary to put the
        invocation of the governor ->exit() callback into the new
        cpufreq_dbs_data_release() function. ]
      
      Fixes: c4435630 ("cpufreq: governor: New sysfs show/store callbacks for governor tunables")
      Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a85ee640
  2. 11 Apr, 2022 1 commit
  3. 10 Apr, 2022 13 commits
    • Linus Torvalds's avatar
      Merge tag 'tty-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 8b57b304
      Linus Torvalds authored
      Pull serial driver fix from Greg KH:
       "This is a single serial driver fix for a build issue that showed up
        due to changes that came in through the tty tree in 5.18-rc1 that were
        missed previously. It resolves a build error with the mpc52xx_uart
        driver.
      
        It has been in linux-next this week with no reported problems"
      
      * tag 'tty-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned, part II.
      8b57b304
    • Linus Torvalds's avatar
      Merge tag 'staging-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 95aa17c3
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix for 5.18-rc2 that resolves an
        endian issue for the r8188eu driver. It has been in linux-next all
        this week with no reported problems"
      
      * tag 'staging-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: r8188eu: Fix PPPoE tag insertion on little endian systems
      95aa17c3
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.18-rc2' of... · 33563138
      Linus Torvalds authored
      Merge tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core updates from Greg KH:
       "Here are two small driver core changes for 5.18-rc2.
      
        They are the final bits in the removal of the default_attrs field in
        struct kobj_type. I had to wait until after 5.18-rc1 for all of the
        changes to do this came in through different development trees, and
        then one new user snuck in. So this series has two changes:
      
         - removal of the default_attrs field in the powerpc/pseries/vas code.
      
           The change has been acked by the PPC maintainers to come through
           this tree
      
         - removal of default_attrs from struct kobj_type now that all
           in-kernel users are removed.
      
           This cleans up the kobject code a little bit and removes some
           duplicated functionality that confused people (now there is only
           one way to do default groups)
      
        Both of these have been in linux-next for all of this week with no
        reported problems"
      
      * tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kobject: kobj_type: remove default_attrs
        powerpc/pseries/vas: use default_groups in kobj_type
      33563138
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · f58d3410
      Linus Torvalds authored
      Pull char/misc driver fix from Greg KH:
       "A single driver fix. It resolves the build warning issue on 32bit
        systems in the habannalabs driver that came in during the 5.18-rc1
        merge cycle.
      
        It has been in linux-next for all this week with no reported problems"
      
      * tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        habanalabs: Fix test build failures
      f58d3410
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 4ea3c642
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix KVM "lost kick" race, where an attempt to pull a vcpu out of the
         guest could be lost (or delayed until the next guest exit).
      
       - Disable SCV (system call vectored) when PR KVM guests could be run.
      
       - Fix KVM PR guests using SCV, by disallowing AIL != 0 for KVM PR
         guests.
      
       - Add a new KVM CAP to indicate if AIL == 3 is supported.
      
       - Fix a regression when hotplugging a CPU to a memoryless/cpuless node.
      
       - Make virt_addr_valid() stricter for 64-bit Book3E & 32-bit, which
         fixes crashes seen due to hardened usercopy.
      
       - Revert a change to max_mapnr which broke HIGHMEM.
      
      Thanks to Christophe Leroy, Fabiano Rosas, Kefeng Wang, Nicholas Piggin,
      and Srikar Dronamraju.
      
      * tag 'powerpc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        Revert "powerpc: Set max_mapnr correctly"
        powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit
        KVM: PPC: Move kvmhv_on_pseries() into kvm_ppc.h
        powerpc/numa: Handle partially initialized numa nodes
        powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S
        KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3
        KVM: PPC: Book3S PR: Disallow AIL != 0
        KVM: PPC: Book3S PR: Disable SCV when AIL could be disabled
        KVM: PPC: Book3S HV P9: Fix "lost kick" race
      4ea3c642
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2022-04-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1519610b
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of interrupt chip driver fixes:
      
         - A fix for a long standing bug in the ARM GICv3 redistributor
           polling which uses the wrong bit number to test.
      
         - Prevent translation of bogus ACPI table entries which map device
           interrupts into the IPI space on ARM GICs.
      
         - Don't write into the pending register of ARM GICV4 before the scan
           in hardware has completed.
      
         - A set of build and correctness fixes for the Qualcomm MPM driver"
      
      * tag 'irq-urgent-2022-04-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic, gic-v3: Prevent GSI to SGI translations
        irqchip/gic-v3: Fix GICR_CTLR.RWP polling
        irqchip/gic-v4: Wait for GICR_VPENDBASER.Dirty to clear before descheduling
        irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init()
        irq/qcom-mpm: Fix build error without MAILBOX
      1519610b
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9c6913b7
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Fix the MSI message data struct definition
      
       - Use local labels in the exception table macros to avoid symbol
         conflicts with clang LTO builds
      
       - A couple of fixes to objtool checking of the relatively newly added
         SLS and IBT code
      
       - Rename a local var in the WARN* macro machinery to prevent shadowing
      
      * tag 'x86_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/msi: Fix msi message data shadow struct
        x86/extable: Prefer local labels in .set directives
        x86,bpf: Avoid IBT objtool warning
        objtool: Fix SLS validation for kcov tail-call replacement
        objtool: Fix IBT tail-call detection
        x86/bug: Prevent shadowing in __WARN_FLAGS
        x86/mm/tlb: Revert retpoline avoidance approach
      9c6913b7
    • Linus Torvalds's avatar
      Merge tag 'perf_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b51f86e9
      Linus Torvalds authored
      Pull perf fixes from Borislav Petkov:
      
       - A couple of fixes to cgroup-related handling of perf events
      
       - A couple of fixes to event encoding on Sapphire Rapids
      
       - Pass event caps of inherited events so that perf doesn't fail wrongly
         at fork()
      
       - Add support for a new Raptor Lake CPU
      
      * tag 'perf_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Always set cpuctx cgrp when enable cgroup event
        perf/core: Fix perf_cgroup_switch()
        perf/core: Use perf_cgroup_info->active to check if cgroup is active
        perf/core: Don't pass task around when ctx sched in
        perf/x86/intel: Update the FRONTEND MSR mask on Sapphire Rapids
        perf/x86/intel: Don't extend the pseudo-encoding to GP counters
        perf/core: Inherit event_caps
        perf/x86/uncore: Add Raptor Lake uncore support
        perf/x86/msr: Add Raptor Lake CPU support
        perf/x86/cstate: Add Raptor Lake support
        perf/x86: Add Intel Raptor Lake support
      b51f86e9
    • Linus Torvalds's avatar
      Merge tag 'locking_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 50c94de6
      Linus Torvalds authored
      Pull locking fixes from Borislav Petkov:
      
       - Allow the compiler to optimize away unused percpu accesses and change
         the local_lock_* macros back to inline functions
      
       - A couple of fixes to static call insn patching
      
      * tag 'locking_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "mm/page_alloc: mark pagesets as __maybe_unused"
        Revert "locking/local_lock: Make the empty local_lock_*() function a macro."
        x86/percpu: Remove volatile from arch_raw_cpu_ptr().
        static_call: Remove __DEFINE_STATIC_CALL macro
        static_call: Properly initialise DEFINE_STATIC_CALL_RET0()
        static_call: Don't make __static_call_return0 static
        x86,static_call: Fix __static_call_return0 for i386
      50c94de6
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7136849e
      Linus Torvalds authored
      Pull scheduler fixes from Borislav Petkov:
      
       - Use the correct static key checking primitive on the IRQ exit path
      
       - Two fixes for the new forceidle balancer
      
      * tag 'sched_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        entry: Fix compile error in dynamic_irqentry_exit_cond_resched()
        sched: Teach the forced-newidle balancer about CPU affinity limitation.
        sched/core: Fix forceidle balancing
      7136849e
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.18-2022-04-09' of... · 1862a69c
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.18-2022-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix the clang command line option probing and remove some options to
         filter out, fixing the build with the latest clang versions
      
       - Fix 'perf bench' futex and epoll benchmarks to deal with machines
         with more than 1K CPUs
      
       - Fix 'perf test tsc' error message when not supported
      
       - Remap perf ring buffer if there is no space for event, fixing perf
         usage in 32-bit ChromeOS
      
       - Drop objdump stderr to avoid getting stuck waiting for stdout output
         in 'perf annotate'
      
       - Fix up garbled output by now showing unwind error messages when
         augmenting frame in best effort mode
      
       - Fix perf's libperf_print callback, use the va_args eprintf() variant
      
       - Sync vhost and arm64 cputype headers with the kernel sources
      
       - Fix 'perf report --mem-mode' with ARM SPE
      
       - Add missing external commands ('iiostat', etc) to 'perf --list-cmds'
      
      * tag 'perf-tools-fixes-for-v5.18-2022-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf annotate: Drop objdump stderr to avoid getting stuck waiting for stdout output
        perf tools: Add external commands to list-cmds
        perf docs: Add perf-iostat link to manpages
        perf session: Remap buf if there is no space for event
        perf bench: Fix epoll bench to correct usage of affinity for machines with #CPUs > 1K
        perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K
        perf tools: Fix perf's libperf_print callback
        perf: arm-spe: Fix perf report --mem-mode
        perf unwind: Don't show unwind error messages when augmenting frame pointer stack
        tools headers arm64: Sync arm64's cputype.h with the kernel sources
        perf test tsc: Fix error message when not supported
        perf build: Don't use -ffat-lto-objects in the python feature test when building with clang-13
        perf python: Fix probing for some clang command line options
        tools build: Filter out options and warnings not supported by clang
        tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts
        tools include UAPI: Sync linux/vhost.h with the kernel sources
      1862a69c
    • Linus Torvalds's avatar
      Merge tag 'cxl+nvdimm-for-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 94a4c2bb
      Linus Torvalds authored
      Pull cxl and nvdimm fixes from Dan Williams:
      
       - Fix a compile error in the nvdimm unit tests
      
       - Fix a shadowed variable warning in the CXL PCI driver
      
      * tag 'cxl+nvdimm-for-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        cxl/pci: Drop shadowed variable
        tools/testing/nvdimm: Fix security_init() symbol collision
      94a4c2bb
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · fa3b895d
      Linus Torvalds authored
      Pull gpio fix from Bartosz Golaszewski:
      
       - fix a race condition with consumers accessing the fields of GPIO IRQ
         chips before they're fully initialized
      
      * tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: Restrict usage of GPIO chip irq members before initialization
      fa3b895d
  4. 09 Apr, 2022 23 commits
    • Thomas Gleixner's avatar
      Merge tag 'irqchip-fixes-5.18-1' of... · 63ef1a8a
      Thomas Gleixner authored
      Merge tag 'irqchip-fixes-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent
      
      Pull irqchip fixes from Marc Zyngier:
      
       - Fix GICv3 polling for RWP in redistributors
      
       - Reject ACPI attempts to use SGIs on GIC/GICv3
      
       - Fix unpredictible behaviour when making a VPE non-resident
         with GICv4
      
       - A couple of fixes for the newly merged qcom-mpm driver
      
      Link: https://lore.kernel.org/lkml/20220409094229.267649-1-maz@kernel.org
      63ef1a8a
    • Ian Rogers's avatar
      perf annotate: Drop objdump stderr to avoid getting stuck waiting for stdout output · 940a445a
      Ian Rogers authored
      If objdump writes to stderr it can block waiting for it to be read. As
      perf doesn't read stderr then progress stops with perf waiting for
      stdout output.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Denis Nikitin <denik@chromium.org>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Lexi Shao <shaolexi@huawei.com>
      Cc: Li Huafei <lihuafei1@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lore.kernel.org/lkml/20220407230503.1265036-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      940a445a
    • Michael Petlan's avatar
      perf tools: Add external commands to list-cmds · 3e6b43be
      Michael Petlan authored
      The `perf --list-cmds` output prints only internal commands, although
      there is no reason for that from users' perspective.
      
      Adding the external commands to commands array with NULL function
      pointer allows printing all perf commands while not changing the logic
      of command handler selection.
      Signed-off-by: default avatarMichael Petlan <mpetlan@redhat.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/r/20220404221541.30312-2-mpetlan@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3e6b43be
    • Michael Petlan's avatar
    • Denis Nikitin's avatar
      perf session: Remap buf if there is no space for event · bc21e74d
      Denis Nikitin authored
      If a perf event doesn't fit into remaining buffer space return NULL to
      remap buf and fetch the event again.
      
      Keep the logic to error out on inadequate input from fuzzing.
      
      This fixes perf failing on ChromeOS (with 32b userspace):
      
        $ perf report -v -i perf.data
        ...
        prefetch_event: head=0x1fffff8 event->header_size=0x30, mmap_size=0x2000000: fuzzed or compressed perf.data?
        Error:
        failed to process sample
      
      Fixes: 57fc032a ("perf session: Avoid infinite loop when seeing invalid header.size")
      Reviewed-by: default avatarJames Clark <james.clark@arm.com>
      Signed-off-by: default avatarDenis Nikitin <denik@chromium.org>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220330031130.2152327-1-denik@chromium.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bc21e74d
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · e1f700eb
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
      
       - add support for new devices (ufs, mvsas)
      
       - a major set of fixes in lpfc
      
       - get rid of a driver specific ioctl in pcmraid
      
       - a major rework of aha152x to get rid of the scsi_pointer.
      
       - minor fixes and obvious changes including several spelling updates.
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (36 commits)
        scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan
        scsi: ufs: ufshpb: Fix a NULL check on list iterator
        scsi: sd: Clean up gendisk if device_add_disk() failed
        scsi: message: fusion: Remove redundant variable dmp
        scsi: mvsas: Add PCI ID of RocketRaid 2640
        scsi: sd: sd_read_cpr() requires VPD pages
        scsi: mpt3sas: Fail reset operation if config request timed out
        scsi: sym53c500_cs: Stop using struct scsi_pointer
        scsi: ufs: ufs-pci: Add support for Intel MTL
        scsi: mpt3sas: Fix mpt3sas_check_same_4gb_region() kdoc comment
        scsi: scsi_debug: Fix sdebug_blk_mq_poll() in_use_bm bitmap use
        scsi: bnx2i: Fix spelling mistake "mis-match" -> "mismatch"
        scsi: bnx2fc: Fix spelling mistake "mis-match" -> "mismatch"
        scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()
        scsi: aic7xxx: Use standard PCI subsystem, subdevice defines
        scsi: ufs: qcom: Drop custom Android boot parameters
        scsi: core: sysfs: Remove comments that conflict with the actual logic
        scsi: hisi_sas: Remove stray fallthrough annotation
        scsi: virtio-scsi: Eliminate anonymous module_init & module_exit
        scsi: isci: Fix spelling mistake "doesnt" -> "doesn't"
        ...
      e1f700eb
    • Athira Rajeev's avatar
      perf bench: Fix epoll bench to correct usage of affinity for machines with #CPUs > 1K · 299687e1
      Athira Rajeev authored
      The 'perf bench epoll' testcase fails on systems with more than 1K CPUs.
      
      Testcase: perf bench epoll all
      
      Result snippet:
      <<>>
      Run summary [PID 106497]: 1399 threads monitoring on 64 file-descriptors for 8 secs.
      
      perf: pthread_create: No such file or directory
      <<>>
      
      In epoll benchmarks (ctl, wait) pthread_create is invoked in do_threads
      from respective bench_epoll_*  function. Though the logs shows direct
      failure from pthread_create, the actual failure is from
      "sched_setaffinity" returning EINVAL (invalid argument).
      
      This happens because the default mask size in glibc is 1024. To overcome
      this 1024 CPUs mask size limitation of cpu_set_t, change the mask size
      using the CPU_*_S macros.
      
      Patch addresses this by fixing all the epoll benchmarks to use CPU_ALLOC
      to allocate cpumask, CPU_ALLOC_SIZE for size, and CPU_SET_S to set the
      mask.
      Reported-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Signed-off-by: default avatarAthira Jajeev <atrajeev@linux.vnet.ibm.com>
      Tested-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: https://lore.kernel.org/r/20220406175113.87881-3-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      299687e1
    • Athira Rajeev's avatar
      perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K · c9c2a427
      Athira Rajeev authored
      The 'perf bench futex' testcase fails on systems with more than 1K CPUs.
      
      Testcase: perf bench futex all
      
      Failure snippet:
      <<>>Running futex/hash benchmark...
      
      perf: pthread_create: No such file or directory
      <<>>
      
      All the futex benchmarks (ie hash, lock-api, requeue, wake,
      wake-parallel), pthread_create is invoked in respective bench_futex_*
      function. Though the logs shows direct failure from pthread_create,
      strace logs showed that actual failure is from  "sched_setaffinity"
      returning EINVAL (invalid argument).
      
      This happens because the default mask size in glibc is 1024. To overcome
      this 1024 CPUs mask size limitation of cpu_set_t, change the mask size
      using the CPU_*_S macros.
      
      Patch addresses this by fixing all the futex benchmarks to use CPU_ALLOC
      to allocate cpumask, CPU_ALLOC_SIZE for size, and CPU_SET_S to set the
      mask.
      Reported-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Reviewed-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: default avatarAthira Jajeev <atrajeev@linux.vnet.ibm.com>
      Tested-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: https://lore.kernel.org/r/20220406175113.87881-2-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c9c2a427
    • Adrian Hunter's avatar
      perf tools: Fix perf's libperf_print callback · aeee9dc5
      Adrian Hunter authored
      eprintf() does not expect va_list as the type of the 4th parameter.
      
      Use veprintf() because it does.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Fixes: 428dab81 ("libperf: Merge libperf_set_print() into libperf_init()")
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/r/20220408132625.2451452-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aeee9dc5
    • James Clark's avatar
      perf: arm-spe: Fix perf report --mem-mode · ffab4870
      James Clark authored
      Since commit bb30acae ("perf report: Bail out --mem-mode if mem
      info is not available") "perf mem report" and "perf report --mem-mode"
      don't allow opening the file unless one of the events has
      PERF_SAMPLE_DATA_SRC set.
      
      SPE doesn't have this set even though synthetic memory data is generated
      after it is decoded. Fix this issue by setting DATA_SRC on SPE events.
      This has no effect on the data collected because the SPE driver doesn't
      do anything with that flag and doesn't generate samples.
      
      Fixes: bb30acae ("perf report: Bail out --mem-mode if mem info is not available")
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220408144056.1955535-1-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ffab4870
    • James Clark's avatar
      perf unwind: Don't show unwind error messages when augmenting frame pointer stack · fa7095c5
      James Clark authored
      Commit Fixes: b9f6fbb3 ("perf arm64: Inject missing frames when
      using 'perf record --call-graph=fp'") intended to add a 'best effort'
      DWARF unwind that improved the frame pointer stack in most scenarios.
      
      It's expected that the unwind will fail sometimes, but this shouldn't be
      reported as an error. It only works when the return address can be
      determined from the contents of the link register alone.
      
      Fix the error shown when the unwinder requires extra registers by adding
      a new flag that suppresses error messages. This flag is not set in the
      normal --call-graph=dwarf unwind mode so that behavior is not changed.
      
      Fixes: b9f6fbb3 ("perf arm64: Inject missing frames when using 'perf record --call-graph=fp'")
      Reported-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220406145651.1392529-1-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fa7095c5
    • Arnaldo Carvalho de Melo's avatar
      tools headers arm64: Sync arm64's cputype.h with the kernel sources · 278aaba2
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        83bea32a ("arm64: Add part number for Arm Cortex-A78AE")
      
      That addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h'
        diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
      
      Cc: Ali Saidi <alisaidi@amazon.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Chanho Park <chanho61.park@samsung.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      278aaba2
    • Chengdong Li's avatar
      perf test tsc: Fix error message when not supported · 290fa68b
      Chengdong Li authored
      By default `perf test tsc` does not return the error message when the
      child process detected kernel does not support it. Instead, the child
      process prints an error message to stderr, unfortunately stderr is
      redirected to /dev/null when verbose <= 0.
      
      This patch does:
      
      - return TEST_SKIP to the parent process instead of TEST_OK when
        perf_read_tsc_conversion() is not supported.
      
      - Add a new subtest of testing if TSC is supported on current
        architecture by moving exist code to a separate function.
        It avoids two places in test__perf_time_to_tsc() that return
        TEST_SKIP by doing this.
      
      - Extend the test suite definition to contain above two subtests.
        Current test_suite and test_case structs do not support printing skip
        reason when the number of subtest less than 1. To print skip reason, it
        is necessary to extend current test suite definition.
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarChengdong Li <chengdongli@tencent.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: likexu@tencent.com
      Link: https://lore.kernel.org/r/20220408084748.43707-1-chengdongli@tencent.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      290fa68b
    • Arnaldo Carvalho de Melo's avatar
      perf build: Don't use -ffat-lto-objects in the python feature test when building with clang-13 · 3a8a0475
      Arnaldo Carvalho de Melo authored
      Using -ffat-lto-objects in the python feature test when building with
      clang-13 results in:
      
        clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
        error: command '/usr/sbin/clang' failed with exit code 1
        cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory
        make[2]: *** [Makefile.perf:639: /tmp/build/perf/python/perf.so] Error 1
      
      Noticed when building on a docker.io/library/archlinux:base container.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Keeping <john@metanate.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Sedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3a8a0475
    • Arnaldo Carvalho de Melo's avatar
      perf python: Fix probing for some clang command line options · dd6e1fe9
      Arnaldo Carvalho de Melo authored
      The clang compiler complains about some options even without a source
      file being available, while others require one, so use the simple
      tools/build/feature/test-hello.c file.
      
      Then check for the "is not supported" string in its output, in addition
      to the "unknown argument" already being looked for.
      
      This was noticed when building with clang-13 where -ffat-lto-objects
      isn't supported and since we were looking just for "unknown argument"
      and not providing a source code to clang, was mistakenly assumed as
      being available and not being filtered to set of command line options
      provided to clang, leading to a build failure.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Keeping <john@metanate.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Sedat Dilek <sedat.dilek@gmail.com>
      Link: http://lore.kernel.org/lkml/Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dd6e1fe9
    • Arnaldo Carvalho de Melo's avatar
      tools build: Filter out options and warnings not supported by clang · 41caff45
      Arnaldo Carvalho de Melo authored
      These make the feature check fail when using clang, so remove them just
      like is done in tools/perf/Makefile.config to build perf itself.
      
      Adding -Wno-compound-token-split-by-macro to tools/perf/Makefile.config
      when building with clang is also necessary to avoid these warnings
      turned into errors (-Werror):
      
          CC      /tmp/build/perf/util/scripting-engines/trace-event-perl.o
        In file included from util/scripting-engines/trace-event-perl.c:35:
        In file included from /usr/lib64/perl5/CORE/perl.h:4085:
        In file included from /usr/lib64/perl5/CORE/hv.h:659:
        In file included from /usr/lib64/perl5/CORE/hv_func.h:34:
        In file included from /usr/lib64/perl5/CORE/sbox32_hash.h:4:
        /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
            ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /usr/lib64/perl5/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
        #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                             ^~~~~~~~~~
        /usr/lib64/perl5/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
        #   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                                      ^
        /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: '{' token is here
            ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /usr/lib64/perl5/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
        #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                        ^
        /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
            ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /usr/lib64/perl5/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
            v ^= (v>>23);                       \
                                                ^
        /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: ')' token is here
            ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /usr/lib64/perl5/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
        } STMT_END
          ^~~~~~~~
        /usr/lib64/perl5/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
        #   define STMT_END     )
                                ^
      
      Please refer to the discussion on the Link: tag below, where Nathan
      clarifies the situation:
      
      <quote>
      acme> And then get to the problems at the end of this message, which seem
      acme> similar to the problem described here:
      acme>
      acme> From  Nathan Chancellor <>
      acme> Subject	[PATCH] mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO
      acme>
      acme> https://lkml.org/lkml/2020/9/1/135
      acme>
      acme> So perhaps in this case its better to disable that
      acme> -Werror,-Wcompound-token-split-by-macro when building with clang?
      
      Yes, I think that is probably the best solution. As far as I can tell,
      at least in this file and context, the warning appears harmless, as the
      "create a GNU C statement expression from two different macros" is very
      much intentional, based on the presence of PERL_USE_GCC_BRACE_GROUPS.
      The warning is fixed in upstream Perl by just avoiding creating GNU C
      statement expressions using STMT_START and STMT_END:
      
        https://github.com/Perl/perl5/issues/18780
        https://github.com/Perl/perl5/pull/18984
      
      If I am reading the source code correctly, an alternative to disabling
      the warning would be specifying -DPERL_GCC_BRACE_GROUPS_FORBIDDEN but it
      seems like that might end up impacting more than just this site,
      according to the issue discussion above.
      </quote>
      Based-on-a-patch-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # Debian/Selfmade LLVM-14 (x86-64)
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Keeping <john@metanate.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Link: http://lore.kernel.org/lkml/YkxWcYzph5pC1EK8@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      41caff45
    • Arnaldo Carvalho de Melo's avatar
      tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts · 541f695c
      Arnaldo Carvalho de Melo authored
      Just like its done for ldopts and for both in tools/perf/Makefile.config.
      
      Using `` to initialize PERL_EMBED_CCOPTS somehow precludes using:
      
        $(filter-out SOMETHING_TO_FILTER,$(PERL_EMBED_CCOPTS))
      
      And we need to do it to allow for building with versions of clang where
      some gcc options selected by distros are not available.
      
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # Debian/Selfmade LLVM-14 (x86-64)
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Keeping <john@metanate.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Link: http://lore.kernel.org/lkml/YktYX2OnLtyobRYD@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      541f695c
    • Arnaldo Carvalho de Melo's avatar
      tools include UAPI: Sync linux/vhost.h with the kernel sources · 940442de
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        b04d910a ("vdpa: support exposing the count of vqs to userspace")
        a61280dd ("vdpa: support exposing the config size to userspace")
      
      Silencing this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h'
        diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
      
        $ diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
        --- tools/include/uapi/linux/vhost.h	2021-07-15 16:17:01.840818309 -0300
        +++ include/uapi/linux/vhost.h	2022-04-02 18:55:05.702522387 -0300
        @@ -150,4 +150,11 @@
         /* Get the valid iova range */
         #define VHOST_VDPA_GET_IOVA_RANGE	_IOR(VHOST_VIRTIO, 0x78, \
         					     struct vhost_vdpa_iova_range)
        +
        +/* Get the config size */
        +#define VHOST_VDPA_GET_CONFIG_SIZE	_IOR(VHOST_VIRTIO, 0x79, __u32)
        +
        +/* Get the count of all virtqueues */
        +#define VHOST_VDPA_GET_VQS_COUNT	_IOR(VHOST_VIRTIO, 0x80, __u32)
        +
         #endif
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before
        $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after
        $ diff -u before after
        --- before	2022-04-04 14:52:25.036375145 -0300
        +++ after	2022-04-04 14:52:31.906549976 -0300
        @@ -38,4 +38,6 @@
         	[0x73] = "VDPA_GET_CONFIG",
         	[0x76] = "VDPA_GET_VRING_NUM",
         	[0x78] = "VDPA_GET_IOVA_RANGE",
        +	[0x79] = "VDPA_GET_CONFIG_SIZE",
        +	[0x80] = "VDPA_GET_VQS_COUNT",
         };
        $
      
      Cc: Longpeng <longpeng2@huawei.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Link: https://lore.kernel.org/lkml/YksxoFcOARk%2Fldev@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      940442de
    • Linus Torvalds's avatar
      Merge tag 'block-5.18-2022-04-08' of git://git.kernel.dk/linux-block · f1b45d8c
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Nothing major in here, just a few small fixes:
      
         - Small series of neglected drbd patches (Christoph, Lv, Xiaomeng)
      
         - Remove dead variable in cdrom (Enze)"
      
      * tag 'block-5.18-2022-04-08' of git://git.kernel.dk/linux-block:
        drbd: set QUEUE_FLAG_STABLE_WRITES
        drbd: fix an invalid memory access caused by incorrect use of list iterator
        drbd: Fix five use after free bugs in get_initial_state
        cdrom: remove unused variable
      f1b45d8c
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.18-2022-04-08' of git://git.kernel.dk/linux-block · 4d6f9f24
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A bit bigger than usual post merge window, largely due to a revert and
        a fix of at what point files are assigned for requests.
      
        The latter fixing a linked request use case where a dependent link can
        rely on what file is assigned consistently.
      
        Summary:
      
         - 32-bit compat fix for IORING_REGISTER_IOWQ_AFF (Eugene)
      
         - File assignment fixes (me)
      
         - Revert of the NAPI poll addition from this merge window. The author
           isn't available right now to engage on this, so let's revert it and
           we can retry for the 5.19 release (me, Jakub)
      
         - Fix a timeout removal race (me)
      
         - File update and SCM fixes (Pavel)"
      
      * tag 'io_uring-5.18-2022-04-08' of git://git.kernel.dk/linux-block:
        io_uring: fix race between timeout flush and removal
        io_uring: use nospec annotation for more indexes
        io_uring: zero tag on rsrc removal
        io_uring: don't touch scm_fp_list after queueing skb
        io_uring: nospec index for tags on files update
        io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF
        Revert "io_uring: Add support for napi_busy_poll"
        io_uring: drop the old style inflight file tracking
        io_uring: defer file assignment
        io_uring: propagate issue_flags state down to file assignment
        io_uring: move read/write file prep state into actual opcode handler
        io_uring: defer splice/tee file validity check until command issue
        io_uring: don't check req->file in io_fsync_prep()
      4d6f9f24
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · f335af10
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Several bug fixes for old bugs:
      
         - Welcome Leon as co-maintainer for RDMA so we are back to having two
           people
      
         - Some corner cases are fixed in mlx5's MR code
      
         - Long standing CM bug where a DREQ at the wrong time can result in a
           long timeout
      
         - Missing locking and refcounting in hf1"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/hfi1: Fix use-after-free bug for mm struct
        IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition
        IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD
        RDMA/mlx5: Add a missing update of cache->last_add
        RDMA/mlx5: Don't remove cache MRs when a delay is needed
        MAINTAINERS: Update qib and hfi1 related drivers
        MAINTAINERS: Add Leon Romanovsky to RDMA maintainers
      f335af10
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · d017a316
      Linus Torvalds authored
      Pull ACPI updates from Rafael Wysocki:
       "These revert a problematic commit from the 5.17 development cycle and
        finalize the elimination of acpi_bus_get_device() that mostly took
        place during the recent merge window.
      
        Specifics:
      
         - Revert an ACPI processor driver change related to cache
           invalidation in acpi_idle_play_dead() that clearly was a mistake
           and introduced user-visible regressions (Akihiko Odaki).
      
         - Replace the last instance of acpi_bus_get_device() added during the
           recent merge window and drop the function to prevent more users of
           it from being added (Rafael Wysocki)"
      
      * tag 'acpi-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: bus: Eliminate acpi_bus_get_device()
        Revert "ACPI: processor: idle: Only flush cache on entering C3"
      d017a316
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-kunit-fixes-5.18-rc2' of... · 6c7376da
      Linus Torvalds authored
      Merge tag 'linux-kselftest-kunit-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull KUnit fix from Shuah Khan:
       "A single documentation fix to incorrect and outdated usage
        information"
      
      * tag 'linux-kselftest-kunit-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        Documentation: kunit: fix path to .kunitconfig in start.rst
      6c7376da