03 Nov, 2020

1 commit

  • 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
    Cc: Alexander Yarygin
    Cc: Borislav Petkov
    Cc: Christian Borntraeger
    Cc: Cornelia Huck
    Cc: David Ahern
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Joerg Roedel
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

12 Aug, 2020

1 commit

  • To pick the changes in:

    23a60f834406 ("s390/kvm: diagnose 0x318 sync and reset")

    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/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
    diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h

    Cc: Adrian Hunter
    Cc: Christian Borntraeger
    Cc: Collin Walling
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

01 Oct, 2019

1 commit

  • To pick the changes in:

    200824f55eef ("KVM: s390: Disallow invalid bits in kvm_valid_regs and kvm_dirty_regs")
    4a53d99dd0c2 ("KVM: VMX: Introduce exit reason for receiving INIT signal on guest-mode")
    7396d337cfad ("KVM: x86: Return to userspace with internal error on unexpected exit reason")
    92f35b751c71 ("KVM: arm/arm64: vgic: Allow more than 256 vcpus for KVM_IRQ_LINE")

    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/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/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
    Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
    diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
    Warning: Kernel ABI header at 'tools/arch/arm/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm/include/uapi/asm/kvm.h'
    diff -u tools/arch/arm/include/uapi/asm/kvm.h arch/arm/include/uapi/asm/kvm.h
    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

    Cc: Adrian Hunter
    Cc: Janosch Frank
    Cc: Jiri Olsa
    Cc: Liran Alon
    Cc: Marc Zyngier
    Cc: Namhyung Kim
    Cc: Paolo Bonzini
    Cc: Thomas Huth
    Link: https://lkml.kernel.org/n/tip-akuugvvjxte26kzv23zp5d2z@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 May, 2019

