1. 24 Jan, 2021 6 commits
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 24c56ee0
      Linus Torvalds authored
      Pull scheduler fixes from Borislav Petkov:
      
       - Correct the marking of kthreads which are supposed to run on a
         specific, single CPU vs such which are affine to only one CPU, mark
         per-cpu workqueue threads as such and make sure that marking
         "survives" CPU hotplug. Fix CPU hotplug issues with such kthreads.
      
       - A fix to not push away tasks on CPUs coming online.
      
       - Have workqueue CPU hotplug code use cpu_possible_mask when breaking
         affinity on CPU offlining so that pending workers can finish on newly
         arrived onlined CPUs too.
      
       - Dump tasks which haven't vacated a CPU which is currently being
         unplugged.
      
       - Register a special scale invariance callback which gets called on
         resume from RAM to read out APERF/MPERF after resume and thus make
         the schedutil scaling governor more precise.
      
      * tag 'sched_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Relax the set_cpus_allowed_ptr() semantics
        sched: Fix CPU hotplug / tighten is_per_cpu_kthread()
        sched: Prepare to use balance_push in ttwu()
        workqueue: Restrict affinity change to rescuer
        workqueue: Tag bound workers with KTHREAD_IS_PER_CPU
        kthread: Extract KTHREAD_IS_PER_CPU
        sched: Don't run cpu-online with balance_push() enabled
        workqueue: Use cpu_possible_mask instead of cpu_active_mask to break affinity
        sched/core: Print out straggler tasks in sched_cpu_dying()
        x86: PM: Register syscore_ops for scale invariance
      24c56ee0
    • Linus Torvalds's avatar
      Merge tag 'timers_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 025929f4
      Linus Torvalds authored
      Pull timer fixes from Borislav Petkov:
      
       - Fix an integer overflow in the NTP RTC synchronization which led to
         the latter happening every 2 seconds instead of the intended every 11
         minutes.
      
       - Get rid of now unused get_seconds().
      
      * tag 'timers_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ntp: Fix RTC synchronization on 32-bit platforms
        timekeeping: Remove unused get_seconds()
      025929f4
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 17b6c49d
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Add a new Intel model number for Alder Lake
      
       - Differentiate which aspects of the FPU state get saved/restored when
         the FPU is used in-kernel and fix a boot crash on K7 due to early
         MXCSR access before CR4.OSFXSR is even set.
      
       - A couple of noinstr annotation fixes
      
       - Correct die ID setting on AMD for users of topology information which
         need the correct die ID
      
       - A SEV-ES fix to handle string port IO to/from kernel memory properly
      
      * tag 'x86_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu: Add another Alder Lake CPU to the Intel family
        x86/mmx: Use KFPU_387 for MMX string operations
        x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state
        x86/topology: Make __max_die_per_package available unconditionally
        x86: __always_inline __{rd,wr}msr()
        x86/mce: Remove explicit/superfluous tracing
        locking/lockdep: Avoid noinstr warning for DEBUG_LOCKDEP
        locking/lockdep: Cure noinstr fail
        x86/sev: Fix nonistr violation
        x86/entry: Fix noinstr fail
        x86/cpu/amd: Set __max_die_per_package on AMD
        x86/sev-es: Handle string port IO to kernel memory properly
      17b6c49d
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.11-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 14c50a66
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix a bad interaction between the scv handling and the fallback L1D
         flush, which could lead to user register corruption. Only affects
         people using scv (~no one) on machines with old firmware that are
         missing the L1D flush.
      
       - Two small selftest fixes.
      
      Thanks to Eirik Fuller, Libor Pechacek, Nicholas Piggin, Sandipan Das,
      and Tulio Magno Quites Machado Filho.
      
      * tag 'powerpc-5.11-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: fix scv entry fallback flush vs interrupt
        selftests/powerpc: Only test lwm/stmw on big endian
        selftests/powerpc: Fix exit status of pkey tests
      14c50a66
    • Linus Torvalds's avatar
      Merge tag 'for-linus-2021-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · c509ce23
      Linus Torvalds authored
      Pull misc fixes from Christian Brauner:
      
       - Jann reported sparse complaints because of a missing __user
         annotation in a helper we added way back when we added
         pidfd_send_signal() to avoid compat syscall handling. Fix it.
      
       - Yanfei replaces a reference in a comment to the _do_fork() helper I
         removed a while ago with a reference to the new kernel_clone()
         replacement
      
       - Alexander Guril added a simple coding style fix
      
      * tag 'for-linus-2021-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        kthread: remove comments about old _do_fork() helper
        Kernel: fork.c: Fix coding style: Do not use {} around single-line statements
        signal: Add missing __user annotation to copy_siginfo_from_user_any
      c509ce23
    • Linus Torvalds's avatar
      Merge tag '5.11-rc4-smb3' of git://git.samba.org/sfrench/cifs-2.6 · 4dcd3bcc
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "An important signal handling patch for stable, and two small cleanup
        patches"
      
      * tag '5.11-rc4-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: do not fail __smb_send_rqst if non-fatal signals are pending
        fs/cifs: Simplify bool comparison.
        fs/cifs: Assign boolean values to a bool variable
      4dcd3bcc
  2. 23 Jan, 2021 5 commits
    • Linus Torvalds's avatar
      Merge branch 'mtd/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · e1ae4b0b
      Linus Torvalds authored
      Pull mtd fixes from Miquel Raynal.
      
      * 'mtd/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: omap: Use BCH private fields in the specific OOB layout
        mtd: spinand: Fix MTD_OPS_AUTO_OOB requests
        mtd: rawnand: intel: check the mtd name only after setting the variable
        mtd: rawnand: nandsim: Fix the logic when selecting Hamming soft ECC engine
        mtd: rawnand: gpmi: fix dst bit offset when extracting raw payload
      e1ae4b0b
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 077e81d5
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Another bunch  of driver fixes"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: sprd: depend on COMMON_CLK to fix compile tests
        Revert "i2c: imx: Remove unused .id_table support"
        i2c: octeon: check correct size of maximum RECV_LEN packet
        i2c: tegra: Create i2c_writesl_vi() to use with VI I2C for filling TX FIFO
        i2c: bpmp-tegra: Ignore unknown I2C_M flags
        i2c: tegra: Wait for config load atomically while in ISR
      077e81d5
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 15cfb0f0
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Twelve minor fixes, all in drivers or doc.
      
        Most of the fixes are pretty obvious (although we had two goes to get
        the UFS sysfs doc right) and the biggest change is in the ufs driver
        which they've extensively tested"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ibmvfc: Set default timeout to avoid crash during migration
        scsi: target: tcmu: Fix use-after-free of se_cmd->priv
        scsi: fnic: Fix memleak in vnic_dev_init_devcmd2
        scsi: libfc: Avoid invoking response handler twice if ep is already completed
        scsi: scsi_transport_srp: Don't block target in failfast state
        scsi: docs: ABI: sysfs-driver-ufs: Rectify table formatting
        scsi: ufs: Fix tm request when non-fatal error happens
        scsi: ufs: Fix livelock of ufshcd_clear_ua_wluns()
        scsi: ibmvfc: Fix missing cast of ibmvfc_event pointer to u64 handle
        scsi: ufs: ufshcd-pltfrm depends on HAS_IOMEM
        scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression
        scsi: docs: ABI: sysfs-driver-ufs: Add DeepSleep power mode
      15cfb0f0
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-kunit-fixes-5.11-rc5' of... · 929b9796
      Linus Torvalds authored
      Merge tag 'linux-kselftest-kunit-fixes-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kunit fixes from Shuah :
       "Five fixes to the kunit tool and documentation from Daniel Latypov and
        David Gow"
      
      * tag 'linux-kselftest-kunit-fixes-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kunit: tool: move kunitconfig parsing into __init__, make it optional
        kunit: tool: fix minor typing issue with None status
        kunit: tool: surface and address more typing issues
        Documentation: kunit: include example of a parameterized test
        kunit: tool: Fix spelling of "diagnostic" in kunit_parser
      929b9796
    • Ronnie Sahlberg's avatar
      cifs: do not fail __smb_send_rqst if non-fatal signals are pending · 214a5ea0
      Ronnie Sahlberg authored
      RHBZ 1848178
      
      The original intent of returning an error in this function
      in the patch:
        "CIFS: Mask off signals when sending SMB packets"
      was to avoid interrupting packet send in the middle of
      sending the data (and thus breaking an SMB connection),
      but we also don't want to fail the request for non-fatal
      signals even before we have had a chance to try to
      send it (the reported problem could be reproduced e.g.
      by exiting a child process when the parent process was in
      the midst of calling futimens to update a file's timestamps).
      
      In addition, since the signal may remain pending when we enter the
      sending loop, we may end up not sending the whole packet before
      TCP buffers become full. In this case the code returns -EINTR
      but what we need here is to return -ERESTARTSYS instead to
      allow system calls to be restarted.
      
      Fixes: b30c74c7 ("CIFS: Mask off signals when sending SMB packets")
      Cc: stable@vger.kernel.org # v5.1+
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      214a5ea0
  3. 22 Jan, 2021 21 commits
  4. 21 Jan, 2021 8 commits
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.11-2021-01-21' of... · 06ee38dc
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.11-2021-01-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.11-2021-01-21:
      
      amdgpu:
      - Green Sardine fixes
      - Vangogh fixes
      - Renoir fixes
      - Misc display fixes
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210121160129.3981-1-alexander.deucher@amd.com
      06ee38dc
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2021-01-21' of... · 5f9986a6
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2021-01-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      drm/i915 fixes for v5.11-rc5:
      - HDCP fixes
      - PMU wakeref fix
      - Fix HWSP validity race
      - Fix DP protocol converter accidental 4:4:4->4:2:0 conversion for RGB
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/87a6t2kzgb.fsf@intel.com
      5f9986a6
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2021-01-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · f722f5be
      Dave Airlie authored
      Short summary of fixes pull (less than what git shortlog provides):
      
       * drm/atomic: Release state on error
       * drm/syncobj: Fix use-after-free
       * drm/ttm: Don't use GFP_TRANSHUGE_LIGTH
       * drm/vc4: Unify driver naming for PCM
       * drm/vram-helper: Fix memory leak in vmap
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YAgdYGNoH7pC29rz@linux-uq9g
      f722f5be
    • Gayatri Kammela's avatar
      x86/cpu: Add another Alder Lake CPU to the Intel family · 6e1239c1
      Gayatri Kammela authored
      Add Alder Lake mobile CPU model number to Intel family.
      Signed-off-by: default avatarGayatri Kammela <gayatri.kammela@intel.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/20210121215004.11618-1-tony.luck@intel.com
      6e1239c1
    • Jin Yao's avatar
      perf script: Fix overrun issue for dynamically-allocated PMU type number · 8adc0a06
      Jin Yao authored
      When unpacking the event which is from dynamic PMU, the array
      output[OUTPUT_TYPE_MAX] may be overrun. For example, type number of SKL
      uncore_imc is 10, but OUTPUT_TYPE_MAX is 7 now (OUTPUT_TYPE_MAX =
      PERF_TYPE_MAX + 1).
      
      /* In builtin-script.c */
      
      process_event()
      {
              unsigned int type = output_type(attr->type);
      
              if (output[type].fields == 0)
                      return;
      }
      
      output[10] is overrun.
      
      Create a type OUTPUT_TYPE_OTHER for dynamic PMU events, then
      output_type(attr->type) will return OUTPUT_TYPE_OTHER here.
      
      Note that if PERF_TYPE_MAX ever changed, then there would be a conflict
      between old perf.data files that had a dynamicaliy allocated PMU number
      that would then be the same as a fixed PERF_TYPE.
      
      Example:
      
        # perf record --switch-events -C 0 -e "{cpu-clock,uncore_imc/data_reads/,uncore_imc/data_writes/}:SD" -a -- sleep 1
        # perf script
      
        Before:
               swapper     0 [000] 1479253.987551:     277766               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.987797:     246709               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.988127:     329883               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.988273:     146393               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.988523:     249977               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.988877:     354090               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.989023:     145940               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.989383:     359856               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1479253.989523:     140082               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
      
        After:
               swapper     0 [000] 1397040.402011:     272384               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1397040.402011:       5396  uncore_imc/data_reads/:
               swapper     0 [000] 1397040.402011:        967 uncore_imc/data_writes/:
               swapper     0 [000] 1397040.402259:     249153               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1397040.402259:       7231  uncore_imc/data_reads/:
               swapper     0 [000] 1397040.402259:       1297 uncore_imc/data_writes/:
               swapper     0 [000] 1397040.402508:     249108               cpu-clock:  ffffffff9d4ddb6f cpuidle_enter_state+0xdf ([kernel.kallsyms])
               swapper     0 [000] 1397040.402508:       5333  uncore_imc/data_reads/:
               swapper     0 [000] 1397040.402508:       1008 uncore_imc/data_writes/:
      Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Link: https://lore.kernel.org/r/20201209005828.21302-1-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8adc0a06
    • John Garry's avatar
      perf metricgroup: Fix system PMU metrics · 3d6e79ee
      John Garry authored
      Joakim reports that getting "perf stat" for multiple system PMU metrics
      segfaults:
      
        $ perf stat -a -I 1000 -M imx8mm_ddr_write.all,imx8mm_ddr_write.all
        Segmentation fault
        $
      
      While the same works without issue for a single metric.
      
      The logic in metricgroup__add_metric_sys_event_iter() is broken, in that
      add_metric() @M argument should be NULL for each new metric. Fix by not
      passing a holder for that, and rather make local in
      metricgroup__add_metric_sys_event_iter().
      
      Fixes: be335ec2 ("perf metricgroup: Support adding metrics for system PMUs")
      Reported-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linuxarm@openeuler.org
      Link: https://lore.kernel.org/r/1611050655-44020-1-git-send-email-john.garry@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3d6e79ee
    • John Garry's avatar
      perf metricgroup: Fix for metrics containing duration_time · 9c880c24
      John Garry authored
      Metrics containing duration_time cause a segfault:
      
        $ perf stat -v -M L1D_Cache_Fill_BW sleep 1
        Using CPUID GenuineIntel-6-3D-4
        metric expr 64 * l1d.replacement / 1000000000 / duration_time for L1D_Cache_Fill_BW
        found event duration_time
        found event l1d.replacement
        adding {l1d.replacement}:W,duration_time
        l1d.replacement -> cpu/umask=0x1,(null)=0x1e8483,event=0x51/
        Segmentation fault
        $
      
      In commit c2337d67 ("perf metricgroup: Fix metrics using aliases
      covering multiple PMUs"), the logic in find_evsel_group() when iter'ing
      events was changed to not only select events in same group, but also for
      aliased PMUs.
      
      Checking whether events were for aliased PMUs was done by comparing the
      event PMU name. This was not safe for duration_time event, which has no
      associated PMU (and no PMU name), so fix by checking if the event PMU name
      is set also.
      
      Committer testing:
      
      Reproduced the bug, then, on a:
      
        $ grep -m1 ^'model name' /proc/cpuinfo
        model name	: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
        $
      
      We now get:
      
        $ perf stat -M L1D_Cache_Fill_BW sleep 1
      
         Performance counter stats for 'sleep 1':
      
                     4,141      l1d.replacement:u
             1,001,285,107 ns   duration_time:u
      
               1.001285107 seconds time elapsed
      
               0.000000000 seconds user
               0.001119000 seconds sys
      
        $
      
      Detais from -v:
      
        Using CPUID GenuineIntel-6-8E-A
        metric expr 64 * l1d.replacement / 1000000000 / duration_time for L1D_Cache_Fill_BW
        found event duration_time
        found event l1d.replacement
        adding {l1d.replacement}:W,duration_time
        l1d.replacement -> cpu/(null)=0x1e8483,umask=0x1,event=0x51/
        Control descriptor is not initialized
        Warning:
        kernel.perf_event_paranoid=2, trying to fall back to excluding kernel and hypervisor  samples
        Warning:
        kernel.perf_event_paranoid=2, trying to fall back to excluding kernel and hypervisor  samples
        l1d.replacement:u: 4592 612201 612201
        duration_time:u: 1001478621 1001478621 1001478621
      
      Fixes: c2337d67 ("perf metricgroup: Fix metrics using aliases covering multiple PMUs")
      Reported-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linuxarm@openeuler.org
      Link: https://lore.kernel.org/r/1611159518-226883-1-git-send-email-john.garry@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9c880c24
    • Adrian Hunter's avatar
      perf evlist: Fix id index for heterogeneous systems · fc705fec
      Adrian Hunter authored
      perf_evlist__set_sid_idx() updates perf_sample_id with the evlist map
      index, CPU number and TID. It is passed indexes to the evsel's cpu and
      thread maps, but references the evlist's maps instead. That results in
      using incorrect CPU numbers on heterogeneous systems. Fix it by using
      evsel maps.
      
      The id index (PERF_RECORD_ID_INDEX) is used by AUX area tracing when in
      sampling mode. Having an incorrect CPU number causes the trace data to
      be attributed to the wrong CPU, and can result in decoder errors because
      the trace data is then associated with the wrong process.
      
      Committer notes:
      
      Keep the class prefix convention in the function name, switching from
      perf_evlist__set_sid_idx() to perf_evsel__set_sid_idx().
      
      Fixes: 3c659eed ("perf tools: Add id index")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20210121125446.11287-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fc705fec