1. 05 Nov, 2020 9 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 6f3f374a
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "A few more merge window regressions that didn't make rc1:
      
         - New validation in the DMA layer triggers wrong use of the DMA layer
           in rxe, siw and rdmavt
      
         - Accidental change of a hypervisor facing ABI when widening the port
           speed u8 to u16 in vmw_pvrdma
      
         - Memory leak on error unwind in SRP target"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/srpt: Fix typo in srpt_unregister_mad_agent docstring
        RDMA/vmw_pvrdma: Fix the active_speed and phys_state value
        IB/srpt: Fix memory leak in srpt_add_one
        RDMA: Fix software RDMA drivers for dma mapping error
      6f3f374a
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · cf26c714
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A small collection of driver specific fixes that have come in since
        the merge window, nothing too major here but all good to have"
      
      * tag 'spi-fix-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: fsl-dspi: fix wrong pointer in suspend/resume
        spi: bcm2835: fix gpio cs level inversion
        spi: imx: fix runtime pm support for !CONFIG_PM
      cf26c714
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v5.10-rc2' of... · 3d55978f
      Linus Torvalds authored
      Merge tag 'regulator-fix-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "An addition to MAINTAINERS plus a fix for a nasty bootstrapping
        problem which caused problems when we need to read the voltage of a
        regulator that is not yet available during initialization, we were not
        correctly distinguishing between this case and the case where a
        regulator is put into a bypass mode"
      
      * tag 'regulator-fix-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: defer probe when trying to get voltage from unresolved supply
        MAINTAINERS: Add entry for Qualcomm IPQ4019 VQMMC regulator
      3d55978f
    • Linus Torvalds's avatar
      Merge tag 'pm-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f786dfa3
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix the device links support in runtime PM, correct mistakes in
        the cpuidle documentation, fix the handling of policy limits changes
        in the schedutil cpufreq governor, fix assorted issues in the OPP
        (operating performance points) framework and make one janitorial
        change.
      
        Specifics:
      
         - Unify the handling of managed and stateless device links in the
           runtime PM framework and prevent runtime PM references to devices
           from being leaked after device link removal (Rafael Wysocki).
      
         - Fix two mistakes in the cpuidle documentation (Julia Lawall).
      
         - Prevent the schedutil cpufreq governor from missing policy limits
           updates in some cases (Viresh Kumar).
      
         - Prevent static OPPs from being dropped by mistake (Viresh Kumar).
      
         - Prevent helper function in the OPP framework from returning
           prematurely (Viresh Kumar).
      
         - Prevent opp_table_lock from being held too long during removal of
           OPP tables with no more active references (Viresh Kumar).
      
         - Drop redundant semicolon from the Intel RAPL power capping driver
           (Tom Rix)"
      
      * tag 'pm-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: runtime: Resume the device earlier in __device_release_driver()
        PM: runtime: Drop pm_runtime_clean_up_links()
        PM: runtime: Drop runtime PM references to supplier on link removal
        powercap/intel_rapl: remove unneeded semicolon
        Documentation: PM: cpuidle: correct path name
        Documentation: PM: cpuidle: correct typo
        cpufreq: schedutil: Don't skip freq update if need_freq_update is set
        opp: Reduce the size of critical section in _opp_table_kref_release()
        opp: Fix early exit from dev_pm_opp_register_set_opp_helper()
        opp: Don't always remove static OPPs in _of_add_opp_table_v1()
      f786dfa3
    • Linus Torvalds's avatar
      Merge tag 'fixes-2020-11-05' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock · 1a092479
      Linus Torvalds authored
      Pull highmem initialization fix from Mike Rapoport:
       "Fix highmem initialization on arm and xtensa
      
        Recent refactoring of memblock iterators has broken initialization of
        highmem on arm and xtensa because it changed the way beginning and end
        of memory regions are rounded to PFNs. This fix restores the original
        behaviour"
      
      * tag 'fixes-2020-11-05' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
        ARM, xtensa: highmem: avoid clobbering non-page aligned memory reservations
      1a092479
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.10-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · d1dd4612
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
       "Various gfs2 fixes"
      
      * tag 'gfs2-v5.10-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Wake up when sd_glock_disposal becomes zero
        gfs2: Don't call cancel_delayed_work_sync from within delete work function
        gfs2: check for live vs. read-only file system in gfs2_fitrim
        gfs2: don't initialize statfs_change inodes in spectator mode
        gfs2: Split up gfs2_meta_sync into inode and rgrp versions
        gfs2: init_journal's undo directive should also undo the statfs inodes
        gfs2: Add missing truncate_inode_pages_final for sd_aspace
        gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
      d1dd4612
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · e2557a2c
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Fix ACS regression that broke device pass-through (Rajat Jain)
      
       - Revert DesignWare ATU memory resource to use last entry to fix
         Tegra194 regression (Rob Herring)
      
       - Remove duplicate mvebu resource requests to fix regression on Turris
         Omnia (Rob Herring)
      
      * tag 'pci-v5.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: mvebu: Fix duplicate resource requests
        PCI: dwc: Restore ATU memory resource setup to use last entry
        PCI: Always enable ACS even if no ACS Capability
      e2557a2c
    • Jason Gunthorpe's avatar
      RDMA/srpt: Fix typo in srpt_unregister_mad_agent docstring · 21fcdeec
      Jason Gunthorpe authored
      htmldocs fails with:
      
      drivers/infiniband/ulp/srpt/ib_srpt.c:630: warning: Function parameter or member 'port_cnt' not described in 'srpt_unregister_mad_agent'
      
      Fixes: 372a1786 ("IB/srpt: Fix memory leak in srpt_add_one")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      21fcdeec
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq', 'pm-cpuidle', 'pm-opp' and 'powercap' · 8c14577d
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: schedutil: Don't skip freq update if need_freq_update is set
      
      * pm-cpuidle:
        Documentation: PM: cpuidle: correct path name
        Documentation: PM: cpuidle: correct typo
      
      * pm-opp:
        opp: Reduce the size of critical section in _opp_table_kref_release()
        opp: Fix early exit from dev_pm_opp_register_set_opp_helper()
        opp: Don't always remove static OPPs in _of_add_opp_table_v1()
      
      * powercap:
        powercap/intel_rapl: remove unneeded semicolon
      8c14577d
  2. 04 Nov, 2020 4 commits
  3. 03 Nov, 2020 27 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.10-2020-11-03' of... · 4ef8451b
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.10-2020-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
       "Only fixes and a sync of the headers so that the perf build is silent:
      
         - Fix visibility attribute in python module init code with newer gcc
      
         - Fix DRAM_BW_Use 0 issue for CLX/SKX in intel JSON vendor event
           files
      
         - Fix the build on new fedora by removing LTO compiler options when
           building perl support
      
         - Remove broken __no_tail_call attribute
      
         - Fix segfault when trying to trace events by cgroup
      
         - Fix crash with non-jited BPF progs
      
         - Increase buffer size in TUI browser, fixing format truncation
      
         - Fix printing of build-id for objects lacking one
      
         - Fix byte swapping for ino_generation field in MMAP2 perf.data
           records
      
         - Fix byte swapping for CGROUP perf.data records, for cross arch
           analysis of perf.data files
      
         - Fix the fast path of feature detection
      
         - Update kernel header copies"
      
      * tag 'perf-tools-for-v5.10-2020-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (23 commits)
        tools feature: Fixup fast path feature detection
        perf tools: Add missing swap for cgroup events
        perf tools: Add missing swap for ino_generation
        perf tools: Initialize output buffer in build_id__sprintf
        perf hists browser: Increase size of 'buf' in perf_evsel__hists_browse()
        tools include UAPI: Update linux/mount.h copy
        tools headers UAPI: Update tools's copy of linux/perf_event.h
        tools kvm headers: Update KVM headers from the kernel sources
        tools UAPI: Update copy of linux/mman.h from the kernel sources
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        tools x86 headers: Update required-features.h header from the kernel
        tools x86 headers: Update cpufeatures.h headers copies
        tools headers UAPI: Update fscrypt.h copy
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers UAPI: Sync prctl.h with the kernel sources
        perf scripting python: Avoid declaring function pointers with a visibility attribute
        perf tools: Remove broken __no_tail_call attribute
        perf vendor events: Fix DRAM_BW_Use 0 issue for CLX/SKX
        perf trace: Fix segfault when trying to trace events by cgroup
        perf tools: Fix crash with non-jited bpf progs
        ...
      4ef8451b
    • Linus Torvalds's avatar
      Merge tag 'docs-5.10-warnings' of git://git.lwn.net/linux · e6b0bd61
      Linus Torvalds authored
      Pull documentation build warning fixes from Jonathan Corbet:
       "This contains a series of warning fixes from Mauro; once applied, the
        number of warnings from the once-noisy docs build process is nearly
        zero.
      
        Getting to this point has required a lot of work; once there,
        hopefully we can keep things that way.
      
        I have packaged this as a separate pull because it does a fair amount
        of reaching outside of Documentation/. The changes are all in comments
        and in code placement. It's all been in linux-next since last week"
      
      * tag 'docs-5.10-warnings' of git://git.lwn.net/linux: (24 commits)
        docs: SafeSetID: fix a warning
        amdgpu: fix a few kernel-doc markup issues
        selftests: kselftest_harness.h: fix kernel-doc markups
        drm: amdgpu_dm: fix a typo
        gpu: docs: amdgpu.rst: get rid of wrong kernel-doc markups
        drm: amdgpu: kernel-doc: update some adev parameters
        docs: fs: api-summary.rst: get rid of kernel-doc include
        IB/srpt: docs: add a description for cq_size member
        locking/refcount: move kernel-doc markups to the proper place
        docs: lockdep-design: fix some warning issues
        MAINTAINERS: fix broken doc refs due to yaml conversion
        ice: docs fix a devlink info that broke a table
        crypto: sun8x-ce*: update entries to its documentation
        net: phy: remove kernel-doc duplication
        mm: pagemap.h: fix two kernel-doc markups
        blk-mq: docs: add kernel-doc description for a new struct member
        docs: userspace-api: add iommu.rst to the index file
        docs: hwmon: mp2975.rst: address some html build warnings
        docs: net: statistics.rst: remove a duplicated kernel-doc
        docs: kasan.rst: add two missing blank lines
        ...
      e6b0bd61
    • Linus Torvalds's avatar
      Merge tag 'docs-5.10-3' of git://git.lwn.net/linux · ce2e33ba
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "A small number of fixes, plus a build tweak to respect the desire for
        silence in V=0 builds"
      
      * tag 'docs-5.10-3' of git://git.lwn.net/linux:
        docs: fix automarkup regression on Python 2
        documentation: arm: sunxi: add Allwinner H6 documents
        scripts: kernel-doc: split typedef complex regex
        scripts: kernel-doc: fix typedef parsing
        docs: Makefile: honor V=0 for docs building
      ce2e33ba
    • Linus Torvalds's avatar
      Merge tag 'x86_seves_for_v5.10_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43c83418
      Linus Torvalds authored
      Pull x86 SEV-ES fixes from Borislav Petkov:
       "A couple of changes to the SEV-ES code to perform more stringent
        hypervisor checks before enabling encryption (Joerg Roedel)"
      
      * tag 'x86_seves_for_v5.10_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sev-es: Do not support MMIO to/from encrypted memory
        x86/head/64: Check SEV encryption before switching to kernel page-table
        x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path
        x86/boot/compressed/64: Sanity-check CPUID results in the early #VC handler
        x86/boot/compressed/64: Introduce sev_status
      43c83418
    • David Howells's avatar
      afs: Fix incorrect freeing of the ACL passed to the YFS ACL store op · f4c79144
      David Howells authored
      The cleanup for the yfs_store_opaque_acl2_operation calls the wrong
      function to destroy the ACL content buffer.  It's an afs_acl struct, not
      a yfs_acl struct - and the free function for latter may pass invalid
      pointers to kfree().
      
      Fix this by using the afs_acl_put() function.  The yfs_acl_put()
      function is then no longer used and can be removed.
      
      	general protection fault, probably for non-canonical address 0x7ebde00000000: 0000 [#1] SMP PTI
      	...
      	RIP: 0010:compound_head+0x0/0x11
      	...
      	Call Trace:
      	 virt_to_cache+0x8/0x51
      	 kfree+0x5d/0x79
      	 yfs_free_opaque_acl+0x16/0x29
      	 afs_put_operation+0x60/0x114
      	 __vfs_setxattr+0x67/0x72
      	 __vfs_setxattr_noperm+0x66/0xe9
      	 vfs_setxattr+0x67/0xce
      	 setxattr+0x14e/0x184
      	 __do_sys_fsetxattr+0x66/0x8f
      	 do_syscall_64+0x2d/0x3a
      	 entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: e49c7b2f ("afs: Build an abstraction around an "operation" concept")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f4c79144
    • David Howells's avatar
      afs: Fix warning due to unadvanced marshalling pointer · c80afa1d
      David Howells authored
      When using the afs.yfs.acl xattr to change an AuriStor ACL, a warning
      can be generated when the request is marshalled because the buffer
      pointer isn't increased after adding the last element, thereby
      triggering the check at the end if the ACL wasn't empty.  This just
      causes something like the following warning, but doesn't stop the call
      from happening successfully:
      
          kAFS: YFS.StoreOpaqueACL2: Request buffer underflow (36<108)
      
      Fix this simply by increasing the count prior to the check.
      
      Fixes: f5e45463 ("afs: Implement YFS ACL setting")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c80afa1d
    • Jonathan Corbet's avatar
      docs: fix automarkup regression on Python 2 · 4f3e6906
      Jonathan Corbet authored
      It turns out that the Python 2 re module lacks the ASCII flag, so don't try
      to use it there.
      
      Fixes: f66e47f9 ("docs: automarkup.py: Fix regexes to solve sphinx 3 warnings")
      Reported-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      4f3e6906
    • Alexander Aring's avatar
      gfs2: Wake up when sd_glock_disposal becomes zero · da7d554f
      Alexander Aring authored
      Commit fc0e38da ("GFS2: Fix glock deallocation race") fixed a
      sd_glock_disposal accounting bug by adding a missing atomic_dec
      statement, but it failed to wake up sd_glock_wait when that decrement
      causes sd_glock_disposal to reach zero.  As a consequence,
      gfs2_gl_hash_clear can now run into a 10-minute timeout instead of
      being woken up.  Add the missing wakeup.
      
      Fixes: fc0e38da ("GFS2: Fix glock deallocation race")
      Cc: stable@vger.kernel.org # v2.6.39+
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      da7d554f
    • Michał Mirosław's avatar
      regulator: defer probe when trying to get voltage from unresolved supply · cf1ad559
      Michał Mirosław authored
      regulator_get_voltage_rdev() is called in regulator probe() when
      applying machine constraints.  The "fixed" commit exposed the problem
      that non-bypassed regulators can forward the request to its parent
      (like bypassed ones) supply. Return -EPROBE_DEFER when the supply
      is expected but not resolved yet.
      
      Fixes: aea6cb99 ("regulator: resolve supply after creating regulator")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Reported-by: default avatarOndřej Jirman <megous@megous.com>
      Reported-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
      Tested-by: default avatarOndřej Jirman <megous@megous.com>
      Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.plSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cf1ad559
    • Arnaldo Carvalho de Melo's avatar
      tools feature: Fixup fast path feature detection · 5d020cbd
      Arnaldo Carvalho de Melo authored
      22dd1ac9 ("tools: Remove feature-libelf-mmap feature detection")
      correctly simplified the this feature detection, but forgot to remove
      the call to the removed function in the main() function for the
      test-all.c fast path feature detection, making it fail and thus do all
      the feature detection individually, fix it.
      
        $ cat /tmp/build/perf/feature/test-all.make.output
        test-all.c: In function ‘main’:
        test-all.c:188:2: error: implicit declaration of function ‘main_test_libelf_mmap’; did you mean ‘main_test_libelf’? [-Werror=implicit-function-declaration]
          188 |  main_test_libelf_mmap();
              |  ^~~~~~~~~~~~~~~~~~~~~
              |  main_test_libelf
        cc1: all warnings being treated as errors
        $ vim tools/build/feature/test-all.c
        $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;make V=1 -k O=/tmp/build/perf  -C tools/perf install-bin ; perf test python
        <SNIP>
        $ cat /tmp/build/perf/feature/test-all.make.output
        $
      
      Fixes: 22dd1ac9 ("tools: Remove feature-libelf-mmap feature detection")
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5d020cbd
    • Namhyung Kim's avatar
      perf tools: Add missing swap for cgroup events · 2c589d93
      Namhyung Kim authored
      It was missed to add a swap function for PERF_RECORD_CGROUP.
      
      Fixes: ba78c1c5 ("perf tools: Basic support for CGROUP event")
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201102140228.303657-1-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2c589d93
    • Jiri Olsa's avatar
      perf tools: Add missing swap for ino_generation · fe01adb7
      Jiri Olsa authored
      We are missing swap for ino_generation field.
      
      Fixes: 5c5e854b ("perf tools: Add attr->mmap2 support")
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20201101233103.3537427-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fe01adb7
    • Jiri Olsa's avatar
      perf tools: Initialize output buffer in build_id__sprintf · 6311951d
      Jiri Olsa authored
      We display garbage for undefined build_id objects, because we don't
      initialize the output buffer.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20201101233103.3537427-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6311951d
    • Song Liu's avatar
      perf hists browser: Increase size of 'buf' in perf_evsel__hists_browse() · 86449b12
      Song Liu authored
      Making perf with gcc-9.1.1 generates the following warning:
      
          CC       ui/browsers/hists.o
        ui/browsers/hists.c: In function 'perf_evsel__hists_browse':
        ui/browsers/hists.c:3078:61: error: '%d' directive output may be \
        truncated writing between 1 and 11 bytes into a region of size \
        between 2 and 12 [-Werror=format-truncation=]
      
         3078 |       "Max event group index to sort is %d (index from 0 to %d)",
              |                                                             ^~
        ui/browsers/hists.c:3078:7: note: directive argument in the range [-2147483648, 8]
         3078 |       "Max event group index to sort is %d (index from 0 to %d)",
              |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        In file included from /usr/include/stdio.h:937,
                         from ui/browsers/hists.c:5:
      
      IOW, the string in line 3078 might be too long for buf[] of 64 bytes.
      
      Fix this by increasing the size of buf[] to 128.
      
      Fixes: dbddf174  ("perf report/top TUI: Support hotkeys to let user select any event for sorting")
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: stable@vger.kernel.org # v5.7+
      Link: http://lore.kernel.org/lkml/20201030235431.534417-1-songliubraving@fb.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      86449b12
    • Arnaldo Carvalho de Melo's avatar
      tools include UAPI: Update linux/mount.h copy · 42cc0e70
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        dab741e0 ("Add a "nosymfollow" mount option.")
      
      That ends up adding support for the new MS_NOSYMFOLLOW mount flag:
      
        $ tools/perf/trace/beauty/mount_flags.sh > before
        $ cp include/uapi/linux/mount.h tools/include/uapi/linux/mount.h
        $ tools/perf/trace/beauty/mount_flags.sh > after
        $ diff -u before after
        --- before	2020-11-03 08:51:28.117997454 -0300
        +++ after	2020-11-03 08:51:38.992218869 -0300
        @@ -7,6 +7,7 @@
         	[32 ? (ilog2(32) + 1) : 0] = "REMOUNT",
         	[64 ? (ilog2(64) + 1) : 0] = "MANDLOCK",
         	[128 ? (ilog2(128) + 1) : 0] = "DIRSYNC",
        +	[256 ? (ilog2(256) + 1) : 0] = "NOSYMFOLLOW",
         	[1024 ? (ilog2(1024) + 1) : 0] = "NOATIME",
         	[2048 ? (ilog2(2048) + 1) : 0] = "NODIRATIME",
         	[4096 ? (ilog2(4096) + 1) : 0] = "BIND",
        $
      
      So now one can use it in --filter expressions for tracepoints.
      
      This silences this perf build warnings:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/mount.h' differs from latest version at 'include/uapi/linux/mount.h'
        diff -u tools/include/uapi/linux/mount.h include/uapi/linux/mount.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mattias Nissler <mnissler@chromium.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      42cc0e70
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Update tools's copy of linux/perf_event.h · a9e27f5f
      Arnaldo Carvalho de Melo authored
      The diff is just tabs versus spaces, trivial.
      
      This silences this perf tools build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
        diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a9e27f5f
    • Arnaldo Carvalho de Melo's avatar
      tools kvm headers: Update KVM headers from the kernel sources · aa04899a
      Arnaldo Carvalho de Melo authored
      Some should cause changes in tooling, like the one adding LAST_EXCP, but
      the way it is structured end up not making that happen.
      
      The new SVM_EXIT_INVPCID should get used by arch/x86/util/kvm-stat.c,
      in the svm_exit_reasons table.
      
      The tools/perf/trace/beauty part has scripts to catch changes and
      automagically create tables, like tools/perf/trace/beauty/kvm_ioctl.sh,
      but changes are needed to make tools/perf/arch/x86/util/kvm-stat.c catch
      those automatically.
      
      These were handled by the existing scripts:
      
        $ tools/perf/trace/beauty/kvm_ioctl.sh > before
        $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
        $ tools/perf/trace/beauty/kvm_ioctl.sh > after
        $ diff -u before after
        --- before	2020-11-03 08:43:52.910728608 -0300
        +++ after	2020-11-03 08:44:04.273959984 -0300
        @@ -89,6 +89,7 @@
         	[0xbf] = "SET_NESTED_STATE",
         	[0xc0] = "CLEAR_DIRTY_LOG",
         	[0xc1] = "GET_SUPPORTED_HV_CPUID",
        +	[0xc6] = "X86_SET_MSR_FILTER",
         	[0xe0] = "CREATE_DEVICE",
         	[0xe1] = "SET_DEVICE_ATTR",
         	[0xe2] = "GET_DEVICE_ATTR",
        $
        $ 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	2020-11-03 08:45:55.522225198 -0300
        +++ after	2020-11-03 08:46:12.881578666 -0300
        @@ -37,4 +37,5 @@
         	[0x71] = "VDPA_GET_STATUS",
         	[0x73] = "VDPA_GET_CONFIG",
         	[0x76] = "VDPA_GET_VRING_NUM",
        +	[0x78] = "VDPA_GET_IOVA_RANGE",
         };
        $
      
      This addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h'
        diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
        Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/sie.h' differs from latest version at 'arch/s390/include/uapi/asm/sie.h'
        diff -u tools/arch/s390/include/uapi/asm/sie.h arch/s390/include/uapi/asm/sie.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h'
        diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/svm.h' differs from latest version at 'arch/x86/include/uapi/asm/svm.h'
        diff -u tools/arch/x86/include/uapi/asm/svm.h arch/x86/include/uapi/asm/svm.h
        Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
        diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
        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
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aa04899a
    • Arnaldo Carvalho de Melo's avatar
      tools UAPI: Update copy of linux/mman.h from the kernel sources · 97a3863b
      Arnaldo Carvalho de Melo authored
        e47168f3 ("powerpc/8xx: Support 16k hugepages with 4k pages")
      
      That don't cause any changes in tooling, just addresses this perf build
      warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/mman.h' differs from latest version at 'include/uapi/linux/mman.h'
        diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      97a3863b
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 32b734e0
      Arnaldo Carvalho de Melo authored
      To pick up the changes in:
      
        29dcc60f ("x86/boot/compressed/64: Add stage1 #VC handler")
        36e1be8a ("perf/x86/amd/ibs: Fix raw sample data accumulation")
        59a854e2 ("perf/x86/intel: Support TopDown metrics on Ice Lake")
        7b2c05a1 ("perf/x86/intel: Generic support for hardware TopDown metrics")
        99e40204 ("x86/msr: Move the F15h MSRs where they belong")
        b57de6cd ("x86/sev-es: Add SEV-ES Feature Detection")
        ed7bde7a ("cpufreq: intel_pstate: Allow enable/disable energy efficiency")
        f0f2f9fe ("x86/msr-index: Define an IA32_PASID MSR")
      
      That cause these changes in tooling:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-10-19 13:27:33.195274425 -0300
        +++ after	2020-10-19 13:27:44.144507610 -0300
        @@ -113,6 +113,8 @@
         	[0x00000309] = "CORE_PERF_FIXED_CTR0",
         	[0x0000030a] = "CORE_PERF_FIXED_CTR1",
         	[0x0000030b] = "CORE_PERF_FIXED_CTR2",
        +	[0x0000030c] = "CORE_PERF_FIXED_CTR3",
        +	[0x00000329] = "PERF_METRICS",
         	[0x00000345] = "IA32_PERF_CAPABILITIES",
         	[0x0000038d] = "CORE_PERF_FIXED_CTR_CTRL",
         	[0x0000038e] = "CORE_PERF_GLOBAL_STATUS",
        @@ -222,6 +224,7 @@
         	[0x00000774] = "HWP_REQUEST",
         	[0x00000777] = "HWP_STATUS",
         	[0x00000d90] = "IA32_BNDCFGS",
        +	[0x00000d93] = "IA32_PASID",
         	[0x00000da0] = "IA32_XSS",
         	[0x00000dc0] = "LBR_INFO_0",
         	[0x00000ffc] = "IA32_BNDCFGS_RSVD",
        @@ -279,6 +282,7 @@
         	[0xc0010115 - x86_AMD_V_KVM_MSRs_offset] = "VM_IGNNE",
         	[0xc0010117 - x86_AMD_V_KVM_MSRs_offset] = "VM_HSAVE_PA",
         	[0xc001011f - x86_AMD_V_KVM_MSRs_offset] = "AMD64_VIRT_SPEC_CTRL",
        +	[0xc0010130 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SEV_ES_GHCB",
         	[0xc0010131 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SEV",
         	[0xc0010140 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_OSVW_ID_LENGTH",
         	[0xc0010141 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_OSVW_STATUS",
        $
      
      Which causes these parts of tools/perf/ to be rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        DESCEND  plugins
        GEN      /tmp/build/perf/python/perf.so
        INSTALL  trace_plugins
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/per
      
      At some point these should just be tables read by perf on demand.
      
      This addresses this perf tools build warning:
      
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      32b734e0
    • Arnaldo Carvalho de Melo's avatar
      tools x86 headers: Update required-features.h header from the kernel · 8b2fc25a
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        ecac7181 ("x86/paravirt: Use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT")
      
      That don entail any changes in tooling, just addressing these perf tools
      build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/required-features.h' differs from latest version at 'arch/x86/include/asm/required-features.h'
        diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8b2fc25a
    • Arnaldo Carvalho de Melo's avatar
      tools x86 headers: Update cpufeatures.h headers copies · 40a6bbf5
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        5866e920 ("x86/cpu: Add hardware-enforced cache coherency as a CPUID feature")
        ff4f8281 ("x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions")
        360e7c5c ("x86/cpufeatures: Add SEV-ES CPU feature")
        18ec63fa ("x86/cpufeatures: Enumerate TSX suspend load address tracking instructions")
        e48cb1a3 ("x86/resctrl: Enumerate per-thread MBA controls")
      
      Which don't cause any changes in tooling, just addresses these build
      warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>
      Cc: Kyung Min Park <kyung.min.park@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      40a6bbf5
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Update fscrypt.h copy · d0448d6a
      Arnaldo Carvalho de Melo authored
      To get the changes from:
      
        c7f0207b ("fscrypt: make "#define fscrypt_policy" user-only")
      
      That don't cause any changes in tools/perf, only addresses this perf
      tools build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/fscrypt.h' differs from latest version at 'include/uapi/linux/fscrypt.h'
        diff -u tools/include/uapi/linux/fscrypt.h include/uapi/linux/fscrypt.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Eric Biggers <ebiggers@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d0448d6a
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync drm/i915_drm.h with the kernel sources · 9e228f48
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        13149e8b ("drm/i915: add syncobj timeline support")
        cda9edd0 ("drm/i915: introduce a mechanism to extend execbuf2")
      
      That don't result in any changes in tooling, just silences this perf
      build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h'
        diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9e228f48
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync prctl.h with the kernel sources · ad6330ac
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        1c101da8 ("arm64: mte: Allow user control of the tag check mode via prctl()")
        af5ce952 ("arm64: mte: Allow user control of the generated random tags via prctl()")
      
      Which don't cause any change in tooling, only addresses this perf build
      warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/prctl.h' differs from latest version at 'include/uapi/linux/prctl.h'
        diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ad6330ac
    • Arnaldo Carvalho de Melo's avatar
      perf scripting python: Avoid declaring function pointers with a visibility attribute · d0e7b0c7
      Arnaldo Carvalho de Melo authored
      To avoid this:
      
        util/scripting-engines/trace-event-python.c: In function 'python_start_script':
        util/scripting-engines/trace-event-python.c:1595:2: error: 'visibility' attribute ignored [-Werror=attributes]
         1595 |  PyMODINIT_FUNC (*initfunc)(void);
              |  ^~~~~~~~~~~~~~
      
      That started breaking when building with PYTHON=python3 and these gcc
      versions (I haven't checked with the clang ones, maybe it breaks there
      as well):
      
        # export PERF_TARBALL=http://192.168.86.5/perf/perf-5.9.0.tar.xz
        # dm  fedora:33 fedora:rawhide
           1   107.80 fedora:33         : Ok   gcc (GCC) 10.2.1 20201005 (Red Hat 10.2.1-5), clang version 11.0.0 (Fedora 11.0.0-1.fc33)
           2    92.47 fedora:rawhide    : Ok   gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6), clang version 11.0.0 (Fedora 11.0.0-1.fc34)
        #
      
      Avoid that by ditching that 'initfunc' function pointer with its:
      
          #define Py_EXPORTED_SYMBOL _attribute_ ((visibility ("default")))
          #define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
      
      And just call PyImport_AppendInittab() at the end of the ifdef python3
      block with the functions that were being attributed to that initfunc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d0e7b0c7
    • Peter Zijlstra's avatar
      perf tools: Remove broken __no_tail_call attribute · 9ae1e990
      Peter Zijlstra authored
      The GCC specific __attribute__((optimize)) attribute does not what is
      commonly expected and is explicitly recommended against using in
      production code by the GCC people.
      
      Unlike what is often expected, it doesn't add to the optimization flags,
      but it fully replaces them, loosing any and all optimization flags
      provided by the compiler commandline.
      
      The only guaranteed upon means of inhibiting tail-calls is by placing a
      volatile asm with side-effects after the call such that the tail-call simply
      cannot be done.
      
      Given the original commit wasn't specific on which calls were the problem, this
      removal might re-introduce the problem, which can then be re-analyzed and cured
      properly.
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Acked-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Arvind Sankar <nivedita@alum.mit.edu>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lore.kernel.org/lkml/20201028081123.GT2628@hirez.programming.kicks-ass.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ae1e990
    • Jin Yao's avatar
      perf vendor events: Fix DRAM_BW_Use 0 issue for CLX/SKX · 0dfbe4c6
      Jin Yao authored
      Ian reports an issue that the metric DRAM_BW_Use often remains 0.
      
      The metric expression for DRAM_BW_Use on CLX/SKX:
      
      "( 64 * ( uncore_imc@cas_count_read@ + uncore_imc@cas_count_write@ ) / 1000000000 ) / duration_time"
      
      The counts of uncore_imc/cas_count_read/ and uncore_imc/cas_count_write/
      are scaled up by 64, that is to turn a count of cache lines into bytes,
      the count is then divided by 1000000000 to give GB.
      
      However, the counts of uncore_imc/cas_count_read/ and
      uncore_imc/cas_count_write/ have been scaled yet.
      
      The scale values are from sysfs, such as
      /sys/devices/uncore_imc_0/events/cas_count_read.scale.
      It's 6.103515625e-5 (64 / 1024.0 / 1024.0).
      
      So if we use original metric expression, the result is not correct.
      
      But the difficulty is, for SKL client, the counts are not scaled.
      
      The metric expression for DRAM_BW_Use on SKL:
      
      "64 * ( arb@event\\=0x81\\,umask\\=0x1@ + arb@event\\=0x84\\,umask\\=0x1@ ) / 1000000 / duration_time / 1000"
      
      root@kbl-ppc:~# perf stat -M DRAM_BW_Use -a -- sleep 1
      
       Performance counter stats for 'system wide':
      
                     190      arb/event=0x84,umask=0x1/ #     1.86 DRAM_BW_Use
              29,093,178      arb/event=0x81,umask=0x1/
           1,000,703,287 ns   duration_time
      
             1.000703287 seconds time elapsed
      
      The result is expected.
      
      So the easy way is just change the metric expression for CLX/SKX.
      This patch changes the metric expression to:
      
      "( ( ( uncore_imc@cas_count_read@ + uncore_imc@cas_count_write@ ) * 1048576 ) / 1000000000 ) / duration_time"
      
      1048576 = 1024 * 1024.
      
      Before (tested on CLX):
      
      root@lkp-csl-2sp5 ~# perf stat -M DRAM_BW_Use -a -- sleep 1
      
       Performance counter stats for 'system wide':
      
                  765.35 MiB  uncore_imc/cas_count_read/ #     0.00 DRAM_BW_Use
                    5.42 MiB  uncore_imc/cas_count_write/
              1001515088 ns   duration_time
      
             1.001515088 seconds time elapsed
      
      After:
      
      root@lkp-csl-2sp5 ~# perf stat -M DRAM_BW_Use -a -- sleep 1
      
       Performance counter stats for 'system wide':
      
                  767.95 MiB  uncore_imc/cas_count_read/ #     0.80 DRAM_BW_Use
                    5.02 MiB  uncore_imc/cas_count_write/
              1001900010 ns   duration_time
      
             1.001900010 seconds time elapsed
      
      Fixes: 038d3b53 ("perf vendor events intel: Update CascadelakeX events to v1.08")
      Fixes: b5ff7f27 ("perf vendor events: Update SkylakeX events to v1.21")
      Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20201023005334.7869-1-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0dfbe4c6