1 commit

  • dd53f6102c30 ("Merge tag 'kvmarm-for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD")
    59c5c58c5b93 ("Merge tag 'kvm-ppc-next-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD")
    d7547c55cbe7 ("KVM: Introduce KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2")
    6520ca64cde7 ("KVM: PPC: Book3S HV: XIVE: Add a mapping for the source ESB pages")
    39e9af3de5ca ("KVM: PPC: Book3S HV: XIVE: Add a TIMA mapping")
    e4945b9da52b ("KVM: PPC: Book3S HV: XIVE: Add get/set accessors for the VP XIVE state")
    e6714bd1671d ("KVM: PPC: Book3S HV: XIVE: Add a control to dirty the XIVE EQ pages")
    7b46b6169ab8 ("KVM: PPC: Book3S HV: XIVE: Add a control to sync the sources")
    5ca806474859 ("KVM: PPC: Book3S HV: XIVE: Add a global reset control")
    13ce3297c576 ("KVM: PPC: Book3S HV: XIVE: Add controls for the EQ configuration")
    e8676ce50e22 ("KVM: PPC: Book3S HV: XIVE: Add a control to configure a source")
    4131f83c3d64 ("KVM: PPC: Book3S HV: XIVE: add a control to initialize a source")
    eacc56bb9de3 ("KVM: PPC: Book3S HV: XIVE: Introduce a new capability KVM_CAP_PPC_IRQ_XIVE")
    90c73795afa2 ("KVM: PPC: Book3S HV: Add a new KVM device for the XIVE native exploitation mode")
    4f45b90e1c03 ("KVM: s390: add deflate conversion facilty to cpu model")
    a243c16d18be ("KVM: arm64: Add capability to advertise ptrauth for guest")
    a22fa321d13b ("KVM: arm64: Add userspace flag to enable pointer authentication")
    4bd774e57b29 ("KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing")
    8ae6efdde451 ("KVM: arm64/sve: Clean up UAPI register ID definitions")
    173aec2d5a9f ("KVM: s390: add enhanced sort facilty to cpu model")
    555f3d03e7fb ("KVM: arm64: Add a capability to advertise SVE support")
    9033bba4b535 ("KVM: arm64/sve: Add pseudo-register for the guest's vector lengths")
    7dd32a0d0103 ("KVM: arm/arm64: Add KVM_ARM_VCPU_FINALIZE ioctl")
    e1c9c98345b3 ("KVM: arm64/sve: Add SVE support to register access ioctl interface")
    2b953ea34812 ("KVM: Allow 2048-bit register access via ioctl interface")

    None entails changes in tooling, the closest to that were some new arch
    specific ioctls, that are still not handled by the tools/perf/trace/beauty/
    library, that needs to create per-arch tables to convert ioctl cmd->string (and
    back).

    From a quick look the arch specific kvm-stat.c files at:

    $ ls -1 tools/perf/arch/*/util/kvm-stat.c
    tools/perf/arch/powerpc/util/kvm-stat.c
    tools/perf/arch/s390/util/kvm-stat.c
    tools/perf/arch/x86/util/kvm-stat.c
    $

    Are not affected.

    This silences these perf building warnings:

    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/arch/powerpc/include/uapi/asm/kvm.h' differs from latest version at 'arch/powerpc/include/uapi/asm/kvm.h'
    diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
    Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
    diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
    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

    Cc: Adrian Hunter
    Cc: Amit Daniel Kachhap
    Cc: Brendan Gregg
    Cc: Cédric Le Goater
    Cc: Christian Borntraeger
    Cc: Dave Martin
    Cc: Jiri Olsa
    Cc: Luis Cláudio Gonçalves
    Cc: Marc Zyngier
    Cc: Namhyung Kim
    Cc: Paolo Bonzini
    Cc: Paul Mackerras
    Cc: Peter Xu
    Link: https://lkml.kernel.org/n/tip-3msmqjenlmb7eygcdnmlqaq1@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

18 Apr, 2019

1 commit

  • This enables stfle.155 and adds the subfunctions for KDSA. Bit 155 is
    added to the list of facilities that will be enabled when there is no
    cpu model involved as MSA9 requires no additional handling from
    userspace, e.g. for migration.

    Please note that a cpu model enabled user space can and will have the
    final decision on the facility bits for a guests.

    Signed-off-by: Christian Borntraeger
    Acked-by: Janosch Frank
    Reviewed-by: Collin Walling
    Reviewed-by: David Hildenbrand

    Christian Borntraeger
     

31 Oct, 2018

1 commit


20 Oct, 2018

1 commit

  • Currently, on x86-64, perf uses LFENCE and MFENCE (rmb() and mb(),
    respectively) when processing events from the perf ring buffer which
    is unnecessarily expensive as we can do more lightweight in particular
    given this is critical fast-path in perf.

    According to Peter rmb()/mb() were added back then via a94d342b9cb0
    ("tools/perf: Add required memory barriers") at a time where kernel
    still supported chips that needed it, but nowadays support for these
    has been ditched completely, therefore we can fix them up as well.

    While for x86-64, replacing rmb() and mb() with smp_*() variants would
    result in just a compiler barrier for the former and LOCK + ADD for
    the latter (__sync_synchronize() uses slower MFENCE by the way), Peter
    suggested we can use smp_{load_acquire,store_release}() instead for
    architectures where its implementation doesn't resolve in slower smp_mb().
    Thus, e.g. in x86-64 we would be able to avoid CPU barrier entirely due
    to TSO. For architectures where the latter needs to use smp_mb() e.g.
    on arm, we stick to cheaper smp_rmb() variant for fetching the head.

    This work adds helpers ring_buffer_read_head() and ring_buffer_write_tail()
    for tools infrastructure that either switches to smp_load_acquire() for
    architectures where it is cheaper or uses READ_ONCE() + smp_rmb() barrier
    for those where it's not in order to fetch the data_head from the perf
    control page, and it uses smp_store_release() to write the data_tail.
    Latter is smp_mb() + WRITE_ONCE() combination or a cheaper variant if
    architecture allows for it. Those that rely on smp_rmb() and smp_mb() can
    further improve performance in a follow up step by implementing the two
    under tools/arch/*/include/asm/barrier.h such that they don't have to
    fallback to rmb() and mb() in tools/include/asm/barrier.h.

    Switch perf to use ring_buffer_read_head() and ring_buffer_write_tail()
    so it can make use of the optimizations. Later, we convert libbpf as
    well to use the same helpers.

    Side note [0]: the topic has been raised of whether one could simply use
    the C11 gcc builtins [1] for the smp_load_acquire() and smp_store_release()
    instead:

    __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
    __atomic_store_n(ptr, val, __ATOMIC_RELEASE);

    Kernel and (presumably) tooling shipped along with the kernel has a
    minimum requirement of being able to build with gcc-4.6 and the latter
    does not have C11 builtins. While generally the C11 memory models don't
    align with the kernel's, the C11 load-acquire and store-release alone
    /could/ suffice, however. Issue is that this is implementation dependent
    on how the load-acquire and store-release is done by the compiler and
    the mapping of supported compilers must align to be compatible with the
    kernel's implementation, and thus needs to be verified/tracked on a
    case by case basis whether they match (unless an architecture uses them
    also from kernel side). The implementations for smp_load_acquire() and
    smp_store_release() in this patch have been adapted from the kernel side
    ones to have a concrete and compatible mapping in place.

    [0] http://patchwork.ozlabs.org/patch/985422/
    [1] https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html

    Signed-off-by: Daniel Borkmann
    Acked-by: Peter Zijlstra (Intel)
    Cc: "Paul E. McKenney"
    Cc: Will Deacon
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: Alexei Starovoitov

    Daniel Borkmann
     

