...
 
Commits (18)
  • Mauro Carvalho Chehab's avatar
    docs: dmaengine: provider.rst: get rid of some warnings · cf7da891
    Mauro Carvalho Chehab authored
    Get rid of those warnings by adding extra blank lines:
    
        Documentation/driver-api/dmaengine/provider.rst:270: WARNING: Unexpected indentation.
        Documentation/driver-api/dmaengine/provider.rst:273: WARNING: Block quote ends without a blank line; unexpected unindent.
        Documentation/driver-api/dmaengine/provider.rst:288: WARNING: Unexpected indentation.
        Documentation/driver-api/dmaengine/provider.rst:290: WARNING: Block quote ends without a blank line; unexpected unindent.
    
    While here, use parenthesis after get_metadata_ptr/set_metadata_len,
    as, if some day someone adds a kerneldoc markup for those, it
    should automatically generate a cross-reference to them.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Link: https://lore.kernel.org/r/62cf2a87b379a92c9c0e5a40c2ae8a138b01fe0a.1583250595.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    cf7da891
  • Masami Hiramatsu's avatar
    tools: Let O= makes handle a relative path with -C option · be40920f
    Masami Hiramatsu authored
    When I tried to compile tools/perf from the top directory with the -C
    option, the O= option didn't work correctly if I passed a relative path:
    
      $ make O=BUILD -C tools/perf/
      make: Entering directory '/home/mhiramat/ksrc/linux/tools/perf'
        BUILD:   Doing 'make -j8' parallel build
      ../scripts/Makefile.include:4: *** O=/home/mhiramat/ksrc/linux/tools/perf/BUILD does not exist.  Stop.
      make: *** [Makefile:70: all] Error 2
      make: Leaving directory '/home/mhiramat/ksrc/linux/tools/perf'
    
    The O= directory existence check failed because the check script ran in
    the build target directory instead of the directory where I ran the make
    command.
    
    To fix that, once change directory to $(PWD) and check O= directory,
    since the PWD is set to where the make command runs.
    
    Fixes: c883122a ("perf tools: Let O= makes handle relative paths")
    Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Masahiro Yamada <masahiroy@kernel.org>
    Cc: Michal Marek <michal.lkml@markovi.net>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sasha Levin <sashal@kernel.org>
    Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Cc: stable@vger.kernel.org
    Link: http://lore.kernel.org/lkml/158351957799.3363.15269768530697526765.stgit@devnote2Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    be40920f
  • disconnect3d's avatar
    perf map: Fix off by one in strncpy() size argument · db2c5494
    disconnect3d authored
    This patch fixes an off-by-one error in strncpy size argument in
    tools/perf/util/map.c. The issue is that in:
    
            strncmp(filename, "/system/lib/", 11)
    
    the passed string literal: "/system/lib/" has 12 bytes (without the NULL
    byte) and the passed size argument is 11. As a result, the logic won't
    match the ending "/" byte and will pass filepaths that are stored in
    other directories e.g. "/system/libmalicious/bin" or just
    "/system/libmalicious".
    
    This functionality seems to be present only on Android. I assume the
    /system/ directory is only writable by the root user, so I don't think
    this bug has much (or any) security impact.
    
    Fixes: eca81836 ("perf tools: Add automatic remapping of Android libraries")
    Signed-off-by: default avatardisconnect3d <dominik.b.czarnota@gmail.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Changbin Du <changbin.du@intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: John Keeping <john@metanate.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Michael Lentine <mlentine@google.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Song Liu <songliubraving@fb.com>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lore.kernel.org/lkml/20200309104855.3775-1-dominik.b.czarnota@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    db2c5494
  • Ilie Halip's avatar
    perf python: Fix clang detection when using CC=clang-version · a7ffd416
    Ilie Halip authored
    Currently, the setup.py script detects the clang compiler only when invoked
    with CC=clang. But when using a specific version (e.g. CC=clang-11), this
    doesn't work correctly and wrong compiler flags are set, leading to build
    errors.
    
    To properly detect clang, invoke the compiler with -v and check the output.
    The first line should start with "clang version ...".
    
    Committer testing:
    
      $ make CC=clang-9 O=/tmp/build/perf -C tools/perf install-bin
      <SNIP>
      $ readelf -wi /tmp/build/perf/python/perf.cpython-37m-x86_64-linux-gnu.so | grep DW_AT_producer | head -1
        <c>   DW_AT_producer    : (indirect string, offset: 0x0): clang version 9.0.1 (Fedora 9.0.1-2.fc31) /usr/bin/clang-9 -Wno-unused-result -Wsign-compare -D DYNAMIC_ANNOTATIONS_ENABLED=1 -D NDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-command-line -m64 -mtune=generic -fasynchronous-unwind-tables -fcf-protection=full -D _GNU_SOURCE -fPIC -fwrapv -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wshadow -D HAVE_ARCH_X86_64_SUPPORT -I /tmp/build/perf/arch/x86/include/generated -D HAVE_SYSCALL_TABLE_SUPPORT -D HAVE_PERF_REGS_SUPPORT -D HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O3 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D _FORTIFY_SOURCE=2 -D _LARGEFILE64_SOURCE -D _FILE_OFFSET_BITS=64 -D _GNU_SOURCE -I /home/acme/git/perf/tools/lib/perf/include -I /home/acme/git/perf/tools/perf/util/include -I /home/acme/git/perf/tools/perf/arch/x86/include -I /home/acme/git/perf/tools/include/ -I /home/acme/git/perf/tools/arch/x86/include/uapi -I /home/acme/git/perf/tools/include/uapi -I /home/acme/git/perf/tools/arch/x86/include/ -I /home/acme/git/perf/tools/arch/x86/ -I /tmp/build/perf//util -I /tmp/build/perf/ -I /home/acme/git/perf/tools/perf/util -I /home/acme/git/perf/tools/perf -I /home/acme/git/perf/tools/lib/ -D HAVE_PTHREAD_ATTR_SETAFFINITY_NP -D HAVE_PTHREAD_BARRIER -D HAVE_EVENTFD -D HAVE_GET_CURRENT_DIR_NAME -D HAVE_GETTID -D HAVE_DWARF_GETLOCATIONS_SUPPORT -D HAVE_GLIBC_SUPPORT -D HAVE_AIO_SUPPORT -D HAVE_SCHED_GETCPU_SUPPORT -D HAVE_SETNS_SUPPORT -D HAVE_LIBELF_SUPPORT -D HAVE_LIBELF_MMAP_SUPPORT -D HAVE_ELF_GETPHDRNUM_SUPPORT -D HAVE_GELF_GETNOTE_SUPPORT -D HAVE_ELF_GETSHDRSTRNDX_SUPPORT -D HAVE_DWARF_SUPPORT -D HAVE_LIBBPF_SUPPORT -D HAVE_BPF_PROLOGUE -D HAVE_SDT_EVENT -D HAVE_JITDUMP -D HAVE_DWARF_UNWIND_SUPPORT -D NO_LIBUNWIND_DEBUG_FRAME -D HAVE_LIBUNWIND_SUPPORT -D HAVE_LIBCRYPTO_SUPPORT -D HAVE_SLANG_SUPPORT -D HAVE_GTK2_SUPPORT -D NO_LIBPERL -D HAVE_TIMERFD_SUPPORT -D HAVE_LIBPYTHON_SUPPORT -D HAVE_CPLUS_DEMANGLE_SUPPORT -D HAVE_LIBBFD_SUPPORT -D HAVE_ZLIB_SUPPORT -D HAVE_LZMA_SUPPORT -D HAVE_ZSTD_SUPPORT -D HAVE_LIBCAP_SUPPORT -D HAVE_BACKTRACE_SUPPORT -D HAVE_LIBNUMA_SUPPORT -D HAVE_KVM_STAT_SUPPORT -D DISASM_FOUR_ARGS_SIGNATURE -D HAVE_LIBBABELTRACE_SUPPORT -D HAVE_AUXTRACE_SUPPORT -D HAVE_JVMTI_CMLR -I /tmp/build/perf/ -fPIC -I util/include -I /usr/include/python3.7m -c /home/acme/git/perf/tools/perf/util/python.c -o /tmp/build/perf/python_ext_build/tmp/home/acme/git/perf/tools/perf/util/python.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wshadow -D HAVE_ARCH_X86_64_SUPPORT -I /tmp/build/perf/arch/x86/include/generated -D HAVE_SYSCALL_TABLE_SUPPORT -D HAVE_PERF_REGS_SUPPORT -D HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O3 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D _FORTIFY_SOURCE=2 -D _LARGEFILE64_SOURCE -D _FILE_OFFSET_BITS=64 -D _GNU_SOURCE -I /home/acme/git/perf/tools/lib/perf/include -I /home/acme/git/perf/tools/perf/util/include -I /home/acme/git/perf/tools/perf/arch/x86/include -I /home/acme/git/perf/tools/include/ -I /home/acme/git/perf/tools/arch/x86/include/uapi -I /home/acme/git/perf/tools/include/uapi -I /home/acme/git/perf/tools/arch/x86/include/ -I /home/acme/git/perf/tools/arch/x86/ -I /tmp/build/perf//util -I /tmp/build/perf/ -I /home/acme/git/perf/tools/perf/util -I /home/acme/git/perf/tools/perf -I /home/acme/git/perf/tools/lib/ -D HAVE_PTHREAD_ATTR_SETAFFINITY_NP -D HAVE_PTHREAD_BARRIER -D HAVE_EVENTFD -D HAVE_GET_CURRENT_DIR_NAME -D HAVE_GETTID -D HAVE_DWARF_GETLOCATIONS_SUPPORT -D HAVE_GLIBC_SUPPORT -D HAVE_AIO_SUPPORT -D HAVE_SCHED_GETCPU_SUPPORT -D HAVE_SETNS_SUPPORT -D HAVE_LIBELF_SUPPORT -D HAVE_LIBELF_MMAP_SUPPORT -D HAVE_ELF_GETPHDRNUM_SUPPORT -D HAVE_GELF_GETNOTE_SUPPORT -D HAVE_ELF_GETSHDRSTRNDX_SUPPORT -D HAVE_DWARF_SUPPORT -D HAVE_LIBBPF_SUPPORT -D HAVE_BPF_PROLOGUE -D HAVE_SDT_EVENT -D HAVE_JITDUMP -D HAVE_DWARF_UNWIND_SUPPORT -D NO_LIBUNWIND_DEBUG_FRAME -D HAVE_LIBUNWIND_SUPPORT -D HAVE_LIBCRYPTO_SUPPORT -D HAVE_SLANG_SUPPORT -D HAVE_GTK2_SUPPORT -D NO_LIBPERL -D HAVE_TIMERFD_SUPPORT -D HAVE_LIBPYTHON_SUPPORT -D HAVE_CPLUS_DEMANGLE_SUPPORT -D HAVE_LIBBFD_SUPPORT -D HAVE_ZLIB_SUPPORT -D HAVE_LZMA_SUPPORT -D HAVE_ZSTD_SUPPORT -D HAVE_LIBCAP_SUPPORT -D HAVE_BACKTRACE_SUPPORT -D HAVE_LIBNUMA_SUPPORT -D HAVE_KVM_STAT_SUPPORT -D DISASM_FOUR_ARGS_SIGNATURE -D HAVE_LIBBABELTRACE_SUPPORT -D HAVE_AUXTRACE_SUPPORT -D HAVE_JVMTI_CMLR -I /tmp/build/perf/ -fno-strict-aliasing -Wno-write-strings -Wno-unused-parameter -Wno-redundant-decls
      $
    
    And here is how tools/perf/util/setup.py checks if the used clang has
    options that the distro specific python extension building compiler
    defaults:
    
      if cc_is_clang:
          from distutils.sysconfig import get_config_vars
          vars = get_config_vars()
          for var in ('CFLAGS', 'OPT'):
              vars[var] = sub("-specs=[^ ]+", "", vars[var])
              if not clang_has_option("-mcet"):
                  vars[var] = sub("-mcet", "", vars[var])
              if not clang_has_option("-fcf-protection"):
                  vars[var] = sub("-fcf-protection", "", vars[var])
              if not clang_has_option("-fstack-clash-protection"):
                  vars[var] = sub("-fstack-clash-protection", "", vars[var])
              if not clang_has_option("-fstack-protector-strong"):
                  vars[var] = sub("-fstack-protector-strong", "", vars[var])
    
    So "-fcf-protection=full" is used, clang-9 has this option and thus it
    was kept, the perf python extension was built with it and the build
    completed successfully.
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/903Signed-off-by: default avatarIlie Halip <ilie.halip@gmail.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Igor Lubashev <ilubashe@akamai.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: clang-built-linux@googlegroups.com
    Link: http://lore.kernel.org/lkml/20200309085618.14307-1-ilie.halip@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    a7ffd416
  • Ian Rogers's avatar
    perf parse-events: Fix reading of invalid memory in event parsing · 05e54e23
    Ian Rogers authored
    ADD_CONFIG_TERM accesses term->weak, however, in get_config_chgs this
    value is accessed outside of the list_for_each_entry and references
    invalid memory. Add an argument for ADD_CONFIG_TERM for weak and set it
    to false in the get_config_chgs case.
    
    This bug was cause by clang's address sanitizer and libfuzzer. It can be
    reproduced with a command line of:
    
      perf stat -a -e i/bs,tsc,L2/o
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@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>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: clang-built-linux@googlegroups.com
    Link: http://lore.kernel.org/lkml/20200307073121.203816-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    05e54e23
  • Masami Hiramatsu's avatar
    perf probe: Fix to delete multiple probe event · 6b8d68f1
    Masami Hiramatsu authored
    When we put an event with multiple probes, perf-probe fails to delete
    with filters. This comes from a failure to list up the event name
    because of overwrapping its name.
    
    To fix this issue, skip to list up the event which has same name.
    
    Without this patch:
    
      # perf probe -l \*
        probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:21@
        probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:25@
        probe_perf:map__map_ip (on append_inlines:12@util/machine.c in
        probe_perf:map__map_ip (on unwind_entry:19@util/machine.c in /
        probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
        probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
      # perf probe -d \*
      "*" does not hit any event.
        Error: Failed to delete events. Reason: No such file or directory (Code: -2)
    
    With it:
    
      # perf probe -d \*
      Removed event: probe_perf:map__map_ip
      #
    
    Fixes: 72363540 ("perf probe: Support multiprobe event")
    Reported-by: default avatarArnaldo Carvalho de Melo <acme@kernel.org>
    Reported-by: default avatarHe Zhe <zhe.he@windriver.com>
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: stable@vger.kernel.org
    Link: http://lore.kernel.org/lkml/158287666197.16697.7514373548551863562.stgit@devnote2Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    6b8d68f1
  • Masami Hiramatsu's avatar
    perf probe: Do not depend on dwfl_module_addrsym() · 1efde275
    Masami Hiramatsu authored
    Do not depend on dwfl_module_addrsym() because it can fail on user-space
    shared libraries.
    
    Actually, same bug was fixed by commit 664fee3d ("perf probe: Do not
    use dwfl_module_addrsym if dwarf_diename finds symbol name"), but commit
    07d36985 ("perf probe: Fix wrong address verification) reverted to
    get actual symbol address from symtab.
    
    This fixes it again by getting symbol address from DIE, and only if the
    DIE has only address range, it uses dwfl_module_addrsym().
    
    Fixes: 07d36985 ("perf probe: Fix wrong address verification)
    Reported-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
    Tested-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sasha Levin <sashal@kernel.org>
    Link: http://lore.kernel.org/lkml/158281812176.476.14164573830975116234.stgit@devnote2Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    1efde275
  • Vinod Koul's avatar
    dmaengine: move .device_release missing log warning to debug level · f91da3bd
    Vinod Koul authored
    Dmaengine core warns the drivers registering for missing .device_release
    implementation. The warning is accurate for dmaengine controllers which
    hotplug but not for rest.
    
    So reduce this to a debug log.
    
    Link: https://lore.kernel.org/r/20200306135018.2286959-1-vkoul@kernel.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    f91da3bd
  • Lukas Bulwahn's avatar
    MAINTAINERS: rectify the INTEL IADX DRIVER entry · 195967c0
    Lukas Bulwahn authored
    Commit bfe1d560 ("dmaengine: idxd: Init and probe for Intel data
    accelerators") added the INTEL IADX DRIVER entry in MAINTAINERS, which
    mentions include/linux/idxd.h as file entry. However, this header file was
    not added in this commit, nor in any later one.
    
    Hence, since then, ./scripts/get_maintainer.pl --self-test complains:
    
      warning: no file matches F: include/linux/idxd.h
    
    Drop the file entry to the non-existing file in INTEL IADX DRIVER now.
    Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
    Acked-by: default avatarDave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/20200307205737.5829-1-lukas.bulwahn@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    195967c0
  • Borislav Petkov's avatar
    x86/ioremap: Fix CONFIG_EFI=n build · 870b4333
    Borislav Petkov authored
    In order to use efi_mem_type(), one needs CONFIG_EFI enabled. Otherwise
    that function is undefined. Use IS_ENABLED() to check and avoid the
    ifdeffery as the compiler optimizes away the following unreachable code
    then.
    
    Fixes: 985e537a ("x86/ioremap: Map EFI runtime services data as encrypted for SEV")
    Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Cc: Tom Lendacky <thomas.lendacky@amd.com>
    Cc: <stable@vger.kernel.org>
    Link: https://lkml.kernel.org/r/7561e981-0d9b-d62c-0ef2-ce6007aff1ab@infradead.org
    870b4333
  • Ingo Molnar's avatar
    Merge tag 'perf-urgent-for-mingo-5.6-20200309' of... · db5d85ce
    Ingo Molnar authored
    Merge tag 'perf-urgent-for-mingo-5.6-20200309' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
    
    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
    
    perf probe:
    
      Masami Hiramatsu:
    
      - Fix deletion of multiple probe events.
    
      - Fix userspace libraries handling by not depending on dwfl_module_addrsym().
    
    Event parsing:
    
      Ian Rogers:
    
      - Fix reading of invalid memory in event parsing.
    
    python binding:
    
      Ilie Halip:
    
      - Fix clang detection when using CC=clang-version.
    
    build:
    
      Masami Hiramatsu:
    
      - Fix O= use with relative paths.
    
    Android:
    
      Dominik b. Czarnota:
    
      - Fix off by one in strncpy() size argument when handling Android
        libraries.
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    db5d85ce
  • Arnaldo Carvalho de Melo's avatar
    tools headers uapi: Update linux/in.h copy · 564200ed
    Arnaldo Carvalho de Melo authored
    To get the changes in:
    
      26776253 ("seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number")
    
    That ends up automatically adding the new IPPROTO_ETHERNET to the socket
    args beautifiers:
    
      $ tools/perf/trace/beauty/socket_ipproto.sh > before
    
    Apply this patch:
    
      $ tools/perf/trace/beauty/socket_ipproto.sh > after
      $ diff -u before after
      --- before	2020-03-19 11:48:36.876673819 -0300
      +++ after	2020-03-19 11:49:00.148541377 -0300
      @@ -6,6 +6,7 @@
       	[132] = "SCTP",
       	[136] = "UDPLITE",
       	[137] = "MPLS",
      +	[143] = "ETHERNET",
       	[17] = "UDP",
       	[1] = "ICMP",
       	[22] = "IDP",
      $
    
    Addresses this tools/perf build warning:
    
      Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
      diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
    
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Paolo Lungaroni <paolo.lungaroni@cnit.it>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    564200ed
  • Dave Jiang's avatar
    dmaengine: idxd: fix off by one on cdev dwq refcount · 988aad2f
    Dave Jiang authored
    The refcount check for dedicated workqueue (dwq) is off by one and allows
    more than 1 user to open the char device. Fix check so only a single user
    can open the device.
    
    Fixes: 42d279f9 ("dmaengine: idxd: add char driver to expose submission portal to userland")
    Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/158403020187.10208.14117394394540710774.stgit@djiang5-desk3.ch.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    988aad2f
  • Zhou Wang's avatar
    MAINTAINERS: Add maintainer for HiSilicon DMA engine driver · 01c4df39
    Zhou Wang authored
    Add myself as the maintainer of HiSilicon DMA engine driver.
    Signed-off-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
    Link: https://lore.kernel.org/r/1584062624-196854-1-git-send-email-wangzhou1@hisilicon.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    01c4df39
  • Christophe JAILLET's avatar
    dmaengine: ti: k3-udma-glue: Fix an error handling path in 'k3_udma_glue_cfg_rx_flow()' · 018af9be
    Christophe JAILLET authored
    All but one error handling paths in the 'k3_udma_glue_cfg_rx_flow()'
    function 'goto err' and call 'k3_udma_glue_release_rx_flow()'.
    
    This not correct because this function has a 'channel->flows_ready--;' at
    the end, but 'flows_ready' has not been incremented here, when we branch to
    the error handling path.
    
    In order to keep a correct value in 'flows_ready', un-roll
    'k3_udma_glue_release_rx_flow()', simplify it, add some labels and branch
    at the correct places when an error is detected.
    
    Doing so, we also NULLify 'flow->udma_rflow' in a path that was lacking it.
    
    Fixes: d7024191 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine user")
    Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
    Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Link: https://lore.kernel.org/r/20200318191209.1267-1-christophe.jaillet@wanadoo.frSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    018af9be
  • Linus Torvalds's avatar
    Merge tag 'dmaengine-fix-5.6' of git://git.infradead.org/users/vkoul/slave-dma · c6ac7188
    Linus Torvalds authored
    Pull dmaengine fixes from Vinod Koul:
     "Late fixes in dmaengine for v5.6:
    
       - move .device_release missing log warning to debug
    
       - couple of maintainer entries for HiSilicon and IADX drivers
    
       - off-by-one fix for idxd driver
    
       - documentation warning fixes
    
       - TI k3 dma error handling fix"
    
    * tag 'dmaengine-fix-5.6' of git://git.infradead.org/users/vkoul/slave-dma:
      dmaengine: ti: k3-udma-glue: Fix an error handling path in 'k3_udma_glue_cfg_rx_flow()'
      MAINTAINERS: Add maintainer for HiSilicon DMA engine driver
      dmaengine: idxd: fix off by one on cdev dwq refcount
      MAINTAINERS: rectify the INTEL IADX DRIVER entry
      dmaengine: move .device_release missing log warning to debug level
      docs: dmaengine: provider.rst: get rid of some warnings
    c6ac7188
  • Linus Torvalds's avatar
    Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3f3ee43a
    Linus Torvalds authored
    Pull x86 fix from Ingo Molnar:
     "A build fix with certain Kconfig combinations"
    
    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      x86/ioremap: Fix CONFIG_EFI=n build
    3f3ee43a
  • Linus Torvalds's avatar
    Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 76ccd234
    Linus Torvalds authored
    Pull perf tooling fixes from Ingo Molnar:
     "A handful of tooling fixes all across the map, no kernel changes"
    
    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      tools headers uapi: Update linux/in.h copy
      perf probe: Do not depend on dwfl_module_addrsym()
      perf probe: Fix to delete multiple probe event
      perf parse-events: Fix reading of invalid memory in event parsing
      perf python: Fix clang detection when using CC=clang-version
      perf map: Fix off by one in strncpy() size argument
      tools: Let O= makes handle a relative path with -C option
    76ccd234
......@@ -266,11 +266,15 @@ to use.
attached (via the dmaengine_desc_attach_metadata() helper to the descriptor.
From the DMA driver the following is expected for this mode:
- DMA_MEM_TO_DEV / DEV_MEM_TO_MEM
The data from the provided metadata buffer should be prepared for the DMA
controller to be sent alongside of the payload data. Either by copying to a
hardware descriptor, or highly coupled packet.
- DMA_DEV_TO_MEM
On transfer completion the DMA driver must copy the metadata to the client
provided metadata buffer before notifying the client about the completion.
After the transfer completion, DMA drivers must not touch the metadata
......@@ -284,10 +288,14 @@ to use.
and dmaengine_desc_set_metadata_len() is provided as helper functions.
From the DMA driver the following is expected for this mode:
- get_metadata_ptr
- get_metadata_ptr()
Should return a pointer for the metadata buffer, the maximum size of the
metadata buffer and the currently used / valid (if any) bytes in the buffer.
- set_metadata_len
- set_metadata_len()
It is called by the clients after it have placed the metadata to the buffer
to let the DMA driver know the number of valid bytes provided.
......
......@@ -7516,6 +7516,12 @@ F: include/uapi/linux/if_hippi.h
F: net/802/hippi.c
F: drivers/net/hippi/
HISILICON DMA DRIVER
M: Zhou Wang <wangzhou1@hisilicon.com>
L: dmaengine@vger.kernel.org
S: Maintained
F: drivers/dma/hisi_dma.c
HISILICON SECURITY ENGINE V2 DRIVER (SEC2)
M: Zaibo Xu <xuzaibo@huawei.com>
L: linux-crypto@vger.kernel.org
......@@ -8476,7 +8482,6 @@ L: dmaengine@vger.kernel.org
S: Supported
F: drivers/dma/idxd/*
F: include/uapi/linux/idxd.h
F: include/linux/idxd.h
INTEL IDLE DRIVER
M: Jacob Pan <jacob.jun.pan@linux.intel.com>
......
......@@ -115,6 +115,9 @@ static void __ioremap_check_other(resource_size_t addr, struct ioremap_desc *des
if (!sev_active())
return;
if (!IS_ENABLED(CONFIG_EFI))
return;
if (efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA)
desc->flags |= IORES_MAP_ENCRYPTED;
}
......
......@@ -1151,7 +1151,7 @@ int dma_async_device_register(struct dma_device *device)
}
if (!device->device_release)
dev_warn(device->dev,
dev_dbg(device->dev,
"WARN: Device release is not defined so it is not safe to unbind this driver while in use\n");
kref_init(&device->ref);
......
......@@ -81,9 +81,9 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
dev = &idxd->pdev->dev;
idxd_cdev = &wq->idxd_cdev;
dev_dbg(dev, "%s called\n", __func__);
dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
if (idxd_wq_refcount(wq) > 1 && wq_dedicated(wq))
if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq))
return -EBUSY;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
......
......@@ -564,12 +564,12 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
if (IS_ERR(flow->udma_rflow)) {
ret = PTR_ERR(flow->udma_rflow);
dev_err(dev, "UDMAX rflow get err %d\n", ret);
goto err;
return ret;
}
if (flow->udma_rflow_id != xudma_rflow_get_id(flow->udma_rflow)) {
xudma_rflow_put(rx_chn->common.udmax, flow->udma_rflow);
return -ENODEV;
ret = -ENODEV;
goto err_rflow_put;
}
/* request and cfg rings */
......@@ -578,7 +578,7 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
if (!flow->ringrx) {
ret = -ENODEV;
dev_err(dev, "Failed to get RX ring\n");
goto err;
goto err_rflow_put;
}
flow->ringrxfdq = k3_ringacc_request_ring(rx_chn->common.ringacc,
......@@ -586,19 +586,19 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
if (!flow->ringrxfdq) {
ret = -ENODEV;
dev_err(dev, "Failed to get RXFDQ ring\n");
goto err;
goto err_ringrx_free;
}
ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg);
if (ret) {
dev_err(dev, "Failed to cfg ringrx %d\n", ret);
goto err;
goto err_ringrxfdq_free;
}
ret = k3_ringacc_ring_cfg(flow->ringrxfdq, &flow_cfg->rxfdq_cfg);
if (ret) {
dev_err(dev, "Failed to cfg ringrxfdq %d\n", ret);
goto err;
goto err_ringrxfdq_free;
}
if (rx_chn->remote) {
......@@ -648,7 +648,7 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
if (ret) {
dev_err(dev, "flow%d config failed: %d\n", flow->udma_rflow_id,
ret);
goto err;
goto err_ringrxfdq_free;
}
rx_chn->flows_ready++;
......@@ -656,8 +656,17 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
flow->udma_rflow_id, rx_chn->flows_ready);
return 0;
err:
k3_udma_glue_release_rx_flow(rx_chn, flow_idx);
err_ringrxfdq_free:
k3_ringacc_ring_free(flow->ringrxfdq);
err_ringrx_free:
k3_ringacc_ring_free(flow->ringrx);
err_rflow_put:
xudma_rflow_put(rx_chn->common.udmax, flow->udma_rflow);
flow->udma_rflow = NULL;
return ret;
}
......
......@@ -74,6 +74,8 @@ enum {
#define IPPROTO_UDPLITE IPPROTO_UDPLITE
IPPROTO_MPLS = 137, /* MPLS in IP (RFC 4023) */
#define IPPROTO_MPLS IPPROTO_MPLS
IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation */
#define IPPROTO_ETHERNET IPPROTO_ETHERNET
IPPROTO_RAW = 255, /* Raw IP packets */
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MPTCP = 262, /* Multipath TCP connection */
......
......@@ -35,7 +35,7 @@ endif
# Only pass canonical directory names as the output directory:
#
ifneq ($(O),)
FULL_O := $(shell readlink -f $(O) || echo $(O))
FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O))
endif
#
......
......@@ -89,7 +89,7 @@ static inline bool replace_android_lib(const char *filename, char *newfilename)
return true;
}
if (!strncmp(filename, "/system/lib/", 11)) {
if (!strncmp(filename, "/system/lib/", 12)) {
char *ndk, *app;
const char *arch;
size_t ndk_length;
......
......@@ -1213,7 +1213,7 @@ static int config_attr(struct perf_event_attr *attr,
static int get_config_terms(struct list_head *head_config,
struct list_head *head_terms __maybe_unused)
{
#define ADD_CONFIG_TERM(__type) \
#define ADD_CONFIG_TERM(__type, __weak) \
struct perf_evsel_config_term *__t; \
\
__t = zalloc(sizeof(*__t)); \
......@@ -1222,18 +1222,18 @@ static int get_config_terms(struct list_head *head_config,
\
INIT_LIST_HEAD(&__t->list); \
__t->type = PERF_EVSEL__CONFIG_TERM_ ## __type; \
__t->weak = term->weak; \
__t->weak = __weak; \
list_add_tail(&__t->list, head_terms)
#define ADD_CONFIG_TERM_VAL(__type, __name, __val) \
#define ADD_CONFIG_TERM_VAL(__type, __name, __val, __weak) \
do { \
ADD_CONFIG_TERM(__type); \
ADD_CONFIG_TERM(__type, __weak); \
__t->val.__name = __val; \
} while (0)
#define ADD_CONFIG_TERM_STR(__type, __val) \
#define ADD_CONFIG_TERM_STR(__type, __val, __weak) \
do { \
ADD_CONFIG_TERM(__type); \
ADD_CONFIG_TERM(__type, __weak); \
__t->val.str = strdup(__val); \
if (!__t->val.str) { \
zfree(&__t); \
......@@ -1247,62 +1247,62 @@ do { \
list_for_each_entry(term, head_config, list) {
switch (term->type_term) {
case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD:
ADD_CONFIG_TERM_VAL(PERIOD, period, term->val.num);
ADD_CONFIG_TERM_VAL(PERIOD, period, term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ:
ADD_CONFIG_TERM_VAL(FREQ, freq, term->val.num);
ADD_CONFIG_TERM_VAL(FREQ, freq, term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_TIME:
ADD_CONFIG_TERM_VAL(TIME, time, term->val.num);
ADD_CONFIG_TERM_VAL(TIME, time, term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
ADD_CONFIG_TERM_STR(CALLGRAPH, term->val.str);
ADD_CONFIG_TERM_STR(CALLGRAPH, term->val.str, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE:
ADD_CONFIG_TERM_STR(BRANCH, term->val.str);
ADD_CONFIG_TERM_STR(BRANCH, term->val.str, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
ADD_CONFIG_TERM_VAL(STACK_USER, stack_user,
term->val.num);
term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_INHERIT:
ADD_CONFIG_TERM_VAL(INHERIT, inherit,
term->val.num ? 1 : 0);
term->val.num ? 1 : 0, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_NOINHERIT:
ADD_CONFIG_TERM_VAL(INHERIT, inherit,
term->val.num ? 0 : 1);
term->val.num ? 0 : 1, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_MAX_STACK:
ADD_CONFIG_TERM_VAL(MAX_STACK, max_stack,
term->val.num);
term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_MAX_EVENTS:
ADD_CONFIG_TERM_VAL(MAX_EVENTS, max_events,
term->val.num);
term->val.num, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_OVERWRITE:
ADD_CONFIG_TERM_VAL(OVERWRITE, overwrite,
term->val.num ? 1 : 0);
term->val.num ? 1 : 0, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE:
ADD_CONFIG_TERM_VAL(OVERWRITE, overwrite,
term->val.num ? 0 : 1);
term->val.num ? 0 : 1, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_DRV_CFG:
ADD_CONFIG_TERM_STR(DRV_CFG, term->val.str);
ADD_CONFIG_TERM_STR(DRV_CFG, term->val.str, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_PERCORE:
ADD_CONFIG_TERM_VAL(PERCORE, percore,
term->val.num ? true : false);
term->val.num ? true : false, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT:
ADD_CONFIG_TERM_VAL(AUX_OUTPUT, aux_output,
term->val.num ? 1 : 0);
term->val.num ? 1 : 0, term->weak);
break;
case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE:
ADD_CONFIG_TERM_VAL(AUX_SAMPLE_SIZE, aux_sample_size,
term->val.num);
term->val.num, term->weak);
break;
default:
break;
......@@ -1339,7 +1339,7 @@ static int get_config_chgs(struct perf_pmu *pmu, struct list_head *head_config,
}
if (bits)
ADD_CONFIG_TERM_VAL(CFG_CHG, cfg_chg, bits);
ADD_CONFIG_TERM_VAL(CFG_CHG, cfg_chg, bits, false);
#undef ADD_CONFIG_TERM
return 0;
......
......@@ -206,6 +206,9 @@ static struct strlist *__probe_file__get_namelist(int fd, bool include_group)
} else
ret = strlist__add(sl, tev.event);
clear_probe_trace_event(&tev);
/* Skip if there is same name multi-probe event in the list */
if (ret == -EEXIST)
ret = 0;
if (ret < 0)
break;
}
......
......@@ -637,14 +637,19 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod,
return -EINVAL;
}
/* Try to get actual symbol name from symtab */
symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
if (dwarf_entrypc(sp_die, &eaddr) == 0) {
/* If the DIE has entrypc, use it. */
symbol = dwarf_diename(sp_die);
} else {
/* Try to get actual symbol name and address from symtab */
symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
eaddr = sym.st_value;
}
if (!symbol) {
pr_warning("Failed to find symbol at 0x%lx\n",
(unsigned long)paddr);
return -ENOENT;
}
eaddr = sym.st_value;
tp->offset = (unsigned long)(paddr - eaddr);
tp->address = (unsigned long)paddr;
......
......@@ -2,11 +2,13 @@ from os import getenv
from subprocess import Popen, PIPE
from re import sub
cc = getenv("CC")
cc_is_clang = b"clang version" in Popen([cc, "-v"], stderr=PIPE).stderr.readline()
def clang_has_option(option):
return [o for o in Popen(['clang', option], stderr=PIPE).stderr.readlines() if b"unknown argument" in o] == [ ]
return [o for o in Popen([cc, option], stderr=PIPE).stderr.readlines() if b"unknown argument" in o] == [ ]
cc = getenv("CC")
if cc == "clang":
if cc_is_clang:
from distutils.sysconfig import get_config_vars
vars = get_config_vars()
for var in ('CFLAGS', 'OPT'):
......@@ -40,7 +42,7 @@ class install_lib(_install_lib):
cflags = getenv('CFLAGS', '').split()
# switch off several checks (need to be at the end of cflags list)
cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
if cc != "clang":
if not cc_is_clang:
cflags += ['-Wno-cast-function-type' ]
src_perf = getenv('srctree') + '/tools/perf'
......
# SPDX-License-Identifier: GPL-2.0
ifneq ($(O),)
ifeq ($(origin O), command line)
dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
ABSOLUTE_O := $(shell cd $(O) ; pwd)
dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
......