1. 30 Dec, 2021 7 commits
    • Huang Rui's avatar
      cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors · ec437d71
      Huang Rui authored
      AMD P-State is the AMD CPU performance scaling driver that introduces a
      new CPU frequency control mechanism on AMD Zen based CPU series in Linux
      kernel. The new mechanism is based on Collaborative processor
      performance control (CPPC) which is finer grain frequency management
      than legacy ACPI hardware P-States. Current AMD CPU platforms are using
      the ACPI P-states driver to manage CPU frequency and clocks with
      switching only in 3 P-states. AMD P-State is to replace the ACPI
      P-states controls, allows a flexible, low-latency interface for the
      Linux kernel to directly communicate the performance hints to hardware.
      
      AMD P-State leverages the Linux kernel governors such as *schedutil*,
      *ondemand*, etc. to manage the performance hints which are provided by CPPC
      hardware functionality. The first version for AMD P-State is to support one
      of the Zen3 processors, and we will support more in future after we verify
      the hardware and SBIOS functionalities.
      
      There are two types of hardware implementations for AMD P-State: one is full
      MSR support and another is shared memory support. It can use
      X86_FEATURE_CPPC feature flag to distinguish the different types.
      
      Using the new AMD P-State method + kernel governors (*schedutil*,
      *ondemand*, ...) to manage the frequency update is the most appropriate
      bridge between AMD Zen based hardware processor and Linux kernel, the
      processor is able to adjust to the most efficiency frequency according to
      the kernel scheduler loading.
      
      Please check the detailed CPU feature and MSR register description in
      Processor Programming Reference (PPR) for AMD Family 19h Model 51h,
      Revision A1 Processors:
      
      https://www.amd.com/system/files/TechDocs/56569-A1-PUB.zipSigned-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ec437d71
    • Jinzhou Su's avatar
      ACPI: CPPC: Add CPPC enable register function · fb0b00af
      Jinzhou Su authored
      Add a new function to enable CPPC feature. This function
      will write Continuous Performance Control package
      EnableRegister field on the processor.
      
      CPPC EnableRegister register described in section 8.4.7.1 of ACPI 6.4:
      This element is optional. If supported, contains a resource descriptor
      with a single Register() descriptor that describes a register to which
      OSPM writes a One to enable CPPC on this processor. Before this register
      is set, the processor will be controlled by legacy mechanisms (ACPI
      Pstates, firmware, etc.).
      
      This register will be used for AMD processors to enable AMD P-State
      function instead of legacy ACPI P-States.
      Signed-off-by: default avatarJinzhou Su <Jinzhou.Su@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fb0b00af
    • Mario Limonciello's avatar
      ACPI: CPPC: Check present CPUs for determining _CPC is valid · 2aeca6bd
      Mario Limonciello authored
      As this is a static check, it should be based upon what is currently
      present on the system. This makes probeing more deterministic.
      
      While local APIC flags field (lapic_flags) of cpu core in MADT table is
      0, then the cpu core won't be enabled. In this case, _CPC won't be found
      in this core, and return back to _CPC invalid with walking through
      possible cpus (include disable cpus). This is not expected, so switch to
      check present CPUs instead.
      Reported-by: default avatarJinzhou Su <Jinzhou.Su@amd.com>
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2aeca6bd
    • Steven Noonan's avatar
      ACPI: CPPC: Implement support for SystemIO registers · a2c8f92b
      Steven Noonan authored
      According to the ACPI v6.2 (and later) specification, SystemIO can be
      used for _CPC registers. This teaches cppc_acpi how to handle such
      registers.
      
      This patch was tested using the amd_pstate driver on my Zephyrus G15
      (model GA503QS) using the current version 410 BIOS, which uses
      a SystemIO register for the HighestPerformance element in _CPC.
      Signed-off-by: default avatarSteven Noonan <steven@valvesoftware.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a2c8f92b
    • Huang Rui's avatar
      x86/msr: Add AMD CPPC MSR definitions · 89aa94b4
      Huang Rui authored
      AMD CPPC (Collaborative Processor Performance Control) function uses MSR
      registers to manage the performance hints. So add the MSR register macro
      here.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      89aa94b4
    • Huang Rui's avatar
      x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag · d341db8f
      Huang Rui authored
      Add Collaborative Processor Performance Control feature flag for AMD
      processors.
      
      This feature flag will be used on the following AMD P-State driver. The
      AMD P-State driver has two approaches to implement the frequency control
      behavior. That depends on the CPU hardware implementation. One is "Full
      MSR Support" and another is "Shared Memory Support". The feature flag
      indicates the current processors with "Full MSR Support".
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d341db8f
    • Rafael J. Wysocki's avatar
      Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm · 5ee22fa4
      Rafael J. Wysocki authored
      Pull ARM cpufreq updates for 5.17-rc1 from Viresh Kumar:
      
      "- Qcom cpufreq driver updates improve irq support (Ard Biesheuvel, Stephen Boyd,
         and Vladimir Zapolskiy).
      
       - Fixes double devm_remap for mediatek driver (Hector Yuan).
      
       - Introduces thermal pressure helpers (Lukasz Luba)."
      
      * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
        cpufreq: mediatek-hw: Fix double devm_remap in hotplug case
        cpufreq: qcom-hw: Use optional irq API
        cpufreq: qcom-hw: Set CPU affinity of dcvsh interrupts
        cpufreq: qcom-hw: Fix probable nested interrupt handling
        cpufreq: qcom-cpufreq-hw: Avoid stack buffer for IRQ name
        arch_topology: Remove unused topology_set_thermal_pressure() and related
        cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function
        cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure
        thermal: cpufreq_cooling: Use new thermal pressure update function
        arch_topology: Introduce thermal pressure update function
      5ee22fa4
  2. 28 Dec, 2021 1 commit
  3. 27 Dec, 2021 1 commit
  4. 22 Dec, 2021 1 commit
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Update cpuinfo.max_freq on HWP_CAP changes · dfeeedc1
      Rafael J. Wysocki authored
      With HWP enabled, when the turbo range of performance levels is
      disabled by the platform firmware, the CPU capacity is given by
      the "guaranteed performance" field in MSR_HWP_CAPABILITIES which
      is generally dynamic.  When it changes, the kernel receives an HWP
      notification interrupt handled by notify_hwp_interrupt().
      
      When the "guaranteed performance" value changes in the above
      configuration, the CPU performance scaling needs to be adjusted so
      as to use the new CPU capacity in computations, which means that
      the cpuinfo.max_freq value needs to be updated for that CPU.
      
      Accordingly, modify intel_pstate_notify_work() to read
      MSR_HWP_CAPABILITIES and update cpuinfo.max_freq to reflect the
      new configuration (this update can be carried out even if the
      configuration doesn't actually change, because it simply doesn't
      matter then and it takes less time to update it than to do extra
      checks to decide whether or not a change has really occurred).
      Reported-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dfeeedc1
  5. 17 Dec, 2021 3 commits
    • Rafael J. Wysocki's avatar
      cpufreq: Fix initialization of min and max frequency QoS requests · 521223d8
      Rafael J. Wysocki authored
      The min and max frequency QoS requests in the cpufreq core are
      initialized to whatever the current min and max frequency values are
      at the init time, but if any of these values change later (for
      example, cpuinfo.max_freq is updated by the driver), these initial
      request values will be limiting the CPU frequency unnecessarily
      unless they are changed by user space via sysfs.
      
      To address this, initialize min_freq_req and max_freq_req to
      FREQ_QOS_MIN_DEFAULT_VALUE and FREQ_QOS_MAX_DEFAULT_VALUE,
      respectively, so they don't really limit anything until user
      space updates them.
      Reported-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      521223d8
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Update EPP for AlderLake mobile · b6e6f8be
      Srinivas Pandruvada authored
      There is an expectation from users that they can get frequency specified
      by cpufreq/cpuinfo_max_freq when conditions permit. But with AlderLake
      mobile it may not be possible. This is possible that frequency is clipped
      based on the system power-up EPP value. In this case users can update
      cpufreq/energy_performance_preference to some performance oriented EPP to
      limit clipping of frequencies.
      
      To get out of box behavior as the prior generations of CPUs, update EPP
      for AlderLake mobile CPUs on boot. On prior generations of CPUs EPP = 128
      was enough to get maximum frequency, but with AlderLake mobile the
      equivalent EPP is 102. Since EPP is model specific, this is possible that
      they have different meaning on each generation of CPU.
      
      The current EPP string "balance_performance" corresponds to EPP = 128.
      Change the EPP corresponding to "balance_performance" to 102 for only
      AlderLake mobile CPUs and update this on each CPU during boot.
      
      To implement reuse epp_values[] array and update the modified EPP at the
      index for BALANCE_PERFORMANCE. Add a dummy EPP_INDEX_DEFAULT to
      epp_values[] to match indexes in the energy_perf_strings[].
      
      After HWP PM is enabled also update EPP when "balance_performance" is
      redefined for the very first time after the boot on each CPU. On
      subsequent suspend/resume or offline/online the old EPP is restored,
      so no specific action is needed.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b6e6f8be
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Drop redundant intel_pstate_get_hwp_cap() call · 458b03f8
      Rafael J. Wysocki authored
      It is not necessary to call intel_pstate_get_hwp_cap() from
      intel_pstate_update_perf_limits(), because it gets called from
      intel_pstate_verify_cpu_policy() which is either invoked directly
      right before intel_pstate_update_perf_limits(), in
      intel_cpufreq_verify_policy() in the passive mode, or called
      from driver callbacks in a sequence that causes it to be followed
      by an immediate intel_pstate_update_perf_limits().
      
      Namely, in the active mode intel_cpufreq_verify_policy() is called
      by intel_pstate_verify_policy() which is the ->verify() callback
      routine of intel_pstate and gets called by the cpufreq core right
      before intel_pstate_set_policy(), which is the driver's ->setoplicy()
      callback routine, where intel_pstate_update_perf_limits() is called.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      458b03f8
  6. 12 Dec, 2021 14 commits
  7. 11 Dec, 2021 13 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.16-2021-12-11' of... · bbdff6d5
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.16-2021-12-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Prevent out-of-bounds access to per sample registers.
      
       - Fix NULL vs IS_ERR_OR_NULL() checking on the python binding.
      
       - Intel PT fixes, half of those are one-liners:
            - Fix some PGE (packet generation enable/control flow packets) usage.
            - Fix sync state when a PSB (synchronization) packet is found.
            - Fix intel_pt_fup_event() assumptions about setting state type.
            - Fix state setting when receiving overflow (OVF) packet.
            - Fix next 'err' value, walking trace.
            - Fix missing 'instruction' events with 'q' option.
            - Fix error timestamp setting on the decoder error path.
      
      * tag 'perf-tools-fixes-for-v5.16-2021-12-11' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf python: Fix NULL vs IS_ERR_OR_NULL() checking
        perf intel-pt: Fix error timestamp setting on the decoder error path
        perf intel-pt: Fix missing 'instruction' events with 'q' option
        perf intel-pt: Fix next 'err' value, walking trace
        perf intel-pt: Fix state setting when receiving overflow (OVF) packet
        perf intel-pt: Fix intel_pt_fup_event() assumptions about setting state type
        perf intel-pt: Fix sync state when a PSB (synchronization) packet is found
        perf intel-pt: Fix some PGE (packet generation enable/control flow packets) usage
        perf tools: Prevent out-of-bounds access to registers
      bbdff6d5
    • Linus Torvalds's avatar
      Merge tag 'block-5.16-2021-12-10' of git://git.kernel.dk/linux-block · eccea80b
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few block fixes that should go into this release:
      
         - NVMe pull request:
              - set ana_log_size to 0 after freeing ana_log_buf (Hou Tao)
              - show subsys nqn for duplicate cntlids (Keith Busch)
              - disable namespace access for unsupported metadata (Keith
                Busch)
              - report write pointer for a full zone as zone start + zone len
                (Niklas Cassel)
              - fix use after free when disconnecting a reconnecting ctrl
                (Ruozhu Li)
              - fix a list corruption in nvmet-tcp (Sagi Grimberg)
      
         - Fix for a regression on DIO single bio async IO (Pavel)
      
         - ioprio seteuid fix (Davidlohr)
      
         - mtd fix that subsequently got reverted as it was broken, will get
           re-done and submitted for the next round
      
         - Two MD fixes via Song (Markus, zhangyue)"
      
      * tag 'block-5.16-2021-12-10' of git://git.kernel.dk/linux-block:
        Revert "mtd_blkdevs: don't scan partitions for plain mtdblock"
        block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2)
        md: fix double free of mddev->private in autorun_array()
        md: fix update super 1.0 on rdev size change
        nvmet-tcp: fix possible list corruption for unexpected command failure
        block: fix single bio async DIO error handling
        nvme: fix use after free when disconnecting a reconnecting ctrl
        nvme-multipath: set ana_log_size to 0 after free ana_log_buf
        mtd_blkdevs: don't scan partitions for plain mtdblock
        nvme: report write pointer for a full zone as zone start + zone len
        nvme: disable namespace access for unsupported metadata
        nvme: show subsys nqn for duplicate cntlids
      eccea80b
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.16-2021-12-10' of git://git.kernel.dk/linux-block · f152165a
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few fixes that are all bound for stable:
      
         - Two syzbot reports for io-wq that turned out to be separate fixes,
           but ultimately very closely related
      
         - io_uring task_work running on cancelations"
      
      * tag 'io_uring-5.16-2021-12-10' of git://git.kernel.dk/linux-block:
        io-wq: check for wq exit after adding new worker task_work
        io_uring: ensure task_work gets run as part of cancelations
        io-wq: remove spurious bit clear on task_work addition
      f152165a
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · bd66be54
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Two more I2C driver bugfixes"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: mpc: Use atomic read and fix break condition
        i2c: virtio: fix completion handling
      bd66be54
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 2acdaf59
      Linus Torvalds authored
      Pull clk driver fixes from Stephen Boyd:
      
       - Fix qcom mux logic to look at the proper parent table member. Luckily
         this clk type isn't very common.
      
       - Don't kill clks on qcom systems that use Trion PLLs that are enabled
         out of the bootloader. We will simply skip programming the PLL rate
         if it's already done.
      
       - Use the proper clk_ops for the qcom sm6125 ICE clks.
      
       - Use module_platform_driver() in i.MX as it can be a module.
      
       - Fix a UAF in the versatile clk driver on an error path.
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: versatile: clk-icst: use after free on error path
        clk: qcom: sm6125-gcc: Swap ops of ice and apps on sdcc1
        clk: imx: use module_platform_driver
        clk: qcom: clk-alpha-pll: Don't reconfigure running Trion
        clk: qcom: regmap-mux: fix parent clock lookup
      2acdaf59
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · a84e0b31
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Revert schema checks on %.dtb targets. This was problematic for some
         external build tools.
      
       - A few DT binding example fixes
      
       - Add back dropped 'enet-phy-lane-no-swap' Ethernet PHY property
      
       - Drop erroneous if/then schema in nxp,imx7-mipi-csi2
      
       - Add a quirk to fix some interrupt controllers use of 'interrupt-map'
      
      * tag 'devicetree-fixes-for-5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        Revert "kbuild: Enable DT schema checks for %.dtb targets"
        dt-bindings: bq25980: Fixup the example
        dt-bindings: input: gpio-keys: Fix interrupts in example
        dt-bindings: net: Reintroduce PHY no lane swap binding
        dt-bindings: media: nxp,imx7-mipi-csi2: Drop bad if/then schema
        of/irq: Add a quirk for controllers with their own definition of interrupt-map
        dt-bindings: iio: adc: exynos-adc: Fix node name in example
      a84e0b31
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · df442a4e
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "21 patches.
      
        Subsystems affected by this patch series: MAINTAINERS, mailmap, and mm
        (mlock, pagecache, damon, slub, memcg, hugetlb, and pagecache)"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
        mm: bdi: initialize bdi_min_ratio when bdi is unregistered
        hugetlbfs: fix issue of preallocation of gigantic pages can't work
        mm/memcg: relocate mod_objcg_mlstate(), get_obj_stock() and put_obj_stock()
        mm/slub: fix endianness bug for alloc/free_traces attributes
        selftests/damon: split test cases
        selftests/damon: test debugfs file reads/writes with huge count
        selftests/damon: test wrong DAMOS condition ranges input
        selftests/damon: test DAMON enabling with empty target_ids case
        selftests/damon: skip test if DAMON is running
        mm/damon/vaddr-test: remove unnecessary variables
        mm/damon/vaddr-test: split a test function having >1024 bytes frame size
        mm/damon/vaddr: remove an unnecessary warning message
        mm/damon/core: remove unnecessary error messages
        mm/damon/dbgfs: remove an unnecessary error message
        mm/damon/core: use better timer mechanisms selection threshold
        mm/damon/core: fix fake load reports due to uninterruptible sleeps
        timers: implement usleep_idle_range()
        filemap: remove PageHWPoison check from next_uptodate_page()
        mailmap: update email address for Guo Ren
        MAINTAINERS: update kdump maintainers
        ...
      df442a4e
    • Thomas Gleixner's avatar
      Merge tag 'timers-v5.16-rc4' of... · aa073d8b
      Thomas Gleixner authored
      Merge tag 'timers-v5.16-rc4' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
      
      Pull timer fixes from Daniel Lezcano:
      
        - Fix build error with clang and some kernel configuration on the
          arm64 architected timer by inlining the
          erratum_set_next_event_generic() function (Marc Zyngier)
      
        - Fix probe error on the dw_apb_timer_of driver by fixing the
          incorrect condition previously introduced (Alexey Sheplyakov)
      
      Link: https://lore.kernel.org/r/429b796d-9395-4ca8-81f3-30911f80a9a9@linaro.org
      aa073d8b
    • Miaoqian Lin's avatar
      perf python: Fix NULL vs IS_ERR_OR_NULL() checking · 9937e8da
      Miaoqian Lin authored
      The function trace_event__tp_format_id may return ERR_PTR(-ENOMEM).  Use
      IS_ERR_OR_NULL to check tp_format.
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.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: Song Liu <song@kernel.org>
      Link: http://lore.kernel.org/lkml/20211211053856.19827-1-linmq006@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9937e8da
    • Adrian Hunter's avatar
      perf intel-pt: Fix error timestamp setting on the decoder error path · 6665b8e4
      Adrian Hunter authored
      An error timestamp shows the last known timestamp for the queue, but this
      is not updated on the error path. Fix by setting it.
      
      Fixes: f4aa0819 ("perf tools: Add Intel PT decoder")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org # v5.15+
      Link: https://lore.kernel.org/r/20211210162303.2288710-8-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6665b8e4
    • Adrian Hunter's avatar
      perf intel-pt: Fix missing 'instruction' events with 'q' option · a882cc94
      Adrian Hunter authored
      FUP packets contain IP information, which makes them also an 'instruction'
      event in 'hop' mode i.e. the itrace 'q' option.  That wasn't happening, so
      restructure the logic so that FUP events are added along with appropriate
      'instruction' and 'branch' events.
      
      Fixes: 7c1b16ba ("perf intel-pt: Add support for decoding FUP/TIP only")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org # v5.15+
      Link: https://lore.kernel.org/r/20211210162303.2288710-7-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a882cc94
    • Adrian Hunter's avatar
      perf intel-pt: Fix next 'err' value, walking trace · a32e6c5d
      Adrian Hunter authored
      Code after label 'next:' in intel_pt_walk_trace() assumes 'err' is zero,
      but it may not be, if arrived at via a 'goto'. Ensure it is zero.
      
      Fixes: 7c1b16ba ("perf intel-pt: Add support for decoding FUP/TIP only")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org # v5.15+
      Link: https://lore.kernel.org/r/20211210162303.2288710-6-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a32e6c5d
    • Adrian Hunter's avatar
      perf intel-pt: Fix state setting when receiving overflow (OVF) packet · c79ee2b2
      Adrian Hunter authored
      An overflow (OVF packet) is treated as an error because it represents a
      loss of trace data, but there is no loss of synchronization, so the packet
      state should be INTEL_PT_STATE_IN_SYNC not INTEL_PT_STATE_ERR_RESYNC.
      
      To support that, some additional variables must be reset, and the FUP
      packet that may follow OVF is treated as an FUP event.
      
      Fixes: f4aa0819 ("perf tools: Add Intel PT decoder")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org # v5.15+
      Link: https://lore.kernel.org/r/20211210162303.2288710-5-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c79ee2b2