12 Sep, 2018

1 commit

  • To get the changes in:

    a449938297e5 ("KVM: s390: Add huge page enablement control")
    8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
    be26b3a73413 ("arm64: KVM: export the capability to set guest SError syndrome")
    b7b27facc7b5 ("arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS")
    b0960b9569db ("KVM: arm: Add 32bit get/set events support")
    a3da7b4a3be5 ("KVM: s390: add etoken support for guests")

    This makes 'perf trace' automagically get aware of these new ioctls:

    $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
    $ tools/perf/trace/beauty/kvm_ioctl.sh > /tmp/after
    $ diff -u /tmp/before /tmp/after
    --- /tmp/before 2018-09-11 11:18:29.173207586 -0300
    +++ /tmp/after 2018-09-11 11:18:38.488200446 -0300
    @@ -84,6 +84,8 @@
    [0xbb] = "MEMORY_ENCRYPT_REG_REGION",
    [0xbc] = "MEMORY_ENCRYPT_UNREG_REGION",
    [0xbd] = "HYPERV_EVENTFD",
    + [0xbe] = "GET_NESTED_STATE",
    + [0xbf] = "SET_NESTED_STATE",
    [0xe0] = "CREATE_DEVICE",
    [0xe1] = "SET_DEVICE_ATTR",
    [0xe2] = "G

    And cures the following warning during perf's build:

    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: Adrian Hunter
    Cc: Christian Borntraeger
    Cc: Cornelia Huck
    Cc: David Ahern
    Cc: David Hildenbrand
    Cc: Dongjiu Geng
    Cc: Eduardo Habkost
    Cc: James Morse
    Cc: Janosch Frank
    Cc: Jim Mattson
    Cc: Jiri Olsa
    Cc: Marc Zyngier
    Cc: Namhyung Kim
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

15 Feb, 2018

1 commit

  • This reverts commit f120c7b187e6c418238710b48723ce141f467543 which is no
    longer required with the introduction of a syscall.tbl on s390.

    Signed-off-by: Hendrik Brueckner
    Cc: Jiri Olsa
    Cc: Michael Petlan
    Cc: Thomas Richter
    Cc: linux-s390@vger.kernel.org
    LPU-Reference: 1518090470-2899-2-git-send-email-brueckner@linux.vnet.ibm.com
    Link: https://lkml.kernel.org/n/tip-q1lg0nvhha1tk39ri9aqalcb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Hendrik Brueckner
     

03 Feb, 2018

