GKI (arm64) relevant 69 out of 278 changes, affecting 88 files +585/-2900b603e7759tracing: Add __print_dynamic_array() helper [3 files, +15/-1]0312735402tracing: Verify event formats that have "%*p.." [2 files, +13/-2]1c9798bf81mm/vmscan: don't try to reclaim hwpoison folio [1 file, +7/-0]db3b3964afPM: EM: use kfree_rcu() to simplify the code [1 file, +1/-9]9d5752b853PM: EM: Address RCU-related sparse warnings [2 files, +26/-25]3e12e8c273block: remove the write_hint field from struct request [4 files, +13/-12]ed7535b141block: remove the ioprio field from struct request [4 files, +11/-15]2afa5ea7c4block: make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone [1 file, +1/-0]46d3575209PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends [1 file, +6/-12]35ba7b2d4dPCI/MSI: Add an option to write MSIX ENTRY_DATA before any reads [2 files, +5/-0]16c8aa5de1dma/contiguous: avoid warning about unused size_bytes [1 file, +1/-2]7ccfadfb25cpufreq: scmi: Fix null-ptr-deref in scmi_cpufreq_get_rate() [1 file, +8/-2]28fbd7b13bcpufreq: scpi: Fix null-ptr-deref in scpi_cpufreq_get_rate() [1 file, +10/-3]7d002f5914scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort() [1 file, +5/-7]5d92e582d1cgroup/cpuset-v1: Add missing support for cpuset_v2_mode [1 file, +29/-0]29daa63f2cscsi: core: Clear flags for scsi_cmnd that did not complete [1 file, +5/-1]eeab661803scsi: ufs: core: Add NULL check in ufshcd_mcq_compl_pending_transfer() [1 file, +2/-0]41143e7105net: phy: leds: fix memory leak [1 file, +13/-10]0ceef62a32tipc: fix NULL pointer dereference in tipc_mon_reinit_self() [1 file, +2/-1]a61afd5482fix a couple of races in MNT_TREE_BENEATH handling by do_move_mount() [1 file, +36/-33]7f24ea6a46block: never reduce ra_pages in blk_apply_bdi_limits [1 file, +7/-1]3decda1a3csplice: remove duplicate noinline from pipe_clear_nowait [1 file, +1/-1]30c0d6e778virtio_console: fix missing byte order handling for cols and rows [1 file, +4/-3]c2a6b4d78cnet: selftests: initialize TCP header and skb payload with zero [1 file, +13/-5]3939d6f29dirqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode() [1 file, +1/-1]7a8a6b627fio_uring: fix 'sync' handling of io_fallback_tw() [1 file, +7/-6]1f439fe4d8scsi: Improve CDL control [1 file, +24/-12]3670dee376char: misc: register chrdev region with all possible minors [1 file, +1/-1]ea0d806b94USB: serial: ftdi_sio: add support for Abacus Electrics Optical Probe [2 files, +7/-0]1777714865xhci: Limit time spent with xHC interrupts disabled during bus resume [3 files, +20/-16]bce3055b08usb: xhci: Fix invalid pointer dereference in Etron workaround [1 file, +1/-1]52a7c9d930usb: dwc3: gadget: check that event count does not exceed event buffer length [1 file, +6/-0]9924ee1bcdusb: quirks: add DELAY_INIT quirk for Silicon Motion Flash Drive [1 file, +3/-0]d85b7af3bdusb: quirks: Add delay init quirk for SanDisk 3.2Gen1 Flash Drive [1 file, +3/-0]3e52ae347eUSB: VLI disk crashes if LPM is used [1 file, +3/-0]0486de3c1bcrypto: null - Use spin lock instead of mutex [1 file, +26/-13]7758e308aebpf: Fix kmemleak warning for percpu hashmap [1 file, +3/-3]c5c833f637bpf: Fix deadlock between rcu_tasks_trace and event_mutex. [1 file, +4/-3]4139072087clk: check for disabled clock-provider in of_clk_get_hw_from_clkspec() [1 file, +4/-0]4131411f42bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage [1 file, +6/-5]b817d2bfd6bpf: Reject attaching fexit/fmod_ret to __noreturn functions [1 file, +32/-0]2ecae00138usb: dwc3: gadget: Refactor loop to avoid NULL endpoints [1 file, +18/-4]cbfa55bda1usb: xhci: Complete 'error mid TD' transfers when handling Missed Service [1 file, +5/-1]16a7a8e6c4usb: xhci: Fix isochronous Ring Underrun/Overrun event handling [1 file, +14/-6]635be13606xhci: Handle spurious events on Etron host isoc enpoints [2 files, +27/-13]9ff59cb815usb: xhci: Avoid Stop Endpoint retry loop if the endpoint seems Running [1 file, +7/-4]0485bdf88fobjtool, panic: Disable SMAP in __stack_chk_fail() [2 files, +10/-1]c548f956889p/net: fix improper handling of bogus negative read/write replies [1 file, +16/-14]18296b59519p/trans_fd: mark concurrent read and writes to p9_conn->err [1 file, +10/-7]3568fd9e44io_uring: always do atomic put from iowq [2 files, +8/-1]90dc6c1e3bperf/core: Fix WARN_ON(!ctx) in __free_event() for partial init [1 file, +3/-3]24ede35eb2nvme: requeue namespace scan on missed AENs [1 file, +4/-0]b9c89c97d7nvme: re-read ANA log page after ns scan completes [1 file, +5/-0]ee5521176anvme: multipath: fix return value of nvme_available_path [1 file, +1/-1]5e58b93a12gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment [1 file, +3/-3]9f8eeac3a6timekeeping: Add a lockdep override in tick_freeze() [1 file, +22/-0]b14d986413iommu: Clear iommu-dma ops on cleanup [1 file, +3/-0]b626bc3c1dext4: make block validity check resistent to sb bh corruption [2 files, +6/-6]2ef6eea2efnetfs: Only create /proc/fs/netfs with CONFIG_PROC_FS [1 file, +4/-0]d53b2d49a8iomap: skip unnecessary ifs_block_is_uptodate check [1 file, +1/-1]bfc66c4c28Revert "drivers: core: synchronize really_probe() and dev_uevent()" [1 file, +0/-3]de7c24febdusb: typec: class: Fix NULL pointer access [2 files, +14/-2]45314999f9ext4: goto right label 'out_mmap_sem' in ext4_setattr() [1 file, +1/-1]40966fc993usb: typec: class: Invalidate USB device pointers on partner unregistration [1 file, +6/-2]4833d0a92biommu: Handle race with default domain setup [1 file, +5/-0]1042d22942nvme: fixup scan failure for non-ANA multipath controllers [1 file, +1/-1]1b7647efadusb: xhci: Fix Short Packet handling rework ignoring errors [1 file, +1/-1]ab5281d21eusb: typec: class: Unlocked on error in typec_register_partner() [1 file, +1/-0]6b9ebcbd31mq-deadline: don't call req_get_ioprio from the I/O completion handler [1 file, +4/-9] Changes in 6.12.26 module: sign with sha512 instead of sha1 by default tracing: Add __print_dynamic_array() helper tracing: Verify event formats that have "%*p.." mm/vmscan: don't try to reclaim hwpoison folio soc: qcom: ice: introduce devm_of_qcom_ice_get mmc: sdhci-msm: fix dev reference leaked through of_qcom_ice_get PM: EM: use kfree_rcu() to simplify the code PM: EM: Address RCU-related sparse warnings media: i2c: imx214: Use subdev active state media: i2c: imx214: Simplify with dev_err_probe() media: i2c: imx214: Convert to CCI register access helpers media: i2c: imx214: Replace register addresses with macros media: i2c: imx214: Check number of lanes from device tree media: i2c: imx214: Fix link frequency validation media: ov08x40: Move ov08x40_identify_module() function up media: ov08x40: Add missing ov08x40_identify_module() call on stream-start block: remove the write_hint field from struct request block: remove the ioprio field from struct request block: make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone net: dsa: mv88e6xxx: fix VTU methods for 6320 family iio: adc: ad7768-1: Move setting of val a bit later to avoid unnecessary return value check iio: adc: ad7768-1: Fix conversion result sign arm64: dts: ti: Refactor J784s4 SoC files to a common file arm64: dts: ti: k3-j784s4-j742s2-main-common: Fix serdes_ln_ctrl reg-masks of: resolver: Simplify of_resolve_phandles() using __free() of: resolver: Fix device node refcount leakage in of_resolve_phandles() scsi: ufs: qcom: fix dev reference leaked through of_qcom_ice_get PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends PCI/MSI: Add an option to write MSIX ENTRY_DATA before any reads accel/ivpu: Add auto selection logic for job scheduler accel/ivpu: Fix the NPU's DPU frequency calculation ksmbd: use __GFP_RETRY_MAYFAIL ksmbd: add netdev-up/down event debug print ksmbd: browse interfaces list on FSCTL_QUERY_INTERFACE_INFO IOCTL ksmbd: fix use-after-free in __smb2_lease_break_noti() scsi: ufs: exynos: Remove empty drv_init method scsi: ufs: exynos: Remove superfluous function parameter scsi: ufs: exynos: Add gs101_ufs_drv_init() hook and enable WriteBooster scsi: ufs: exynos: Move UFS shareability value to drvdata scsi: ufs: exynos: Disable iocc if dma-coherent property isn't set net/niu: Niu requires MSIX ENTRY_DATA fields touch before entry reads drm/xe/bmg: Add one additional PCI ID drm/amd/display: Fix unnecessary cast warnings from checkpatch drm/amd/display/dml2: use vzalloc rather than kzalloc lib/Kconfig.ubsan: Remove 'default UBSAN' from UBSAN_INTEGER_WRAP ceph: Fix incorrect flush end position calculation cpufreq: sun50i: prevent out-of-bounds access dma/contiguous: avoid warning about unused size_bytes cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate() cpufreq: scmi: Fix null-ptr-deref in scmi_cpufreq_get_rate() cpufreq: scpi: Fix null-ptr-deref in scpi_cpufreq_get_rate() scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort() cpufreq: cppc: Fix invalid return value in .get() callback cpufreq: Do not enable by default during compile testing cpufreq: fix compile-test defaults btrfs: avoid page_lockend underflow in btrfs_punch_hole_lock_range() btrfs: zoned: return EIO on RAID1 block group write pointer mismatch cgroup/cpuset-v1: Add missing support for cpuset_v2_mode vhost-scsi: Add better resource allocation failure handling vhost-scsi: Fix vhost_scsi_send_bad_target() vhost-scsi: Fix vhost_scsi_send_status() net/mlx5: Fix null-ptr-deref in mlx5_create_{inner_,}ttc_table() net/mlx5: Move ttc allocation after switch case to prevent leaks scsi: core: Clear flags for scsi_cmnd that did not complete scsi: ufs: core: Add NULL check in ufshcd_mcq_compl_pending_transfer() net: lwtunnel: disable BHs when required net: phy: leds: fix memory leak tipc: fix NULL pointer dereference in tipc_mon_reinit_self() net: ethernet: mtk_eth_soc: net: revise NETSYSv3 hardware configuration fix a couple of races in MNT_TREE_BENEATH handling by do_move_mount() net_sched: hfsc: Fix a UAF vulnerability in class handling net_sched: hfsc: Fix a potential UAF in hfsc_dequeue() too net: dsa: mt7530: sync driver-specific behavior of MT7531 variants pds_core: Prevent possible adminq overflow/stuck condition pds_core: handle unsupported PDS_CORE_CMD_FW_CONTROL result pds_core: Remove unnecessary check in pds_client_adminq_cmd() pds_core: make wait_context part of q_info block: never reduce ra_pages in blk_apply_bdi_limits iommu/amd: Return an error if vCPU affinity is set for non-vCPU IRTE riscv: Replace function-like macro by static inline function riscv: uprobes: Add missing fence.i after building the XOL buffer splice: remove duplicate noinline from pipe_clear_nowait bpf: Add namespace to BPF internal symbols perf/x86: Fix non-sampling (counting) events on certain x86 platforms LoongArch: Select ARCH_USE_MEMTEST LoongArch: Make regs_irqs_disabled() more clear LoongArch: Make do_xyz() exception handlers more robust KVM: SVM: Disable AVIC on SNP-enabled system without HvInUseWrAllowed feature netfilter: fib: avoid lookup if socket is available virtio_console: fix missing byte order handling for cols and rows sched_ext: Use kvzalloc for large exit_dump allocation crypto: atmel-sha204a - Set hwrng quality to lowest possible xen-netfront: handle NULL returned by xdp_convert_buff_to_frame() net: selftests: initialize TCP header and skb payload with zero net: phy: microchip: force IRQ polling mode for lan88xx scsi: mpi3mr: Fix pending I/O counter rust: firmware: Use `ffi::c_char` type in `FwFunc` drm: panel: jd9365da: fix reset signal polarity in unprepare drm/amd/display: Fix gpu reset in multidisplay config drm/amd/display: Force full update in gpu reset x86/insn: Fix CTEST instruction decoding irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode() LoongArch: Handle fp, lsx, lasx and lbt assembly symbols LoongArch: Return NULL from huge_pte_offset() for invalid PMD LoongArch: Remove a bogus reference to ZONE_DMA LoongArch: KVM: Fully clear some CSRs when VM reboot LoongArch: KVM: Fix PMU pass-through issue if VM exits to host finally io_uring: fix 'sync' handling of io_fallback_tw() KVM: SVM: Allocate IR data using atomic allocation cxl/core/regs.c: Skip Memory Space Enable check for RCD and RCH Ports mcb: fix a double free bug in chameleon_parse_gdd() ata: libata-scsi: Improve CDL control ata: libata-scsi: Fix ata_mselect_control_ata_feature() return type ata: libata-scsi: Fix ata_msense_control_ata_feature() USB: storage: quirk for ADATA Portable HDD CH94 scsi: Improve CDL control mei: me: add panther lake H DID mei: vsc: Fix fortify-panic caused by invalid counted_by() use KVM: x86: Explicitly treat routing entry type changes as changes KVM: x86: Reset IRTE to host control if *new* route isn't postable KVM: x86: Take irqfds.lock when adding/deleting IRQ bypass producer char: misc: register chrdev region with all possible minors misc: microchip: pci1xxxx: Fix Kernel panic during IRQ handler registration misc: microchip: pci1xxxx: Fix incorrect IRQ status handling during ack firmware: stratix10-svc: Add of_platform_default_populate() tty: Require CAP_SYS_ADMIN for all usages of TIOCL_SELMOUSEREPORT serial: msm: Configure correct working mode before starting earlycon serial: sifive: lock port in startup()/shutdown() callbacks USB: serial: ftdi_sio: add support for Abacus Electrics Optical Probe USB: serial: option: add Sierra Wireless EM9291 USB: serial: simple: add OWON HDS200 series oscilloscope support xhci: Limit time spent with xHC interrupts disabled during bus resume usb: xhci: Fix invalid pointer dereference in Etron workaround usb: cdns3: Fix deadlock when using NCM gadget usb: chipidea: ci_hdrc_imx: fix usbmisc handling usb: chipidea: ci_hdrc_imx: fix call balance of regulator routines usb: chipidea: ci_hdrc_imx: implement usb_phy_init() error handling USB: OHCI: Add quirk for LS7A OHCI controller (rev 0x02) usb: dwc3: gadget: check that event count does not exceed event buffer length usb: dwc3: xilinx: Prevent spike in reset signal usb: quirks: add DELAY_INIT quirk for Silicon Motion Flash Drive usb: quirks: Add delay init quirk for SanDisk 3.2Gen1 Flash Drive USB: VLI disk crashes if LPM is used USB: wdm: handle IO errors in wdm_wwan_port_start USB: wdm: close race between wdm_open and wdm_wwan_port_stop USB: wdm: wdm_wwan_port_tx_complete mutex in atomic context USB: wdm: add annotation selftests/bpf: Fix stdout race condition in traffic monitor pinctrl: renesas: rza2: Fix potential NULL pointer dereference pinctrl: mcp23s08: Get rid of spurious level interrupts MIPS: cm: Detect CM quirks from device tree crypto: ccp - Add support for PCI device 0x1134 crypto: lib/Kconfig - Fix lib built-in failure when arch is modular crypto: null - Use spin lock instead of mutex bpf: Fix kmemleak warning for percpu hashmap bpf: Fix deadlock between rcu_tasks_trace and event_mutex. clk: check for disabled clock-provider in of_clk_get_hw_from_clkspec() parisc: PDT: Fix missing prototype warning s390/sclp: Add check for get_zeroed_page() s390/tty: Fix a potential memory leak bug bpf: bpftool: Setting error code in do_loader() bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage bpf: Reject attaching fexit/fmod_ret to __noreturn functions mailbox: pcc: Fix the possible race in updation of chan_in_use flag mailbox: pcc: Always clear the platform ack interrupt first usb: host: max3421-hcd: Add missing spi_device_id table fs/ntfs3: Keep write operations atomic fs/ntfs3: Fix WARNING in ntfs_extend_initialized_size usb: dwc3: gadget: Refactor loop to avoid NULL endpoints usb: dwc3: gadget: Avoid using reserved endpoints on Intel Merrifield sound/virtio: Fix cancel_sync warnings on uninitialized work_structs usb: xhci: Complete 'error mid TD' transfers when handling Missed Service usb: xhci: Fix isochronous Ring Underrun/Overrun event handling xhci: Handle spurious events on Etron host isoc enpoints i3c: master: svc: Add support for Nuvoton npcm845 i3c dmaengine: dmatest: Fix dmatest waiting less when interrupted usb: xhci: Avoid Stop Endpoint retry loop if the endpoint seems Running phy: rockchip: usbdp: Avoid call hpd_event_trigger in dp_phy_init usb: gadget: aspeed: Add NULL pointer check in ast_vhub_init_dev() usb: host: xhci-plat: mvebu: use ->quirks instead of ->init_quirk() func thunderbolt: Scan retimers after device router has been enumerated um: work around sched_yield not yielding in time-travel mode objtool: Silence more KCOV warnings objtool, panic: Disable SMAP in __stack_chk_fail() objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() objtool, regulator: rk808: Remove potential undefined behavior in rk806_set_mode_dcdc() objtool, lkdtm: Obfuscate the do_nothing() pointer qibfs: fix _another_ leak ntb: reduce stack usage in idt_scan_mws ntb_hw_amd: Add NTB PCI ID for new gen CPU 9p/net: fix improper handling of bogus negative read/write replies 9p/trans_fd: mark concurrent read and writes to p9_conn->err rtc: pcf85063: do a SW reset if POR failed io_uring: always do atomic put from iowq kbuild: add dependency from vmlinux to sorttable sched/isolation: Make CONFIG_CPU_ISOLATION depend on CONFIG_SMP KVM: s390: Don't use %pK through tracepoints KVM: s390: Don't use %pK through debug printing cgroup/cpuset: Don't allow creation of local partition over a remote one selftests: ublk: fix test_stripe_04 perf/core: Fix WARN_ON(!ctx) in __free_event() for partial init xen: Change xen-acpi-processor dom0 dependency nvme: requeue namespace scan on missed AENs ACPI: EC: Set ec_no_wakeup for Lenovo Go S ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls drm/amdgpu: Increase KIQ invalidate_tlbs timeout drm/xe/xe3lpg: Apply Wa_14022293748, Wa_22019794406 nvme: re-read ANA log page after ns scan completes nvme: multipath: fix return value of nvme_available_path objtool: Stop UNRET validation on UD2 gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment x86/xen: disable CPU idle and frequency drivers for PVH dom0 selftests/mincore: Allow read-ahead pages to reach the end of the file x86/bugs: Use SBPB in write_ibpb() if applicable x86/bugs: Don't fill RSB on VMEXIT with eIBRS+retpoline x86/bugs: Don't fill RSB on context switch with eIBRS nvmet-fc: take tgtport reference only once nvmet-fc: put ref when assoc->del_work is already scheduled cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode timekeeping: Add a lockdep override in tick_freeze() cifs: Fix querying of WSL CHR and BLK reparse points over SMB1 iommu: Clear iommu-dma ops on cleanup ext4: make block validity check resistent to sb bh corruption scsi: hisi_sas: Fix I/O errors caused by hardware port ID changes scsi: ufs: exynos: Ensure pre_link() executes before exynos_ufs_phy_init() scsi: ufs: exynos: Enable PRDT pre-fetching with UFSHCD_CAP_CRYPTO scsi: ufs: exynos: Move phy calls to .exit() callback scsi: ufs: exynos: gs101: Put UFS device in reset on .suspend() scsi: pm80xx: Set phy_attached to zero when device is gone ASoC: fsl_asrc_dma: get codec or cpu dai from backend x86/i8253: Call clockevent_i8253_disable() with interrupts disabled netfs: Only create /proc/fs/netfs with CONFIG_PROC_FS iomap: skip unnecessary ifs_block_is_uptodate check riscv: Provide all alternative macros all the time ksmbd: fix WARNING "do not call blocking ops when !TASK_RUNNING" spi: tegra210-quad: use WARN_ON_ONCE instead of WARN_ON for timeouts spi: tegra210-quad: add rate limiting and simplify timeout error message ubsan: Fix panic from test_ubsan_out_of_bounds x86/cpu: Add CPU model number for Bartlett Lake CPUs with Raptor Cove cores md/raid1: Add check for missing source disk in process_checks() drm/amdgpu: use a dummy owner for sysfs triggered cleaner shaders v4 drm/amdgpu: Use the right function for hdp flush spi: spi-imx: Add check for spi_imx_setupxfer() Revert "drivers: core: synchronize really_probe() and dev_uevent()" driver core: introduce device_set_driver() helper driver core: fix potential NULL pointer dereference in dev_uevent() xfs: do not check NEEDSREPAIR if ro,norecovery mount. xfs: Do not allow norecovery mount with quotacheck xfs: rename xfs_iomap_swapfile_activate to xfs_vm_swap_activate xfs: flush inodegc before swapon selftests/bpf: fix bpf_map_redirect call for cpu map test selftests/bpf: make xdp_cpumap_attach keep redirect prog attached selftests/bpf: check program redirect in xdp_cpumap_attach selftests/bpf: Adjust data size to have ETH_HLEN usb: typec: class: Fix NULL pointer access vmxnet3: Fix malformed packet sizing in vmxnet3_process_xdp comedi: jr3_pci: Fix synchronous deletion of timer ext4: goto right label 'out_mmap_sem' in ext4_setattr() usb: typec: class: Invalidate USB device pointers on partner unregistration Revert "net: dsa: mv88e6xxx: fix internal PHYs for 6320 family" net: dsa: mv88e6xxx: fix atu_move_port_mask for 6341 family net: dsa: mv88e6xxx: enable PVT for 6321 switch net: dsa: mv88e6xxx: enable .port_set_policy() for 6320 family net: dsa: mv88e6xxx: enable STU methods for 6320 family iommu: Handle race with default domain setup crypto: lib/Kconfig - Hide arch options from user media: i2c: imx214: Fix uninitialized variable in imx214_set_ctrl() MIPS: cm: Fix warning if MIPS_CM is disabled nvme: fixup scan failure for non-ANA multipath controllers usb: xhci: Fix Short Packet handling rework ignoring errors objtool: Ignore end-of-section jumps for KCOV/GCOV objtool: Silence more KCOV warnings, part 2 usb: typec: class: Unlocked on error in typec_register_partner() crypto: Kconfig - Select LIB generic option arm64: dts: ti: k3-j784s4-j742s2-main-common: Correct the GICD size mq-deadline: don't call req_get_ioprio from the I/O completion handler Linux 6.12.26 Change-Id: Iff5be8c388b8b915652fafb787156a4653f060aa Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
410 lines
13 KiB
C
410 lines
13 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_ENERGY_MODEL_H
|
|
#define _LINUX_ENERGY_MODEL_H
|
|
#include <linux/cpumask.h>
|
|
#include <linux/device.h>
|
|
#include <linux/jump_label.h>
|
|
#include <linux/kobject.h>
|
|
#include <linux/kref.h>
|
|
#include <linux/rcupdate.h>
|
|
#include <linux/sched/cpufreq.h>
|
|
#include <linux/sched/topology.h>
|
|
#include <linux/types.h>
|
|
|
|
/**
|
|
* struct em_perf_state - Performance state of a performance domain
|
|
* @performance: CPU performance (capacity) at a given frequency
|
|
* @frequency: The frequency in KHz, for consistency with CPUFreq
|
|
* @power: The power consumed at this level (by 1 CPU or by a registered
|
|
* device). It can be a total power: static and dynamic.
|
|
* @cost: The cost coefficient associated with this level, used during
|
|
* energy calculation. Equal to: power * max_frequency / frequency
|
|
* @flags: see "em_perf_state flags" description below.
|
|
*/
|
|
struct em_perf_state {
|
|
unsigned long performance;
|
|
unsigned long frequency;
|
|
unsigned long power;
|
|
unsigned long cost;
|
|
unsigned long flags;
|
|
};
|
|
|
|
/*
|
|
* em_perf_state flags:
|
|
*
|
|
* EM_PERF_STATE_INEFFICIENT: The performance state is inefficient. There is
|
|
* in this em_perf_domain, another performance state with a higher frequency
|
|
* but a lower or equal power cost. Such inefficient states are ignored when
|
|
* using em_pd_get_efficient_*() functions.
|
|
*/
|
|
#define EM_PERF_STATE_INEFFICIENT BIT(0)
|
|
|
|
/**
|
|
* struct em_perf_table - Performance states table
|
|
* @rcu: RCU used for safe access and destruction
|
|
* @kref: Reference counter to track the users
|
|
* @state: List of performance states, in ascending order
|
|
*/
|
|
struct em_perf_table {
|
|
struct rcu_head rcu;
|
|
struct kref kref;
|
|
struct em_perf_state state[];
|
|
};
|
|
|
|
/**
|
|
* struct em_perf_domain - Performance domain
|
|
* @em_table: Pointer to the runtime modifiable em_perf_table
|
|
* @nr_perf_states: Number of performance states
|
|
* @min_perf_state: Minimum allowed Performance State index
|
|
* @max_perf_state: Maximum allowed Performance State index
|
|
* @flags: See "em_perf_domain flags"
|
|
* @cpus: Cpumask covering the CPUs of the domain. It's here
|
|
* for performance reasons to avoid potential cache
|
|
* misses during energy calculations in the scheduler
|
|
* and simplifies allocating/freeing that memory region.
|
|
*
|
|
* In case of CPU device, a "performance domain" represents a group of CPUs
|
|
* whose performance is scaled together. All CPUs of a performance domain
|
|
* must have the same micro-architecture. Performance domains often have
|
|
* a 1-to-1 mapping with CPUFreq policies. In case of other devices the @cpus
|
|
* field is unused.
|
|
*/
|
|
struct em_perf_domain {
|
|
struct em_perf_table __rcu *em_table;
|
|
int nr_perf_states;
|
|
int min_perf_state;
|
|
int max_perf_state;
|
|
unsigned long flags;
|
|
unsigned long cpus[];
|
|
};
|
|
|
|
/*
|
|
* em_perf_domain flags:
|
|
*
|
|
* EM_PERF_DOMAIN_MICROWATTS: The power values are in micro-Watts or some
|
|
* other scale.
|
|
*
|
|
* EM_PERF_DOMAIN_SKIP_INEFFICIENCIES: Skip inefficient states when estimating
|
|
* energy consumption.
|
|
*
|
|
* EM_PERF_DOMAIN_ARTIFICIAL: The power values are artificial and might be
|
|
* created by platform missing real power information
|
|
*/
|
|
#define EM_PERF_DOMAIN_MICROWATTS BIT(0)
|
|
#define EM_PERF_DOMAIN_SKIP_INEFFICIENCIES BIT(1)
|
|
#define EM_PERF_DOMAIN_ARTIFICIAL BIT(2)
|
|
|
|
#define em_span_cpus(em) (to_cpumask((em)->cpus))
|
|
#define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
|
|
|
|
#ifdef CONFIG_ENERGY_MODEL
|
|
/*
|
|
* The max power value in micro-Watts. The limit of 64 Watts is set as
|
|
* a safety net to not overflow multiplications on 32bit platforms. The
|
|
* 32bit value limit for total Perf Domain power implies a limit of
|
|
* maximum CPUs in such domain to 64.
|
|
*/
|
|
#define EM_MAX_POWER (64000000) /* 64 Watts */
|
|
|
|
/*
|
|
* To avoid possible energy estimation overflow on 32bit machines add
|
|
* limits to number of CPUs in the Perf. Domain.
|
|
* We are safe on 64bit machine, thus some big number.
|
|
*/
|
|
#ifdef CONFIG_64BIT
|
|
#define EM_MAX_NUM_CPUS 4096
|
|
#else
|
|
#define EM_MAX_NUM_CPUS 16
|
|
#endif
|
|
|
|
struct em_data_callback {
|
|
/**
|
|
* active_power() - Provide power at the next performance state of
|
|
* a device
|
|
* @dev : Device for which we do this operation (can be a CPU)
|
|
* @power : Active power at the performance state
|
|
* (modified)
|
|
* @freq : Frequency at the performance state in kHz
|
|
* (modified)
|
|
*
|
|
* active_power() must find the lowest performance state of 'dev' above
|
|
* 'freq' and update 'power' and 'freq' to the matching active power
|
|
* and frequency.
|
|
*
|
|
* In case of CPUs, the power is the one of a single CPU in the domain,
|
|
* expressed in micro-Watts or an abstract scale. It is expected to
|
|
* fit in the [0, EM_MAX_POWER] range.
|
|
*
|
|
* Return 0 on success.
|
|
*/
|
|
int (*active_power)(struct device *dev, unsigned long *power,
|
|
unsigned long *freq);
|
|
|
|
/**
|
|
* get_cost() - Provide the cost at the given performance state of
|
|
* a device
|
|
* @dev : Device for which we do this operation (can be a CPU)
|
|
* @freq : Frequency at the performance state in kHz
|
|
* @cost : The cost value for the performance state
|
|
* (modified)
|
|
*
|
|
* In case of CPUs, the cost is the one of a single CPU in the domain.
|
|
* It is expected to fit in the [0, EM_MAX_POWER] range due to internal
|
|
* usage in EAS calculation.
|
|
*
|
|
* Return 0 on success, or appropriate error value in case of failure.
|
|
*/
|
|
int (*get_cost)(struct device *dev, unsigned long freq,
|
|
unsigned long *cost);
|
|
};
|
|
#define EM_SET_ACTIVE_POWER_CB(em_cb, cb) ((em_cb).active_power = cb)
|
|
#define EM_ADV_DATA_CB(_active_power_cb, _cost_cb) \
|
|
{ .active_power = _active_power_cb, \
|
|
.get_cost = _cost_cb }
|
|
#define EM_DATA_CB(_active_power_cb) \
|
|
EM_ADV_DATA_CB(_active_power_cb, NULL)
|
|
|
|
struct em_perf_domain *em_cpu_get(int cpu);
|
|
struct em_perf_domain *em_pd_get(struct device *dev);
|
|
int em_dev_update_perf_domain(struct device *dev,
|
|
struct em_perf_table *new_table);
|
|
int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
|
|
struct em_data_callback *cb, cpumask_t *span,
|
|
bool microwatts);
|
|
void em_dev_unregister_perf_domain(struct device *dev);
|
|
struct em_perf_table *em_table_alloc(struct em_perf_domain *pd);
|
|
void em_table_free(struct em_perf_table *table);
|
|
int em_dev_compute_costs(struct device *dev, struct em_perf_state *table,
|
|
int nr_states);
|
|
int em_dev_update_chip_binning(struct device *dev);
|
|
int em_update_performance_limits(struct em_perf_domain *pd,
|
|
unsigned long freq_min_khz, unsigned long freq_max_khz);
|
|
|
|
/**
|
|
* em_pd_get_efficient_state() - Get an efficient performance state from the EM
|
|
* @table: List of performance states, in ascending order
|
|
* @pd: performance domain for which this must be done
|
|
* @max_util: Max utilization to map with the EM
|
|
*
|
|
* It is called from the scheduler code quite frequently and as a consequence
|
|
* doesn't implement any check.
|
|
*
|
|
* Return: An efficient performance state id, high enough to meet @max_util
|
|
* requirement.
|
|
*/
|
|
static inline int
|
|
em_pd_get_efficient_state(struct em_perf_state *table,
|
|
struct em_perf_domain *pd, unsigned long max_util)
|
|
{
|
|
unsigned long pd_flags = pd->flags;
|
|
int min_ps = pd->min_perf_state;
|
|
int max_ps = pd->max_perf_state;
|
|
struct em_perf_state *ps;
|
|
int i;
|
|
|
|
for (i = min_ps; i <= max_ps; i++) {
|
|
ps = &table[i];
|
|
if (ps->performance >= max_util) {
|
|
if (pd_flags & EM_PERF_DOMAIN_SKIP_INEFFICIENCIES &&
|
|
ps->flags & EM_PERF_STATE_INEFFICIENT)
|
|
continue;
|
|
return i;
|
|
}
|
|
}
|
|
|
|
return max_ps;
|
|
}
|
|
|
|
/**
|
|
* em_cpu_energy() - Estimates the energy consumed by the CPUs of a
|
|
* performance domain
|
|
* @pd : performance domain for which energy has to be estimated
|
|
* @max_util : highest utilization among CPUs of the domain
|
|
* @sum_util : sum of the utilization of all CPUs in the domain
|
|
* @allowed_cpu_cap : maximum allowed CPU capacity for the @pd, which
|
|
* might reflect reduced frequency (due to thermal)
|
|
*
|
|
* This function must be used only for CPU devices. There is no validation,
|
|
* i.e. if the EM is a CPU type and has cpumask allocated. It is called from
|
|
* the scheduler code quite frequently and that is why there is not checks.
|
|
*
|
|
* Return: the sum of the energy consumed by the CPUs of the domain assuming
|
|
* a capacity state satisfying the max utilization of the domain.
|
|
*/
|
|
static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
|
|
unsigned long max_util, unsigned long sum_util,
|
|
unsigned long allowed_cpu_cap)
|
|
{
|
|
struct em_perf_table *em_table;
|
|
struct em_perf_state *ps;
|
|
int i;
|
|
|
|
#ifdef CONFIG_SCHED_DEBUG
|
|
WARN_ONCE(!rcu_read_lock_held(), "EM: rcu read lock needed\n");
|
|
#endif
|
|
|
|
if (!sum_util)
|
|
return 0;
|
|
|
|
/*
|
|
* In order to predict the performance state, map the utilization of
|
|
* the most utilized CPU of the performance domain to a requested
|
|
* performance, like schedutil. Take also into account that the real
|
|
* performance might be set lower (due to thermal capping). Thus, clamp
|
|
* max utilization to the allowed CPU capacity before calculating
|
|
* effective performance.
|
|
*/
|
|
max_util = min(max_util, allowed_cpu_cap);
|
|
|
|
/*
|
|
* Find the lowest performance state of the Energy Model above the
|
|
* requested performance.
|
|
*/
|
|
em_table = rcu_dereference(pd->em_table);
|
|
i = em_pd_get_efficient_state(em_table->state, pd, max_util);
|
|
ps = &em_table->state[i];
|
|
|
|
/*
|
|
* The performance (capacity) of a CPU in the domain at the performance
|
|
* state (ps) can be computed as:
|
|
*
|
|
* ps->freq * scale_cpu
|
|
* ps->performance = -------------------- (1)
|
|
* cpu_max_freq
|
|
*
|
|
* So, ignoring the costs of idle states (which are not available in
|
|
* the EM), the energy consumed by this CPU at that performance state
|
|
* is estimated as:
|
|
*
|
|
* ps->power * cpu_util
|
|
* cpu_nrg = -------------------- (2)
|
|
* ps->performance
|
|
*
|
|
* since 'cpu_util / ps->performance' represents its percentage of busy
|
|
* time.
|
|
*
|
|
* NOTE: Although the result of this computation actually is in
|
|
* units of power, it can be manipulated as an energy value
|
|
* over a scheduling period, since it is assumed to be
|
|
* constant during that interval.
|
|
*
|
|
* By injecting (1) in (2), 'cpu_nrg' can be re-expressed as a product
|
|
* of two terms:
|
|
*
|
|
* ps->power * cpu_max_freq
|
|
* cpu_nrg = ------------------------ * cpu_util (3)
|
|
* ps->freq * scale_cpu
|
|
*
|
|
* The first term is static, and is stored in the em_perf_state struct
|
|
* as 'ps->cost'.
|
|
*
|
|
* Since all CPUs of the domain have the same micro-architecture, they
|
|
* share the same 'ps->cost', and the same CPU capacity. Hence, the
|
|
* total energy of the domain (which is the simple sum of the energy of
|
|
* all of its CPUs) can be factorized as:
|
|
*
|
|
* pd_nrg = ps->cost * \Sum cpu_util (4)
|
|
*/
|
|
return ps->cost * sum_util;
|
|
}
|
|
|
|
/**
|
|
* em_pd_nr_perf_states() - Get the number of performance states of a perf.
|
|
* domain
|
|
* @pd : performance domain for which this must be done
|
|
*
|
|
* Return: the number of performance states in the performance domain table
|
|
*/
|
|
static inline int em_pd_nr_perf_states(struct em_perf_domain *pd)
|
|
{
|
|
return pd->nr_perf_states;
|
|
}
|
|
|
|
/**
|
|
* em_perf_state_from_pd() - Get the performance states table of perf.
|
|
* domain
|
|
* @pd : performance domain for which this must be done
|
|
*
|
|
* To use this function the rcu_read_lock() should be hold. After the usage
|
|
* of the performance states table is finished, the rcu_read_unlock() should
|
|
* be called.
|
|
*
|
|
* Return: the pointer to performance states table of the performance domain
|
|
*/
|
|
static inline
|
|
struct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd)
|
|
{
|
|
return rcu_dereference(pd->em_table)->state;
|
|
}
|
|
|
|
#else
|
|
struct em_data_callback {};
|
|
#define EM_ADV_DATA_CB(_active_power_cb, _cost_cb) { }
|
|
#define EM_DATA_CB(_active_power_cb) { }
|
|
#define EM_SET_ACTIVE_POWER_CB(em_cb, cb) do { } while (0)
|
|
|
|
static inline
|
|
int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
|
|
struct em_data_callback *cb, cpumask_t *span,
|
|
bool microwatts)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline void em_dev_unregister_perf_domain(struct device *dev)
|
|
{
|
|
}
|
|
static inline struct em_perf_domain *em_cpu_get(int cpu)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline struct em_perf_domain *em_pd_get(struct device *dev)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
|
|
unsigned long max_util, unsigned long sum_util,
|
|
unsigned long allowed_cpu_cap)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int em_pd_nr_perf_states(struct em_perf_domain *pd)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline
|
|
struct em_perf_table *em_table_alloc(struct em_perf_domain *pd)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void em_table_free(struct em_perf_table *table) {}
|
|
static inline
|
|
int em_dev_update_perf_domain(struct device *dev,
|
|
struct em_perf_table *new_table)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline
|
|
struct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline
|
|
int em_dev_compute_costs(struct device *dev, struct em_perf_state *table,
|
|
int nr_states)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline int em_dev_update_chip_binning(struct device *dev)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline
|
|
int em_update_performance_limits(struct em_perf_domain *pd,
|
|
unsigned long freq_min_khz, unsigned long freq_max_khz)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
#endif
|
|
|
|
#endif
|