Skip to content
  1. May 14, 2021
  2. May 13, 2021
  3. May 12, 2021
  4. May 11, 2021
    • Ritesh Harjani's avatar
      btrfs: handle transaction start error in btrfs_fileattr_set · 9b8a233b
      Ritesh Harjani authored
      Add error handling in btrfs_fileattr_set in case of an error while
      starting a transaction. This fixes btrfs/232 which otherwise used to
      fail with below signature on Power.
      
        btrfs/232 [ 1119.474650] run fstests btrfs/232 at 2021-04-21 02:21:22
        <...>
        [ 1366.638585] BUG: Unable to handle kernel data access on read at 0xffffffffffffff86
        [ 1366.638768] Faulting instruction address: 0xc0000000009a5c88
        cpu 0x0: Vector: 380 (Data SLB Access) at [c000000014f177b0]
            pc: c0000000009a5c88: btrfs_update_root_times+0x58/0xc0
            lr: c0000000009a5c84: btrfs_update_root_times+0x54/0xc0
            <...>
            pid   = 24881, comm = fsstress
      	   btrfs_update_inode+0xa0/0x140
      	   btrfs_fileattr_set+0x5d0/0x6f0
      	   vfs_fileattr_set+0x2a8/0x390
      	   do_vfs_ioctl+0x1290/0x1ac0
      	   sys_ioctl+0x6c/0x120
      	   system_call_exception+0x3d4/0x410
      	   system_call_common+0xec/0x278
      
      Fixes: 97fc2977
      
       ("btrfs: convert to fileattr")
      Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      9b8a233b
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of... · 1140ab59
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix swapping of cpu_map and stat_config records.
      
       - Fix dynamic libbpf linking.
      
       - Disallow -c and -F option at the same time in 'perf record'.
      
       - Update headers with the kernel originals.
      
       - Silence warning for JSON ArchStd files.
      
       - Fix a build error on arm64 with clang.
      
      * tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools headers UAPI: Sync perf_event.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
        tools include UAPI powerpc: Sync errno.h with the kernel headers
        tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy'
        tools headers UAPI: Sync linux/prctl.h with the kernel sources
        tools headers UAPI: Sync files changed by landlock, quotactl_path and mount_settattr new syscalls
        perf tools: Fix a build error on arm64 with clang
        tools headers kvm: Sync kvm headers with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        perf tools: Fix dynamic libbpf link
        perf session: Fix swapping of cpu_map and stat_config records
        perf jevents: Silence warning for ArchStd files
        perf record: Disallow -c and -F option at the same time
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers UAPI: Update tools's copy of drm.h headers
      1140ab59
    • Randy Dunlap's avatar
      Documentation: drop optional BOMs · 9e255e2b
      Randy Dunlap authored
      A few of the Documentation .rst files begin with a Unicode
      byte order mark (BOM). The BOM may signify endianess for
      16-bit or 32-bit encodings or indicate that the text stream
      is indeed Unicode. We don't need it for either of those uses.
      It may also interfere with (confuse) some software.
      
      Since we don't need it and its use is optional, just delete
      the uses of it in Documentation/.
      
      https://en.wikipedia.org/wiki/Byte_order_mark
      
      
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Link: https://lore.kernel.org/r/20210506231907.14359-1-rdunlap@infradead.org
      
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      9e255e2b
    • Wan Jiabing's avatar
      docs/zh_CN: Remove obsolete translation file · bf9e262f
      Wan Jiabing authored
      This translation file was replaced by
         Documentation/translations/zh_CN/admin-guide/security-bugs.rst
      which was created in commit 2d153571
      
       ("docs/zh_CN: Add
      zh_CN/admin-guide/security-bugs.rst").
      This is a translation left over from history. Remove it.
      
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Acked-by: default avatarWu XiangCheng <bobwxc@email.cn>
      Link: https://lore.kernel.org/r/20210508030741.82655-1-wanjiabing@vivo.com
      
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      bf9e262f
    • Linus Torvalds's avatar
      Merge tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 142b507f
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "First batch of various fixes, here's a list of notable ones:
      
         - fix unmountable seed device after fstrim
      
         - fix silent data loss in zoned mode due to ordered extent splitting
      
         - fix race leading to unpersisted data and metadata on fsync
      
         - fix deadlock when cloning inline extents and using qgroups"
      
      * tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: initialize return variable in cleanup_free_space_cache_v1
        btrfs: zoned: sanity check zone type
        btrfs: fix unmountable seed device after fstrim
        btrfs: fix deadlock when cloning inline extents and using qgroups
        btrfs: fix race leading to unpersisted data and metadata on fsync
        btrfs: do not consider send context as valid when trying to flush qgroups
        btrfs: zoned: fix silent data loss after failure splitting ordered extent
      142b507f
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0aa099a3
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
      
       - Lots of bug fixes.
      
       - Fix virtualization of RDPID
      
       - Virtualization of DR6_BUS_LOCK, which on bare metal is new to this
         release
      
       - More nested virtualization migration fixes (nSVM and eVMCS)
      
       - Fix for KVM guest hibernation
      
       - Fix for warning in SEV-ES SRCU usage
      
       - Block KVM from loading on AMD machines with 5-level page tables, due
         to the APM not mentioning how host CR4.LA57 exactly impacts the
         guest.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (48 commits)
        KVM: SVM: Move GHCB unmapping to fix RCU warning
        KVM: SVM: Invert user pointer casting in SEV {en,de}crypt helpers
        kvm: Cap halt polling at kvm->max_halt_poll_ns
        tools/kvm_stat: Fix documentation typo
        KVM: x86: Prevent deadlock against tk_core.seq
        KVM: x86: Cancel pvclock_gtod_work on module removal
        KVM: x86: Prevent KVM SVM from loading on kernels with 5-level paging
        KVM: X86: Expose bus lock debug exception to guest
        KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit
        KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks
        KVM: x86: Hide RDTSCP and RDPID if MSR_TSC_AUX probing failed
        KVM: x86: Tie Intel and AMD behavior for MSR_TSC_AUX to guest CPU model
        KVM: x86: Move uret MSR slot management to common x86
        KVM: x86: Export the number of uret MSRs to vendor modules
        KVM: VMX: Disable loading of TSX_CTRL MSR the more conventional way
        KVM: VMX: Use common x86's uret MSR list as the one true list
        KVM: VMX: Use flag to indicate "active" uret MSRs instead of sorting list
        KVM: VMX: Configure list of user return MSRs at module init
        KVM: x86: Add support for RDPID without RDTSCP
        KVM: SVM: Probe and load MSR_TSC_AUX regardless of RDTSCP support in host
        ...
      0aa099a3
  5. May 10, 2021
    • Andy Shevchenko's avatar
      hwmon: (ltc2992) Put fwnode in error case during ->probe() · 8370e5b0
      Andy Shevchenko authored
      In each iteration fwnode_for_each_available_child_node() bumps a reference
      counting of a loop variable followed by dropping in on a next iteration,
      
      Since in error case the loop is broken, we have to drop a reference count
      by ourselves. Do it for port_fwnode in error case during ->probe().
      
      Fixes: b0bd407e
      
       ("hwmon: (ltc2992) Add support")
      Cc: Alexandru Tachici <alexandru.tachici@analog.com>
      Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Link: https://lore.kernel.org/r/20210510100136.3303142-1-andy.shevchenko@gmail.com
      
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      8370e5b0
    • Václav Kubernát's avatar
      hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding · 2d101db3
      Václav Kubernát authored
      I didn't properly test the driver for YH-5151E, so it was completely
      broken. Firstly, the log/real mapping was incorrect in one case.
      Secondly, PMBus specifies that output voltages should be in the linear16
      encoding. However, the YH-5151E is non-compliant and uses linear11.
      YM-2151E isn't affected by this. Fix this by converting the values
      inside the read functions. linear16 gets the exponent from the VOUT_MODE
      command. The device doesn't support it, so I have to manually supply the
      value for it.
      
      Both supported devices have now been tested to report correct vout
      values.
      
      Fixes: 1734b413
      
       ("hwmon: Add driver for fsp-3y PSUs and PDUs")
      Signed-off-by: default avatarVáclav Kubernát <kubernat@cesnet.cz>
      Link: https://lore.kernel.org/r/20210429075337.110502-1-kubernat@cesnet.cz
      
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      2d101db3
    • Eddie James's avatar
      hwmon: (occ) Fix poll rate limiting · 5216dff2
      Eddie James authored
      The poll rate limiter time was initialized at zero. This breaks the
      comparison in time_after if jiffies is large. Switch to storing the
      next update time rather than the previous time, and initialize the
      time when the device is probed.
      
      Fixes: c10e753d
      
       ("hwmon (occ): Add sensor types and versions")
      Signed-off-by: default avatarEddie James <eajames@linux.ibm.com>
      Link: https://lore.kernel.org/r/20210429151336.18980-1-eajames@linux.ibm.com
      
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      5216dff2
    • Wan Jiabing's avatar
      hwmon: (corsair-psu) Remove unneeded semicolons · 726c945a
      Wan Jiabing authored
      
      
      Fix the following coccicheck warning:
      
      ./drivers/hwmon/corsair-psu.c:379:2-3: Unneeded semicolon
      
      Remove unneeded semicolons.
      
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Link: https://lore.kernel.org/r/20210427044219.7799-1-wanjiabing@vivo.com
      
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      726c945a
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync perf_event.h with the kernel sources · 71d7924b
      Arnaldo Carvalho de Melo authored
      To pick up the changes in:
      
        2b26f0aa ("perf: Support only inheriting events if cloned with CLONE_THREAD")
        2e498d0a ("perf: Add support for event removal on exec")
        547b6098 ("perf: aux: Add flags for the buffer format")
        55bcf6ef ("perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE")
        7dde5176 ("perf: aux: Add CoreSight PMU buffer formats")
        97ba62b2 ("perf: Add support for SIGTRAP on perf events")
        d0d1dd62
      
       ("perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event")
      
      Also change the expected sizeof(struct perf_event_attr) from 120 to 128 due to
      fields being added for the SIGTRAP changes.
      
      Addressing this perf 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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Marco Elver <elver@google.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      71d7924b
    • Arnaldo Carvalho de Melo's avatar
      tools headers cpufeatures: Sync with the kernel sources · 6faf64f5
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        4e629211 ("x86/paravirt: Add new features for paravirt patching")
        a161545a ("x86/cpufeatures: Enumerate Intel Hybrid Technology feature bit")
        a89dfde3 ("x86: Remove dynamic NOP selection")
        b8921dcc ("x86/cpufeatures: Add SGX1 and SGX2 sub-features")
        f21d4d3b ("x86/cpufeatures: Enumerate #DB for bus lock detection")
        f333374e
      
       ("x86/cpufeatures: Add the Virtual SPEC_CTRL feature")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        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
      
      Cc: Babu Moger <babu.moger@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6faf64f5
    • Arnaldo Carvalho de Melo's avatar
      tools include UAPI powerpc: Sync errno.h with the kernel headers · 39163293
      Arnaldo Carvalho de Melo authored
      To pick the change in:
      
        7de21e67
      
       ("powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h")
      
      That will make the errno number -> string tables to pick this change on powerpc.
      
      Silencing this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/errno.h' differs from latest version at 'arch/powerpc/include/uapi/asm/errno.h'
        diff -u tools/arch/powerpc/include/uapi/asm/errno.h arch/powerpc/include/uapi/asm/errno.h
      
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Tony Ambardar <tony.ambardar@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      39163293
    • Arnaldo Carvalho de Melo's avatar
      tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' · fb24e308
      Arnaldo Carvalho de Melo authored
      To bring in the change made in this cset:
      
       5e21a3ec
      
       ("x86/alternative: Merge include files")
      
      This just silences these perf tools build warnings, no change in the tools:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
        diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S'
        diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
      
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Juergen Gross <jgross@suse.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fb24e308
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/prctl.h with the kernel sources · 5a80ee42
      Arnaldo Carvalho de Melo authored
      To pick a new prctl introduced in:
      
        20169862
      
       ("arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)")
      
      That results in
      
        $ grep prctl tools/perf/trace/beauty/*.sh
        tools/perf/trace/beauty/prctl_option.sh:printf "static const char *prctl_options[] = {\n"
        tools/perf/trace/beauty/prctl_option.sh:egrep $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \
        tools/perf/trace/beauty/prctl_option.sh:printf "static const char *prctl_set_mm_options[] = {\n"
        tools/perf/trace/beauty/prctl_option.sh:egrep $regex ${header_dir}/prctl.h | \
        tools/perf/trace/beauty/x86_arch_prctl.sh:prctl_arch_header=${x86_header_dir}/prctl.h
        tools/perf/trace/beauty/x86_arch_prctl.sh:	printf "#define x86_arch_prctl_codes_%d_offset %s\n" $idx $first_entry
        tools/perf/trace/beauty/x86_arch_prctl.sh:	printf "static const char *x86_arch_prctl_codes_%d[] = {\n" $idx
        tools/perf/trace/beauty/x86_arch_prctl.sh:	egrep -q $regex ${prctl_arch_header} && \
        tools/perf/trace/beauty/x86_arch_prctl.sh:	(egrep $regex ${prctl_arch_header} | \
        $ tools/perf/trace/beauty/prctl_option.sh > before
        $ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h
        $ tools/perf/trace/beauty/prctl_option.sh > after
        $ diff -u before after
        --- before	2021-05-09 10:06:10.064559675 -0300
        +++ after	2021-05-09 10:06:21.319791396 -0300
        @@ -54,6 +54,8 @@
         	[57] = "SET_IO_FLUSHER",
         	[58] = "GET_IO_FLUSHER",
         	[59] = "SET_SYSCALL_USER_DISPATCH",
        +	[60] = "PAC_SET_ENABLED_KEYS",
        +	[61] = "PAC_GET_ENABLED_KEYS",
         };
         static const char *prctl_set_mm_options[] = {
         	[1] = "START_CODE",
        $
      
      Now users can do:
      
        # perf trace -e syscalls:sys_enter_prctl --filter "option==PAC_GET_ENABLED_KEYS"
      ^C#
        # trace -v -e syscalls:sys_enter_prctl --filter "option==PAC_GET_ENABLED_KEYS"
        New filter for syscalls:sys_enter_prctl: (option==0x3d) && (common_pid != 5519 && common_pid != 3404)
      ^C#
      
      And also when prctl appears in a session, its options will be
      translated to the string.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5a80ee42
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync files changed by landlock, quotactl_path and mount_settattr new syscalls · f8bcb061
      Arnaldo Carvalho de Melo authored
      To pick the changes in these csets:
      
        a49f4f81 ("arch: Wire up Landlock syscalls")
        2a186721 ("fs: add mount_setattr()")
        fa8b9007
      
       ("quota: wire up quotactl_path")
      
      That silences these perf build warnings and add support for those new
      syscalls in tools such as 'perf trace'.
      
      For instance, this is now possible:
      
        # ~acme/bin/perf trace -v -e landlock*
        event qualifier tracepoint filter: (common_pid != 129365 && common_pid != 3502) && (id == 444 || id == 445 || id == 446)
        ^C#
      
      That is tha filter expression attached to the raw_syscalls:sys_{enter,exit}
      tracepoints.
      
        $ grep landlock tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
        444	common	landlock_create_ruleset	sys_landlock_create_ruleset
        445	common	landlock_add_rule	sys_landlock_add_rule
        446	common	landlock_restrict_self	sys_landlock_restrict_self
        $
      
      This addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
        diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
        Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
        diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/s390/entry/syscalls/syscall.tbl' differs from latest version at 'arch/s390/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl'
        diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
      
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Cc: James Morris <jamorris@linux.microsoft.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mickaël Salaün <mic@linux.microsoft.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8bcb061
    • Masami Hiramatsu's avatar
      perf tools: Fix a build error on arm64 with clang · a00b7e39
      Masami Hiramatsu authored
      
      
      Since clang's -Wmissing-field-initializers warns if a data
      structure is initialized with a signle NULL as below,
      
       ----
       tools/perf $ make CC=clang LLVM=1
       ...
       arch/arm64/util/kvm-stat.c:74:9: error: missing field 'ops' initializer [-Werror,-Wmissing-field-initializers]
               { NULL },
                      ^
       1 error generated.
       ----
      
      add another field initializer expressly as same as other
      arch's kvm-stat.c code.
      
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Anders Roxell <anders.roxell@linaro.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Link: http://lore.kernel.org/lkml/162037767540.94840.15758657049033010518.stgit@devnote2
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a00b7e39
    • Arnaldo Carvalho de Melo's avatar
      tools headers kvm: Sync kvm headers with the kernel sources · b35629bc
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        3c0c2ad1
      
       ("KVM: VMX: Add basic handling of VM-Exit from SGX enclave")
      
      None of them trigger any changes in tooling, this time this is just to silence
      these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h' differs from latest version at 'arch/x86/include/uapi/asm/vmx.h'
        diff -u tools/arch/x86/include/uapi/asm/vmx.h arch/x86/include/uapi/asm/vmx.h
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b35629bc
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · 0d943d5f
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        15fb7de1 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command")
        3bf72569 ("KVM: arm64: Add support for the KVM PTP service")
        4cfdd47d ("KVM: SVM: Add KVM_SEV SEND_START command")
        54526d1f ("KVM: x86: Support KVM VMs sharing SEV context")
        5569e2e7 ("KVM: SVM: Add support for KVM_SEV_SEND_CANCEL command")
        8b13c364 ("KVM: introduce KVM_CAP_SET_GUEST_DEBUG2")
        af43cbbf ("KVM: SVM: Add support for KVM_SEV_RECEIVE_START command")
        d3d1af85 ("KVM: SVM: Add KVM_SEND_UPDATE_DATA command")
        fe7e9488
      
       ("KVM: x86: Add capability to grant VM access to privileged SGX attribute")
      
      That don't cause any change in tooling as it doesn't introduce any new
      ioctl.
      
        $ grep kvm tools/perf/trace/beauty/*.sh
        tools/perf/trace/beauty/kvm_ioctl.sh:printf "static const char *kvm_ioctl_cmds[] = {\n"
        tools/perf/trace/beauty/kvm_ioctl.sh:egrep $regex ${header_dir}/kvm.h	| \
        $
        $ 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
        $
      
      This silences this perf build warning:
      
        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
      
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: Jianyong Wu <jianyong.wu@arm.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Nathan Tempelman <natet@google.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Steve Rutherford <srutherford@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0d943d5f
    • Jiri Olsa's avatar
      perf tools: Fix dynamic libbpf link · ad1237c3
      Jiri Olsa authored
      Justin reported broken build with LIBBPF_DYNAMIC=1.
      
      When linking libbpf dynamically we need to use perf's
      hashmap object, because it's not exported in libbpf.so
      (only in libbpf.a).
      
      Following build is now passing:
      
        $ make LIBBPF_DYNAMIC=1
          BUILD:   Doing 'make -j8' parallel build
          ...
        $ ldd perf | grep libbpf
              libbpf.so.0 => /lib64/libbpf.so.0 (0x00007fa7630db000)
      
      Fixes: eee19501
      
       ("perf tools: Grab a copy of libbpf's hashmap")
      Reported-by: default avatarJustin M. Forbes <jforbes@redhat.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210508205020.617984-1-jolsa@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ad1237c3
    • Dmitry Koshelev's avatar
      perf session: Fix swapping of cpu_map and stat_config records · a11c9a6e
      Dmitry Koshelev authored
      
      
      'data' field in perf_record_cpu_map_data struct is 16-bit
      wide and so should be swapped using bswap_16().
      
      'nr' field in perf_record_stat_config struct should be
      swapped before being used for size calculation.
      
      Signed-off-by: default avatarDmitry Koshelev <karaghiozis@gmail.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210506131244.13328-1-karaghiozis@gmail.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a11c9a6e
    • Ian Rogers's avatar
      perf jevents: Silence warning for ArchStd files · 7aa3c9ea
      Ian Rogers authored
      
      
      JSON files in the level 1 directory are used for ArchStd events (see
      preprocess_arch_std_files), as such they shouldn't be warned about.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210506225640.1461000-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7aa3c9ea
    • Namhyung Kim's avatar
      perf record: Disallow -c and -F option at the same time · e8c11676
      Namhyung Kim authored
      
      
      It's confusing which one is effective when the both options are given.
      The current code happens to use -c in this case but users might not be
      aware of it.  We can change it to complain about that instead of relying
      on the implicit priority.
      
      Before:
      
        $ perf record -c 111111 -F 99 true
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.031 MB perf.data (8 samples) ]
      
        $ perf evlist -F
        cycles: sample_period=111111
        $
      
      After:
        $ perf record -c 111111 -F 99 true
        cannot set frequency and period at the same time
        $
      
      So this change can break existing usages, but I think it's rare to have
      both options and it'd be better changing them.
      
      Suggested-by: default avatarAlexey Alexandrov <aalexand@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210402094020.28164-1-namhyung@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e8c11676