1 commit

  • The 35b3fde6203b ("KVM: s390: wire up bpb feature") was noticed by the
    perf build process:

    Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'

    The changes in this cset don't cause or require changes in tools/perf/,
    so just update the copy to silence the build warning.

    Cc: Adrian Hunter
    Cc: Christian Borntraeger
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Radim Krčmář
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-kif2fdkcaewj8iqw6lwyil8s@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

06 Jan, 2018

1 commit


01 Jan, 2018

1 commit

  • Pull perf fixes from Thomas Gleixner:

    - plug a memory leak in the intel pmu init code

    - clang fixes

    - tooling fix to avoid including kernel headers

    - a fix for jvmti to generate correct debug information for inlined
    code

    - replace backtick with a regular shell function

    - fix the build in hardened environments

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel: Plug memory leak in intel_pmu_init()
    x86/asm: Allow again using asm.h when building for the 'bpf' clang target
    tools arch s390: Do not include header files from the kernel sources
    perf jvmti: Generate correct debug information for inlined code
    perf tools: Fix up build in hardened environments
    perf tools: Use shell function for perl cflags retrieval

    Linus Torvalds
     

27 Dec, 2017

1 commit

  • Will be used for generating the syscall id/string translation table.

    Signed-off-by: Hendrik Brueckner
    Reviewed-by: Thomas Richter
    Cc: Jiri Olsa
    Cc: Michael Petlan
    Cc: linux-s390@vger.kernel.org
    LPU-Reference: 1512635281-20733-2-git-send-email-brueckner@linux.vnet.ibm.com
    Link: https://lkml.kernel.org/n/tip-vjfbfvgjrnqnbdluqd7leo98@git.kernel.org
    [ split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Hendrik Brueckner
     

19 Dec, 2017

1 commit

  • With 720f228e8d31 ("bpf: fix broken BPF selftest build") the
    inclusion of arch-specific header files changed. Including the
    asm/bpf_perf_event.h on s390, correctly includes the s390 specific
    header file. This header file tries then to include the s390
    asm/ptrace.h and the build fails with:

    cc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../../include/generated -I../../../include test_verifier.c
    +/root/git/linux/tools/testing/selftests/bpf/libbpf.a /root/git/linux/tools/testing/selftests/bpf/cgroup_helpers.c -lcap -lelf -o
    +/root/git/linux/tools/testing/selftests/bpf/test_verifier
    In file included from ../../../include/uapi/asm/bpf_perf_event.h:4:0,
    from ../../../include/uapi/linux/bpf_perf_event.h:11,
    from test_verifier.c:29:
    ../../../include/uapi/../../arch/s390/include/uapi/asm/bpf_perf_event.h:7:9: error: unknown type name 'user_pt_regs'
    typedef user_pt_regs bpf_user_pt_regs_t;
    ^~~~~~~~~~~~
    make: *** [../lib.mk:109: /root/git/linux/tools/testing/selftests/bpf/test_verifier] Error 1

    This is caused by a recent update to the s390 asm/ptrace.h file
    that is not (yet) available in the local installation. That means,
    the s390 asm/ptrace.h must be included from the tools/arch/s390
    directory.

    Because there is no proper framework to deal with asm specific
    includes in tools/, slightly modify the s390 asm/bpf_perf_event.h
    to include the local ptrace.h header file.

    See also discussion on
    https://marc.info/?l=linux-s390&m=151359424420691&w=2

    Please note that this needs to be preserved until tools/ is able to
    correctly handle asm specific headers.

    References: https://marc.info/?l=linux-s390&m=151359424420691&w=2
    Fixes: 720f228e8d31 ("bpf: fix broken BPF selftest build")
    Signed-off-by: Hendrik Brueckner
    Cc: Daniel Borkmann
    Cc: Hendrik Brueckner
    Cc: Arnaldo Carvalho de Melo
    Cc: Alexei Starovoitov
    Signed-off-by: Daniel Borkmann

    Hendrik Brueckner
     

18 Dec, 2017

1 commit

  • Long ago we decided to be verbotten including files in the kernel git
    sources from tools/ living source code, to avoid disturbing kernel
    development (and perf's and other tools/) when, say, a kernel hacker
    adds something, tests everything but tools/ and have tools/ build
    broken.

    This got broken recently by s/390, fix it by copying
    arch/s390/include/uapi/asm/perf_regs.h to tools/arch/s390/include/uapi/asm/,
    making this one be used by means of and updating
    tools/perf/check_headers.sh to make sure we are notified when the
    original changes, so that we can check if anything is needed on the
    tooling side.

    This would have been caught by the 'tarkpg' test entry in:

    $ make -C tools/perf build-test

    When run on a s/390 build system or container.

    Acked-by: Heiko Carstens
    Cc: Hendrik Brueckner
    Cc: Thomas Richter
    Cc: Martin Schwidefsky
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Fixes: f704ef44602f ("s390/perf: add support for perf_regs and libdw")
    Link: https://lkml.kernel.org/n/tip-n57139ic0v9uffx8wdqi3d8a@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

09 Dec, 2017

1 commit

  • Pull networking fixes from David Miller:

    1) CAN fixes from Martin Kelly (cancel URBs properly in all the CAN usb
    drivers).

    2) Revert returning -EEXIST from __dev_alloc_name() as this propagates
    to userspace and broke some apps. From Johannes Berg.

    3) Fix conn memory leaks and crashes in TIPC, from Jon Malloc and Cong
    Wang.

    4) Gianfar MAC can't do EEE so don't advertise it by default, from
    Claudiu Manoil.

    5) Relax strict netlink attribute validation, but emit a warning. From
    David Ahern.

    6) Fix regression in checksum offload of thunderx driver, from Florian
    Westphal.

    7) Fix UAPI bpf issues on s390, from Hendrik Brueckner.

    8) New card support in iwlwifi, from Ihab Zhaika.

    9) BBR congestion control bug fixes from Neal Cardwell.

    10) Fix port stats in nfp driver, from Pieter Jansen van Vuuren.

    11) Fix leaks in qualcomm rmnet, from Subash Abhinov Kasiviswanathan.

    12) Fix DMA API handling in sh_eth driver, from Thomas Petazzoni.

    13) Fix spurious netpoll warnings in bnxt_en, from Calvin Owens.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (67 commits)
    net: mvpp2: fix the RSS table entry offset
    tcp: evaluate packet losses upon RTT change
    tcp: fix off-by-one bug in RACK
    tcp: always evaluate losses in RACK upon undo
    tcp: correctly test congestion state in RACK
    bnxt_en: Fix sources of spurious netpoll warnings
    tcp_bbr: reset long-term bandwidth sampling on loss recovery undo
    tcp_bbr: reset full pipe detection on loss recovery undo
    tcp_bbr: record "full bw reached" decision in new full_bw_reached bit
    sfc: pass valid pointers from efx_enqueue_unwind
    gianfar: Disable EEE autoneg by default
    tcp: invalidate rate samples during SACK reneging
    can: peak/pcie_fd: fix potential bug in restarting tx queue
    can: usb_8dev: cancel urb on -EPIPE and -EPROTO
    can: kvaser_usb: cancel urb on -EPIPE and -EPROTO
    can: esd_usb2: cancel urb on -EPIPE and -EPROTO
    can: ems_usb: cancel urb on -EPIPE and -EPROTO
    can: mcba_usb: cancel urb on -EPROTO
    usbnet: fix alignment for frames with no ethernet header
    tcp: use current time in tcp_rcv_space_adjust()
    ...

    Linus Torvalds
     

