1. 30 Jan, 2024 4 commits
    • Arnaldo Carvalho de Melo's avatar
      tools include UAPI: Sync linux/mount.h copy with the kernel sources · 1f8c43b0
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        35e27a57 ("fs: keep struct mnt_id_req extensible")
        b4c2bea8 ("add listmount(2) syscall")
        46eae99e ("add statmount(2) syscall")
      
      That doesn't change anything in tools this time as nothing that is
      harvested by the beauty scripts got changed:
      
        $ ls -1 tools/perf/trace/beauty/*mount*sh
        tools/perf/trace/beauty/fsmount.sh
        tools/perf/trace/beauty/mount_flags.sh
        tools/perf/trace/beauty/move_mount_flags.sh
        $
      
      This addresses this perf build warning.
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/linux/mount.h include/uapi/linux/mount.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Miklos Szeredi <mszeredi@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/ZbkMiB7ZcOsLP2V5@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1f8c43b0
    • James Clark's avatar
      perf evlist: Fix evlist__new_default() for > 1 core PMU · 7814fe24
      James Clark authored
      The 'Session topology' test currently fails with this message when
      evlist__new_default() opens more than one event:
      
        32: Session topology                                                :
        --- start ---
        templ file: /tmp/perf-test-vv5YzZ
        Using CPUID 0x00000000410fd070
        Opening: unknown-hardware:HG
        ------------------------------------------------------------
        perf_event_attr:
          type                             0 (PERF_TYPE_HARDWARE)
          config                           0xb00000000
          disabled                         1
        ------------------------------------------------------------
        sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 4
        Opening: unknown-hardware:HG
        ------------------------------------------------------------
        perf_event_attr:
          type                             0 (PERF_TYPE_HARDWARE)
          config                           0xa00000000
          disabled                         1
        ------------------------------------------------------------
        sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 5
        non matching sample_type
        FAILED tests/topology.c:73 can't get session
        ---- end ----
        Session topology: FAILED!
      
      This is because when re-opening the file and parsing the header, Perf
      expects that any file that has more than one event has the sample ID
      flag set. Perf record already sets the flag in a similar way when there
      is more than one event, so add the same logic to evlist__new_default().
      
      evlist__new_default() is only currently used in tests, so I don't
      expect this change to have any other side effects. The other tests that
      use it don't save and re-open the file so don't hit this issue.
      
      The session topology test has been failing on Arm big.LITTLE platforms
      since commit 251aa040 ("perf parse-events: Wildcard most
      "numeric" events") when evlist__new_default() started opening multiple
      events for 'cycles'.
      
      Fixes: 251aa040 ("perf parse-events: Wildcard most "numeric" events")
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      [ This was failing as well on a Rocket Lake Refresh/14700k Intel hybrid system - Arnaldo ]
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Closes: https://lore.kernel.org/lkml/CAP-5=fWVQ-7ijjK3-w1q+k2WYVNHbAcejb-xY0ptbjRw476VKA@mail.gmail.com/
      Link: https://lore.kernel.org/r/20240124094358.489372-1-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7814fe24
    • Arnaldo Carvalho de Melo's avatar
      tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' · efe80f9c
      Arnaldo Carvalho de Melo authored
      This is to get the changes from:
      
        94ea9c05 ("x86/headers: Replace #include <asm/export.h> with #include <linux/export.h>")
        10f4c9b9 ("x86/asm: Fix build of UML with KASAN")
      
      That addresses these perf tools build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
          diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>
      Link: https://lore.kernel.org/lkml/ZbkIKpKdNqOFdMwJ@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      efe80f9c
    • Arnaldo Carvalho de Melo's avatar
      tools headers x86 cpufeatures: Sync with the kernel sources to pick TDX, Zen,... · 15d6daad
      Arnaldo Carvalho de Melo authored
      tools headers x86 cpufeatures: Sync with the kernel sources to pick TDX, Zen, APIC MSR fence changes
      
      To pick the changes from:
      
        1e536e10 ("x86/cpu: Detect TDX partial write machine check erratum")
        765a0542 ("x86/virt/tdx: Detect TDX during kernel boot")
        30fa9283 ("x86/CPU/AMD: Add ZenX generations flags")
        04c30245 ("x86/barrier: Do not serialize MSR accesses on AMD")
      
      This causes these perf files to be rebuilt and brings some X86_FEATURE
      that will be used when updating the copies of
      tools/arch/x86/lib/mem{cpy,set}_64.S with the kernel sources:
      
            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 differences:
          diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kai Huang <kai.huang@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      15d6daad
  2. 29 Jan, 2024 1 commit
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync unistd.h to pick {list,stat}mount,... · 21fdd8dd
      Arnaldo Carvalho de Melo authored
      tools headers UAPI: Sync unistd.h to pick {list,stat}mount, lsm_{[gs]et_self_attr,list_modules} syscall numbers
      
      To pick the changes in these csets:
      
        d8b0f546 ("wire up syscalls for statmount/listmount")
        5f423759 ("LSM: wireup Linux Security Module syscalls")
      
      Used in some architectures to create syscall tables.
      
      This addresses this perf build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
      
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Miklos Szeredi <mszeredi@redhat.com>
      Cc: Paul Moore <paul@paul-moore.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/ZbfMuAlUMRO9Hqa6@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      21fdd8dd
  3. 27 Jan, 2024 2 commits
    • Ian Rogers's avatar
      perf vendor events intel: Alderlake/sapphirerapids metric fixes · becc24e9
      Ian Rogers authored
      As events are deduplicated by name, ensure PMU prefixes are always
      used in metrics. Previously they may be missed on the first event in a
      formula.
      
      Update metric constraints for architectures with topdown l2 events.
      
      Conversion script updated in:
      https://github.com/intel/perfmon/pull/128Reported-by: default avatarArnaldo Carvalho de Melo <acme@kernel.org>
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Edward Baker <edward.baker@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Closes: https://lore.kernel.org/lkml/ZZam-EG-UepcXtWw@kernel.org/
      Link: https://lore.kernel.org/r/20240104231903.775717-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      becc24e9
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync kvm headers with the kernel sources · e30dca91
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        a5d3df8a ("KVM: remove deprecated UAPIs")
        6d722835 ("KVM x86/xen: add an override for PVCLOCK_TSC_STABLE_BIT")
        89ea60c2 ("KVM: x86: Add support for "protected VMs" that can utilize private memory")
        8dd2eee9 ("KVM: x86/mmu: Handle page fault for private memory")
        a7800aa8 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
        5a475554 ("KVM: Introduce per-page memory attributes")
        16f95f3b ("KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace")
        bb58b90b ("KVM: Introduce KVM_SET_USER_MEMORY_REGION2")
        3f9cd0ca ("KVM: arm64: Allow userspace to get the writable masks for feature ID registers")
      
      That automatically adds support for some new ioctls and remove a bunch
      of deprecated ones.
      
      This ends up making the new binary to forget about the deprecated one,
      so when used in an older system it will not be able to resolve those
      codes to strings.
      
        $ 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	2024-01-27 14:48:16.523014020 -0300
        +++ after	2024-01-27 14:48:24.183932866 -0300
        @@ -14,6 +14,7 @@
         	[0x46] = "SET_USER_MEMORY_REGION",
         	[0x47] = "SET_TSS_ADDR",
         	[0x48] = "SET_IDENTITY_MAP_ADDR",
        +	[0x49] = "SET_USER_MEMORY_REGION2",
         	[0x60] = "CREATE_IRQCHIP",
         	[0x61] = "IRQ_LINE",
         	[0x62] = "GET_IRQCHIP",
        @@ -22,14 +23,8 @@
         	[0x65] = "GET_PIT",
         	[0x66] = "SET_PIT",
         	[0x67] = "IRQ_LINE_STATUS",
        -	[0x69] = "ASSIGN_PCI_DEVICE",
         	[0x6a] = "SET_GSI_ROUTING",
        -	[0x70] = "ASSIGN_DEV_IRQ",
         	[0x71] = "REINJECT_CONTROL",
        -	[0x72] = "DEASSIGN_PCI_DEVICE",
        -	[0x73] = "ASSIGN_SET_MSIX_NR",
        -	[0x74] = "ASSIGN_SET_MSIX_ENTRY",
        -	[0x75] = "DEASSIGN_DEV_IRQ",
         	[0x76] = "IRQFD",
         	[0x77] = "CREATE_PIT2",
         	[0x78] = "SET_BOOT_CPU_ID",
        @@ -66,7 +61,6 @@
         	[0x9f] = "GET_VCPU_EVENTS",
         	[0xa0] = "SET_VCPU_EVENTS",
         	[0xa3] = "ENABLE_CAP",
        -	[0xa4] = "ASSIGN_SET_INTX_MASK",
         	[0xa5] = "SIGNAL_MSI",
         	[0xa6] = "GET_XCRS",
         	[0xa7] = "SET_XCRS",
        @@ -97,6 +91,8 @@
         	[0xcd] = "SET_SREGS2",
         	[0xce] = "GET_STATS_FD",
         	[0xd0] = "XEN_HVM_EVTCHN_SEND",
        +	[0xd2] = "SET_MEMORY_ATTRIBUTES",
        +	[0xd4] = "CREATE_GUEST_MEMFD",
         	[0xe0] = "CREATE_DEVICE",
         	[0xe1] = "SET_DEVICE_ATTR",
         	[0xe2] = "GET_DEVICE_ATTR",
        $
      
      This silences these perf build warnings:
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
          diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Chao Peng <chao.p.peng@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jing Zhang <jingzhangos@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oliver Upton <oliver.upton@linux.dev>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Paul Durrant <pdurrant@amazon.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/lkml/ZbVLbkngp4oq13qN@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e30dca91
  4. 26 Jan, 2024 13 commits
    • Sun Haiyong's avatar
      perf tools: Fix calloc() arguments to address error introduced in gcc-14 · 7bbe8f00
      Sun Haiyong authored
      the definition of calloc is as follows:
      
          void *calloc(size_t nmemb, size_t size);
      
      number of members is in the first parameter and the size is in the
      second parameter.
      
      Fix error messages on gcc 14 20240102:
      
        error: 'calloc' sizes specified with 'sizeof' in the earlier argument and
        not in the later argument [-Werror=calloc-transposed-args]
      
      Committer notes:
      
      I noticed this on fedora 40 and rawhide.
      Signed-off-by: default avatarSun Haiyong <sunhaiyong@loongson.cn>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20240106094129.3337057-1-siyanteng@loongson.cnSigned-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7bbe8f00
    • Sun Haiyong's avatar
      perf top: Remove needless malloc(0) call that triggers -Walloc-size · 79baac8a
      Sun Haiyong authored
      GCC 14 introduces a new -Walloc-size included in -Wextra which errors out
      like:
      
        builtin-top.c: In function ‘prompt_integer’:
        builtin-top.c:360:21: error: allocation of insufficient size ‘0’ for
        type ‘char’ with size ‘1’ [-Werror=alloc-size]
          360 |         char *buf = malloc(0), *p;
              |                     ^~~~~~
      
      Just set it to NULL, getline() will do the allocation.
      Signed-off-by: default avatarSun Haiyong <sunhaiyong@loongson.cn>
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20231204082055.91877-1-siyanteng@loongson.cnSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      79baac8a
    • Yicong Yang's avatar
      perf build: Make minimal shellcheck version to v0.6.0 · 39af6741
      Yicong Yang authored
      The perf build failed due to the shellcheck on my machine (v0.4.6 on Ubuntu
      18.04.1 LTS) doesn't support -a/--check-sourced and -S/--severity option.
      
      These two options are introduced in shellcheck v0.4.7 and v0.6.0
      respectively. So restrict the minimal version of shellcheck to v0.6.0.
      
      Fixes: b809fc65 ("perf build: Shellcheck support for OUTPUT directory")
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarYicong Yang <yangyicong@hisilicon.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Junhao He <hejunhao3@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linuxarm@huawei.com
      Link: https://lore.kernel.org/r/20240122080406.28678-1-yangyicong@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      39af6741
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Update tools's copy of drm.h headers to pick DRM_IOCTL_MODE_CLOSEFB · 1233d1d5
      Arnaldo Carvalho de Melo authored
      Picking the changes from:
      
        8570c279 ("drm/syncobj: Add deadline support for syncobj waits")
        9724ed6c ("drm: Introduce DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT")
        e4d983ac ("drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP")
        d208d875 ("drm: introduce CLOSEFB IOCTL")
        afa5cf31 ("drm/i915/uapi: fix typos/spellos and punctuation")
      
      Addressing these perf build warnings:
      
        Warning: Kernel ABI header differences:
      
      Now 'perf trace' and other code that might use the
      tools/perf/trace/beauty autogenerated tables will be able to translate
      this new ioctl command into a string:
      
        $ tools/perf/trace/beauty/drm_ioctl.sh > before
        $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h
        $ tools/perf/trace/beauty/drm_ioctl.sh > after
        $ diff -u before after
        --- before	2024-01-26 10:54:23.486381862 -0300
        +++ after	2024-01-26 10:54:35.767902442 -0300
        @@ -109,6 +109,7 @@
         	[0xCD] = "SYNCOBJ_TIMELINE_SIGNAL",
         	[0xCE] = "MODE_GETFB2",
         	[0xCF] = "SYNCOBJ_EVENTFD",
        +	[0xD0] = "MODE_CLOSEFB",
         	[DRM_COMMAND_BASE + 0x00] = "I915_INIT",
         	[DRM_COMMAND_BASE + 0x01] = "I915_FLUSH",
         	[DRM_COMMAND_BASE + 0x02] = "I915_FLIP",
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Javier Martinez Canillas <javierm@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Rob Clark <robdclark@chromium.org>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Zack Rusin <zack.rusin@broadcom.com>
      Link: https://lore.kernel.org/lkml/ZbPIN9Dcc5AM0uxo@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1233d1d5
    • Ian Rogers's avatar
      perf test shell daemon: Make signal test less racy · 9a8dd2f2
      Ian Rogers authored
      The daemon signal test sends signals and then expects files to be
      written. It was observed on an Intel Alderlake that the signals were
      sent too quickly leading to the 3 expected files not appearing.
      
      To avoid this send the next signal only after the expected previous file
      has appeared. To avoid an infinite loop the number of retries is
      limited.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ross Zwisler <zwisler@chromium.org>
      Cc: Shirisha G <shirisha@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240124043015.1388867-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9a8dd2f2
    • Ian Rogers's avatar
      perf test shell script: Fix test for python being disabled · 1c2124ec
      Ian Rogers authored
      "grep -cv" can exit with an error code that causes the "set -e" to abort
      the script. Switch to using the grep exit code in the if condition to
      avoid this.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ross Zwisler <zwisler@chromium.org>
      Cc: Shirisha G <shirisha@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240124043015.1388867-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1c2124ec
    • Ian Rogers's avatar
      perf test: Workaround debug output in list test · a734c7f9
      Ian Rogers authored
      Write the JSON output to a specific file to avoid debug output
      breaking it.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ross Zwisler <zwisler@chromium.org>
      Cc: Shirisha G <shirisha@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240124043015.1388867-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a734c7f9
    • Ian Rogers's avatar
      perf list: Add output file option · 79bacb6a
      Ian Rogers authored
      Add an option to write the 'perf list' output to a specific file. This
      can avoid issues with debug output being written into the output stream.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ross Zwisler <zwisler@chromium.org>
      Cc: Shirisha G <shirisha@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240124043015.1388867-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      79bacb6a
    • Ian Rogers's avatar
      perf list: Switch error message to pr_err() to respect debug settings (-v) · 9d95c6be
      Ian Rogers authored
      Using printf() can interrupt 'perf list output', use pr_err() which can
      respect debug settings and the debug file.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ross Zwisler <zwisler@chromium.org>
      Cc: Shirisha G <shirisha@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240124043015.1388867-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9d95c6be
    • Thomas Richter's avatar
      perf test: Fix 'perf script' tests on s390 · 2dac1f08
      Thomas Richter authored
      In linux next repo, test case 'perf script tests' fails on s390.
      
      The root case is a command line invocation of 'perf record' with
      call-graph information. On s390 only DWARF formatted call-graphs are
      supported and only on software events.
      
      Change the command line parameters for s390.
      
      Output before:
      
        # perf test 89
        89: perf script tests              : FAILED!
        #
      
      Output after:
      
        # perf test 89
        89: perf script tests              : Ok
        #
      
      Fixes: 0dd5041c ("perf addr_location: Add init/exit/copy functions")
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: https://lore.kernel.org/r/20240125100351.936262-1-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2dac1f08
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/fcntl.h with the kernel sources · b0dc9921
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        8a924db2 ("fs: Pass AT_GETATTR_NOSEC flag to getattr interface function")
      
      That don't add anything that is handled by existing hard coded tables or
      table generation scripts.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stefan Berger <stefanb@linux.ibm.com>
      Link: https://lore.kernel.org/lkml/ZbJv9fGF_k2xXEdr@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b0dc9921
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync the msr-index.h copy with the kernel sources to pick... · 17437266
      Arnaldo Carvalho de Melo authored
      tools arch x86: Sync the msr-index.h copy with the kernel sources to pick IA32_MKTME_KEYID_PARTITIONING
      
      To pick up the changes in:
      
        765a0542 ("x86/virt/tdx: Detect TDX during kernel boot")
      
      Addressing this tools/perf build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
      
      That makes the beautification scripts to pick some new entries:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2024-01-25 11:08:12.363223880 -0300
        +++ after	2024-01-25 11:08:24.839307699 -0300
        @@ -21,6 +21,7 @@
         	[0x0000004f] = "PPIN",
         	[0x00000060] = "LBR_CORE_TO",
         	[0x00000079] = "IA32_UCODE_WRITE",
        +	[0x00000087] = "IA32_MKTME_KEYID_PARTITIONING",
         	[0x0000008b] = "AMD64_PATCH_LEVEL",
         	[0x0000008C] = "IA32_SGXLEPUBKEYHASH0",
         	[0x0000008D] = "IA32_SGXLEPUBKEYHASH1",
        $
      
      Now one can trace systemwide asking to see backtraces to where that MSR
      is being read/written, see this example with a previous update:
      
        # perf trace -e msr:*_msr/max-stack=32/ --filter="msr==IA32_MKTME_KEYID_PARTITIONING"
        ^C#
      
      If we use -v (verbose mode) we can see what it does behind the scenes:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_MKTME_KEYID_PARTITIONING"
        Using CPUID GenuineIntel-6-8E-A
        0x87
        New filter for msr:read_msr: (msr==0x87) && (common_pid != 58627 && common_pid != 3792)
        0x87
        New filter for msr:write_msr: (msr==0x87) && (common_pid != 58627 && common_pid != 3792)
        mmap size 528384B
        ^C#
      
      Example with a frequent msr:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2
        Using CPUID AuthenticAMD-25-21-0
        0x48
        New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841)
        0x48
        New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841)
        mmap size 528384B
        Looking at the vmlinux_path (8 entries long)
        symsrc__init: build id mismatch for vmlinux.
        Using /proc/kcore for kernel data
        Using /proc/kallsyms for symbols
         0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6)
        				   do_trace_write_msr ([kernel.kallsyms])
        				   do_trace_write_msr ([kernel.kallsyms])
        				   __switch_to_xtra ([kernel.kallsyms])
        				   __switch_to ([kernel.kallsyms])
        				   __schedule ([kernel.kallsyms])
        				   schedule ([kernel.kallsyms])
        				   futex_wait_queue_me ([kernel.kallsyms])
        				   futex_wait ([kernel.kallsyms])
        				   do_futex ([kernel.kallsyms])
        				   __x64_sys_futex ([kernel.kallsyms])
        				   do_syscall_64 ([kernel.kallsyms])
        				   entry_SYSCALL_64_after_hwframe ([kernel.kallsyms])
        				   __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so)
         0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2)
        				   do_trace_write_msr ([kernel.kallsyms])
        				   do_trace_write_msr ([kernel.kallsyms])
        				   __switch_to_xtra ([kernel.kallsyms])
        				   __switch_to ([kernel.kallsyms])
        				   __schedule ([kernel.kallsyms])
        				   schedule_idle ([kernel.kallsyms])
        				   do_idle ([kernel.kallsyms])
        				   cpu_startup_entry ([kernel.kallsyms])
        				   secondary_startup_64_no_verify ([kernel.kallsyms])
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kai Huang <kai.huang@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/ZbJt27rjkQVU1YoP@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      17437266
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Sync linux/stat.h with the kernel sources to pick STATX_MNT_ID_UNIQUE · 690811f0
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        98d2b430 ("add unique mount ID")
      
      That add STATX_MNT_ID_UNIQUE that was manually added to
      tools/perf/trace/beauty/statx.c, at some point this should move to the
      shell based automated way.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Miklos Szeredi <mszeredi@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/ZbJq08s19890WDo-@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      690811f0
  5. 25 Jan, 2024 20 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · ecb1b828
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf, netfilter and WiFi.
      
        Jakub is doing a lot of work to include the self-tests in our CI, as a
        result a significant amount of self-tests related fixes is flowing in
        (and will likely continue in the next few weeks).
      
        Current release - regressions:
      
         - bpf: fix a kernel crash for the riscv 64 JIT
      
         - bnxt_en: fix memory leak in bnxt_hwrm_get_rings()
      
         - revert "net: macsec: use skb_ensure_writable_head_tail to expand
           the skb"
      
        Previous releases - regressions:
      
         - core: fix removing a namespace with conflicting altnames
      
         - tc/flower: fix chain template offload memory leak
      
         - tcp:
            - make sure init the accept_queue's spinlocks once
            - fix autocork on CPUs with weak memory model
      
         - udp: fix busy polling
      
         - mlx5e:
            - fix out-of-bound read in port timestamping
            - fix peer flow lists corruption
      
         - iwlwifi: fix a memory corruption
      
        Previous releases - always broken:
      
         - netfilter:
            - nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress
              basechain
            - nft_limit: reject configurations that cause integer overflow
      
         - bpf: fix bpf_xdp_adjust_tail() with XSK zero-copy mbuf, avoiding a
           NULL pointer dereference upon shrinking
      
         - llc: make llc_ui_sendmsg() more robust against bonding changes
      
         - smc: fix illegal rmb_desc access in SMC-D connection dump
      
         - dpll: fix pin dump crash for rebound module
      
         - bnxt_en: fix possible crash after creating sw mqprio TCs
      
         - hv_netvsc: calculate correct ring size when PAGE_SIZE is not 4kB
      
        Misc:
      
         - several self-tests fixes for better integration with the netdev CI
      
         - added several missing modules descriptions"
      
      * tag 'net-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (88 commits)
        tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring
        tsnep: Remove FCS for XDP data path
        net: fec: fix the unhandled context fault from smmu
        selftests: bonding: do not test arp/ns target with mode balance-alb/tlb
        fjes: fix memleaks in fjes_hw_setup
        i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue
        i40e: set xdp_rxq_info::frag_size
        xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
        ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue
        intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers
        ice: remove redundant xdp_rxq_info registration
        i40e: handle multi-buffer packets that are shrunk by xdp prog
        ice: work on pre-XDP prog frag count
        xsk: fix usage of multi-buffer BPF helpers for ZC XDP
        xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags
        xsk: recycle buffer in case Rx queue was full
        net: fill in MODULE_DESCRIPTION()s for rvu_mbox
        net: fill in MODULE_DESCRIPTION()s for litex
        net: fill in MODULE_DESCRIPTION()s for fsl_pq_mdio
        net: fill in MODULE_DESCRIPTION()s for fec
        ...
      ecb1b828
    • Linus Torvalds's avatar
      Merge tag 'ovl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs · bdc01020
      Linus Torvalds authored
      Pull overlayfs fix from Amir Goldstein:
       "Change the on-disk format for the new "xwhiteouts" feature introduced
        in v6.7
      
        The change reduces unneeded overhead of an extra getxattr per readdir.
        The only user of the "xwhiteout" feature is the external composefs
        tool, which has been updated to support the new on-disk format.
      
        This change is also designated for 6.7.y"
      
      * tag 'ovl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
        ovl: mark xwhiteouts directory with overlay.opaque='x'
      bdc01020
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.8-rc2.netfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · a658e0e9
      Linus Torvalds authored
      Pull netfs fixes from Christian Brauner:
       "This contains various fixes for the netfs work merged earlier this
        cycle:
      
        afs:
         - Fix locking imbalance in afs_proc_addr_prefs_show()
         - Remove afs_dynroot_d_revalidate() which is redundant
         - Fix error handling during lookup
         - Hide sillyrenames from userspace. This fixes a race between
           silly-rename files being created/removed and userspace iterating
           over directory entries
         - Don't use unnecessary folio_*() functions
      
        cifs:
         - Don't use unnecessary folio_*() functions
      
        cachefiles:
         - erofs: Fix Null dereference when cachefiles are not doing
           ondemand-mode
         - Update mailing list
      
        netfs library:
         - Add Jeff Layton as reviewer
         - Update mailing list
         - Fix a error checking in netfs_perform_write()
         - fscache: Check error before dereferencing
         - Don't use unnecessary folio_*() functions"
      
      * tag 'vfs-6.8-rc2.netfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        afs: Fix missing/incorrect unlocking of RCU read lock
        afs: Remove afs_dynroot_d_revalidate() as it is redundant
        afs: Fix error handling with lookup via FS.InlineBulkStatus
        afs: Hide silly-rename files from userspace
        cachefiles, erofs: Fix NULL deref in when cachefiles is not doing ondemand-mode
        netfs: Fix a NULL vs IS_ERR() check in netfs_perform_write()
        netfs, fscache: Prevent Oops in fscache_put_cache()
        cifs: Don't use certain unnecessary folio_*() functions
        afs: Don't use certain unnecessary folio_*() functions
        netfs: Don't use certain unnecessary folio_*() functions
        netfs: Add Jeff Layton as reviewer
        netfs, cachefiles: Change mailing list
      a658e0e9
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · b9fa4cbd
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
      
       - Fix in-kernel RPC UDP transport
      
       - Fix NFSv4.0 RELEASE_LOCKOWNER
      
      * tag 'nfsd-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        nfsd: fix RELEASE_LOCKOWNER
        SUNRPC: use request size to initialize bio_vec in svc_udp_sendto()
      b9fa4cbd
    • Linus Torvalds's avatar
      Merge tag 'urgent-rcu.2024.01.24a' of https://github.com/neeraju/linux · 3cb9871f
      Linus Torvalds authored
      Pull RCU fix from Neeraj Upadhyay:
       "This fixes RCU grace period stalls, which are observed when an
        outgoing CPU's quiescent state reporting results in wakeup of one of
        the grace period kthreads, to complete the grace period.
      
        If those kthreads have SCHED_FIFO policy, the wake up can indirectly
        arm the RT bandwith timer to the local offline CPU.
      
        Earlier migration of the hrtimers from the CPU introduced in commit
        5c0930cc ("hrtimers: Push pending hrtimers away from outgoing CPU
        earlier") results in this timer getting ignored.
      
        If the RCU grace period kthreads are waiting for RT bandwidth to be
        available, they may never be actually scheduled, resulting in RCU
        stall warnings"
      
      * tag 'urgent-rcu.2024.01.24a' of https://github.com/neeraju/linux:
        rcu: Defer RCU kthreads wakeup when CPU is dying
      3cb9871f
    • Paolo Abeni's avatar
      Merge branch 'tsnep-xdp-fixes' · 0a5bd0ff
      Paolo Abeni authored
      Gerhard Engleder says:
      
      ====================
      tsnep: XDP fixes
      
      Found two driver specific problems during XDP and XSK testing.
      ====================
      
      Link: https://lore.kernel.org/r/20240123200918.61219-1-gerhard@engleder-embedded.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0a5bd0ff
    • Gerhard Engleder's avatar
      tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring · 9a91c05f
      Gerhard Engleder authored
      The fill ring of the XDP socket may contain not enough buffers to
      completey fill the RX queue during socket creation. In this case the
      flag XDP_RING_NEED_WAKEUP is not set as this flag is only set if the RX
      queue is not completely filled during polling.
      
      Set XDP_RING_NEED_WAKEUP flag also if RX queue is not completely filled
      during XDP socket creation.
      
      Fixes: 3fc23339 ("tsnep: Add XDP socket zero-copy RX support")
      Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      9a91c05f
    • Gerhard Engleder's avatar
      tsnep: Remove FCS for XDP data path · 50bad6f7
      Gerhard Engleder authored
      The RX data buffer includes the FCS. The FCS is already stripped for the
      normal data path. But for the XDP data path the FCS is included and
      acts like additional/useless data.
      
      Remove the FCS from the RX data buffer also for XDP.
      
      Fixes: 65b28c81 ("tsnep: Add XDP RX support")
      Fixes: 3fc23339 ("tsnep: Add XDP socket zero-copy RX support")
      Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      50bad6f7
    • Paolo Abeni's avatar
      Merge tag 'mlx5-fixes-2024-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 5da45971
      Paolo Abeni authored
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2024-01-24
      
      This series provides bug fixes to mlx5 driver.
      Please pull and let me know if there is any problem.
      
      * tag 'mlx5-fixes-2024-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5e: fix a potential double-free in fs_any_create_groups
        net/mlx5e: fix a double-free in arfs_create_groups
        net/mlx5e: Ignore IPsec replay window values on sender side
        net/mlx5e: Allow software parsing when IPsec crypto is enabled
        net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO
        net/mlx5: DR, Can't go to uplink vport on RX rule
        net/mlx5: DR, Use the right GVMI number for drop action
        net/mlx5: Bridge, fix multicast packets sent to uplink
        net/mlx5: Fix a WARN upon a callback command failure
        net/mlx5e: Fix peer flow lists handling
        net/mlx5e: Fix inconsistent hairpin RQT sizes
        net/mlx5e: Fix operation precedence bug in port timestamping napi_poll context
        net/mlx5: Fix query of sd_group field
        net/mlx5e: Use the correct lag ports number when creating TISes
      ====================
      
      Link: https://lore.kernel.org/r/20240124081855.115410-1-saeed@kernel.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      5da45971
    • Paolo Abeni's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · fdf8e6d1
      Paolo Abeni authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2024-01-25
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 12 non-merge commits during the last 2 day(s) which contain
      a total of 13 files changed, 190 insertions(+), 91 deletions(-).
      
      The main changes are:
      
      1) Fix bpf_xdp_adjust_tail() in context of XSK zero-copy drivers which
         support XDP multi-buffer. The former triggered a NULL pointer
         dereference upon shrinking, from Maciej Fijalkowski & Tirthendu Sarkar.
      
      2) Fix a bug in riscv64 BPF JIT which emitted a wrong prologue and
         epilogue for struct_ops programs, from Pu Lehui.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue
        i40e: set xdp_rxq_info::frag_size
        xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
        ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue
        intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers
        ice: remove redundant xdp_rxq_info registration
        i40e: handle multi-buffer packets that are shrunk by xdp prog
        ice: work on pre-XDP prog frag count
        xsk: fix usage of multi-buffer BPF helpers for ZC XDP
        xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags
        xsk: recycle buffer in case Rx queue was full
        riscv, bpf: Fix unpredictable kernel crash about RV64 struct_ops
      ====================
      
      Link: https://lore.kernel.org/r/20240125084416.10876-1-daniel@iogearbox.netSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      fdf8e6d1
    • Shenwei Wang's avatar
      net: fec: fix the unhandled context fault from smmu · 5e344807
      Shenwei Wang authored
      When repeatedly changing the interface link speed using the command below:
      
      ethtool -s eth0 speed 100 duplex full
      ethtool -s eth0 speed 1000 duplex full
      
      The following errors may sometimes be reported by the ARM SMMU driver:
      
      [ 5395.035364] fec 5b040000.ethernet eth0: Link is Down
      [ 5395.039255] arm-smmu 51400000.iommu: Unhandled context fault:
      fsr=0x402, iova=0x00000000, fsynr=0x100001, cbfrsynra=0x852, cb=2
      [ 5398.108460] fec 5b040000.ethernet eth0: Link is Up - 100Mbps/Full -
      flow control off
      
      It is identified that the FEC driver does not properly stop the TX queue
      during the link speed transitions, and this results in the invalid virtual
      I/O address translations from the SMMU and causes the context faults.
      
      Fixes: dbc64a8e ("net: fec: move calls to quiesce/resume packet processing out of fec_restart()")
      Signed-off-by: default avatarShenwei Wang <shenwei.wang@nxp.com>
      Link: https://lore.kernel.org/r/20240123165141.2008104-1-shenwei.wang@nxp.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      5e344807
    • Hangbin Liu's avatar
      selftests: bonding: do not test arp/ns target with mode balance-alb/tlb · a2933a87
      Hangbin Liu authored
      The prio_arp/ns tests hard code the mode to active-backup. At the same
      time, The balance-alb/tlb modes do not support arp/ns target. So remove
      the prio_arp/ns tests from the loop and only test active-backup mode.
      
      Fixes: 481b56e0 ("selftests: bonding: re-format bond option tests")
      Reported-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Closes: https://lore.kernel.org/netdev/17415.1705965957@famine/Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Link: https://lore.kernel.org/r/20240123075917.1576360-1-liuhangbin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      a2933a87
    • Jakub Kicinski's avatar
      Merge tag 'nf-24-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · a717932d
      Jakub Kicinski authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Update nf_tables kdoc to keep it in sync with the code, from George Guo.
      
      2) Handle NETDEV_UNREGISTER event for inet/ingress basechain.
      
      3) Reject configuration that cause nft_limit to overflow,
         from Florian Westphal.
      
      4) Restrict anonymous set/map names to 16 bytes, from Florian Westphal.
      
      5) Disallow to encode queue number and error in verdicts. This reverts
         a patch which seems to have introduced an early attempt to support for
         nfqueue maps, which is these days supported via nft_queue expression.
      
      6) Sanitize family via .validate for expressions that explicitly refer
         to NF_INET_* hooks.
      
      * tag 'nf-24-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        netfilter: nf_tables: validate NFPROTO_* family
        netfilter: nf_tables: reject QUEUE/DROP verdict parameters
        netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
        netfilter: nft_limit: reject configurations that cause integer overflow
        netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain
        netfilter: nf_tables: cleanup documentation
      ====================
      
      Link: https://lore.kernel.org/r/20240124191248.75463-1-pablo@netfilter.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a717932d
    • Zhipeng Lu's avatar
      fjes: fix memleaks in fjes_hw_setup · f6cc4b6a
      Zhipeng Lu authored
      In fjes_hw_setup, it allocates several memory and delay the deallocation
      to the fjes_hw_exit in fjes_probe through the following call chain:
      
      fjes_probe
        |-> fjes_hw_init
              |-> fjes_hw_setup
        |-> fjes_hw_exit
      
      However, when fjes_hw_setup fails, fjes_hw_exit won't be called and thus
      all the resources allocated in fjes_hw_setup will be leaked. In this
      patch, we free those resources in fjes_hw_setup and prevents such leaks.
      
      Fixes: 2fcbca68 ("fjes: platform_driver's .probe and .remove routine")
      Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20240122172445.3841883-1-alexious@zju.edu.cnSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f6cc4b6a
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.8-rc2' of https://github.com/ceph/ceph-client · 6098d87e
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "A fix to avoid triggering an assert in some cases where RBD exclusive
        mappings are involved and a deprecated API cleanup"
      
      * tag 'ceph-for-6.8-rc2' of https://github.com/ceph/ceph-client:
        rbd: don't move requests to the running list on errors
        rbd: remove usage of the deprecated ida_simple_*() API
      6098d87e
    • Linus Torvalds's avatar
      Merge tag 'integrity-v6.8-rc1' of... · f22face1
      Linus Torvalds authored
      Merge tag 'integrity-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
      
      Pull integrity fix from Mimi Zohar:
       "Revert patch that required user-provided key data, since keys can be
        created from kernel-generated random numbers"
      
      * tag 'integrity-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
        Revert "KEYS: encrypted: Add check for strsep"
      f22face1
    • Alexei Starovoitov's avatar
      Merge branch 'net-bpf_xdp_adjust_tail-and-intel-mbuf-fixes' · 9d71bc83
      Alexei Starovoitov authored
      Maciej Fijalkowski says:
      
      ====================
      net: bpf_xdp_adjust_tail() and Intel mbuf fixes
      
      Hey,
      
      after a break followed by dealing with sickness, here is a v6 that makes
      bpf_xdp_adjust_tail() actually usable for ZC drivers that support XDP
      multi-buffer. Since v4 I tried also using bpf_xdp_adjust_tail() with
      positive offset which exposed yet another issues, which can be observed
      by increased commit count when compared to v3.
      
      John, in the end I think we should remove handling
      MEM_TYPE_XSK_BUFF_POOL from __xdp_return(), but it is out of the scope
      for fixes set, IMHO.
      
      Thanks,
      Maciej
      
      v6:
      - add acks [Magnus]
      - fix spelling mistakes [Magnus]
      - avoid touching xdp_buff in xp_alloc_{reused,new_from_fq}() [Magnus]
      - s/shrink_data/bpf_xdp_shrink_data [Jakub]
      - remove __shrink_data() [Jakub]
      - check retvals from __xdp_rxq_info_reg() [Magnus]
      
      v5:
      - pick correct version of patch 5 [Simon]
      - elaborate a bit more on what patch 2 fixes
      
      v4:
      - do not clear frags flag when deleting tail; xsk_buff_pool now does
        that
      - skip some NULL tests for xsk_buff_get_tail [Martin, John]
      - address problems around registering xdp_rxq_info
      - fix bpf_xdp_frags_increase_tail() for ZC mbuf
      
      v3:
      - add acks
      - s/xsk_buff_tail_del/xsk_buff_del_tail
      - address i40e as well (thanks Tirthendu)
      
      v2:
      - fix !CONFIG_XDP_SOCKETS builds
      - add reviewed-by tag to patch 3
      ====================
      
      Link: https://lore.kernel.org/r/20240124191602.566724-1-maciej.fijalkowski@intel.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      9d71bc83
    • Maciej Fijalkowski's avatar
      i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue · 0cbb0870
      Maciej Fijalkowski authored
      Now that i40e driver correctly sets up frag_size in xdp_rxq_info, let us
      make it work for ZC multi-buffer as well. i40e_ring::rx_buf_len for ZC
      is being set via xsk_pool_get_rx_frame_size() and this needs to be
      propagated up to xdp_rxq_info.
      
      Fixes: 1c9ba9c1 ("i40e: xsk: add RX multi-buffer support")
      Acked-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Link: https://lore.kernel.org/r/20240124191602.566724-12-maciej.fijalkowski@intel.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      0cbb0870
    • Maciej Fijalkowski's avatar
      i40e: set xdp_rxq_info::frag_size · a045d2f2
      Maciej Fijalkowski authored
      i40e support XDP multi-buffer so it is supposed to use
      __xdp_rxq_info_reg() instead of xdp_rxq_info_reg() and set the
      frag_size. It can not be simply converted at existing callsite because
      rx_buf_len could be un-initialized, so let us register xdp_rxq_info
      within i40e_configure_rx_ring(), which happen to be called with already
      initialized rx_buf_len value.
      
      Commit 5180ff13 ("i40e: use int for i40e_status") converted 'err' to
      int, so two variables to deal with return codes are not needed within
      i40e_configure_rx_ring(). Remove 'ret' and use 'err' to handle status
      from xdp_rxq_info registration.
      
      Fixes: e213ced1 ("i40e: add support for XDP multi-buffer Rx")
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Link: https://lore.kernel.org/r/20240124191602.566724-11-maciej.fijalkowski@intel.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      a045d2f2
    • Maciej Fijalkowski's avatar
      xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL · fbadd83a
      Maciej Fijalkowski authored
      XSK ZC Rx path calculates the size of data that will be posted to XSK Rx
      queue via subtracting xdp_buff::data_end from xdp_buff::data.
      
      In bpf_xdp_frags_increase_tail(), when underlying memory type of
      xdp_rxq_info is MEM_TYPE_XSK_BUFF_POOL, add offset to data_end in tail
      fragment, so that later on user space will be able to take into account
      the amount of bytes added by XDP program.
      
      Fixes: 24ea5012 ("xsk: support mbuf on ZC RX")
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Link: https://lore.kernel.org/r/20240124191602.566724-10-maciej.fijalkowski@intel.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      fbadd83a