1. 11 Apr, 2024 10 commits
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ab4319fd
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "The most important fix is the sg one because the regression it fixes
        (spurious warning and use after final put) is already backported to
        stable.
      
        The next biggest impact is the target fix for wrong credentials used
        to load a module because it's affecting new kernels installed on
        selinux based distributions.
      
        The other three fixes are an obvious off by one and SATA protocol
        issues"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix off by one in qla_edif_app_getstats()
        scsi: hisi_sas: Modify the deadline for ata_wait_after_reset()
        scsi: hisi_sas: Handle the NCQ error returned by D2H frame
        scsi: target: Fix SELinux error when systemd-modules loads the target module
        scsi: sg: Avoid race in error handling & drop bogus warn
      ab4319fd
    • Linus Torvalds's avatar
      Merge tag 'loongarch-fixes-6.9-1' of... · 5de6b467
      Linus Torvalds authored
      Merge tag 'loongarch-fixes-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
      
      Pull LoongArch fixes from Huacai Chen:
      
       - make {virt, phys, page, pfn} translation work with KFENCE for
         LoongArch (otherwise NVMe and virtio-blk cannot work with KFENCE
         enabled)
      
       - update dts files for Loongson-2K series to make devices work
         correctly
      
       - fix a build error
      
      * tag 'loongarch-fixes-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
        LoongArch: Include linux/sizes.h in addrspace.h to prevent build errors
        LoongArch: Update dts for Loongson-2K2000 to support GMAC/GNET
        LoongArch: Update dts for Loongson-2K2000 to support PCI-MSI
        LoongArch: Update dts for Loongson-2K2000 to support ISA/LPC
        LoongArch: Update dts for Loongson-2K1000 to support ISA/LPC
        LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE
        LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE
        mm: Move lowmem_page_address() a little later
      5de6b467
    • Linus Torvalds's avatar
      Merge tag 'bcachefs-2024-04-10' of https://evilpiepirate.org/git/bcachefs · e1dc191d
      Linus Torvalds authored
      Pull more bcachefs fixes from Kent Overstreet:
       "Notable user impacting bugs
      
         - On multi device filesystems, recovery was looping in
           btree_trans_too_many_iters(). This checks if a transaction has
           touched too many btree paths (because of iteration over many keys),
           and isuses a restart to drop unneeded paths.
      
           But it's now possible for some paths to exceed the previous limit
           without iteration in the interior btree update path, since the
           transaction commit will do alloc updates for every old and new
           btree node, and during journal replay we don't use the btree write
           buffer for locking reasons and thus those updates use btree paths
           when they wouldn't normally.
      
         - Fix a corner case in rebalance when moving extents on a
           durability=0 device. This wouldn't be hit when a device was
           formatted with durability=0 since in that case we'll only use it as
           a write through cache (only cached extents will live on it), but
           durability can now be changed on an existing device.
      
         - bch2_get_acl() could rarely forget to handle a transaction restart;
           this manifested as the occasional missing acl that came back after
           dropping caches.
      
         - Fix a major performance regression on high iops multithreaded write
           workloads (only since 6.9-rc1); a previous fix for a deadlock in
           the interior btree update path to check the journal watermark
           introduced a dependency on the state of btree write buffer flushing
           that we didn't want.
      
         - Assorted other repair paths and recovery fixes"
      
      * tag 'bcachefs-2024-04-10' of https://evilpiepirate.org/git/bcachefs: (25 commits)
        bcachefs: Fix __bch2_btree_and_journal_iter_init_node_iter()
        bcachefs: Kill read lock dropping in bch2_btree_node_lock_write_nofail()
        bcachefs: Fix a race in btree_update_nodes_written()
        bcachefs: btree_node_scan: Respect member.data_allowed
        bcachefs: Don't scan for btree nodes when we can reconstruct
        bcachefs: Fix check_topology() when using node scan
        bcachefs: fix eytzinger0_find_gt()
        bcachefs: fix bch2_get_acl() transaction restart handling
        bcachefs: fix the count of nr_freed_pcpu after changing bc->freed_nonpcpu list
        bcachefs: Fix gap buffer bug in bch2_journal_key_insert_take()
        bcachefs: Rename struct field swap to prevent macro naming collision
        MAINTAINERS: Add entry for bcachefs documentation
        Documentation: filesystems: Add bcachefs toctree
        bcachefs: JOURNAL_SPACE_LOW
        bcachefs: Disable errors=panic for BCH_IOCTL_FSCK_OFFLINE
        bcachefs: Fix BCH_IOCTL_FSCK_OFFLINE for encrypted filesystems
        bcachefs: fix rand_delete unit test
        bcachefs: fix ! vs ~ typo in __clear_bit_le64()
        bcachefs: Fix rebalance from durability=0 device
        bcachefs: Print shutdown journal sequence number
        ...
      e1dc191d
    • Linus Torvalds's avatar
      Merge tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of... · 346668f0
      Linus Torvalds authored
      Merge tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
      
      Pull chrome platform fix from Tzung-Bi Shih:
       "Fix a NULL pointer dereference"
      
      * tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
        platform/chrome: cros_ec_uart: properly fix race condition
      346668f0
    • Linus Torvalds's avatar
      Merge tag 'probes-fixes-v6.9-rc3' of... · e8c39d0f
      Linus Torvalds authored
      Merge tag 'probes-fixes-v6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull probes fixes from Masami Hiramatsu:
       "Fix possible use-after-free issue on kprobe registration.
      
        check_kprobe_address_safe() uses `is_module_text_address()` and
        `__module_text_address()` separately.
      
        As a result, if the probed address is in a module that is being
        unloaded, the first `is_module_text_address()` might return true but
        then the `__module_text_address()` call might return NULL if the
        module has been unloaded between the two.
      
        The result is that kprobe believes the probe is on the kernel text,
        and skips getting a module reference. In this case, when it arms a
        breakpoint on the probe address, it may cause a use-after-free.
      
        To fix this issue, only use `__module_text_address()` once and get a
        reference to the module then. If it fails, reject the probe"
      
      * tag 'probes-fixes-v6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        kprobes: Fix possible use-after-free issue on kprobe registration
      e8c39d0f
    • Linus Torvalds's avatar
      Merge tag 'bootconfig-fixes-v6.9-rc3' of... · 03a55b63
      Linus Torvalds authored
      Merge tag 'bootconfig-fixes-v6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull bootconfig fixes from Masami Hiramatsu:
      
       - show the original cmdline only once, and only if it was modeified by
         bootconfig
      
      * tag 'bootconfig-fixes-v6.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        fs/proc: Skip bootloader comment if no embedded kernel parameters
        fs/proc: remove redundant comments from /proc/bootconfig
      03a55b63
    • Kent Overstreet's avatar
      bcachefs: Fix __bch2_btree_and_journal_iter_init_node_iter() · 1189bdda
      Kent Overstreet authored
      We weren't respecting trans->journal_replay_not_finished - we shouldn't
      be searching the journal keys unless we have a ref on them.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      1189bdda
    • Kent Overstreet's avatar
      bcachefs: Kill read lock dropping in bch2_btree_node_lock_write_nofail() · 517236cb
      Kent Overstreet authored
      dropping read locks in bch2_btree_node_lock_write_nofail() dates from
      before we had the cycle detector; we can now tell the cycle detector
      directly when taking a lock may not fail because we can't handle
      transaction restarts.
      
      This is needed for adding should_be_locked asserts.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      517236cb
    • Kent Overstreet's avatar
      bcachefs: Fix a race in btree_update_nodes_written() · beccf291
      Kent Overstreet authored
      One btree update might have terminated in a node update, and then while
      it is in flight another btree update might free that original node.
      
      This race has to be handled in btree_update_nodes_written() - we were
      missing a READ_ONCE().
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      beccf291
    • Noah Loomans's avatar
      platform/chrome: cros_ec_uart: properly fix race condition · 5e700b38
      Noah Loomans authored
      The cros_ec_uart_probe() function calls devm_serdev_device_open() before
      it calls serdev_device_set_client_ops(). This can trigger a NULL pointer
      dereference:
      
          BUG: kernel NULL pointer dereference, address: 0000000000000000
          ...
          Call Trace:
           <TASK>
           ...
           ? ttyport_receive_buf
      
      A simplified version of crashing code is as follows:
      
          static inline size_t serdev_controller_receive_buf(struct serdev_controller *ctrl,
                                                            const u8 *data,
                                                            size_t count)
          {
                  struct serdev_device *serdev = ctrl->serdev;
      
                  if (!serdev || !serdev->ops->receive_buf) // CRASH!
                      return 0;
      
                  return serdev->ops->receive_buf(serdev, data, count);
          }
      
      It assumes that if SERPORT_ACTIVE is set and serdev exists, serdev->ops
      will also exist. This conflicts with the existing cros_ec_uart_probe()
      logic, as it first calls devm_serdev_device_open() (which sets
      SERPORT_ACTIVE), and only later sets serdev->ops via
      serdev_device_set_client_ops().
      
      Commit 01f95d42 ("platform/chrome: cros_ec_uart: fix race
      condition") attempted to fix a similar race condition, but while doing
      so, made the window of error for this race condition to happen much
      wider.
      
      Attempt to fix the race condition again, making sure we fully setup
      before calling devm_serdev_device_open().
      
      Fixes: 01f95d42 ("platform/chrome: cros_ec_uart: fix race condition")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNoah Loomans <noah@noahloomans.com>
      Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
      Link: https://lore.kernel.org/r/20240410182618.169042-2-noah@noahloomans.comSigned-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
      5e700b38
  2. 10 Apr, 2024 17 commits
    • Linus Torvalds's avatar
      Merge tag 'media/v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 9875c0be
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
      
       - some fixes for mediatec vcodec encoder/decoder oopses
      
      * tag 'media/v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        media: mediatek: vcodec: support 36 bits physical address
        media: mediatek: vcodec: adding lock to protect encoder context list
        media: mediatek: vcodec: adding lock to protect decoder context list
        media: mediatek: vcodec: Fix oops when HEVC init fails
        media: mediatek: vcodec: Handle VP9 superframe bitstream with 8 sub-frames
      9875c0be
    • Linus Torvalds's avatar
      Merge tag 'hardening-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · fe5b5ef8
      Linus Torvalds authored
      Pull hardening fixes from Kees Cook:
      
       - gcc-plugins/stackleak: Avoid .head.text section (Ard Biesheuvel)
      
       - ubsan: fix unused variable warning in test module (Arnd Bergmann)
      
       - Improve entropy diffusion in randomize_kstack
      
      * tag 'hardening-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        randomize_kstack: Improve entropy diffusion
        ubsan: fix unused variable warning in test module
        gcc-plugins/stackleak: Avoid .head.text section
      fe5b5ef8
    • Linus Torvalds's avatar
      Merge tag 'turbostat-2024.04.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · a6189a74
      Linus Torvalds authored
      Pull turbostat updates from Len Brown:
      
       - Use of the CPU MSR driver is now optional
      
       - Perf is now preferred for many counters
      
       - Non-root users can now execute turbostat, though with limited
         functionality
      
       - Add counters for some new GFX hardware
      
       - Minor fixes
      
      * tag 'turbostat-2024.04.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (26 commits)
        tools/power turbostat: v2024.04.10
        tools/power/turbostat: Add support for Xe sysfs knobs
        tools/power/turbostat: Add support for new i915 sysfs knobs
        tools/power/turbostat: Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz
        tools/power/turbostat: Fix uncore frequency file string
        tools/power/turbostat: Unify graphics sysfs snapshots
        tools/power/turbostat: Cache graphics sysfs path
        tools/power/turbostat: Enable MSR_CORE_C1_RES support for ICX
        tools/power turbostat: Add selftests
        tools/power turbostat: read RAPL counters via perf
        tools/power turbostat: Add proper re-initialization for perf file descriptors
        tools/power turbostat: Clear added counters when in no-msr mode
        tools/power turbostat: add early exits for permission checks
        tools/power turbostat: detect and disable unavailable BICs at runtime
        tools/power turbostat: Add reading aperf and mperf via perf API
        tools/power turbostat: Add --no-perf option
        tools/power turbostat: Add --no-msr option
        tools/power turbostat: enhance -D (debug counter dump) output
        tools/power turbostat: Fix warning upon failed /dev/cpu_dma_latency read
        tools/power turbostat: Read base_hz and bclk from CPUID.16H if available
        ...
      a6189a74
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.9-2' of... · 3679d9d1
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Ilpo Järvinen:
       "Fixes:
      
         - intel/hid: Solve spurious hibernation aborts (power button release)
      
         - toshiba_acpi: Ignore 2 keys to avoid log noise during
           suspend/resume
      
         - intel-vbtn: Fix probe by restoring VBDL and VGBS evalutation order
      
         - lg-laptop: Fix W=1 %s null argument warning
      
        New HW Support:
      
         - acer-wmi: PH18-71 mode button and fan speed sensor
      
         - intel/hid: Lunar Lake and Arrow Lake HID IDs"
      
      * tag 'platform-drivers-x86-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: lg-laptop: fix %s null argument warning
        platform/x86: intel-vbtn: Update tablet mode switch at end of probe
        platform/x86: intel-vbtn: Use acpi_has_method to check for switch
        platform/x86: toshiba_acpi: Silence logging for some events
        platform/x86/intel/hid: Add Lunar Lake and Arrow Lake support
        platform/x86/intel/hid: Don't wake on 5-button releases
        platform/x86: acer-wmi: Add support for Acer PH18-71
      3679d9d1
    • Zheng Yejian's avatar
      kprobes: Fix possible use-after-free issue on kprobe registration · 325f3fb5
      Zheng Yejian authored
      When unloading a module, its state is changing MODULE_STATE_LIVE ->
       MODULE_STATE_GOING -> MODULE_STATE_UNFORMED. Each change will take
      a time. `is_module_text_address()` and `__module_text_address()`
      works with MODULE_STATE_LIVE and MODULE_STATE_GOING.
      If we use `is_module_text_address()` and `__module_text_address()`
      separately, there is a chance that the first one is succeeded but the
      next one is failed because module->state becomes MODULE_STATE_UNFORMED
      between those operations.
      
      In `check_kprobe_address_safe()`, if the second `__module_text_address()`
      is failed, that is ignored because it expected a kernel_text address.
      But it may have failed simply because module->state has been changed
      to MODULE_STATE_UNFORMED. In this case, arm_kprobe() will try to modify
      non-exist module text address (use-after-free).
      
      To fix this problem, we should not use separated `is_module_text_address()`
      and `__module_text_address()`, but use only `__module_text_address()`
      once and do `try_module_get(module)` which is only available with
      MODULE_STATE_LIVE.
      
      Link: https://lore.kernel.org/all/20240410015802.265220-1-zhengyejian1@huawei.com/
      
      Fixes: 28f6c37a ("kprobes: Forbid probing on trampoline and BPF code areas")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
      Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      325f3fb5
    • Randy Dunlap's avatar
      LoongArch: Include linux/sizes.h in addrspace.h to prevent build errors · a07c772f
      Randy Dunlap authored
      LoongArch's include/asm/addrspace.h uses SZ_32M and SZ_16K, so add
      <linux/sizes.h> to provide those macros to prevent build errors:
      
      In file included from ../arch/loongarch/include/asm/io.h:11,
                       from ../include/linux/io.h:13,
                       from ../include/linux/io-64-nonatomic-lo-hi.h:5,
                       from ../drivers/cxl/pci.c:4:
      ../include/asm-generic/io.h: In function 'ioport_map':
      ../arch/loongarch/include/asm/addrspace.h:124:25: error: 'SZ_32M' undeclared (first use in this function); did you mean 'PS_32M'?
        124 | #define PCI_IOSIZE      SZ_32M
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      a07c772f
    • Huacai Chen's avatar
      LoongArch: Update dts for Loongson-2K2000 to support GMAC/GNET · 3744e0ee
      Huacai Chen authored
      Current dts file for Loongson-2K2000's GMAC/GNET is incomplete, both irq
      and phy descriptions are missing. Add them to make GMAC/GNET work.
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      3744e0ee
    • Huacai Chen's avatar
      LoongArch: Update dts for Loongson-2K2000 to support PCI-MSI · 84892ceb
      Huacai Chen authored
      Current dts file for Loongson-2K2000 misses the interrupt-controller &
      interrupt-cells descriptions in the msi-controller node, and misses the
      msi-parent link in the pci root node. Add them to support PCI-MSI.
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      84892ceb
    • Huacai Chen's avatar
      LoongArch: Update dts for Loongson-2K2000 to support ISA/LPC · b07b9f35
      Huacai Chen authored
      Some Loongson-2K2000 platforms have ISA/LPC devices such as Super-IO,
      define an ISA node in the dts file to avoid access error. Also adjust
      the PCI io resource range to avoid confliction.
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      b07b9f35
    • Huacai Chen's avatar
      LoongArch: Update dts for Loongson-2K1000 to support ISA/LPC · ec2bbc57
      Huacai Chen authored
      Some Loongson-2K1000 platforms have ISA/LPC devices such as Super-IO,
      define an ISA node in the dts file to avoid access error.
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      ec2bbc57
    • Huacai Chen's avatar
      LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE · 1a629fe4
      Huacai Chen authored
      When enabling both CONFIG_KFENCE and CONFIG_DEBUG_SG, I get the
      following backtraces when running LongArch kernels.
      
      [    2.496257] kernel BUG at include/linux/scatterlist.h:187!
      ...
      [    2.501925] Call Trace:
      [    2.501950] [<9000000004ad59c4>] sg_init_one+0xac/0xc0
      [    2.502204] [<9000000004a438f8>] do_test_kpp+0x278/0x6e4
      [    2.502353] [<9000000004a43dd4>] alg_test_kpp+0x70/0xf4
      [    2.502494] [<9000000004a41b48>] alg_test+0x128/0x690
      [    2.502631] [<9000000004a3d898>] cryptomgr_test+0x20/0x40
      [    2.502775] [<90000000041b4508>] kthread+0x138/0x158
      [    2.502912] [<9000000004161c48>] ret_from_kernel_thread+0xc/0xa4
      
      The backtrace is always similar but not exactly the same. It is always
      triggered from cryptomgr_test, but not always from the same test.
      
      Analysis shows that with CONFIG_KFENCE active, the address returned from
      kmalloc() and friends is not always below vm_map_base. It is allocated
      by kfence_alloc() which at least sometimes seems to get its memory from
      an address space above vm_map_base. This causes __virt_addr_valid() to
      return false for the affected objects.
      
      Let __virt_addr_valid() return 1 for kfence pool addresses, this make
      virt_addr_valid()/__virt_addr_valid() work with KFENCE.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Suggested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      1a629fe4
    • Huacai Chen's avatar
      LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE · 0ca84aea
      Huacai Chen authored
      KFENCE changes virt_to_page() to be able to translate tlb mapped virtual
      addresses, but forget to change virt_to_phys()/phys_to_virt() and other
      translation functions as well. This patch fix it, otherwise some drivers
      (such as nvme and virtio-blk) cannot work with KFENCE.
      
      All {virt, phys, page, pfn} translation functions are updated:
      1, virt_to_pfn()/pfn_to_virt();
      2, virt_to_page()/page_to_virt();
      3, virt_to_phys()/phys_to_virt().
      
      DMW/TLB mapped addresses are distinguished by comparing the vaddress
      with vm_map_base in virt_to_xyz(), and we define WANT_PAGE_VIRTUAL in
      the KFENCE case for the reverse translations, xyz_to_virt().
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      0ca84aea
    • Huacai Chen's avatar
      mm: Move lowmem_page_address() a little later · 0871bc01
      Huacai Chen authored
      LoongArch will override page_to_virt() which use page_address() in the
      KFENCE case (by defining WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL). So move
      lowmem_page_address() a little later to avoid such build errors:
      
      error: implicit declaration of function 'page_address'.
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
      0871bc01
    • Len Brown's avatar
      tools/power turbostat: v2024.04.10 · 3ab7296a
      Len Brown authored
      Much of turbostat can now run with perf, rather than using the MSR driver
      
      Some of turbostat can now run as a regular non-root user.
      
      Add some new output columns for some new GFX hardware.
      
      [This patch updates the version, but otherwise changes no function;
       it touches up some checkpatch issues from previous patches]
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      3ab7296a
    • Zhang Rui's avatar
      tools/power/turbostat: Add support for Xe sysfs knobs · 91a91d38
      Zhang Rui authored
      Xe graphics driver uses different graphics sysfs knobs including
         /sys/class/drm/card0/device/tile0/gt0/gtidle/idle_residency_ms
         /sys/class/drm/card0/device/tile0/gt0/freq0/cur_freq
         /sys/class/drm/card0/device/tile0/gt0/freq0/act_freq
         /sys/class/drm/card0/device/tile0/gt1/gtidle/idle_residency_ms
         /sys/class/drm/card0/device/tile0/gt1/freq0/cur_freq
         /sys/class/drm/card0/device/tile0/gt1/freq0/act_freq
      
      Plus that,
         /sys/class/drm/card0/device/tile0/gt<n>/gtidle/name
      returns either gt<n>-rc or gt<n>-mc. rc is for GFX and mc is SA Media.
      
      Enhance turbostat to prefer the Xe sysfs knobs when they are available.
      Export gt<n>-rc via BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz.
      Export gt<n>-mc via BIC_SMA_mc6/BIC_SMAMHz/BIC_SMAACTMHz.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      91a91d38
    • Zhang Rui's avatar
      tools/power/turbostat: Add support for new i915 sysfs knobs · dc02dc93
      Zhang Rui authored
      On Meteorlake platform, i915 driver supports the traditional graphics
      sysfs knobs including
         /sys/class/drm/card0/power/rc6_residency_ms
         /sys/class/drm/card0/gt_cur_freq_mhz
         /sys/class/drm/card0/gt_act_freq_mhz
      
      At the same time, it also supports
         /sys/class/drm/card0/gt/gt0/rc6_residency_ms
         /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz
         /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz
         /sys/class/drm/card0/gt/gt1/rc6_residency_ms
         /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz
         /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz
      gt0 is for GFX and gt1 is for SA Media.
      
      Enhance turbostat to prefer the i915 new sysfs knobs.
      Export gt0 via BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz.
      Export gt1 via BIC_SMA_mc6/BIC_SMAMHz/BIC_SMAACTMHz.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      dc02dc93
    • Zhang Rui's avatar
      tools/power/turbostat: Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz · 3bbb331c
      Zhang Rui authored
      Graphics driver (i915/Xe) on mordern platforms splits GFX and SA Media
      information via different sysfs knobs.
      
      Existing BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz columns can be reused for
      GFX.
      
      Introduce BIC_SAM_mc6/BIC_SAMMHz/BIC_SAMACTMHz columns for SA Media.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      3bbb331c
  3. 09 Apr, 2024 13 commits