07 Dec, 2017

1 commit

  • There were two trivial updates to these upstream UAPI headers:

    arch/s390/include/uapi/asm/kvm.h
    arch/s390/include/uapi/asm/kvm_perf.h
    arch/x86/lib/x86-opcode-map.txt

    Synchronize them with their tooling copies.

    (The x86 opcode map includes a new instruction pattern now.)

    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Namhyung Kim
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

05 Dec, 2017

1 commit

  • Synchronize the uapi kernel header files which solves the broken
    uapi export of pt_regs. Because of arch-specific uapi headers,
    extended the include path in the Makefile.

    With this change, the test_verifier program compiles and runs successfully
    on s390.

    Signed-off-by: Hendrik Brueckner
    Reviewed-and-tested-by: Thomas Richter
    Acked-by: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Shuah Khan
    Signed-off-by: Daniel Borkmann

    Hendrik Brueckner
     

02 Nov, 2017

3 commits

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many user space API headers are missing licensing information, which
    makes it hard for compliance tools to determine the correct license.

    By default are files without license information under the default
    license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
    them from being included in non GPLV2 code, which is obviously not
    intended. The user space API headers fall under the syscall exception
    which is in the kernels COPYING file:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    otherwise syscall usage would not be possible.

    Update the files which contain no license information with an SPDX
    license identifier. The chosen identifier is 'GPL-2.0 WITH
    Linux-syscall-note' which is the officially assigned identifier for the
    Linux syscall exception. SPDX license identifiers are a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Sep, 2017

1 commit

  • Time for a sync with ABI/uapi headers with the upcoming v4.14 kernel.

    None of the ABI changes require any source code level changes to our
    existing in-kernel tooling code:

    - tools/arch/s390/include/uapi/asm/kvm.h:

    New KVM_S390_VM_TOD_EXT ABI, not used by in-kernel tooling.

    - tools/arch/x86/include/asm/cpufeatures.h:
    tools/arch/x86/include/asm/disabled-features.h:

    New PCID, SME and VGIF x86 CPU feature bits defined.

    - tools/include/asm-generic/hugetlb_encode.h:
    tools/include/uapi/asm-generic/mman-common.h:
    tools/include/uapi/linux/mman.h:

    Two new madvise() flags, plus a hugetlb system call mmap flags
    restructuring/extension changes.

    - tools/include/uapi/drm/drm.h:
    tools/include/uapi/drm/i915_drm.h:

    New drm_syncobj_create flags definitions, new drm_syncobj_wait
    and drm_syncobj_array ABIs. DRM_I915_PERF_* calls and a new
    I915_PARAM_HAS_EXEC_FENCE_ARRAY ABI for the Intel driver.

    - tools/include/uapi/linux/bpf.h:

    New bpf_sock fields (::mark and ::priority), new XDP_REDIRECT
    action, new kvm_ppc_smmu_info fields (::data_keys, instr_keys)

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Cc: Wang Nan
    Cc: Yao Jin
    Link: http://lkml.kernel.org/r/20170913073823.lxmi4c7ejqlfabjx@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

31 Jul, 2017

1 commit

  • Sync up (copy) the following v4.13 kernel headers to the tooling headers:

    arch/arm/include/uapi/asm/kvm.h:
    arch/arm64/include/uapi/asm/kvm.h:
    arch/powerpc/include/uapi/asm/kvm.h:
    arch/s390/include/uapi/asm/kvm.h:

    - KVM ABI extensions, which do not affect perf tooling

    arch/x86/include/asm/cpufeatures.h:
    arch/x86/include/asm/disabled-features.h:

    - New PCID CPU feature on Intel CPUs - does not affect tooling.

    I.e. no real changes were needed to resolve the build warnings, just a plain copy
    of the latest kernel header version.

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: David Carrillo-Cisneros
    Cc: Francis Deslauriers
    Cc: Geneviève Bastien
    Cc: Jiri Olsa
    Cc: Julien Desfossez
    Cc: Martin Liška
    Cc: Mathieu Desnoyers
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Paul Turner
    Cc: Peter Zijlstra
    Cc: Simon Que
    Cc: Stephane Eranian
    Cc: Taeung Song
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20170730095232.4j4xigsoqwufl5hu@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

24 May, 2017

1 commit

  • Sync (copy) the following v4.12 kernel headers to the tooling headers:

    arch/x86/include/asm/disabled-features.h:
    arch/x86/include/uapi/asm/kvm.h:
    arch/powerpc/include/uapi/asm/kvm.h:
    arch/s390/include/uapi/asm/kvm.h:
    arch/arm/include/uapi/asm/kvm.h:
    arch/arm64/include/uapi/asm/kvm.h:

    - 'struct kvm_sync_regs' got changed in an ABI-incompatible way,
    fortunately none of the (in-kernel) tooling relied on it

    - new KVM_DEV calls added

    arch/x86/include/asm/required-features.h:

    - 5-level paging hardware ABI detail added

    arch/x86/include/asm/cpufeatures.h:

    - new CPU feature added

    arch/x86/include/uapi/asm/vmx.h:

    - new VMX exit conditions

    None of the changes requires fixes in the tooling source code.

    This addresses the following warnings:

    Warning: include/uapi/linux/stat.h differs from kernel
    Warning: arch/x86/include/asm/disabled-features.h differs from kernel
    Warning: arch/x86/include/asm/required-features.h differs from kernel
    Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
    Warning: arch/x86/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/x86/include/uapi/asm/vmx.h differs from kernel
    Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/s390/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/arm/include/uapi/asm/kvm.h differs from kernel
    Warning: arch/arm64/include/uapi/asm/kvm.h differs from kernel

    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Yao Jin
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20170524065721.j2mlch6bgk5klgbc@gmail.com
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

26 Apr, 2017

1 commit


19 Sep, 2016

1 commit

  • Some macros required by tools/perf/trace/beauty/mmap.c is not support
    for all architectures. For example, MAP_32BIT is defined on x86 only,
    alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.

    This patch regenerates mman.h for each arch, defines these missing
    macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
    because they are in a 'case ...' statement. For flags, define it to 0.

    Following is the script to generate this patch:

    macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
    rm `find ./tools/arch/ -name mman.h`
    for arch in `ls tools/arch`
    do
    [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
    src=arch/$arch/include/uapi/asm/mman.h
    target=tools/arch/$arch/include/uapi/asm/mman.h.tmp
    real_target=tools/arch/$arch/include/uapi/asm/mman.h
    guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
    rm -f $target

    [ -f $src ] &&
    for m in $macros
    do
    if grep '#define[ \t]*'$m $src > /dev/null 2>&1
    then
    grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
    fi
    done

    if [ -f $src ]
    then
    grep '#include > $real_target
    rm $target
    echo "$real_target"
    done

    exit 0
    # Following macros are extracted from:
    # tools/perf/trace/beauty/mmap.c
    #
    # start macro list
    MADV_DODUMP
    MADV_DOFORK
    MADV_DONTDUMP
    MADV_DONTFORK
    MADV_DONTNEED
    MADV_FREE
    MADV_HUGEPAGE
    MADV_HWPOISON
    MADV_MERGEABLE
    MADV_NOHUGEPAGE
    MADV_NORMAL
    MADV_RANDOM
    MADV_REMOVE
    MADV_SEQUENTIAL
    MADV_SOFT_OFFLINE
    MADV_UNMERGEABLE
    MADV_WILLNEED
    MAP_32BIT
    MAP_ANONYMOUS
    MAP_DENYWRITE
    MAP_EXECUTABLE
    MAP_FILE
    MAP_FIXED
    MAP_GROWSDOWN
    MAP_HUGETLB
    MAP_LOCKED
    MAP_NONBLOCK
    MAP_NORESERVE
    MAP_POPULATE
    MAP_PRIVATE
    MAP_SHARED
    MAP_STACK
    MAP_UNINITIALIZED
    MREMAP_FIXED
    MREMAP_MAYMOVE
    PROT_EXEC
    PROT_GROWSDOWN
    PROT_GROWSUP
    PROT_NONE
    PROT_READ
    PROT_SEM
    PROT_WRITE

    Signed-off-by: Wang Nan
    Tested-by: Kim Phillips
    Tested-by: Naveen N. Rao
    Cc: Ravi Bangoria
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Fixes: 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")
    Link: http://lkml.kernel.org/r/1473850649-83389-3-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

14 Sep, 2016

1 commit

  • Some mmap related macros have different values for different
    architectures. This patch introduces uapi mman.h for each
    architectures.

    Three headers are cloned from kernel include to tools/include:

    tools/include/uapi/asm-generic/mman-common.h
    tools/include/uapi/asm-generic/mman.h
    tools/include/uapi/linux/mman.h

    The main part of this patch is generated by following script:

    macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
    for arch in `ls tools/arch`
    do
    [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
    src=arch/$arch/include/uapi/asm/mman.h
    target=tools/arch/$arch/include/uapi/asm/mman.h
    guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
    echo '#ifndef '$guard > $target
    echo '#define '$guard >> $target

    [ -f $src ] &&
    for m in $macros
    do
    if grep '#define[ \t]*'$m $src > /dev/null 2>&1
    then
    grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
    fi
    done

    if [ -f $src ]
    then
    grep '#include > $target
    echo "$target"
    done

    exit 0
    # Following macros are extracted from:
    # tools/perf/trace/beauty/mmap.c
    #
    # start macro list
    MADV_DODUMP
    MADV_DOFORK
    MADV_DONTDUMP
    MADV_DONTFORK
    MADV_DONTNEED
    MADV_HUGEPAGE
    MADV_HWPOISON
    MADV_MERGEABLE
    MADV_NOHUGEPAGE
    MADV_NORMAL
    MADV_RANDOM
    MADV_REMOVE
    MADV_SEQUENTIAL
    MADV_SOFT_OFFLINE
    MADV_UNMERGEABLE
    MADV_WILLNEED
    MAP_32BIT
    MAP_ANONYMOUS
    MAP_DENYWRITE
    MAP_EXECUTABLE
    MAP_FILE
    MAP_FIXED
    MAP_GROWSDOWN
    MAP_HUGETLB
    MAP_LOCKED
    MAP_NONBLOCK
    MAP_NORESERVE
    MAP_POPULATE
    MAP_PRIVATE
    MAP_SHARED
    MAP_STACK
    MAP_UNINITIALIZED
    MREMAP_FIXED
    MREMAP_MAYMOVE
    PROT_EXEC
    PROT_GROWSDOWN
    PROT_GROWSUP
    PROT_NONE
    PROT_READ
    PROT_SEM
    PROT_WRITE

    Signed-off-by: Wang Nan
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1473684871-209320-2-git-send-email-wangnan0@huawei.com
    [ Added new files to tools/perf/MANIFEST to fix the detached tarball build, add mman.h for ARC ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

16 Aug, 2016

1 commit

  • From a quick look nothing stands out as requiring changes to kvm tools
    such as tools/perf/arch/s390/util/kvm-stat.c.

    Silences these header checking warnings:

    $ make -C tools/perf
    make: Entering directory '/home/acme/git/linux/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: tools/arch/s390/include/uapi/asm/kvm.h differs from kernel
    Warning: tools/arch/s390/include/uapi/asm/sie.h differs from kernel
    Warning: tools/arch/arm64/include/uapi/asm/kvm.h differs from kernel

    Cc: Adrian Hunter
    Cc: Alexander Yarygin
    Cc: David Ahern
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Michael Ellerman
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Scott Wood
    Cc: Srikar Dronamraju
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-btutge414g516qmh6r5ienlj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

13 Jul, 2016

2 commits

  • We use it in bitops/__ffs.h and bitops/atomic.h, that we also got from
    the kernel, but were getting it from either newer systems that carry it
    in /usr/include, or from the kernel sources, that we decided not to
    touch from tools/ code. Fix it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-lwqvgbuitjmrdpjmjp6zqnyx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Those kernel files were being directly accessed, which we're not
    allowing anymore to avoid that changes in the kernel side break tooling.

    Warn if these copies drift from the original files.

    Cc: Adrian Hunter
    Cc: Alexander Yarygin
    Cc: Christoffer Dall
    Cc: David Ahern
    Cc: Eric Auger
    Cc: Hemant Kumar
    Cc: Jiri Olsa
    Cc: Marc Zyngier
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Srikar Dronamraju
    Cc: Wang Nan
    Cc: Yunlong Song
    Link: http://lkml.kernel.org/n/tip-mnopguymhnwzjhw3mowllvsy@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

09 May, 2015

1 commit