Skip to contentSkip to conversation

6.19.6-rc1 review

PATCH In review Sasha Levin 15 participants 880 messages Feb 28 – Mar 10 Page 1 of 7

Subsystems (6)
Stable branch VFS RISC-V s390 +2 more subsystems
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

cover 6.19.6-rc1 review

This is the start of the stable review cycle for the 6.19.6 release. There are 844 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Mon Mar 2 05:32:25 PM UTC 2026. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

        https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=linux-6.19.y&id2=v6.19.5

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
and the diffstat can be found below.

Thanks,
Sasha

-------------
Pseudo-Shortlog of commits:

Aaron Erhardt (1):
ALSA: hda/hdmi: Add quirk for TUXEDO IBS14G6

Abdun Nihaal (2):
media: i2c/tw9903: Fix potential memory leak in tw9903_probe()
media: i2c/tw9906: Fix potential memory leak in tw9906_probe()

Abel Vesa (2):
phy: qcom: edp: Make the number of clocks flexible
arm64: dts: qcom: x1e80100: Add missing TCSR ref clock to the DP PHYs

Adarsh Das (1):
btrfs: replace BUG() with error handling in __btrfs_balance()

Adrian Hunter (2):
i3c: mipi-i3c-hci: Stop reading Extended Capabilities if capability ID
is 0
i3c: mipi-i3c-hci: Reset RING_OPERATION1 fields during init

Ai Chao (1):
ACPI: resource: Add JWIPC JVC9100 to irq1_level_low_skip_override[]

Al Viro (1):
ntfs: ->d_compare() must not block

Alain Volmat (3):
media: stm32: dcmipp: avoid naming clock if only one is needed
media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop
media: stm32: dcmipp: byteproc: disable compose for all bayers

Alan Maguire (1):
kcsan, compiler_types: avoid duplicate type issues in BPF Type Format

Aleksandar Gerasimovski (1):
phy: mvebu-cp110-utmi: fix dr_mode property read from dts

Alex Deucher (2):
drm/amdgpu: avoid a warning in timedout job handler drm/amdgpu: keep vga memory on MacBooks with switchable graphics

Alex Hung (2):
drm/amd/display: Fix writeback on DCN 3.2+ drm/amd/display: Remove conditional for shaper 3DLUT power-on

Alex Williamson (1):
PCI: Mark ASM1164 SATA controller to avoid bus reset

Alexander Aring (1):
dlm: fix recovery pending middle conversion

Alexander Grest (1):
iommu/arm-smmu-v3: Improve CMDQ lock fairness and efficiency

Alexandre Courbot (1):
rust: cpufreq: always inline functions using build_assert with
arguments

Alexei Starovoitov (1):
bpf: Recognize special arithmetic shift in the verifier

Alexey Charkov (1):
arm64: dts: rockchip: Explicitly request UFS reset pin on RK3576

Alexey Klimov (1):
gpu/panel-edp: add AUO panel entry for B140HAN06.4

Alexey Minnekhanov (1):
arm64: dts: qcom: sdm630: Add missing MDSS reset

Alper Ak (2):
media: rockchip: rga: Fix possible ERR_PTR dereference in

    rga_buf_init()

media: qcom: camss: vfe: Fix out-of-bounds access in
vfe_isr_reg_update()

Amelie Delaunay (1):
dmaengine: stm32-dma3: use module_platform_driver

Andrea Scian (1):
mtd: rawnand: pl353: Fix software ECC support

Andreas Gruenbacher (1):
gfs2: fiemap page fault fix

Andreas Larsson (1):
sparc: Synchronize user stack on fork and clone

Andrey Vatoropin (1):
fbcon: check return value of con2fb_acquire_newinfo()

Andrii Nakryiko (1):
procfs: fix possible double mmput() in do_procmap_query()

Anj Duvnjak (1):
hwmon: (nct6683) Add customer ID for ASRock Z590 Taichi

Ankit Nautiyal (1):
drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry

Ankit Soni (2):
iommu/amd: move wait_on_sem() out of spinlock iommu/amd: serialize sequence allocation under concurrent TLB
invalidations

Anthony Iliopoulos (1):
nfsd: fix return error code for nfsd_map_name_to_[ug]id

Anthony Pighin (Nokia) (1):
rtc: interface: Alarm race handling should not discard preceding error

Anton Protopopov (1):
bpf: Properly mark live registers for indirect jumps

Antoniu Miclaus (1):
iio: gyro: itg3200: Fix unchecked return value in read_raw

Ard Biesheuvel (1):
x86/kexec: Copy ACPI root pointer address from config table

Armin Wolf (2):
ACPICA: Abort AML bytecode execution when executing AML_FATAL_OP
hwmon: (dell-smm) Add support for Dell OptiPlex 7080

Arnaldo Carvalho de Melo (1):
perf annotate: Fix BUILD_NONDISTRO=1 missing args->ms conversions to
pointer

Arnd Bergmann (4):
vmw_vsock: bypass false-positive Wnonnull warning with gcc-16
myri10ge: avoid uninitialized variable use
scsi: buslogic: Reduce stack usage
arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16)

Artem Shimko (1):
serial: 8250_dw: handle clock enable errors in runtime_resume

Asad Kamal (1):
drm/amdgpu/ras: Move ras data alloc before bad page check

Asbjørn Sloth Tønnesen (1):
io_uring/cmd_net: fix too strict requirement on ioctl

Ata İlhan Köktürk (1):
ACPI: battery: fix incorrect charging status when current is zero

Balasubramani Vivekanandan (1):
drm/xe/xe3_lpg: Apply Wa_16028005424

Baochen Qiang (2):
wifi: ath12k: fix preferred hardware mode calculation
wifi: ath12k: fix mac phy capability parsing

Baojun Xu (1):
ALSA: hda/tas2781: Ignore reset check for SPI device

Baokun Li (1):
ext4: move ext4_percpu_param_init() before ext4_mb_init()

Bard Liao (3):
ASoC: soc-acpi-intel-arl-match: change rt722 amp endpoint to
aggregated
ASoC: soc-acpi-intel-ptl-match: use aggregated endpoint in

    ptl_rt722_l0_rt1320_l23

ASoC: sdw_utils: remove dai registered check

Bartosz Golaszewski (5):
clocksource/drivers/timer-integrator-ap: Add missing Kconfig
dependency on OF
pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping
reset: gpio: suppress bind attributes in sysfs
gpio: swnode: restore the swnode-name-against-chip-label matching
gpio: sysfs: fix chip removal with GPIOs exported over sysfs

Bastien Nocera (1):
HID: logitech-hidpp: Add support for Logitech K980

Benjamin Gaignard (4):
media: verisilicon: AV1: Fix enable cdef computation
media: verisilicon: AV1: Fix tx mode bit setting
media: verisilicon: AV1: Set IDR flag for intra_only frame type
media: verisilicon: AV1: Fix tile info buffer size

Benjamin Marzinski (2):
dm mpath: Add missing dm_put_device when failing to get scsi dh name dm mpath: make pg_init_delay_msecs settable

Benno Lossin (2):
rust: irq: add 'static bounds to irq callbacks
rust: pin-init: replace clippy expect with allow

Benson Leung (1):
usb: typec: ucsi: psy: Fix voltage and current max for non-Fixed PDOs

Bharat Dev Burman (1):
ALSA: hda/realtek: add HP Victus 16-e0xxx mute LED quirk

Bhavik Sachdev (1):
statmount: permission check should return EPERM

Biju Das (2):
clk: renesas: rzg2l: Deassert reset on assert timeout
serial: rsci: Add set_rtrg() callback

Billy Tsai (1):
gpio: aspeed-sgpio: Change the macro to support deferred probe

Bing Jiao (1):
mm/vmscan: fix demotion targets checks in reclaim/demotion

Bingbu Cao (6):
media: ipu6: Fix typo and wrong constant in ipu6-mmu.c
media: ipu6: Fix RPM reference leak in probe error paths
media: staging/ipu7: Ignore interrupts when device is suspended
media: staging/ipu7: Call synchronous RPM suspend in probe failure
media: staging/ipu7: Update CDPHY register settings
media: staging/ipu7: Fix the loop bound in l2 table alloc

Bitterblue Smith (3):
wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode()
wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band()
wifi: rtw88: Fix inadvertent sharing of struct
ieee80211_supported_band data

Bjorn Andersson (1):
regulator: core: Remove regulator supply_name length limit

Bluecross (1):
Bluetooth: btusb: Add support for MediaTek7920 0489:e158

Bo Sun (1):
octeontx2-af: CGX: fix bitmap leaks

Boris Brezillon (1):
drm/panthor: Always wait after sending a command to an AS

Borislav Petkov (AMD) (1):
x86/sev: Use kfree_sensitive() when freeing a SNP message descriptor

Brandon Brnich (2):
media: chips-media: wave5: Fix conditional in start_streaming
media: chips-media: wave5: Process ready frames when CMD_STOP sent to
Encoder

Breno Leitao (2):
arm64: Disable branch profiling for all arm64 code
uprobes: Fix incorrect lockdep condition in filter_chain()

Brian Howard (1):
HID: multitouch: add quirks for Lenovo Yoga Book 9i

Brian Masney (2):
openrisc: define arch-specific version of nop()
clk: microchip: core: correct return value on *_get_parent()

Brian Norris (1):
PCI/PM: Prevent runtime suspend until devices are fully initialized

Caleb Sander Mateos (1):
io_uring: add IORING_OP_URING_CMD128 to opcode checks

Carl Lee (1):
nfc: nxp-nci: remove interrupt trigger type

Carl Worth (1):
arm64: mte: Set TCMA1 whenever MTE is present in the kernel

Carlos López (1):
mshv: clear eventfd counter on irqfd shutdown

Carlos Song (1):
i2c: imx-lpi2c: fix SMBus block read NACK after byte count

Ce Sun (1):
drm/amdgpu: Adjust usleep_range in fence wait

Chaitanya Kulkarni (1):
block: fix partial IOVA mapping cleanup in blk_rq_dma_map_iova

Charlene Liu (3):
drm/amd/display: Fix DP no audio issue drm/amd/display: Fix dsc eDP issue drm/amd/display: Correct logic check error for fastboot

Chen Ni (2):
ASoC: sunxi: sun50i-dmic: Add missing check for devm_regmap_init_mmio
ASoC: codecs: max98390: Check return value of

    devm_gpiod_get_optional() in max98390_i2c_probe()

Chen-Yu Tsai (1):
dmaengine: sun6i: Choose appropriate burst length under maxburst

Chenghai Huang (1):
crypto: hisilicon/qm - move the barrier before writing to the mailbox
register

Chia-I Wu (1):
drm/panthor: fix for dma-fence safe access rules

Chih-Kang Chang (2):
wifi: rtw89: setting TBTT AGG number when mac port initialization
wifi: rtw89: mcc: reset probe counter when receiving beacon

Chin-Ting Kuo (1):
spi: spi-mem: Protect dirmap_create() with spi_mem_access_start/end

Chin-Yen Lee (1):
wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode

Chris Brandt (2):
clk: renesas: rzg2l: Fix intin variable size
clk: renesas: rzg2l: Select correct div round macro

Christian Brauner (1):
fs: ensure that internal tmpfs mount gets mount id zero

Christoph Hellwig (1):
xfs: remove xfs_attr_leaf_hasname

Chuan Liu (1):
clk: amlogic: remove potentially unsafe flags from S4 video clocks

Chun-Tse Shao (1):
perf stat: Ensure metrics are displayed even with failed events

Clay King (1):
drm/amd/display: bypass post csc for additional color spaces in dal

Clint George (1):
kselftest/kublk: include message in _Static_assert for C11
compatibility

Clément Le Goffic (1):
dmaengine: stm32-mdma: initialize m2m_hw_period and ccr to fix
warnings

Colin Lord (1):
tracing: Fix false sharing in hwlat get_sample()

Cosmin Tanislav (1):
pinctrl: renesas: rzt2h: Allow .get_direction() for IRQ function GPIOs

Cui Chao (1):
mm: numa_memblks: Identify the accurate NUMA ID of CFMW

Cupertino Miranda (1):
bpf: verifier improvement in 32bit shift sign extension pattern

Cédric Bellegarde (1):
ASoC: qcom: q6asm: drop DSP responses for closed data streams

Damien Dagorn (1):
ALSA: hda/realtek: fix LG Gram Style 14 speakers

Daniel Gomez (1):
dm: replace -EEXIST with -EBUSY

Daniel Hodges (1):
tipc: fix RCU dereference race in tipc_aead_users_dec()

Daniel Palmer (1):
m68k: nommu: fix memmove() with differently aligned src and dest for

    68000

Daniel Peng (1):
HID: i2c-hid: Add FocalTech FT8112

Daniel Tang (1):
powercap: intel_rapl: Add PL4 support for Ice Lake

Daniil Dulov (1):
ring-buffer: Fix possible dereference of uninitialized pointer

Darrick J. Wong (9):
xfs: mark data structures corrupt on EIO and ENODATA
xfs: delete attr leaf freemap entries when empty
xfs: fix freemap adjustments when adding xattrs to leaf blocks
xfs: fix the xattr scrub to detect freemap/entries array collisions
xfs: fix remote xattr valuelblk check
xfs: get rid of the xchk_xfile_*_descr calls
xfs: only call xf{array,blob}_destroy if we have a valid pointer
xfs: check return value of xchk_scrub_create_subord
xfs: check for deleted cursors when revalidating two btrees

David LaPorte (1):
mtd: spinand: Disable continuous read during probe

David Phillips (1):
HID: elecom: Add support for ELECOM HUGE Plus M-HT1MRBK

David Plowman (3):
media: i2c: ov5647: Correct pixel array offset
media: i2c: ov5647: Correct minimum VBLANK value
media: i2c: ov5647: Sensor should report RAW color space

David Woodhouse (1):
ptp: ptp_vmclock: add 'VMCLOCK' to ACPI device match

Deepak Kumar (1):
spi: stm32: fix Overrun issue at < 8bpw

Deepakkumar Karn (1):
fs/buffer: add alert in try_to_free_buffers() for folios without
buffers

Deepanshu Kartikey (1):
mm/vmalloc: prevent RCU stalls in kasan_release_vmalloc_node

Denis Pauk (1):
hwmon: (nct6775) Add ASUS Pro WS WRX90E-SAGE SE

Derek J. Clark (1):
iio: bmi270_i2c: Add MODULE_DEVICE_TABLE for BMI260/270

Dian-Syuan Yang (1):
wifi: rtw89: pci: restore LDO setting after device resume

Diksha Kumari (1):
staging: rtl8723bs: fix memory leak on failure path

Dikshita Agarwal (8):
media: venus: vdec: restrict EOS addr quirk to IRIS2 only Revert "media: iris: Add sanity check for stop streaming"
media: iris: remove v4l2_m2m_ioctl_{de,en}coder_cmd API usage during
STOP handling
media: iris: Add missing platform data entries for SM8750
media: iris: Add buffer to list only after successful allocation
media: iris: Skip resolution set on first IPSC
media: iris: gen1: Destroy internal buffers after FW releases
media: iris: gen2: Add sanity check for session stop

Dillon Varone (1):
drm/amd/display: Guard FAMS2 configuration updates

Ding Hui (1):
dm: remove fake timeout to avoid leak request

Diogo Ivo (1):
arm64: tegra: smaug: Add usb-role-switch support

Dipayaan Roy (1):
net: mana: Fix double destroy_workqueue on service rescan PCI path

Dirk Behme (1):
drm/tyr: fix register name in error print

Dmitry Torokhov (1):
net: phy: qcom: qca807x: normalize return value of gpio_get

Dmytro Laktyushkin (2):
drm/amd/display: Add signal type check for dcn401 get_phyd32clk_src drm/amd/display: only power down dig on phy endpoints

Donet Tom (2):
drm/amdkfd: Relax size checking during queue buffer get drm/amdkfd: Fix GART PTE for non-4K pagesize in svm_migrate_gart_map()

Douglas Anderson (1):
mfd: core: Add locking around 'mfd_of_node_list'

Duoming Zhou (2):
net: wan: farsync: Fix use-after-free bugs caused by unfinished
tasklets
atm: fore200e: fix use-after-free in tasklets during device removal

Emanuele Ghidoli (1):
power: reset: tdx-ec-poweroff: fix restart

Eric Biggers (2):
dm-verity: correctly handle dm_bufio_client_create() failure
dm: fix excessive blk-crypto operations for invalid keys

Eric Dumazet (9):
ipv6: annotate data-races in ip6_multipath_hash_{policy,fields}()
ipv6: annotate data-races over sysctl.flowlabel_reflect
ipv6: annotate data-races in net/ipv6/route.c
ipv6: exthdrs: annotate data-race over multiple sysctl
gro: change the BUG_ON() in gro_pull_from_frag0()
ipv4: igmp: annotate data-races around idev->mr_maxdelay
tcp: fix potential race in tcp_v6_syn_recv_sock()
psp: use sk->sk_hash in psp_write_headers()
net: do not pass flow_id to set_rps_cpu()

Erik Sanjaya (1):
ALSA: hda/realtek: Fix headset mic on ASUS Zenbook 14 UX3405MA

Ethan Nelson-Moore (4):
net: usb: sr9700: remove code to drive nonexistent multicast filter
net: ethernet: marvell: skge: remove incorrect conflicting PCI ID
net: intel: fix PCI device ID conflict between i40e and ipw2200
net: arcnet: com20020-pci: fix support for 2.5Mbit cards

Ethan Tidmore (3):
proc: Fix pointer error dereference
staging: rtl8723bs: fix null dereference in find_network
gpio: nomadik: Add missing IS_ERR() check

Eugenio Pérez (1):
vhost: move vdpa group bound check to vhost_vdpa

Evangelos Petrongonas (1):
kho: skip memoryless NUMA nodes when reserving scratch areas

Ezrak1e (1):
dlm: validate length in dlm_search_rsb_tree

Fabian Godehardt (1):
spi: spidev: fix lock inversion between spi_lock and buf_lock

Fabio M. De Francesco (1):
ACPI: APEI: GHES: Add helper for CPER CXL protocol errors checks

Felix Gu (4):
hwmon: (emc2305) Fix a resource leak in emc2305_of_parse_pwm_child
hwmon: (nct7363) Fix a resource leak in nct7363_present_pwm_fanin
misc: ti_fpc202: fix a potential memory leak in probe function
dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()

Filipe Manana (1):
btrfs: don't BUG() on unexpected delayed ref type in
run_one_delayed_ref()

Florian Westphal (1):
netfilter: xt_tcpmss: check remaining length before reading optlen

Francesco Dolcini (1):
arm64: dts: ti: am62p-verdin: Fix SD regulator startup delay

Francesco Lavra (1):
iio: accel: adxl380: Avoid reading more entries than present in FIFO

Frank Li (1):
i3c: master: svc: Initialize 'dev' to NULL in svc_i3c_master_ibi_isr()

Gangliang Xie (2):
drm/amdgpu: mark invalid records with U64_MAX drm/amdgpu: return when ras table checksum is error

Gao Xiang (3):
erofs: fix interlaced plain identification for encoded extents
erofs: fix incorrect early exits for invalid metabox-enabled images
erofs: fix incorrect early exits in volume label handling

Geetha sowjanya (1):
octeontx2-af: Workaround SQM/PSE stalls by disabling sticky

Gerd Rausch (1):
net/rds: No shortcut out of RDS_CONN_ERROR

Greg Kroah-Hartman (2):
Revert "mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms" driver core: faux: stop using static struct device

Guangshuo Li (1):
powerpc/smp: Add check for kcalloc() failure in parse_thread_groups()

Gui-Dong Han (2):
rpmsg: core: fix race in driver_override_show() and use core helper
hwmon: (max16065) Use READ/WRITE_ONCE to avoid compiler optimization
induced race

Gustavo Salvini (1):
ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR

Günther Noack (3):
HID: magicmouse: Do not crash on missing msc->input
HID: prodikeys: Check presence of pm->input_ep82
HID: logitech-hidpp: Check maxfield in hidpp_get_report_length()

Hans Verkuil (4):
media: dvb-core: dmxdevfilter must always flush bufs
media: omap3isp: isp_video_mbus_to_pix/pix_to_mbus fixes
media: omap3isp: isppreview: always clamp in preview_try_format()
media: omap3isp: set initial format

Hans de Goede (10):
drm/panel: edp: add BOE NV140WUM-T08 panel
media: mt9m114: Avoid a reset low spike during probe()
media: mt9m114: Return -EPROBE_DEFER if no endpoint is found
media: i2c: ov01a10: Fix the horizontal flip control
media: i2c: ov01a10: Fix reported pixel-rate value
media: i2c: ov01a10: Fix analogue gain range
media: i2c: ov01a10: Add missing v4l2_subdev_cleanup() calls
media: i2c: ov01a10: Fix passing stream instead of pad to

    v4l2_subdev_state_get_format()

media: i2c: ov01a10: Fix test-pattern disabling
fbdev: Use device_create_with_groups() to fix sysfs groups
registration race

Haotian Zhang (1):
jfs: Add missing set_freezable() for freezable kthread

Haotien Hsu (1):
usb: gadget: tegra-xudc: Add handling for BLCG_COREPLL_PWRDN

Haoxiang Li (12):
PCI/MSI: Unmap MSI-X region on error
firmware: arm_ffa: Unmap Rx/Tx buffers on init failure
media: cx25821: Fix a resource leak in cx25821_dev_setup()
media: mtk-mdp: Fix error handling in probe function
media: mtk-mdp: Fix a reference leak bug in mtk_mdp_remove()
media: cx88: Add missing unmap in snd_cx88_hw_params()
media: cx23885: Add missing unmap in snd_cx23885_hw_params()
media: cx25821: Add missing unmap in snd_cx25821_hw_params()
clk: tegra: tegra124-emc: Fix potential memory leak in

    tegra124_clk_register_emc()

bus: fsl-mc: fix an error handling in fsl_mc_device_add()
rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net()
parisc: kernel: replace kfree() with put_device() in
create_tree_node()

Harin Lee (1):
ALSA: ctxfi: Add quirk for SE-300PCIE variant (160b:0102)

Harry Yoo (5):
mm/slab: avoid allocating slabobj_ext array from its own slab mm/slab: use unsigned long for orig_size to ensure proper metadata
align
mm/slab: do not access current->mems_allowed_seq if !allow_spin mm/slab: use prandom if !allow_spin
mm/page_alloc: skip debug_check_no_{obj,locks}_freed with FPI_TRYLOCK

Harshit Mogalapalli (3):
ima: verify the previous kernel's IMA buffer lies in addressable RAM of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range() x86/kexec: add a sanity check on previous kernel's ima kexec buffer

Heiko Carstens (2):
s390/boot: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS s390/purgatory: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS

Heinz Mauelshagen (1):
md raid: fix hang when stopping arrays with metadata through dm-raid

Helge Deller (1):
parisc: Prevent interrupts during reboot

Heming Zhao (1):
ocfs2: fix reflink preserve cleanup issue

Henrique Carvalho (2):
smb: client: add proper locking around ses->iface_last_update
smb: client: prevent races in ->query_interfaces()

Henry Tseng (1):
ata: libata: avoid long timeouts on hot-unplugged SATA DAS

Himal Prasad Ghimiray (1):
drm/xe/vm: Skip ufence association for CPU address mirror VMA during
MAP

Hou Wenlong (1):
x86/xen/pvh: Enable PAE mode for 32-bit guest only when CONFIG_X86_PAE
is set

Hsieh Hung-En (1):
ASoC: es8328: Add error unwind in resume

Hsiu-Ming Chang (1):
wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H

Huacai Chen (2):
writeback: Fix wakeup and logging timeouts for !DETECT_HUNG_TASK
LoongArch: Prefer top-down allocation after arch_mem_init()

Hugo Villeneuve (1):
drm: renesas: rz-du: mipi_dsi: fix kernel panic when rebooting for
some panels

Hyunwoo Kim (2):
espintcp: Fix race condition in espintcp_close()
tls: Fix race condition in tls_sw_cancel_work_tx()

Håkon Bugge (1):
net/rds: Clear reconnect pending bit

Ian Rogers (12):
perf unwind-libdw: Fix invalid reference counts perf callchain: Fix srcline printing with inlines perf symbol-elf: Fix leak of ELF files with GNU debugdata perf tests kallsyms: Fix missed map__put()
perf annotate: Fix args leak of map_symbol
perf maps: Fix reference count leak in maps__find_ams() perf tests sched: Avoid error in cleanup on loaded machines perf build: Remove NO_LIBCAP that controls nothing libperf build: Always place libperf includes first perf metricgroup: Don't early exit if no CPUID table exists perf stat-shadow: In prepare_metric fix guard on reading NULL
perf_stat_evsel
PCI: cadence: Avoid signed 64-bit truncation and invalid sort

Ihor Solodrai (1):
bpftool: Fix dependencies for static build

Ilan Peer (1):
wifi: iwlwifi: mld: Handle rate selection for NAN interface

Illia Barbashyn (1):
ALSA: hda/realtek - Enable mute LEDs on HP ENVY x360 15-es0xxx

Ilpo Järvinen (5):
PCI/bwctrl: Disable BW controller on Intel P45 using a quirk
mfd: intel-lpss: Add Intel Nova Lake-S PCI IDs
PCI: Use resource_set_range() that correctly sets ->end
PCI: Fix bridge window alignment with optional resources
PCI: Don't claim disabled bridge windows

Ilya Dryomov (1):
libceph: define and enforce CEPH_MAX_KEY_LEN

Imran Khan (1):
genirq/cpuhotplug: Notify about affinity changes breaking the affinity
mask

Imre Deak (2):
drm/i915/dp: Fail state computation for invalid DSC source input BPP
values
drm/i915/dp: Fix pipe BPP clamping due to HDR

Irui Wang (1):
media: mediatek: encoder: Fix uninitialized scalar variable issue

Iuliana Prodan (1):
remoteproc: imx_dsp_rproc: Skip RP_MBOX_SUSPEND_SYSTEM when mailbox TX
channel is uninitialized

Ivan Vecera (1):
dpll: zl3073x: fix REF_PHASE_OFFSET_COMP register width for some chip
IDs

Jack Wang (1):
md/bitmap: fix GPF in write_page caused by resize race

Jack Yu (1):
ASoC: rt721-sdca: Fix issue of fail to detect OMTP jack type

Jackson Lee (2):
media: chips-media: wave5: Fix SError of kernel panic when closed
media: chips-media: wave5: Fix Null reference while testing fluster

Jacky Bai (1):
mailbox: imx: Skip the suspend flag for i.MX7ULP

Jacob Moroni (1):
RDMA/umem: Fix double dma_buf_unpin in failure path

Jacopo Scannella (1):
Bluetooth: btusb: Add device ID for Realtek RTL8761BU

Jaehun Gou (3):
fs: ntfs3: check return value of indx_find to avoid infinite loop
fs: ntfs3: fix infinite loop in attr_load_runs_range on inconsistent
metadata
fs: ntfs3: fix infinite loop triggered by zero-sized ATTR_LIST

Jai Luthra (2):
media: i2c: ov5647: Initialize subdev before controls
media: i2c: ov5647: Fix PIXEL_RATE value for VGA mode

Jakob Riemenschneider (1):
ACPI: x86: s2idle: Invoke Microsoft _DSM Function 9 (Turn On Display)

Jakub Kicinski (2):
netconsole: avoid OOB reads, msg is not nul-terminated
net: consume xmit errors of GSO frames

James Clark (2):
perf cs-etm: Fix decoding for sparse CPU maps perf jevents: Handle deleted JSONS in out of source builds

Jan Gerber (1):
wifi: rtw89: 8852au: add support for TP TX30U Plus

Jan Remmet (1):
gpio: pca953x: Add support for TCAL6408 TCAL6416

Janne Grunau (4):
arm64: dts: apple: t8112-j473: Keep the HDMI port powered on
clk: clk-apple-nco: Add "apple,t8103-nco" compatible
mfd: macsmc: Initialize mutex
spmi: apple: Add "apple,t8103-spmi" compatible

Jason Andryuk (1):
xenbus: Use .freeze/.thaw to handle xenbus devices

Jason Gunthorpe (4):
RDMA/efa: Fix typo in efa_alloc_mr()
iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence iommu/arm-smmu-v3: Mark STE MEV safe when computing the update
sequence
iommu/arm-smmu-v3: Mark EATS_TRANS safe when computing the update
sequence

Jeff Layton (1):
nfsd: fix nfs4_file refcount leak in nfsd_get_dir_deleg()

Jeffrey Bencteux (2):
audit: add fchmodat2() to change attributes class
audit: add missing syscalls to read class

Jens Axboe (4):
io_uring/timeout: annotate data race in io_flush_timeouts() io_uring/net: don't continue send bundle if poll was required for
retry
io_uring/filetable: clamp alloc_hint to the configured alloc range io_uring/openclose: fix io_pipe_fixed() slot tracking for specific
slots

Jesse.Zhang (1):
drm/amdgpu: validate user queue size constraints

Ji-Ze Hong (Peter Hong) (1):
hwmon: (f71882fg) Add F81968 support

Jia Yao (1):
drm/xe: Add bounds check on pat_index to prevent OOB kernel read in
madvise

Jianbo Liu (1):
net/mlx5e: Fix "scheduling while atomic" in IPsec MAC address query

Jiasheng Jiang (1):
md-cluster: fix NULL pointer dereference in process_metadata_update

Jiaxun Yang (1):
MIPS: rb532: Fix MMIO UART resource registration

Jiayuan Chen (2):
xfrm6: fix uninitialized saddr in xfrm6_get_saddr()
kcm: fix zero-frag skb in frag_list on partial sendmsg error

Jijie Shao (1):
net: hns3: extend HCLGE_FD_AD_QID to 11 bits

Jing Zhou (1):
drm/amd/display: Correct FIXED_VS Link Rate Toggle Condition

Jinhui Guo (3):
iommu/vt-d: Skip dev-iotlb flush for inaccessible PCIe device without
scalable mode
iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in
scalable mode
PCI: Fix pci_slot_trylock() error handling

Jinqian Yang (1):
arm64: Add support for TSV110 Spectre-BHB mitigation

Jinwang Li (1):
Bluetooth: hci_qca: Cleanup on all setup failures

Jinzhou Su (1):
drm/amd/pm: Fix null pointer dereference issue

Jiri Olsa (1):
arm64/ftrace,bpf: Fix partial regs after bpf_prog_run

Jiri Pirko (2):
dma-mapping: avoid random addr value print out on error path RDMA/core: Fix stale RoCE GIDs during netdev events at registration

Jisheng Zhang (1):
usb: dwc2: fix resume failure if dr_mode is host

Joe Damato (1):
bnxt_en: Allow ntuple filters for drops

Joel Fernandes (1):
sched/debug: Fix updating of ppos on server write ops

Joey Bednar (1):
HID: apple: Add "SONiX KN85 Keyboard" to the list of non-apple
keyboards

Joey Gouly (1):
arm64: poe: fix stale POR_EL0 values for ptrace

Johan Hovold (9):
memory: mtk-smi: fix device leaks on common probe
memory: mtk-smi: fix device leak on larb probe drm/tegra: dsi: fix device leak on probe
soc: ti: k3-socinfo: Fix regmap leak on probe failure
bus: omap-ocp2scp: fix OF populate on driver rebind
mfd: qcom-pm8xxx: Fix OF populate on driver rebind
mfd: omap-usb-host: Fix OF populate on driver rebind
clk: tegra: tegra124-emc: fix device leak on set_rate()
mux: mmio: fix regmap leak on probe failure

Johannes Berg (2):
wifi: iwlwifi: fix 22000 series SMEM parsing
wifi: cfg80211: wext: fix IGTK key ID off-by-one

John Garry (2):
MIPS: Loongson: Make cpumask_of_node() robust against NUMA_NO_NODE
LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE

John Keeping (1):
rtc: pcf8563: use correct of_node for output clock

Johnny-CC Chang (1):
PCI: Mark Nvidia GB10 to avoid bus reset

Jonathan Marek (2):
spi-geni-qcom: initialize mode related registers to 0
spi-geni-qcom: use xfer->bits_per_word for can_dma()

Joonwon Kang (1):
mailbox: Prevent out-of-bounds access in fw_mbox_index_xlate()

Jori Koolstra (3):
hfs: Replace BUG_ON with error handling for CNID count checks
minix: Add required sanity checking to minix_check_superblock()
jfs: nlink overflow in jfs_rename

Jose Ignacio Tornos Martinez (1):
wifi: rtw89: 8922a: set random mac if efuse contains zeroes

Joshua Hahn (1):
mm/hugetlb: restore failed global reservations to subpool

Jouni Högander (1):
drm/i915/psr: Don't enable Panel Replay on sink if globally disabled

Jun Yan (1):
arm64: dts: rockchip: Do not enable hdmi_sound node on Pinebook Pro

Junrui Luo (1):
dpaa2-switch: validate num_ifs to prevent out-of-bounds write

Kai Aizen (1):
io_uring/zcrx: fix user_ref race between scrub and refill paths

Kailang Yang (1):
ALSA: hda/realtek - Enable Mute LED for Lenovo platform

Kamal Heib (1):
RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_port

Kaushlendra Kumar (3):
tools/cpupower: Fix inverted APERF capability check tools/power cpupower: Reset errno before strtoull()
thermal: int340x: Fix sysfs group leak on DLVR registration failure

Kees Cook (1):
media: solo6x10: Check for out of bounds chip_id

Keita Morisaki (1):
scsi: ufs: mediatek: Fix page faults in ufs_mtk_clk_scale() trace
event

Keith Busch (1):
PCI: Fix pci_slot_lock () device locking

Kevin Hao (4):
net: cpsw_new: Fix unnecessary netdev unregistration in cpsw_probe()
error path
net: cpsw_new: Fix potential unregister of netdev that has not been
registered yet
net: ti: icssg-prueth: Add optional dependency on HSR
net: macb: Fix tx/rx malfunction after phy link down and up

Koichiro Den (1):
NTB: ntb_transport: Fix too small buffer for debugfs_name

Kommula Shiva Shankar (1):
vhost: fix caching attributes of MMIO regions by setting them
explicitly

Konrad Dybcio (1):
cpufreq: dt-platdev: Block the driver from probing on more QC
platforms

Konstantin Komarov (3):
fs/ntfs3: handle attr_set_size() errors when truncating files fs/ntfs3: drop preallocated clusters for sparse and compressed files fs/ntfs3: avoid calling run_get_entry() when run == NULL in

    ntfs_read_run_nb_ra()

Kory Maincent (TI.com) (1):
mfd: tps65219: Implement LOCK register handling for TPS65214

Krishna Chaitanya Chundru (1):
PCI: Add ACS quirk for Qualcomm Hamoa & Glymur

Krzysztof Kozlowski (2):
arm64: dts: qcom: sm8750: Fix BAM DMA probing
nvmem: Drop OF node reference on nvmem_add_one_cell() failure

Kuan-Chung Chen (1):
wifi: rtw89: fix potential zero beacon interval in beacon tracking

Kuniyuki Iwashima (2):
ipv4: fib: Annotate access to struct fib_alias.fa_state.
udplite: Fix null-ptr-deref in __udp_enqueue_schedule_skb().

Langyan Ye (1):
drm/panel-edp: Add CSW MNE007QB3-1

Leo Li (1):
drm/amd/display: Increase DCN35 SR enter/exit latency

Leo Yan (2):
tools headers: Go back to include asm-generic/unistd.h for arm64
tools: Fix bitfield dependency failure

Leon Romanovsky (1):
xfrm: skip templates check for packet offload tunnel mode

Li Chen (3):
ext4: mark group add fast-commit ineligible
ext4: mark group extend fast-commit ineligible
kexec: derive purgatory entry from symbol

Li Wang (1):
selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs

Liang Jie (2):
staging: rtl8723bs: fix missing status update on sdio_alloc_irq()
failure
pinctrl: mediatek: make devm allocations safer and clearer in

    mtk_eint_do_init()

Lianqin Hu (1):
ALSA: usb-audio: Add iface reset and delay quirk for AB13X USB Audio

Lijo Lazar (1):
drm/amdgpu: Skip vcn poison irq release on VF

Likun Gao (1):
drm/amdgpu: fix NULL pointer issue buffer funcs

Lili Li (1):
EDAC/igen6: Add more Intel Panther Lake-H SoCs support

LinCheng Ku (1):
drm/amd/display: Add USB-C DP Alt Mode lane limitation in DCN32

Linus Torvalds (1):
Remove WARN_ALL_UNSEEDED_RANDOM kernel config option

Linus Walleij (1):
net: ethernet: xscale: Check for PTP support properly

Lizhi Hou (1):
accel/amdxdna: Fix tail-pointer polling in mailbox_get_msg()

Loic Poulain (1):
drm/bridge: anx7625: Fix invalid EDID size

Longfang Liu (3):
hisi_acc_vfio_pci: resolve duplicate migration states
hisi_acc_vfio_pci: fix the queue parameter anomaly issue
hisi_acc_vfio_pci: update status after RAS error

Luca Ceresoli (1):
drm: of: drm_of_panel_bridge_remove(): fix device_node leak

Ludovic Desroches (4):
drm/atmel-hlcdc: destroy properly the plane state in the reset
callback
drm/atmel-hlcdc: fix memory leak from the atomic_destroy_state
callback
drm/atmel-hlcdc: don't reject the commit if the src rect has
fractional parts
drm/atmel-hlcdc: fix use-after-free of drm_crtc_commit after release

Luiz Augusto von Dentz (5):
Bluetooth: L2CAP: Fix invalid response to L2CAP_ECRED_RECONF_REQ
Bluetooth: L2CAP: Fix result of L2CAP_ECRED_CONN_RSP when MTU is too
short
Bluetooth: L2CAP: Fix response to L2CAP_ECRED_CONN_REQ
Bluetooth: L2CAP: Fix not checking output MTU is acceptable on
L2CAP_ECRED_CONN_REQ
Bluetooth: L2CAP: Fix missing key size check for L2CAP_LE_CONN_REQ

Lukas Wunner (1):
PCI/AER: Clear stale errors on reporting agents upon probe

Luke Wang (1):
block: decouple secure erase size limit from discard size limit

Lyude Paul (1):
rust/drm: Fix Registration::{new,new_foreign_owned}() docs

Maciej Grochowski (2):
ntb: ntb_hw_switchtec: Fix array-index-out-of-bounds access
ntb: ntb_hw_switchtec: Fix shift-out-of-bounds for 0 mw lut

Maciej Strozek (1):
soundwire: intel_auxdevice: add cs42l45 codec to wake_capable_list

Magnus Lindholm (1):
alpha: fix user-space corruption during memory compaction

Manikanta Maddireddy (1):
PCI: endpoint: Fix swapped parameters in
pci_{primary/secondary}_epc_epf_unlink() functions

Manivannan Sadhasivam (3):
PCI: dwc: Skip PME_Turn_Off broadcast and L2/L3 transition during
suspend if link is not up
PCI: Enable ACS after configuring IOMMU for OF platforms
net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels

Marc Zyngier (1):
arm64: Force the use of CNTVCT_EL0 in __delay()

Marco Elver (1):
arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y

Marcus Folkesson (1):
Revert "mfd: da9052-spi: Change read-mask to write-mask"

Marek Behún (1):
net: sfp: add quirk for Lantech 8330-265D

Marek Szyprowski (1):
wifi: brcmfmac: Fix potential kernel oops when probe fails

Marek Vasut (1):
clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841

Mario Peter (1):
usb: chipidea: udc: fix DMA and SG cleanup in _ep_nuke()

Mark Brown (2):
spi: cadence-quadspi: Parse DT for flashes with the rest of the DT
parsing
mailbox: pcc: Remove spurious IRQF_ONESHOT usage

Markus Perkins (1):
misc: eeprom: Fix EWEN/EWDS/ERAL commands for 93xx56 and 93xx66

Martin Pålsson (1):
net: usb: lan78xx: scan all MDIO addresses on LAN7801

Martin Schiller (3):
perf/x86/msr: Add Airmont NP
perf/x86/cstate: Add Airmont NP
perf/x86/intel: Add Airmont NP

Masami Hiramatsu (Google) (3):
tracing: Fix to set write permission to per-cpu buffer_size_kb
tracing: Reset last_boot_info if ring buffer is reset
tracing: ring-buffer: Fix to check event length before using

Matt Johnston (1):
ipmi: ipmb: initialise event handler read bytes

Matt Roper (1):
drm/xe/ggtt: Use scope-based runtime pm

Matt Whitlock (1):
dm-unstripe: fix mapping bug when there are multiple targets in a
table

Matthew Brost (2):
drm/xe: Covert return of -EBUSY to -ENOMEM in VM bind IOCTL drm/xe: Only toggle scheduling in TDR if GuC is running

Matthew Schwartz (1):
mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms

Matthew Stewart (1):
drm/amd/display: Fix GFX12 family constant checks

Matthieu Baerts (NGI0) (1):
mptcp: pm: in-kernel: always set ID as avail when rm endp

Mauro Carvalho Chehab (6):
EFI/CPER: don't dump the entire memory region APEI/GHES: ensure that won't go past CPER allocated record APEI/GHES: ARM processor Error: don't go past allocated memory EFI/CPER: don't go past the ARM processor CPER record buffer
docs: kdoc: fix logic to handle unissued warnings
docs: kdoc: avoid error_count overflows

Md Haris Iqbal (2):
rnbd-srv: Zero the rsp buffer before using it RDMA/rtrs-clt: For conn rejection use actual err number

Mehdi Ben Hadj Khelifa (1):
hfsplus: ensure sb->s_fs_info is always cleaned up

Mehdi Djait (1):
media: i2c: ov01a10: Fix digital gain range

Michael Liang (1):
dm: clear cloned request bio pointer when last clone bio completes

Michael Thalmeier (1):
net: nfc: nci: Fix parameter validation for packet data

Michal Pecio (1):
media: uvcvideo: Return queued buffers on start_streaming() failure

Mickaël Salaün (1):
kbuild: Fix CC_CAN_LINK detection

Miguel Ojeda (2):
objtool/rust: add one more noreturn Rust function
rust: kbuild: pass -Zunstable-options for Rust 1.95.0

Mikhail Gavrilov (1):
mm/page_alloc: clear page->private in free_pages_prepare()

Mikulas Patocka (2):
dm-integrity: fix a typo in the code for write/discard race
dm-integrity: fix recalculation in bitmap mode

Ming Qian (3):
media: amphion: Clear last_buffer_dequeued flag for DEC_CMD_START
media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC
media: amphion: Drop min_queued_buffers assignment

Mingj Ye (1):
net: usb: r8152: fix transmit queue timeout

Miquel Raynal (1):
spi: spi-mem: Limit octal DTR constraints to octal DTR situations

Miquel Raynal (Schneider Electric) (2):
spi: cadence-qspi: Fix probe error path and remove
spi: cadence-qspi: Try hard to disable the clocks

Miri Korenblit (3):
wifi: cfg80211: allow only one NAN interface, also in multi radio
wifi: iwlwifi: mvm: check the validity of noa_len
wifi: iwlwifi: mld: fix chandef start calculation

Moteen Shah (2):
serial: 8250: 8250_omap.c: Add support for handling UART error
conditions
serial: 8250: 8250_omap.c: Clear DMA RX running status only after DMA
termination is done

Mukesh R (1):
x86/hyperv: Move hv crash init after hypercall pg setup

Nam Cao (1):
powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded

Namhyung Kim (2):
perf tools: Get debug info of DSO properly perf/core: Fix slow perf_event_task_exit() with LBR callstacks

Naohiro Aota (3):
btrfs: zoned: fixup last alloc pointer after extent removal for RAID1
btrfs: zoned: fixup last alloc pointer after extent removal for DUP
btrfs: zoned: fixup last alloc pointer after extent removal for

    RAID0/10

Nathan Chancellor (8):
tty: vt/keyboard: Split apart vt_do_diacrit()
ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing
with clang < 18
compiler-clang.h: require LLVM 19.1.0 or higher for __typeof_unqual__
kbuild: rpm-pkg: Restrict manual debug package creation
kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo
package
kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm
kbuild: rpm-pkg: Disable automatic requires for manual debuginfo
package
ALSA: pcm: Revert bufs move in snd_pcm_xfern_frames_ioctl()

Navaneeth K (1):
most: core: fix resource leak in most_register_interface error paths

Nicholas Carlini (1):
ksmbd: fix signededness bug in smb_direct_prepare_negotiation()

Nicholas Kazlauskas (4):
drm/amd/display: Fix wrong x_pos and y_pos for cursor offload drm/amd/display: Fix mismatched unlock for DMUB HW lock in HWSS fast
path
drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS
on DCN35
drm/amd/display: Ensure link output is disabled in backend reset for
PLL_ON

Nick Hu (1):
irqchip/riscv-imsic: Add a CPU pm notifier to restore the IMSIC on
exit

Nicolas Dufresne (2):
media: mediatek: vcodec: Don't try to decode 422/444 VP9
media: v4l2-mem2mem: Add a kref to the v4l2_m2m_dev structure

Nicolas Schier (1):
perf build: Raise minimum shellcheck version to 0.7.2

Nicolin Chen (1):
iommu/arm-smmu-v3: Do not set disable_ats unless vSTE is Translate

Nidhish A N (1):
wifi: iwlwifi: mld: Fix primary link selection logic

Niklas Cassel (7):
Revert "PCI: dw-rockchip: Don't wait for link since we can detect Link

    Up"

Revert "PCI: dw-rockchip: Enumerate endpoints based on dll_link_up
IRQ"
Revert "PCI: qcom: Don't wait for link if we can detect Link Up" Revert "PCI: qcom: Enable MSI interrupts together with Link up if
'Global IRQ' is supported"
Revert "PCI: qcom: Enumerate endpoints based on Link up event in
'global_irq' interrupt"
Revert "PCI: dwc: Don't wait for link up if driver can detect Link Up
event"
PCI: dwc: Fix msg_atu_index assignment

Niklas Schnelle (3):
s390/pci: Handle futile config accesses of disabled devices directly Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling

    SR-IOV"

PCI/IOV: Fix race between SR-IOV enable/disable and hotplug

Niklas Söderlund (1):
clocksource/drivers/sh_tmu: Always leave device running after probe

Ojaswin Mujoo (1):
ext4: propagate flags to convert_initialized_extent()

Oleg Nesterov (1):
x86/uprobes: Fix XOL allocation failure for 32-bit tasks

Oleksandr Suvorov (1):
watchdog: imx7ulp_wdt: handle the nowayout option

Olga Kornievskaia (1):
NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation

Oliver Neukum (1):
HID: hid-pl: handle probe errors

Otto Pflüger (2):
mailbox: sprd: mask interrupts that are not handled
mailbox: sprd: clear delivery flag before handling TX done

Ovidiu Bunea (1):
drm/amd/display: Disable FEC when powering down encoders

Pagadala Yesu Anjaneyulu (1):
wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI
mode

Pavan Chebbi (2):
bnxt_en: Fix RSS context delete logic
bnxt_en: Fix deleting of Ntuple filters

Pavel Begunkov (3):
io_uring/zcrx: fix sgtable leak on mapping failures io_uring/zcrx: fix post open error handling io_uring/zcrx: check unsupported flags on import

Peichen Huang (1):
drm/amd/display: Don't disable DPCD mst_en if sink connected

Peng Fan (2):
soc: imx8m: Fix error handling for clk_prepare_enable()
remoteproc: imx_rproc: Fix invalid loaded resource table detection

Peter Robinson (1):
rtc: nvvrs: Add ARCH_TEGRA to the NV VRS RTC driver

Peter Ujfalusi (8):
ASoC: SOF: ipc4: Support for sending payload along with
LARGE_CONFIG_GET
PCI: Add Intel Nova Lake audio Device ID
ALSA: hda: controllers: intel: add support for Nova Lake
soundwire: dmi-quirks: add mapping for Avell B.ON (OEM rebranded of

    NUC15)
  ASoC: SOF: ipc4-control: If there is no data do not send bytes update
  ASoC: SOF: ipc4-topology: Correct the allocation size for bytes
    controls
  ASoC: SOF: ipc4-control: Use the correct size for
    scontrol->ipc_control_data

ASoC: SOF: ipc4-control: Keep the payload size up to date

Petr Pavlu (2):
tracing: Fix checking of freed trace_event_file for hist files
tracing: Wake up poll waiters for hist files when removing an event

Phil Sutter (1):
include: uapi: netfilter_bridge.h: Cover for musl libc

Philip Yang (3):
drm/amdkfd: Handle GPU reset and drain retry fault race drm/amdgpu: GPU vm support 5-level page table drm/amdgpu: Use 5-level paging if gmc support 57-bit VA

Philipp Stanner (1):
rust: list: Add unsafe blocks for container_of and safety comments

Pierre-Eric Pelloux-Prayer (1):
drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify

Ping-Ke Shih (4):
wifi: rtw89: pci: validate sequence number of TX release report
wifi: rtw89: mac: correct page number for CSI response
wifi: rtw89: disable EHT protocol by chip capabilities
wifi: rtw89: pci: validate release report content before using for

    RTL8922DE

Po-Hao Huang (2):
wifi: rtw89: fix unable to receive probe responses under MLO
connection
wifi: rtw89: 8922a: add digital compensation for 2GHz

Prashanth K (1):
usb: dwc3: gadget: Move vbus draw to workqueue context

Prathamesh Shete (1):
soc/tegra: pmc: Fix unsafe generic_handle_irq() call

Praveen Talari (1):
spi: geni-qcom: Fix abort sequence execution for serial engine errors

Purna Pavan Chandra Aekkaladevi (1):
mshv: Ignore second stats page map result failure

Qanux (1):
ipv6: ioam: fix heap buffer overflow in __ioam6_fill_trace_data()

Qian Zhang (1):
wifi: ath11k: Fix failure to connect to a 6 GHz AP

Qihang Guo (1):
ALSA: usb-audio: Add DSD support for iBasso DC04U

Qiuxu Zhuo (1):
EDAC/igen6: Add two Intel Amston Lake SoCs support

Qu Wenruo (2):
btrfs: fallback to buffered IO if the data profile has duplication
btrfs: do not ASSERT() when the fs flips RO inside
btrfs_repair_io_failure()

Raag Jadav (1):
pinctrl: intel: Add code name documentation

Rafael J. Wysocki (1):
watchdog: rzv2h_wdt: Discard pm_runtime_put() return value

Ralf Lici (1):
ovpn: tcp - fix packet extraction from stream

Randy Dunlap (1):
rtc: max31335: use correct CONFIG symbol in IS_REACHABLE()

Ranjani Sridharan (1):
ASoC: SOF: Intel: hda: Fix NULL pointer dereference

Relja Vojvodic (1):
drm/amd/display: Correct DSC padding accounting

Renjiang Han (1):
media: venus: vdec: fix error state assignment for zero bytesused

René Rebe (4):
drm/ast: Swap framebuffer writes on big-endian machines
modpost: Amend ppc64 save/restfpr symnames for -Os build fix it87_wdt early reboot by reporting running timer
fbdev: ffb: fix corrupted video output on Sun FFB1

Ricardo Ribalda (4):
media: uvcvideo: Create an ID namespace for streaming output terminals
media: uvcvideo: Fix support for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX
media: dw9714: Fix powerup sequence
media: iris: Fix fps calculation

Richard Zhu (2):
PCI: imx6: Add CLKREQ# override to enable REFCLK for i.MX95 PCIe
PCI: dwc: Skip waiting for L2/L3 Ready if dw_pcie_rp::skip_l23_wait is
true

Robert McIntyre (1):
hwmon: (asus-ec-sensors) add Pro WS TRX50-SAGE WIFI A

Robin Murphy (2):
perf/arm-cmn: Support CMN-600AE
perf/arm-cmn: Reject unsupported hardware configurations

Romain Gantois (1):
fpga: of-fpga-region: Fail if any bridge is missing

Roman Peshkichev (1):
wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero

Rong Zhang (2):
MIPS: Loongson2ef: Register PCI controller in early stage
MIPS: Loongson2ef: Use pcibios_align_resource() to block io range

Ross Vandegrift (1):
wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1

Rui Wang (1):
media: rkisp1: Fix filter mode register configuration

Ruipeng Qi (1):
pstore: ram_core: fix incorrect success return when vmap() fails

Ruitong Liu (1):
net/sched: act_skbedit: fix divide-by-zero in tcf_skbedit_hash()

Sakari Ailus (6):
media: v4l2-async: Fix error handling on steps after finding a match
media: ipu6: Ensure stream_mutex is acquired when dealing with node
list
media: ipu6: Close firmware streams on streaming enable failure
media: ipu6: Always close firmware stream
media: ccs: Avoid possible division by zero
media: ccs: Fix setting initial sub-device state

Sam Day (2):
usb: gadget: f_fs: fix DMA-BUF OUT queues
usb: gadget: f_fs: Fix ioctl error handling

Sam Edwards (2):
ceph: do not propagate page array emplacement errors as batch errors
ceph: fix write storm on fscrypted files

Sam James (1):
sparc: don't reference obsolete termio struct for TC* constants

Sami Tolvanen (3):
gendwarfksyms: Fix build on 32-bit hosts
bpf: crypto: Use the correct destructor kfunc type
bpf: net_sched: Use the correct destructor kfunc type

Samuel Dionne-Riel (1):
ALSA: hda/realtek: Add quirk for Minisforum V3 SE

Sandipan Das (1):
perf vendor events amd: Fix Zen 5 MAB allocation events

Sanjay Yadav (1):
drm/buddy: Prevent BUG_ON by validating rounded allocation

Sasha Levin (2):
Revert "ACPI: processor: Update cpuidle driver check in

    __acpi_processor_start()"

Linux 6.19.6-rc1

Sean Christopherson (3):
KVM: x86: Return "unsupported" instead of "invalid" on access to
unsupported PV MSR
KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3()
succeeding
KVM: x86: Ignore -EBUSY when checking nested events from vcpu_block()

Sebastian Andrzej Siewior (6):
perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD
mailbox: bcm-ferxrm-mailbox: Use default primary handler
char: tpm: cr50: Remove IRQF_ONESHOT
iio: Use IRQF_NO_THREAD
iio: magnetometer: Remove IRQF_ONESHOT
net: Drop the lock in skb_may_tx_timestamp()

Sebastian Krzyszkowiak (2):
ASoC: wm8962: Add WM8962_ADC_MONOMIX to "3D Coefficients" mask
ASoC: wm8962: Don't report a microphone if it's shorted to ground on
plug

Sergey Matyukevich (1):
riscv: vector: init vector context with proper vlenb

Shaurya Rane (1):
media: radio-keene: fix memory leak in error path

Shawn Lin (9):
PCI: dw-rockchip: Disable BAR 0 and BAR 1 for Root Port
PCI: dwc: Add L1 Substates context to ltssm_status of debugfs
PCI: dw-rockchip: Change get_ltssm() to provide L1 Substates info
soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition
soc: rockchip: grf: Support multiple grf to be handled
arm64: dts: rockchip: Fix SD card support for RK3576 EVB1
arm64: dts: rockchip: Fix SD card support for RK3576 Nanopi R76s
arm64: dts: rockchip: Fix rk356x PCIe range mappings
arm64: dts: rockchip: Fix rk3588 PCIe range mappings

Shay Drory (4):
net/mlx5: DR, Fix circular locking dependency in dump net/mlx5: LAG, disable MPESW in lag_disable_change() net/mlx5: E-switch, Clear legacy flag when moving to switchdev net/mlx5: Fix missing devlink lock in SRIOV enable error path

Shell Chen (1):
Bluetooth: btusb: Add new VID/PID for RTL8852CE

Shengming Hu (2):
watchdog/softlockup: fix sample ring index wrap in
need_counting_irqs()
function_graph: Restore direct mode when callbacks drop to one

Shin-Yi Lin (1):
wifi: rtw89: Add default ID 28de:2432 for RTL8832CU

Shuai Zhang (1):
Bluetooth: hci_qca: Fix SSR (SubSystem Restart) fail when BT_EN is
pulled up by hw

Shyam Prasad N (3):
netfs: when subreq is marked for retry, do not check if it faced an
error
cifs: Fix locking usage for tcon fields
cifs: some missing initializations on replay

Siddharth Vadapalli (1):
PCI: j721e: Add config guards for Cadence Host and Endpoint library
APIs

Simon Baatz (1):
tcp: re-enable acceptance of FIN packets when RWIN is 0

Siva Reddy Kallam (2):
RDMA/bng_re: Remove unnessary validity checks
RDMA/bng_re: Unwind bng_re_dev_init properly

Slark Xiao (1):
net: wwan: mhi: Add network support for Foxconn T99W760

Sri Jayaramappa (1):
libsubcmd: Fix null intersection case in exclude_cmds()

Srinivas Pandruvada (2):
platform/x86: ISST: Add missing write block check platform/x86: ISST: Store and restore all domains data

Srinivasan Shanmugam (1):
drm/amdgpu: Refactor amdgpu_gem_va_ioctl for Handling Last Fence
Update and Timeline Management v4

Stefan Sørensen (2):
Bluetooth: hci_conn: Set link_policy on incoming ACL connections
Bluetooth: hci_conn: use mod_delayed_work for active mode timeout

Stefano Stabellini (1):
9p/xen: protect xen_9pfs_front_free against concurrent calls

Steven Rostedt (1):
fgraph: Do not call handlers direct when not using ftrace_ops

Stian Halseth (1):
sparc: Fix page alignment in dma mapping

Suchit Karunakaran (1):
perf annotate: Fix memcpy size in arch__grow_instructions()

Sun YangKai (1):
btrfs: fix periodic reclaim condition

Sunday Clement (1):
drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set()

Szymon Wilczek (3):
media: pvrusb2: fix URB leak in pvr2_send_request_ex
wifi: libertas: fix WARNING in usb_tx_block
ntfs3: fix circular locking dependency in run_unpack_ex

Takashi Iwai (3):
ALSA: mixer: oss: Add card disconnect checkpoints
ALSA: usb-audio: Update the number of packets properly at receiving
ALSA: usb-audio: Add sanity check for OOB writes at silencing

Tao Zhou (1):
drm/amdgpu: fix the calculation of RAS bad page number

Techie Ernie (1):
Bluetooth: btusb: Add USB ID 0489:e112 for Realtek 8851BE

Tetsuo Handa (3):
hfsplus: pretend special inodes as regular files
xfrm: always flush state and policy upon NETDEV_UNREGISTER event
team: avoid NETDEV_CHANGEMTU event when unregistering slave

Thadeu Lima de Souza Cascardo (1):
fpga: dfl: use subsys_initcall to allow built-in drivers to be added

Thomas Fourier (3):
net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in uhdlc_memclean()
fbdev: vt8500lcdfb: fix missing dma_free_coherent()
net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle

Thomas Richard (TI.com) (2):
phy: ti: phy-j721e-wiz: restore mux selection during resume
phy: cadence-torrent: restore parent clock for refclk during resume

Thomas Richter (5):
perf test: Fix test case perf evlist tests for s390x perf test stat tests: Fix for virtualized machines perf test: Fix test perf evlist for z/VM s390x perf test: Fix test case perftool-testsuite_report for s390 s390/perf: Disable register readout on sampling events

Thomas Weissschuh (1):
ARM: 9467/1: mm: Don't use %pK through printk

Thomas Weißschuh (3):
hyper-v: Mark inner union in hv_kvp_exchg_msg_value as packed
virt: vbox: uapi: Mark inner unions in packed structs as packed
binder: don't use %pK through printk

Thomas Yen (1):
scsi: ufs: core: Flush exception handling work when RPM level is zero

Thomas Zimmermann (6):
drm/tests: shmem: Swap names of export tests drm/tests: shmem: Add clean-up action to unpin pages drm/tests: shmem: Hold reservation lock around vmap/vunmap drm/tests: shmem: Hold reservation lock around madvise drm/tests: shmem: Hold reservation lock around purge
fbcon: Remove struct fbcon_display.inverse

Thorsten Schmelzer (2):
media: adv7180: fix frame interval in progressive mode
HID: multitouch: add eGalaxTouch EXC3188 support

Tiezhu Yang (5):
LoongArch: Use %px to print unmodified unwinding address
LoongArch: Handle percpu handler address for ORC unwinder
LoongArch: Guard percpu handler under !CONFIG_PREEMPT_RT
LoongArch: Remove some extern variables in source files
LoongArch: Disable instrumentation for setup_ptwalker()

Tim Huang (1):
drm/amdgpu: add support for HDP IP version 6.1.1

Tiwei Bie (1):
um: Preserve errno within signal handler

Tom Chung (1):
drm/amd/display: Fix system resume lag issue

Tomas Melin (2):
Revert "arm64: zynqmp: Add an OP-TEE node to the device tree"
rtc: zynqmp: correct frequency value

Tomasz Pakuła (1):
HID: pidff: Do not set out of range trigger button

Tung Nguyen (1):
tipc: fix duplicate publication key in tipc_service_insert_publ()

Tuo Li (3):
ACPI: processor: Fix NULL-pointer dereference in
acpi_processor_errata_piix4()
drm/panel: Fix a possible null-pointer dereference in
jdi_panel_dsi_remove()
misc: bcm_vk: Fix possible null-pointer dereferences in bcm_vk_read()

Tvrtko Ursulin (1):
drm/xe: Fix ggtt fb alignment

Tzung-Bi Shih (1):
remoteproc: mediatek: Break lock dependency to prepare_lock

Vahagn Vardanian (1):
netfilter: nf_conntrack_h323: fix OOB read in decode_choice()

Val Packett (2):
drm/panel-edp: Add AUO B140QAX01.H panel
media: iris: use fallback size when S_FMT is called without
width/height

Valentina Fernandez (2):
mailbox: mchp-ipc-sbi: fix out-of-bounds access in
mchp_ipc_get_cluster_aggr_irq()
mailbox: mchp-ipc-sbi: fix uninitialized symbol and other smatch
warnings

Vasiliy Kovalev (1):
KVM: x86: Add SRCU protection for reading PDPTRs in __get_sregs2()

Vasily Gorbik (1):
crash_dump: fix dm_crypt keys locking and ref leak

Viacheslav Dubeyko (2):
hfsplus: fix volume corruption issue for generic/480
hfsplus: fix volume corruption issue for generic/498

Victor Zhao (1):
drm/amdgpu: avoid sdma ring reset in sriov

Vijendar Mukunda (1):
ASoC: amd: amd_sdw: add machine driver quirk for Lenovo models

Vishnu Reddy (2):
media: iris: Fix ffmpeg corrupted frame error
media: iris: Prevent output buffer queuing before stream-on completes

Vitor Soares (2):
arm64: dts: ti: k3-am69-aquila: Change main_spi0/2 CS to GPIO mode
arm64: dts: ti: k3-am69-aquila-clover: Change main_spi2 CS0 to GPIO
mode

Vladimir Zapolskiy (1):
media: qcom: camss: Do not enable cpas fast ahb clock for SM8550 VFE
lite

Vlastimil Babka (2):
mm, page_alloc, thp: prevent reclaim for __GFP_THISNODE THP
allocations
mm/slab: add rcu_barrier() to kvfree_rcu_barrier_on_cache()

Waiman Long (1):
cgroup/cpuset: Don't fail cpuset.cpus change in v2

Wander Lairson Costa (1):
rtla: Fix NULL pointer dereference in actions_parse

Wang, Sung-huai (2):
drm/amd/display: Revert "init dispclk from bootup clock for DCN314" drm/amd/display: Revert "init dispclk from bootup clock for DCN315"

Wayne Chang (1):
usb: host: tegra: Remove manual wake IRQ disposal

Wayne Lin (1):
drm/amd/display: Avoid updating surface with the same surface under
MPO

Weigang He (1):
fbdev: of: display_timing: fix refcount leak in
of_get_display_timings()

Wentao Liang (2):
ARM: omap2: Fix reference count leaks in omap_control_init()
soc: ti: pruss: Fix double free in pruss_clk_mux_setup()

William Tambe (1):
mm/highmem: fix __kmap_to_page() build error

Xi Ruoyao (1):
rust_binder: Fix build failure if !CONFIG_COMPAT

Xiao Kan (1):
drm: Account property blob allocations to memcg

Xiaolei Wang (2):
drm/v3d: Set DMA segment size to avoid debug warnings
media: i2c: ov5647: use our own mutex for the ctrl lock

Xu Yang (2):
phy: fsl-imx8mq-usb: disable bind/unbind platform driver feature
phy: fsl-imx8mq-usb: set platform driver data

Xuewen Yan (1):
PM: sleep: core: Avoid bit field races related to work_in_progress

Xulin Sun (3):
media: chips-media: wave5: Fix PM runtime usage count underflow
media: chips-media: wave5: Fix kthread worker destruction in polling
mode
media: chips-media: wave5: Fix device cleanup order to prevent kernel
panic

Yauhen Kharuzhy (1):
ACPI: x86: Force enabling of PWM2 on the Yogabook YB1-X90

Yazen Ghannam (1):
x86/acpi/boot: Correct acpi_is_processor_usable() check again

Yeoreum Yun (1):
arm64: kernel: initialize missing kexec_buf->random field

Yi Liu (1):
iommu/vt-d: Flush piotlb for SVM and Nested domain

YiLing Chen (1):
drm/amd/display: set enable_legacy_fast_update to false for DCN36

Yicong Yang (1):
ACPI: scan: Use async schedule function in acpi_scan_clear_dep_fn()

Yifan Zhang (1):
drm/amdgpu: Protect GPU register accesses in powergated state in some
paths

Yosry Ahmed (1):
KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation

Yu Kuai (2):
blk-mq-debugfs: add missing debugfs_mutex in
blk_mq_debugfs_register_hctxs()
blk-mq-sched: unify elevators checking for async requests

Yu Zhang (1):
iommupt: Always add IOVA range to iotlb_gather in gather_range_pages()

YuBiao Wang (1):
drm/amdgpu: Skip loading SDMA_RS64 in VF

Yuto Hamaguchi (1):
netfilter: nf_conntrack: Add allow_clash to generic protocol handler

Zenghui Yu (Huawei) (1):
KVM: arm64: nv: Return correct RES0 bits for FGT registers

Zenm Chen (2):
wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N)
wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18)

Zhang Yi (1):
ext4: use reserved metadata blocks when splitting extent on endio

Zhongwei (1):
drm/amd/display: avoid dig reg access timeout on usb4 link training
fail

Zilin Guan (1):
media: tegra-video: Fix memory leak in __tegra_channel_try_format()

Ziyi Guo (7):
power: sequencing: fix missing state_lock in pwrseq_power_on() error
path
ASoC: fsl: imx-rpmsg: use snd_soc_find_dai_with_mutex() in probe
wifi: iwlegacy: add missing mutex protection in

    il4965_store_tx_power()
  wifi: iwlegacy: add missing mutex protection in
    il3945_store_measurement()
  wifi: ath10k: fix lock protection in
    ath10k_wmi_event_peer_sta_ps_state_chg()

net: usb: kaweth: remove TX queue manipulation in kaweth_set_rx_mode
net: usb: pegasus: enable basic endpoint checking

Zong-Zhe Yang (2):
wifi: rtw89: ser: enable error IMR after recovering from L1
wifi: rtw89: regd: 6 GHz power type marks default when inactive

decce6 (2):
drm/amdgpu: Add HAINAN clock adjustment
drm/radeon: Add HAINAN clock adjustment

ethanwu (2):
ceph: supply snapshot context in ceph_uninline_data()
ceph: supply snapshot context in ceph_zero_partial_object()

fenugrec (1):
ALSA: usb-audio: presonus s18xx uses little-endian

gongqi (1):
ALSA: hda/conexant: Add headset mic fix for MECHREVO Wujie 15X Pro

jinbaohong (2):
btrfs: handle user interrupt properly in btrfs_trim_fs()
btrfs: continue trimming remaining devices on failure

 Documentation/admin-guide/cgroup-v2.rst       |   8 +-
 Documentation/hwmon/asus_ec_sensors.rst       |   1 +
 Documentation/hwmon/nct6683.rst               |   1 +
 Makefile                                      |   4 +-
 arch/alpha/include/asm/pgtable.h              |  33 +-
 arch/alpha/include/asm/tlbflush.h             |   4 +-
 arch/alpha/mm/Makefile                        |   2 +-
 arch/alpha/mm/tlbflush.c                      | 112 +++++++
 arch/arm/mach-omap2/control.c                 |  14 +-
 arch/arm/mm/physaddr.c                        |   2 +-
 arch/arm64/Kbuild                             |   4 +
 arch/arm64/boot/dts/apple/t8112-j473.dts      |  19 ++
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts |   2 +
 arch/arm64/boot/dts/qcom/hamoa.dtsi           |  12 +-
 arch/arm64/boot/dts/qcom/sdm630.dtsi          |   1 +
 arch/arm64/boot/dts/qcom/sm8750.dtsi          |   2 +
 .../boot/dts/rockchip/rk3399-pinebook-pro.dts |   4 -
 arch/arm64/boot/dts/rockchip/rk3568.dtsi      |   4 +-
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi |   2 +-
 .../boot/dts/rockchip/rk3576-evb1-v10.dts     |  22 ++
 .../boot/dts/rockchip/rk3576-nanopi-r76s.dts  |  23 +-
 .../boot/dts/rockchip/rk3576-pinctrl.dtsi     |   7 +
 arch/arm64/boot/dts/rockchip/rk3576.dtsi      |   2 +-
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi |   4 +-
 .../arm64/boot/dts/rockchip/rk3588-extra.dtsi |   6 +-
 arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi   |   2 +-
 .../boot/dts/ti/k3-am69-aquila-clover.dts     |   3 +-
 arch/arm64/boot/dts/ti/k3-am69-aquila.dtsi    |   6 +-
 arch/arm64/boot/dts/xilinx/zynqmp.dtsi        |   5 -
 arch/arm64/include/asm/pgtable.h              |   9 +-
 arch/arm64/include/asm/rwonce.h               |   2 +-
 arch/arm64/kernel/kexec_image.c               |   2 +-
 arch/arm64/kernel/proton-pack.c               |   1 +
 arch/arm64/kernel/ptrace.c                    |   3 +
 arch/arm64/kvm/emulate-nested.c               |   2 +-
 arch/arm64/lib/delay.c                        |  19 +-
 arch/arm64/mm/proc.S                          |  10 +-
 arch/loongarch/include/asm/setup.h            |   3 +
 arch/loongarch/include/asm/topology.h         |   2 +-
 arch/loongarch/kernel/setup.c                 |   1 +
 arch/loongarch/kernel/unwind_orc.c            |  18 +-
 arch/loongarch/kernel/unwind_prologue.c       |   6 +-
 arch/loongarch/mm/tlb.c                       |   3 +-
 arch/m68k/lib/memmove.c                       |  18 ++
 .../include/asm/mach-loongson2ef/loongson.h   |   6 +
 .../include/asm/mach-loongson64/topology.h    |   2 +-
 arch/mips/loongson2ef/common/pci.c            |  18 +-
 arch/mips/loongson2ef/common/setup.c          |   1 +
 arch/mips/rb532/devices.c                     |   5 +-
 arch/openrisc/include/asm/barrier.h           |   2 +
 arch/parisc/kernel/drivers.c                  |   2 +-
 arch/parisc/kernel/process.c                  |   3 +
 arch/powerpc/kernel/smp.c                     |   2 +
 arch/powerpc/platforms/pseries/msi.c          |  44 ++-
 arch/riscv/kernel/vector.c                    |  12 +-
 arch/s390/boot/Makefile                       |   1 +
 arch/s390/kernel/perf_cpum_sf.c               |   2 +-
 arch/s390/pci/pci.c                           |  25 +-
 arch/s390/purgatory/Makefile                  |   1 +
 arch/sparc/include/uapi/asm/ioctls.h          |   8 +-
 arch/sparc/kernel/iommu.c                     |   2 +
 arch/sparc/kernel/pci_sun4v.c                 |   2 +
 arch/sparc/kernel/process.c                   |  38 ++-
 arch/um/os-Linux/signal.c                     |   6 +-
 arch/x86/coco/sev/core.c                      |   3 +-
 arch/x86/events/intel/core.c                  |   1 +
 arch/x86/events/intel/cstate.c                |   1 +
 arch/x86/events/msr.c                         |   1 +
 arch/x86/hyperv/hv_init.c                     |   4 +-
 arch/x86/kernel/acpi/boot.c                   |  12 +-
 arch/x86/kernel/cpu/topology.c                |  15 -
 arch/x86/kernel/kexec-bzimage64.c             |   7 +
 arch/x86/kernel/setup.c                       |   6 +
 arch/x86/kernel/uprobes.c                     |  24 ++
 arch/x86/kvm/svm/nested.c                     |   3 +-
 arch/x86/kvm/svm/svm.c                        |   5 +-
 arch/x86/kvm/x86.c                            |  45 +--
 arch/x86/platform/pvh/head.S                  |   2 +
 block/bfq-iosched.c                           |   2 +-
 block/blk-merge.c                             |  21 +-
 block/blk-mq-debugfs.c                        |   2 +
 block/blk-mq-dma.c                            |  13 +-
 block/blk-mq-sched.h                          |   5 +
 block/blk.h                                   |   6 +-
 block/kyber-iosched.c                         |   2 +-
 block/mq-deadline.c                           |   2 +-
 drivers/accel/amdxdna/amdxdna_mailbox.c       |  19 +-
 drivers/accel/qaic/mhi_controller.c           |  44 ---
 drivers/acpi/acpi_processor.c                 |  28 +-
 drivers/acpi/acpica/exoparg3.c                |  46 ++-
 drivers/acpi/apei/Makefile                    |   5 +
 drivers/acpi/apei/ghes.c                      |  56 ++--
 drivers/acpi/apei/ghes_helpers.c              |  33 ++
 drivers/acpi/battery.c                        |   9 +-
 drivers/acpi/processor_driver.c               |   2 +-
 drivers/acpi/resource.c                       |   8 +
 drivers/acpi/scan.c                           |  41 +--
 drivers/acpi/x86/s2idle.c                     |   6 +
 drivers/acpi/x86/utils.c                      |  12 +
 drivers/android/binder.c                      |   2 +-
 drivers/android/binder/rust_binder_main.rs    |   1 +
 drivers/android/binder_alloc.c                |   6 +-
 drivers/ata/libata-core.c                     |  24 ++
 drivers/ata/libata-eh.c                       |   3 +-
 drivers/ata/libata-scsi.c                     |   3 +
 drivers/ata/libata.h                          |   1 +
 drivers/atm/fore200e.c                        |   4 +
 drivers/base/faux.c                           |  18 +-
 drivers/block/rnbd/rnbd-srv.c                 |   3 +
 drivers/bluetooth/btusb.c                     |   7 +
 drivers/bluetooth/hci_qca.c                   |  57 +++-
 drivers/bus/fsl-mc/fsl-mc-bus.c               |   6 +-
 drivers/bus/mhi/host/pci_generic.c            |  20 +-
 drivers/bus/omap-ocp2scp.c                    |  13 +-
 drivers/char/ipmi/ipmi_ipmb.c                 |   5 +
 drivers/char/random.c                         |  12 +-
 drivers/char/tpm/tpm_tis_i2c_cr50.c           |   3 +-
 drivers/char/tpm/tpm_tis_spi_cr50.c           |   2 +-
 drivers/clk/clk-apple-nco.c                   |   1 +
 drivers/clk/clk-renesas-pcie.c                |   2 +-
 drivers/clk/meson/s4-peripherals.c            |   4 -
 drivers/clk/microchip/clk-core.c              |  25 +-
 drivers/clk/renesas/rzg2l-cpg.c               |  15 +-
 drivers/clk/tegra/clk-tegra124-emc.c          |   6 +-
 drivers/clocksource/Kconfig                   |   1 +
 drivers/clocksource/sh_tmu.c                  |  18 --
 drivers/cpufreq/cpufreq-dt-platdev.c          |   3 +
 drivers/crypto/hisilicon/qm.c                 |   6 +-
 drivers/dma/stm32/stm32-dma3.c                |   7 +-
 drivers/dma/stm32/stm32-mdma.c                |   2 +-
 drivers/dma/sun6i-dma.c                       |  26 +-
 drivers/dpll/zl3073x/core.c                   |   7 +-
 drivers/dpll/zl3073x/core.h                   |  28 ++
 drivers/dpll/zl3073x/dpll.c                   |   7 +-
 drivers/dpll/zl3073x/ref.c                    |  25 +-
 drivers/dpll/zl3073x/regs.h                   |   1 +
 drivers/edac/igen6_edac.c                     |  24 ++
 drivers/firmware/arm_ffa/driver.c             |   1 +
 drivers/firmware/efi/cper-arm.c               |  12 +-
 drivers/firmware/efi/cper.c                   |   8 +-
 drivers/fpga/dfl.c                            |   2 +-
 drivers/fpga/of-fpga-region.c                 |   8 +-
 drivers/gpio/Kconfig                          |   4 +-
 drivers/gpio/gpio-aspeed-sgpio.c              |   5 +-
 drivers/gpio/gpio-nomadik.c                   |   3 +
 drivers/gpio/gpio-pca953x.c                   |   6 +
 drivers/gpio/gpiolib-swnode.c                 |  19 ++
 drivers/gpio/gpiolib-sysfs.c                  | 106 +++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  12 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c   |   9 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c       | 135 +++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       |  10 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c       |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |  20 +-
 .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c    |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c      |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c     |  11 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c      |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c     |   1 +
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c         |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_events.c       |   6 +
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c      |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_queue.c        |   6 +-
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c          |   7 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  33 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |   4 +-
 .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c        | 133 +--------
 .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h        |   5 -
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c        |  90 +-----
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.h        |   1 -
 .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  |  16 +-
 .../drm/amd/display/dc/core/dc_hw_sequencer.c |  10 +-
 .../dc/dio/dcn32/dcn32_dio_link_encoder.c     |  15 +-
 .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c  |   4 +-
 .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c  |  21 +-
 .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h  |   4 +
 .../amd/display/dc/dpp/dcn401/dcn401_dpp.c    |   6 +-
 .../amd/display/dc/hubp/dcn401/dcn401_hubp.c  |  14 +-
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c |  40 ++-
 .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c   |  12 +-
 .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c   |  16 +-
 .../amd/display/dc/hwss/dcn314/dcn314_hwseq.c |   2 +-
 .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c   |   2 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |  54 +++-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h   |   3 +
 .../amd/display/dc/hwss/dcn35/dcn35_init.c    |   2 +-
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |  19 +-
 .../gpu/drm/amd/display/dc/link/link_dpms.c   |  19 +-
 .../link_dp_training_fixed_vs_pe_retimer.c    |   2 +-
 .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c  |   3 +-
 .../dc/resource/dcn20/dcn20_resource.c        |   6 +-
 .../dc/resource/dcn36/dcn36_resource.c        |   2 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c    |   5 +
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     |   3 +
 drivers/gpu/drm/ast/ast_cursor.c              |  11 +-
 drivers/gpu/drm/ast/ast_mode.c                |  11 +-
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c   |  77 ++---
 drivers/gpu/drm/bridge/analogix/anx7625.c     |   2 +-
 drivers/gpu/drm/drm_buddy.c                   |   9 +
 drivers/gpu/drm/drm_gem_shmem_helper.c        |  63 ++++
 drivers/gpu/drm/drm_property.c                |   2 +-
 drivers/gpu/drm/i915/display/intel_dp.c       |  48 ++-
 drivers/gpu/drm/i915/display/intel_psr.c      |   7 +-
 drivers/gpu/drm/i915/display/intel_quirks.c   |   2 +-
 drivers/gpu/drm/panel/panel-edp.c             |  10 +
 drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c |   4 +-
 drivers/gpu/drm/panthor/panthor_mmu.c         |  27 +-
 drivers/gpu/drm/panthor/panthor_sched.c       |   4 +
 drivers/gpu/drm/radeon/si_dpm.c               |   5 +
 .../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c    |   8 +
 drivers/gpu/drm/tegra/dsi.c                   |   6 +-
 drivers/gpu/drm/tests/drm_gem_shmem_test.c    |  30 +-
 drivers/gpu/drm/tyr/driver.rs                 |   2 +-
 drivers/gpu/drm/v3d/v3d_drv.c                 |   2 +
 drivers/gpu/drm/xe/display/xe_fb_pin.c        |   2 +-
 drivers/gpu/drm/xe/regs/xe_guc_regs.h         |   3 +
 drivers/gpu/drm/xe/xe_ggtt.c                  |   3 +-
 drivers/gpu/drm/xe/xe_guc_submit.c            |   3 +-
 drivers/gpu/drm/xe/xe_vm.c                    |  14 +-
 drivers/gpu/drm/xe/xe_vm_madvise.c            |   7 +-
 drivers/gpu/drm/xe/xe_wa.c                    |   5 +
 drivers/hid/Kconfig                           |   1 +
 drivers/hid/hid-apple.c                       |   1 +
 drivers/hid/hid-elecom.c                      |  16 +
 drivers/hid/hid-ids.h                         |   5 +
 drivers/hid/hid-logitech-hidpp.c              |   4 +-
 drivers/hid/hid-magicmouse.c                  |   5 +
 drivers/hid/hid-multitouch.c                  |  75 +++++
 drivers/hid/hid-pl.c                          |   7 +-
 drivers/hid/hid-prodikeys.c                   |   4 +
 drivers/hid/hid-quirks.c                      |   3 +
 drivers/hid/i2c-hid/i2c-hid-of-elan.c         |   8 +
 drivers/hid/usbhid/hid-pidff.c                |  16 +-
 drivers/hv/mshv_eventfd.c                     |   5 +-
 drivers/hv/mshv_eventfd.h                     |   1 -
 drivers/hv/mshv_root_hv_call.c                |  52 +++-
 drivers/hv/mshv_root_main.c                   |   3 +
 drivers/hwmon/asus-ec-sensors.c               |   2 +
 drivers/hwmon/dell-smm-hwmon.c                |   7 +
 drivers/hwmon/emc2305.c                       |   1 +
 drivers/hwmon/f71882fg.c                      |   6 +-
 drivers/hwmon/max16065.c                      |  26 +-
 drivers/hwmon/nct6683.c                       |   3 +
 drivers/hwmon/nct6775-platform.c              |   1 +
 drivers/hwmon/nct7363.c                       |   1 +
 drivers/i2c/busses/i2c-imx-lpi2c.c            | 107 +++++--
 drivers/i3c/master/mipi-i3c-hci/dma.c         |   8 +
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c    |   2 +-
 drivers/i3c/master/svc-i3c-master.c           |   4 +-
 drivers/iio/accel/adxl380.c                   |   1 +
 drivers/iio/accel/bma180.c                    |   5 +-
 drivers/iio/adc/ad7766.c                      |   2 +-
 drivers/iio/gyro/itg3200_buffer.c             |   8 +-
 drivers/iio/gyro/itg3200_core.c               |   2 +
 drivers/iio/imu/bmi270/bmi270_i2c.c           |   3 +
 drivers/iio/light/si1145.c                    |   2 +-
 drivers/iio/magnetometer/ak8975.c             |   2 +-
 drivers/infiniband/core/cache.c               |  13 +
 drivers/infiniband/core/core_priv.h           |   3 +
 drivers/infiniband/core/device.c              |  34 ++-
 drivers/infiniband/core/umem_dmabuf.c         |   4 +-
 drivers/infiniband/hw/bng_re/bng_dev.c        |  56 ++--
 drivers/infiniband/hw/efa/efa_verbs.c         |   2 +-
 drivers/infiniband/hw/ionic/ionic_ibdev.c     |   2 +
 drivers/infiniband/ulp/rtrs/rtrs-clt.c        |   4 +-
 drivers/iommu/amd/amd_iommu_types.h           |   2 +-
 drivers/iommu/amd/init.c                      |   2 +-
 drivers/iommu/amd/iommu.c                     |  41 ++-
 .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c     |   4 +-
 .../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c  |  31 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   |  95 ++++--
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |   4 +
 drivers/iommu/generic_pt/iommu_pt.h           |   3 +-
 drivers/iommu/intel/cache.c                   |   9 +-
 drivers/iommu/intel/pasid.c                   |  10 +-
 drivers/irqchip/irq-riscv-imsic-early.c       |  39 ++-
 drivers/mailbox/bcm-flexrm-mailbox.c          |  14 +-
 drivers/mailbox/imx-mailbox.c                 |   8 +-
 drivers/mailbox/mailbox-mchp-ipc-sbi.c        |  41 ++-
 drivers/mailbox/mailbox.c                     |   6 +-
 drivers/mailbox/pcc.c                         |   2 +-
 drivers/mailbox/sprd-mailbox.c                |  20 +-
 drivers/md/dm-exception-store.c               |   2 +-
 drivers/md/dm-integrity.c                     |  15 +-
 drivers/md/dm-log.c                           |   2 +-
 drivers/md/dm-mpath.c                         |  22 +-
 drivers/md/dm-path-selector.c                 |   2 +-
 drivers/md/dm-rq.c                            |  16 +-
 drivers/md/dm-table.c                         |  12 +-
 drivers/md/dm-target.c                        |   2 +-
 drivers/md/dm-unstripe.c                      |   2 +-
 drivers/md/dm-verity-fec.c                    |   4 +-
 drivers/md/md-bitmap.c                        |   3 +-
 drivers/md/md-cluster.c                       |   7 +-
 drivers/md/md.c                               |  14 +-
 drivers/media/dvb-core/dmxdev.c               |   8 +-
 drivers/media/dvb-core/dvb_vb2.c              |   5 +-
 drivers/media/i2c/adv7180.c                   |   7 +
 drivers/media/i2c/ccs/ccs-core.c              |  12 +-
 drivers/media/i2c/dw9714.c                    |   2 +-
 drivers/media/i2c/mt9m114.c                   |  16 +-
 drivers/media/i2c/ov01a10.c                   |  46 +--
 drivers/media/i2c/ov5647.c                    |  24 +-
 drivers/media/i2c/tw9903.c                    |   1 +
 drivers/media/i2c/tw9906.c                    |   1 +
 drivers/media/pci/cx23885/cx23885-alsa.c      |   4 +-
 drivers/media/pci/cx25821/cx25821-alsa.c      |   1 +
 drivers/media/pci/cx25821/cx25821-core.c      |   1 +
 drivers/media/pci/cx88/cx88-alsa.c            |   4 +-
 .../media/pci/intel/ipu6/ipu6-isys-queue.c    |   8 +-
 .../media/pci/intel/ipu6/ipu6-isys-video.c    |   6 +-
 drivers/media/pci/intel/ipu6/ipu6-mmu.c       |   4 +-
 drivers/media/pci/intel/ipu6/ipu6.c           |  10 +-
 drivers/media/pci/solo6x10/solo6x10-tw28.c    |   8 +-
 drivers/media/platform/amphion/vdec.c         |   1 +
 drivers/media/platform/amphion/vpu_v4l2.c     |   2 -
 .../platform/chips-media/wave5/wave5-helper.c |  28 +-
 .../platform/chips-media/wave5/wave5-helper.h |   1 +
 .../chips-media/wave5/wave5-vpu-dec.c         |  10 +-
 .../chips-media/wave5/wave5-vpu-enc.c         |  13 +-
 .../platform/chips-media/wave5/wave5-vpu.c    | 111 ++++++-
 .../platform/chips-media/wave5/wave5-vpuapi.c |  15 -
 .../platform/chips-media/wave5/wave5-vpuapi.h |   6 +
 .../platform/mediatek/mdp/mtk_mdp_core.c      |  17 +-
 .../vcodec/decoder/mtk_vcodec_dec_stateless.c |   6 +
 .../mediatek/vcodec/encoder/mtk_vcodec_enc.c  |   6 +-
 .../media/platform/qcom/camss/camss-vfe-480.c |   6 +-
 drivers/media/platform/qcom/camss/camss.c     |   6 +-
 .../media/platform/qcom/iris/iris_buffer.c    |   7 +-
 .../qcom/iris/iris_hfi_gen1_command.c         |   6 +-
 .../qcom/iris/iris_hfi_gen2_command.c         |   3 +
 .../platform/qcom/iris/iris_platform_gen2.c   |   2 +
 drivers/media/platform/qcom/iris/iris_vb2.c   |  18 +-
 drivers/media/platform/qcom/iris/iris_vdec.c  |   8 +
 drivers/media/platform/qcom/iris/iris_venc.c  |  15 +-
 drivers/media/platform/qcom/iris/iris_vidc.c  |  10 +-
 drivers/media/platform/qcom/venus/vdec.c      |  14 +-
 drivers/media/platform/rockchip/rga/rga-buf.c |   3 +
 .../platform/rockchip/rkisp1/rkisp1-params.c  |   6 -
 .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c    |   3 +
 .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c   |   7 +-
 .../st/stm32/stm32-dcmipp/dcmipp-core.c       |   7 +-
 .../media/platform/ti/omap3isp/isppreview.c   |  21 +-
 drivers/media/platform/ti/omap3isp/ispvideo.c |  14 +-
 drivers/media/platform/verisilicon/hantro.h   |   2 +
 .../media/platform/verisilicon/hantro_drv.c   |  42 ++-
 .../media/platform/verisilicon/imx8m_vpu_hw.c |   8 +
 .../verisilicon/rockchip_vpu981_hw_av1_dec.c  |  43 ++-
 drivers/media/radio/radio-keene.c             |   2 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c       |   5 +
 drivers/media/usb/uvc/uvc_ctrl.c              |  14 +-
 drivers/media/usb/uvc/uvc_driver.c            |  54 ++--
 drivers/media/usb/uvc/uvc_queue.c             |  12 +-
 drivers/media/usb/uvc/uvc_v4l2.c              |  10 +-
 drivers/media/usb/uvc/uvcvideo.h              |   5 +-
 drivers/media/v4l2-core/v4l2-async.c          |  45 ++-
 drivers/media/v4l2-core/v4l2-mem2mem.c        |  23 ++
 drivers/memory/mtk-smi.c                      |   3 +
 drivers/mfd/da9052-spi.c                      |   2 +-
 drivers/mfd/intel-lpss-pci.c                  |  13 +
 drivers/mfd/macsmc.c                          |   1 +
 drivers/mfd/mfd-core.c                        |  36 ++-
 drivers/mfd/omap-usb-host.c                   |   6 +-
 drivers/mfd/qcom-pm8xxx.c                     |   8 +-
 drivers/mfd/tps65219.c                        |   9 +
 drivers/misc/bcm-vk/bcm_vk_msg.c              |  12 +-
 drivers/misc/eeprom/eeprom_93xx46.c           |  11 +-
 drivers/misc/ti_fpc202.c                      |   3 +-
 drivers/most/core.c                           |   6 +-
 drivers/mtd/nand/raw/pl35x-nand-controller.c  |   1 +
 drivers/mtd/nand/spi/core.c                   |   8 +
 drivers/mux/mmio.c                            |   2 +-
 drivers/net/arcnet/com20020-pci.c             |  16 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  13 +-
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  13 +-
 drivers/net/ethernet/cadence/macb_main.c      |  11 +-
 drivers/net/ethernet/ec_bhf.c                 |   2 +-
 .../ethernet/freescale/dpaa2/dpaa2-switch.c   |   7 +
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |   5 +-
 .../hisilicon/hns3/hns3pf/hclge_main.c        |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |   8 +-
 .../net/ethernet/marvell/octeontx2/af/cgx.c   |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |  12 +-
 drivers/net/ethernet/marvell/skge.c           |   1 -
 .../mellanox/mlx5/core/en_accel/ipsec.c       |   3 +-
 .../mellanox/mlx5/core/eswitch_offloads.c     |   2 +
 .../net/ethernet/mellanox/mlx5/core/lag/lag.c |   8 +-
 .../ethernet/mellanox/mlx5/core/lag/mpesw.c   |   8 +-
 .../ethernet/mellanox/mlx5/core/lag/mpesw.h   |   5 +
 .../net/ethernet/mellanox/mlx5/core/sriov.c   |   2 +
 .../mellanox/mlx5/core/steering/sws/dr_dbg.c  |   4 +-
 .../net/ethernet/microsoft/mana/gdma_main.c   |   5 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c |   4 +-
 .../net/ethernet/myricom/myri10ge/myri10ge.c  |  28 +-
 drivers/net/ethernet/ti/Kconfig               |   1 +
 drivers/net/ethernet/ti/cpsw_new.c            |  15 +-
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |   5 +-
 drivers/net/ethernet/xscale/ptp_ixp46x.c      |   3 +
 drivers/net/netconsole.c                      |   3 +-
 drivers/net/ovpn/tcp.c                        |  53 ++--
 drivers/net/phy/qcom/qca807x.c                |   2 +-
 drivers/net/phy/sfp.c                         |   8 +-
 drivers/net/team/team_core.c                  |  26 +-
 drivers/net/usb/Kconfig                       |   1 -
 drivers/net/usb/kaweth.c                      |   2 -
 drivers/net/usb/lan78xx.c                     |   2 -
 drivers/net/usb/pegasus.c                     |  35 ++-
 drivers/net/usb/r8152.c                       |   2 +
 drivers/net/usb/sr9700.c                      |  25 +-
 drivers/net/usb/sr9700.h                      |   7 +-
 drivers/net/wan/farsync.c                     |   2 +
 drivers/net/wan/fsl_ucc_hdlc.c                |   8 +-
 drivers/net/wireless/ath/ath10k/wmi.c         |   4 +-
 drivers/net/wireless/ath/ath11k/core.c        |  28 ++
 drivers/net/wireless/ath/ath11k/mhi.c         |   4 -
 drivers/net/wireless/ath/ath11k/reg.c         |   9 +-
 drivers/net/wireless/ath/ath12k/mhi.c         |   4 -
 drivers/net/wireless/ath/ath12k/wmi.c         |  24 +-
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |   7 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        |   7 +-
 .../broadcom/brcm80211/brcmfmac/sdio.h        |   2 +-
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |   8 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |   2 +
 .../net/wireless/intel/iwlegacy/4965-mac.c    |   2 +
 drivers/net/wireless/intel/iwlwifi/fw/smem.c  |   8 +-
 .../net/wireless/intel/iwlwifi/mld/mac80211.c |  23 +-
 drivers/net/wireless/intel/iwlwifi/mld/mlo.c  |   4 +-
 drivers/net/wireless/intel/iwlwifi/mld/tx.c   |   5 +
 .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c |  14 +
 .../net/wireless/marvell/libertas/if_usb.c    |   2 +
 drivers/net/wireless/realtek/rtw88/main.c     |  47 ++-
 drivers/net/wireless/realtek/rtw88/main.h     |   2 +-
 .../net/wireless/realtek/rtw88/rtw8821cu.c    |   2 +
 drivers/net/wireless/realtek/rtw88/rtw8822b.c |   3 +-
 drivers/net/wireless/realtek/rtw89/chan.c     |   5 +-
 drivers/net/wireless/realtek/rtw89/core.c     |  16 +-
 drivers/net/wireless/realtek/rtw89/core.h     |   1 +
 drivers/net/wireless/realtek/rtw89/fw.c       |   3 +
 drivers/net/wireless/realtek/rtw89/fw.h       |   4 +
 drivers/net/wireless/realtek/rtw89/mac.c      |  18 ++
 drivers/net/wireless/realtek/rtw89/mac.h      |   1 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |   1 +
 drivers/net/wireless/realtek/rtw89/mac_be.c   |   3 +-
 drivers/net/wireless/realtek/rtw89/pci.c      |  12 +-
 drivers/net/wireless/realtek/rtw89/regd.c     |   1 +
 .../net/wireless/realtek/rtw89/rtw8852au.c    |   4 +
 .../net/wireless/realtek/rtw89/rtw8852bu.c    |   2 +
 .../net/wireless/realtek/rtw89/rtw8852cu.c    |   2 +
 drivers/net/wireless/realtek/rtw89/rtw8922a.c |  79 ++++-
 drivers/net/wireless/realtek/rtw89/ser.c      |  10 +
 drivers/net/wireless/realtek/rtw89/wow.c      |   4 +
 drivers/net/wireless/realtek/rtw89/wow.h      |   1 +
 drivers/net/wwan/mhi_wwan_mbim.c              |   3 +-
 drivers/nfc/nxp-nci/i2c.c                     |   2 +-
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c        |  12 +-
 drivers/ntb/ntb_transport.c                   |   4 +-
 drivers/nvmem/core.c                          |   1 +
 drivers/of/kexec.c                            |  15 +-
 drivers/pci/bus.c                             |   8 +
 drivers/pci/controller/cadence/pci-j721e.c    |  41 ++-
 .../cadence/pcie-cadence-host-common.c        |  12 +-
 drivers/pci/controller/dwc/pci-imx6.c         |  25 ++
 .../controller/dwc/pcie-designware-debugfs.c  |   2 +
 .../pci/controller/dwc/pcie-designware-host.c |  35 ++-
 drivers/pci/controller/dwc/pcie-designware.h  |   6 +-
 drivers/pci/controller/dwc/pcie-dw-rockchip.c |  95 +++---
 drivers/pci/controller/dwc/pcie-qcom.c        |  63 +---
 drivers/pci/endpoint/pci-ep-cfs.c             |   8 +-
 drivers/pci/iov.c                             |   9 +-
 drivers/pci/msi/msi.c                         |   4 +-
 drivers/pci/pci-driver.c                      |   8 +
 drivers/pci/pci.c                             |  45 +--
 drivers/pci/pci.h                             |   1 +
 drivers/pci/pcie/aer.c                        |  26 +-
 drivers/pci/pcie/bwctrl.c                     |   3 +
 drivers/pci/probe.c                           |   6 +-
 drivers/pci/quirks.c                          |  32 ++
 drivers/pci/setup-bus.c                       |  12 +-
 drivers/perf/arm-cmn.c                        |  19 +-
 drivers/perf/cxl_pmu.c                        |   2 +-
 drivers/phy/cadence/phy-cadence-torrent.c     |  23 ++
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c    |   3 +
 drivers/phy/marvell/phy-mvebu-cp110-utmi.c    |   2 +-
 drivers/phy/qualcomm/phy-qcom-edp.c           |  16 +-
 drivers/phy/ti/phy-j721e-wiz.c                |  19 +-
 drivers/pinctrl/intel/Kconfig                 |  21 +-
 drivers/pinctrl/mediatek/mtk-eint.c           |  29 +-
 drivers/pinctrl/meson/pinctrl-amlogic-a4.c    |   2 +-
 drivers/pinctrl/renesas/pinctrl-rzt2h.c       |  21 +-
 .../intel/speed_select_if/isst_tpmi_core.c    |  57 ++--
 drivers/power/reset/tdx-ec-poweroff.c         |  19 ++
 drivers/power/sequencing/core.c               |   6 +-
 drivers/powercap/intel_rapl_msr.c             |   1 +
 drivers/ptp/ptp_vmclock.c                     |   1 +
 drivers/rapidio/rio-scan.c                    |   3 +-
 drivers/ras/ras.c                             |   6 +-
 drivers/regulator/core.c                      |  12 +-
 drivers/remoteproc/imx_dsp_rproc.c            |   9 +
 drivers/remoteproc/imx_rproc.c                |   4 +
 drivers/remoteproc/mtk_scp.c                  |  39 ++-
 drivers/remoteproc/mtk_scp_ipi.c              |   4 +-
 drivers/reset/reset-gpio.c                    |   1 +
 drivers/rpmsg/rpmsg_core.c                    |  66 ++--
 drivers/rtc/Kconfig                           |   1 +
 drivers/rtc/interface.c                       |   2 +-
 drivers/rtc/rtc-max31335.c                    |   6 +-
 drivers/rtc/rtc-pcf8563.c                     |   2 +-
 drivers/rtc/rtc-zynqmp.c                      |   3 +
 drivers/scsi/BusLogic.c                       |   6 +-
 drivers/soc/imx/soc-imx8m.c                   |   6 +-
 drivers/soc/rockchip/grf.c                    |  57 ++--
 drivers/soc/tegra/pmc.c                       | 104 +++++--
 drivers/soc/ti/k3-socinfo.c                   |   2 +-
 drivers/soc/ti/pruss.c                        |   6 +-
 drivers/soundwire/dmi-quirks.c                |  11 +
 drivers/soundwire/intel_auxdevice.c           |   1 +
 drivers/spi/spi-cadence-quadspi.c             |  59 ++--
 drivers/spi/spi-geni-qcom.c                   |  38 +--
 drivers/spi/spi-mem.c                         |  26 +-
 drivers/spi/spi-stm32.c                       |   9 +-
 drivers/spi/spidev.c                          |  63 ++--
 drivers/spmi/spmi-apple-controller.c          |   1 +
 drivers/staging/media/ipu7/ipu7-buttress.c    |  17 +-
 .../staging/media/ipu7/ipu7-isys-csi-phy.c    |  13 +-
 drivers/staging/media/ipu7/ipu7-mmu.c         |   2 +-
 drivers/staging/media/ipu7/ipu7.c             |   6 +-
 drivers/staging/media/tegra-video/vi.c        |  13 +-
 drivers/staging/rtl8723bs/core/rtw_mlme.c     |   6 +-
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c |   3 +-
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  |   3 +-
 .../int340x_thermal/processor_thermal_rfim.c  |   5 +-
 drivers/tty/serial/8250/8250_dw.c             |  11 +-
 drivers/tty/serial/8250/8250_omap.c           |  25 +-
 drivers/tty/serial/rsci.c                     |  17 ++
 drivers/tty/vt/keyboard.c                     | 221 +++++++-------
 drivers/ufs/core/ufshcd.c                     |   2 +
 drivers/ufs/host/ufs-mediatek-trace.h         |   6 +-
 drivers/usb/chipidea/udc.c                    |   7 +
 drivers/usb/dwc2/core.c                       |   1 +
 drivers/usb/dwc3/core.c                       |  19 +-
 drivers/usb/dwc3/core.h                       |   4 +
 drivers/usb/dwc3/gadget.c                     |   8 +-
 drivers/usb/gadget/function/f_fs.c            |  24 +-
 drivers/usb/gadget/udc/tegra-xudc.c           |  12 +-
 drivers/usb/host/xhci-tegra.c                 |  21 +-
 drivers/usb/typec/ucsi/psy.c                  |  30 +-
 drivers/vdpa/mlx5/net/mlx5_vnet.c             |   3 -
 drivers/vdpa/vdpa_sim/vdpa_sim.c              |   6 -
 .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c    |   6 +-
 drivers/vhost/vdpa.c                          |   3 +-
 drivers/video/fbdev/core/fbcon.c              |   3 +-
 drivers/video/fbdev/core/fbcon.h              |   1 -
 drivers/video/fbdev/core/fbsysfs.c            |  36 +--
 drivers/video/fbdev/ffb.c                     |  14 +-
 drivers/video/fbdev/vt8500lcdfb.c             |   5 +-
 drivers/video/of_display_timing.c             |   4 +-
 drivers/watchdog/imx7ulp_wdt.c                |   1 +
 drivers/watchdog/it87_wdt.c                   |  12 +
 drivers/watchdog/rzv2h_wdt.c                  |   4 +-
 drivers/xen/xenbus/xenbus_probe_frontend.c    |   4 +-
 fs/btrfs/bio.c                                |   8 +-
 fs/btrfs/block-group.c                        |   6 +-
 fs/btrfs/direct-io.c                          |  12 +
 fs/btrfs/extent-tree.c                        |  33 +-
 fs/btrfs/space-info.c                         |  21 +-
 fs/btrfs/volumes.c                            |  10 +-
 fs/btrfs/zoned.c                              | 223 +++++++++++++-
 fs/buffer.c                                   |   4 +
 fs/ceph/addr.c                                |  28 +-
 fs/ceph/file.c                                |  17 +-
 fs/dlm/lock.c                                 |  22 +-
 fs/erofs/super.c                              |  11 +-
 fs/erofs/zmap.c                               |   9 +-
 fs/ext4/extents.c                             |  11 +-
 fs/ext4/ioctl.c                               |   3 +
 fs/ext4/super.c                               |  10 +-
 fs/fs-writeback.c                             |   9 +-
 fs/gfs2/inode.c                               |  16 +
 fs/hfs/dir.c                                  |  15 +-
 fs/hfs/hfs_fs.h                               |   1 +
 fs/hfs/inode.c                                |  30 +-
 fs/hfs/mdb.c                                  |  31 +-
 fs/hfs/super.c                                |   3 +
 fs/hfsplus/dir.c                              |  46 ++-
 fs/hfsplus/inode.c                            |  17 +-
 fs/hfsplus/super.c                            |  19 +-
 fs/jfs/jfs_logmgr.c                           |   1 +
 fs/jfs/namei.c                                |   6 +-
 fs/minix/inode.c                              |  50 ++--
 fs/namespace.c                                |   4 +-
 fs/netfs/read_collect.c                       |  10 +
 fs/netfs/read_retry.c                         |   4 +-
 fs/netfs/write_collect.c                      |   8 +-
 fs/netfs/write_issue.c                        |   1 +
 fs/nfsd/nfs4idmap.c                           |   4 +
 fs/nfsd/nfs4state.c                           |   8 +-
 fs/ntfs3/attrib.c                             |  19 +-
 fs/ntfs3/attrlist.c                           |   9 +
 fs/ntfs3/dir.c                                |   5 +-
 fs/ntfs3/file.c                               |  10 +-
 fs/ntfs3/fsntfs.c                             |  10 +-
 fs/ntfs3/index.c                              |   7 +-
 fs/ntfs3/inode.c                              |  13 +-
 fs/ntfs3/namei.c                              |  17 +-
 fs/ntfs3/run.c                                |  13 +-
 fs/ntfs3/xattr.c                              |   5 +-
 fs/ocfs2/xattr.c                              |   4 +
 fs/proc/base.c                                |   3 +
 fs/proc/task_mmu.c                            |   3 +-
 fs/pstore/ram_core.c                          |   7 +
 fs/smb/client/cached_dir.c                    |   4 +-
 fs/smb/client/connect.c                       |   2 +
 fs/smb/client/smb2misc.c                      |   6 +-
 fs/smb/client/smb2ops.c                       |  29 +-
 fs/smb/client/smb2pdu.c                       |   3 +
 fs/smb/client/trace.h                         |   1 +
 fs/smb/server/transport_rdma.c                |   4 +-
 fs/xfs/libxfs/xfs_attr.c                      |  75 ++---
 fs/xfs/libxfs/xfs_attr_leaf.c                 |  49 ++-
 fs/xfs/scrub/agheader_repair.c                |  21 +-
 fs/xfs/scrub/alloc_repair.c                   |  20 +-
 fs/xfs/scrub/attr.c                           |  59 ++--
 fs/xfs/scrub/attr_repair.c                    |  26 +-
 fs/xfs/scrub/bmap_repair.c                    |   6 +-
 fs/xfs/scrub/btree.c                          |   2 +
 fs/xfs/scrub/common.c                         |   7 +
 fs/xfs/scrub/common.h                         |  25 --
 fs/xfs/scrub/dabtree.c                        |   2 +
 fs/xfs/scrub/dir.c                            |  13 +-
 fs/xfs/scrub/dir_repair.c                     |  19 +-
 fs/xfs/scrub/dirtree.c                        |  19 +-
 fs/xfs/scrub/ialloc_repair.c                  |  25 +-
 fs/xfs/scrub/nlinks.c                         |   9 +-
 fs/xfs/scrub/parent.c                         |  11 +-
 fs/xfs/scrub/parent_repair.c                  |  23 +-
 fs/xfs/scrub/quotacheck.c                     |  13 +-
 fs/xfs/scrub/refcount_repair.c                |  13 +-
 fs/xfs/scrub/repair.c                         |   3 +
 fs/xfs/scrub/rmap_repair.c                    |   5 +-
 fs/xfs/scrub/rtbitmap_repair.c                |   6 +-
 fs/xfs/scrub/rtrefcount_repair.c              |  15 +-
 fs/xfs/scrub/rtrmap_repair.c                  |   5 +-
 fs/xfs/scrub/rtsummary.c                      |   7 +-
 fs/xfs/scrub/scrub.c                          |   2 +-
 include/acpi/ghes.h                           |   1 +
 include/asm-generic/audit_change_attr.h       |   3 +
 include/asm-generic/audit_read.h              |   6 +
 include/cxl/event.h                           |  10 +
 include/drm/drm_gem_shmem_helper.h            |  11 +
 include/drm/drm_of.h                          |   3 +
 include/linux/compiler-clang.h                |   2 +-
 include/linux/compiler_types.h                |  23 +-
 include/linux/cper.h                          |   3 +-
 include/linux/cpuset.h                        |   6 +-
 include/linux/fb.h                            |   1 -
 include/linux/ftrace.h                        |  13 +-
 include/linux/ftrace_regs.h                   |  25 ++
 include/linux/ima.h                           |   1 +
 include/linux/inetdevice.h                    |   2 +-
 include/linux/memcontrol.h                    |   6 +-
 include/linux/mfd/tps65219.h                  |   2 +
 include/linux/pci.h                           |   1 +
 include/linux/pci_ids.h                       |   1 +
 include/linux/pm.h                            |   2 +-
 include/linux/trace_events.h                  |   5 +
 include/linux/uprobes.h                       |   1 +
 include/media/dvb_vb2.h                       |   6 +-
 include/media/v4l2-mem2mem.h                  |  21 ++
 include/net/bluetooth/l2cap.h                 |   8 +-
 include/net/cfg80211.h                        |   2 +-
 include/net/inet_connection_sock.h            |   4 +-
 include/net/ioam6.h                           |   2 +
 include/net/ipv6.h                            |   4 +-
 include/net/sock.h                            |   2 +-
 include/net/tcp.h                             |   4 +-
 include/uapi/linux/hyperv.h                   |   2 +-
 include/uapi/linux/netfilter_bridge.h         |   4 +
 include/uapi/linux/vbox_vmmdev_types.h        |   4 +-
 io_uring/cmd_net.c                            |   9 +-
 io_uring/filetable.c                          |   4 +
 io_uring/io_uring.h                           |   6 +
 io_uring/kbuf.c                               |   2 +-
 io_uring/net.c                                |   6 +-
 io_uring/openclose.c                          |   9 +-
 io_uring/rw.c                                 |   4 +-
 io_uring/timeout.c                            |   2 +-
 io_uring/zcrx.c                               |  24 +-
 kernel/bpf/crypto.c                           |   8 +-
 kernel/bpf/verifier.c                         |  63 +++-
 kernel/cgroup/cpuset.c                        |  84 ++++--
 kernel/configs/debug.config                   |   1 -
 kernel/crash_dump_dm_crypt.c                  |  17 +-
 kernel/dma/direct.h                           |   2 +-
 kernel/events/core.c                          |  20 +-
 kernel/events/uprobes.c                       |  12 +-
 kernel/irq/cpuhotplug.c                       |   6 +-
 kernel/irq/internals.h                        |   2 +-
 kernel/irq/manage.c                           |  26 +-
 kernel/kexec_file.c                           | 131 ++++----
 kernel/liveupdate/kexec_handover.c            |   8 +-
 kernel/sched/debug.c                          |   7 +-
 kernel/trace/bpf_trace.c                      |   1 +
 kernel/trace/fgraph.c                         |  14 +-
 kernel/trace/ring_buffer.c                    |   9 +-
 kernel/trace/trace.c                          |   8 +-
 kernel/trace/trace_events.c                   |   3 +
 kernel/trace/trace_events_hist.c              |   4 +-
 kernel/trace/trace_hwlat.c                    |  15 +-
 kernel/watchdog.c                             |   2 +-
 lib/Kconfig.debug                             |  27 --
 mm/highmem.c                                  |   3 +-
 mm/hugetlb.c                                  |   9 +
 mm/memcontrol.c                               |  16 +-
 mm/numa_memblks.c                             |   9 +-
 mm/page_alloc.c                               |  32 +-
 mm/slab_common.c                              |   5 +-
 mm/slub.c                                     | 115 +++++--
 mm/vmalloc.c                                  |   8 +
 mm/vmscan.c                                   |  34 ++-
 net/9p/trans_xen.c                            |  85 +++---
 net/bluetooth/hci_conn.c                      |   5 +-
 net/bluetooth/hci_sync.c                      |   2 -
 net/bluetooth/l2cap_core.c                    |  95 ++++--
 net/bluetooth/l2cap_sock.c                    |  15 +-
 net/ceph/crypto.c                             |   8 +-
 net/ceph/crypto.h                             |   2 +-
 net/ceph/messenger_v2.c                       |   2 +-
 net/core/dev.c                                |  35 ++-
 net/core/gro.c                                |   2 +-
 net/core/skbuff.c                             |  23 +-
 net/ipv4/fib_lookup.h                         |   6 +-
 net/ipv4/fib_trie.c                           |   4 +-
 net/ipv4/igmp.c                               |   4 +-
 net/ipv4/syncookies.c                         |   2 +-
 net/ipv4/tcp_fastopen.c                       |   2 +-
 net/ipv4/tcp_input.c                          |  18 +-
 net/ipv4/tcp_ipv4.c                           |   8 +-
 net/ipv4/tcp_minisocks.c                      |   2 +-
 net/ipv4/udplite.c                            |   3 +-
 net/ipv6/af_inet6.c                           |   4 +-
 net/ipv6/exthdrs.c                            |  15 +-
 net/ipv6/icmp.c                               |   3 +-
 net/ipv6/ioam6.c                              |  14 +
 net/ipv6/ioam6_iptunnel.c                     |  10 +-
 net/ipv6/route.c                              |  24 +-
 net/ipv6/tcp_ipv6.c                           | 101 +++----
 net/ipv6/udplite.c                            |   3 +-
 net/ipv6/xfrm6_policy.c                       |   7 +-
 net/kcm/kcmsock.c                             |  21 +-
 net/mptcp/pm_kernel.c                         |  20 +-
 net/mptcp/subflow.c                           |   6 +-
 net/netfilter/nf_conntrack_h323_asn1.c        |   2 +-
 net/netfilter/nf_conntrack_proto_generic.c    |   1 +
 net/netfilter/xt_tcpmss.c                     |   2 +-
 net/nfc/nci/ntf.c                             | 159 ++++++++--
 net/psp/psp_main.c                            |  39 ++-
 net/qrtr/mhi.c                                |  69 ++++-
 net/rds/connection.c                          |   4 +
 net/rds/tcp_listen.c                          |   5 -
 net/sched/act_skbedit.c                       |   6 +-
 net/sched/bpf_qdisc.c                         |   8 +-
 net/smc/af_smc.c                              |   6 +-
 net/socket.c                                  |   2 +-
 net/tipc/crypto.c                             |   2 +-
 net/tipc/name_table.c                         |   6 +-
 net/tls/tls_sw.c                              |   2 +-
 net/vmw_vsock/vmci_transport.c                |   2 +-
 net/wireless/core.c                           |   8 +-
 net/wireless/wext-compat.c                    |   2 +-
 net/xfrm/espintcp.c                           |   2 +-
 net/xfrm/xfrm_device.c                        |  12 +-
 net/xfrm/xfrm_policy.c                        |  11 +-
 rust/Makefile                                 |   3 +
 rust/kernel/cpufreq.rs                        |   2 +
 rust/kernel/drm/driver.rs                     |   6 +-
 rust/kernel/irq/request.rs                    |  12 +-
 rust/kernel/list/impl_list_item_mod.rs        |  25 +-
 rust/pin-init/src/lib.rs                      |   4 +-
 scripts/cc-can-link.sh                        |   2 +-
 scripts/gendwarfksyms/dwarf.c                 |   4 +-
 scripts/gendwarfksyms/symbols.c               |   5 +-
 scripts/kernel-doc.py                         |  26 +-
 scripts/mod/modpost.c                         |   4 +
 scripts/package/kernel.spec                   |  64 +++-
 scripts/package/mkspec                        |  38 ++-
 security/integrity/ima/ima_kexec.c            |  35 +++
 sound/core/oss/mixer_oss.c                    |  16 +
 sound/core/pcm_native.c                       |   4 +-
 sound/hda/codecs/conexant.c                   |   1 +
 sound/hda/codecs/hdmi/hdmi.c                  |   1 +
 sound/hda/codecs/realtek/alc269.c             | 282 +++++++++++++++++-
 .../hda/codecs/side-codecs/tas2781_hda_spi.c  |  20 +-
 sound/hda/controllers/intel.c                 |   1 +
 sound/pci/ctxfi/ctatc.c                       |  11 +-
 sound/soc/amd/acp/acp-sdw-legacy-mach.c       |  16 +
 sound/soc/amd/yc/acp6x-mach.c                 |   8 +-
 sound/soc/codecs/es8328.c                     |  10 +-
 sound/soc/codecs/max98390.c                   |   3 +
 sound/soc/codecs/rt721-sdca.c                 |   4 +-
 sound/soc/codecs/wm8962.c                     |  12 +-
 sound/soc/fsl/imx-rpmsg.c                     |   2 +-
 .../intel/common/soc-acpi-intel-arl-match.c   |  23 +-
 .../intel/common/soc-acpi-intel-ptl-match.c   |  13 +-
 sound/soc/qcom/qdsp6/q6asm.c                  |   4 +-
 sound/soc/sdw_utils/soc_sdw_utils.c           |  15 -
 sound/soc/sof/intel/hda-dai.c                 |  14 +-
 sound/soc/sof/ipc4-control.c                  |  41 ++-
 sound/soc/sof/ipc4-topology.c                 |  35 ++-
 sound/soc/sof/ipc4.c                          |  44 ++-
 sound/soc/sunxi/sun50i-dmic.c                 |   3 +
 sound/usb/endpoint.c                          |  40 +--
 sound/usb/mixer_s1810c.c                      |  36 +--
 sound/usb/quirks.c                            |   4 +
 tools/arch/arm64/include/uapi/asm/unistd.h    |  24 +-
 tools/bpf/bpftool/Makefile                    |   4 +-
 tools/include/linux/bitfield.h                |   1 +
 tools/lib/perf/Makefile                       |   2 +-
 tools/lib/python/kdoc/kdoc_parser.py          |  35 ++-
 tools/lib/subcmd/help.c                       |  10 +-
 tools/objtool/check.c                         |   3 +-
 tools/perf/Makefile.perf                      |   9 +-
 .../arch/loongarch/annotate/instructions.c    |  14 +-
 tools/perf/arch/s390/annotate/instructions.c  |  11 +-
 tools/perf/pmu-events/Build                   |  14 +-
 .../arch/x86/amdzen5/load-store.json          |   6 +-
 tools/perf/tests/kallsyms-split.c             |   1 +
 tools/perf/tests/make                         |   2 +-
 tools/perf/tests/shell/evlist.sh              |   9 +-
 tools/perf/tests/shell/sched.sh               |   2 +-
 tools/perf/tests/shell/stat.sh                |   2 +-
 tools/perf/util/addr2line.c                   |   4 +-
 tools/perf/util/annotate.c                    |   2 +-
 tools/perf/util/capstone.c                    |  14 +-
 tools/perf/util/cs-etm.c                      |   3 +-
 tools/perf/util/disasm.c                      |  38 +--
 tools/perf/util/disasm.h                      |   2 +-
 tools/perf/util/dso.c                         |  63 +++-
 tools/perf/util/dso.h                         |  11 +-
 tools/perf/util/evsel_fprintf.c               |   8 +-
 tools/perf/util/libbfd.c                      |   6 +-
 tools/perf/util/llvm.c                        |   6 +-
 tools/perf/util/maps.c                        |   1 +
 tools/perf/util/metricgroup.c                 |  18 +-
 tools/perf/util/stat-display.c                |  59 ++--
 tools/perf/util/stat-shadow.c                 |  30 +-
 tools/perf/util/stat.h                        |   2 +-
 tools/perf/util/symbol-elf.c                  |   2 +-
 tools/perf/util/unwind-libdw.c                |   7 +-
 tools/power/cpupower/lib/cpuidle.c            |   1 +
 tools/power/cpupower/utils/cpufreq-info.c     |   2 +-
 .../selftests/mm/charge_reserved_hugetlb.sh   |   4 +-
 tools/testing/selftests/ublk/kublk.h          |   2 +-
 tools/tracing/rtla/src/actions.c              |   2 +
 857 files changed, 8016 insertions(+), 3810 deletions(-)
 create mode 100644 arch/alpha/mm/tlbflush.c
 create mode 100644 drivers/acpi/apei/ghes_helpers.c
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH 1/844 rust_binder: Fix build failure if !CONFIG_COMPAT

From: Xi Ruoyao <[email protected]>

commit 174e2a339bf731e080ced67c215ad609a677560b upstream.

The bindgen utility cannot handle "#define compat_ptr_ioctl NULL" in the C header, so we need to handle this case on our own.

Simply skip this field in the initializer when !CONFIG_COMPAT as the SAFETY comment above this initializer implies this is allowed.

---
 drivers/android/binder/rust_binder_main.rs | 1 +
 1 file changed, 1 insertion(+)
drivers/android/binder/rust_binder_main.rs +1 -0
index c79a9e7422401..9a527268f5b45 100644
@@ -314,6 +314,7 @@ unsafe impl<T> Sync for AssertSync<T> {}
         owner: THIS_MODULE.as_ptr(),
         poll: Some(rust_binder_poll),
         unlocked_ioctl: Some(rust_binder_ioctl),
+        #[cfg(CONFIG_COMPAT)]
         compat_ioctl: Some(bindings::compat_ptr_ioctl),
         mmap: Some(rust_binder_mmap),
         open: Some(rust_binder_open),
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 2/844 mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms

In reply to Sasha Levin

From: Matthew Schwartz <[email protected]>

[ Upstream commit aced969e9bf3701dc75cfca57c78c031b7875b9d ]

The existing 1ms delay in sd_power_on is insufficient and causes resume errors around 4% of the time.

Increasing the delay to 5ms resolves this issue after testing 300 s2idle cycles.

Fixes 1f311c94aabd ("mmc: rtsx: add 74 Clocks in power on flow")
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/rtsx_pci_sdmmc.c +1 -1
index 4db3328f46dfb..b6cf1803c7d27 100644
@@ -937,7 +937,7 @@ static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode)
 	if (err < 0)
 		return err;
 
-	mdelay(1);
+	mdelay(5);
 
 	err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
 	if (err < 0)
Signature · 1 line
2.51.0
author maintainer
#3 lore raw

PATCH 3/844 Revert "mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms"

In reply to Sasha Levin

From: Greg Kroah-Hartman <[email protected]>

[ Upstream commit ff112f1ecd10b72004eac05bae395e1c65f0c63c ]

This reverts commit aced969e9bf3701dc75cfca57c78c031b7875b9d.

It was determined that this was not the correct "fix", so should be reverted.

Fixes aced969e9bf3 ("mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms")
Cc Matthew Schwartz <[email protected]>
Cc Ulf Hansson <[email protected]>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/rtsx_pci_sdmmc.c +1 -1
index b6cf1803c7d27..4db3328f46dfb 100644
@@ -937,7 +937,7 @@ static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode)
 	if (err < 0)
 		return err;
 
-	mdelay(5);
+	mdelay(1);
 
 	err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
 	if (err < 0)
Signature · 1 line
2.51.0
author maintainer
#4 lore raw

PATCH 4/844 perf test: Fix test case perf evlist tests for s390x

In reply to Sasha Levin

From: Thomas Richter <[email protected]>

[ Upstream commit b04d2b9199129f4f0c992a518c0fb78c2efc1064 ]

Perf test case 78: perf evlist tests fails on s390.

The failure is causes by grouping events cycles and instructions because sampling does only support event cycles. Change the group to software events to fix this.

Output before:

  # ./perf test 78
  78: perf evlist tests              : FAILED!
  #

Output after:

  # ./perf test 78
  78: perf evlist tests              : Ok
  #
Fixes db452961de939225 ("perf tests evlist: Add basic evlist test")
Cc Alexander Gordeev <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Jan Polensky <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Sumanth Korikkar <[email protected]>
Cc Vasily Gorbik <[email protected]>
---
 tools/perf/tests/shell/evlist.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/tests/shell/evlist.sh +3 -2
index 140f099e75c1e..5632be3917109 100755
@@ -38,13 +38,14 @@ test_evlist_simple() {
 
 test_evlist_group() {
 	echo "Group evlist test"
-	if ! perf record -e "{cycles,instructions}" -o "${perfdata}" true 2> /dev/null
+	if ! perf record -e "{cpu-clock,task-clock}" -o "${perfdata}" \
+		-- perf test -w noploop 2> /dev/null
 	then
 		echo "Group evlist [Skipped event group recording failed]"
 		return
 	fi
 
-	if ! perf evlist -i "${perfdata}" -g | grep -q "{.*cycles.*,.*instructions.*}"
+	if ! perf evlist -i "${perfdata}" -g | grep -q "{.*cpu-clock.*,.*task-clock.*}"
 	then
 		echo "Group evlist [Failed to list event group]"
 		err=1
Signature · 1 line
2.51.0
author maintainer
#5 lore raw

PATCH 5/844 perf test stat tests: Fix for virtualized machines

In reply to Sasha Levin

From: Thomas Richter <[email protected]>

[ Upstream commit e272628902c1c96731e2d9f62a7fc77767686eb0 ]

On s390 'perf test's 'perf stat tests', subtest test_hybrid fails for z/VM systems. The root cause is this statement:

  $(perf stat -a -- sleep 0.1 2>&1 |\
                  grep -E "/cpu-cycles/[uH]*|  cpu-cycles[:uH]* -c)

The 'perf stat' output on a s390 z/VM system is

  # perf stat -a -- sleep 0.1 2>&1
  Performance counter stats for 'system wide':
        56      context-switches  #     46.3 cs/sec  cs_per_second
  1,210.41 msec cpu-clock         #     11.9 CPUs  CPUs_utilized
        12      cpu-migrations    #      9.9 migrations/sec ...
        81      page-faults       #     66.9 faults/sec ...
        0.100891009 seconds time elapsed

The grep command does not match any single line and exits with error code 1.

As the bash script is executed with 'set -e', it aborts with the first error code being non-zero.

Fix this and use 'wc -l' to count matching lines instead of 'grep ... -c'.

Output before:

  # perf test 102
  102: perf stat tests                      : FAILED!
  #

Output after:

  # perf test 102
  102: perf stat tests                      : Ok
  #
Fixes bb6e7cb11d97ce19 ("perf tools: Add fallback for exclude_guest")
Cc Alexander Gordeev <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Jan Polensky <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Sumanth Korikkar <[email protected]>
Cc Vasily Gorbik <[email protected]>
---
 tools/perf/tests/shell/stat.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/stat.sh +1 -1
index 0b2f0f88ca166..792a0b79f6b86 100755
@@ -233,7 +233,7 @@ test_hybrid() {
   fi
 
   # Run default Perf stat
-  cycles_events=$(perf stat -a -- sleep 0.1 2>&1 | grep -E "/cpu-cycles/[uH]*|  cpu-cycles[:uH]*  " -c)
+  cycles_events=$(perf stat -a -- sleep 0.1 2>&1 | grep -E "/cpu-cycles/[uH]*|  cpu-cycles[:uH]*  "  | wc -l)
 
   # The expectation is that default output will have a cycles events on each
   # hybrid PMU. In situations with no cycles PMU events, like virtualized, this
Signature · 1 line
2.51.0
author maintainer
#6 lore raw

PATCH 6/844 perf build: Raise minimum shellcheck version to 0.7.2

In reply to Sasha Levin

From: Nicolas Schier <[email protected]>

[ Upstream commit 383f8e26e2c483e25453f8c3d0839877708ac701 ]

Raise the minimum shellcheck version for perf builds to 0.7.2, so that systems with shellcheck versions below 0.7.2 will automatically skip the shell script checking, even if NO_SHELLCHECK is unset.

Since commit 241f21be7d0fdf3c ("perf test perftool_testsuite: Use absolute paths"), shellcheck versions before 0.7.2 break the perf build with several SC1090 [2] warnings due to its too strict dynamic source handling [1], e.g.:

In tests/shell/base_probe/test_line_semantics.sh line 20:
. "$DIR_PATH/../common/init.sh"

    ^---------------------------^ SC1090: Can't follow non-constant source. Use a directive to specify location.
Fixes 241f21be7d0fdf3c ("perf test perftool_testsuite: Use absolute paths")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jakub Brnak <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Michael Petlan <[email protected]>
Cc Nicolas Schier <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Philipp Hahn <[email protected]>
Cc Veronika Molnarova <[email protected]>
---
 tools/perf/Makefile.perf | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tools/perf/Makefile.perf +4 -3
index b3f481a626afa..e6895626c1872 100644
@@ -251,11 +251,12 @@ else
 endif
 
 # shellcheck is using in tools/perf/tests/Build with option -a/--check-sourced (
-# introduced in v0.4.7) and -S/--severity (introduced in v0.6.0). So make the
-# minimal shellcheck version as v0.6.0.
+# introduced in v0.4.7) and -S/--severity (introduced in v0.6.0) as well as
+# dynamic source inclusions (properly handled since v0.7.2).
+# So make the minimal shellcheck version as v0.7.2.
 ifneq ($(SHELLCHECK),)
   ifeq ($(shell expr $(shell $(SHELLCHECK) --version | grep version: | \
-        sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 060), 1)
+        sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 072), 1)
     SHELLCHECK :=
   else
     SHELLCHECK := $(SHELLCHECK) -s bash -a -S warning
Signature · 1 line
2.51.0
author maintainer
#7 lore raw

PATCH 7/844 perf unwind-libdw: Fix invalid reference counts

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit f815fc0c66e777c727689666cfb46b8d461c2f99 ]

The addition of addr_location__exit() causes use-after put on the maps and map references in the unwind info. Add the gets and then add the map_symbol__exit() calls.

Fixes 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephen Brennan <[email protected]>
Cc Tony Jones <[email protected]>
---
 tools/perf/util/unwind-libdw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/perf/util/unwind-libdw.c +5 -2
index ae70fb56a0572..3ff427a49e4c5 100644
@@ -136,8 +136,8 @@ static int entry(u64 ip, struct unwind_info *ui)
 	}
 
 	e->ip	  = ip;
-	e->ms.maps = al.maps;
-	e->ms.map = al.map;
+	e->ms.maps = maps__get(al.maps);
+	e->ms.map = map__get(al.map);
 	e->ms.sym = al.sym;
 
 	pr_debug("unwind: %s:ip = 0x%" PRIx64 " (0x%" PRIx64 ")\n",
@@ -325,6 +325,9 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 	if (err)
 		pr_debug("unwind: failed with '%s'\n", dwfl_errmsg(-1));
 
+	for (i = 0; i < ui->idx; i++)
+		map_symbol__exit(&ui->entries[i].ms);
+
 	dwfl_end(ui->dwfl);
 	free(ui);
 	return 0;
Signature · 1 line
2.51.0
author maintainer
#8 lore raw

PATCH 8/844 perf callchain: Fix srcline printing with inlines

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit abec464767b5d26f0612250d511c18f420826ca1 ]

sample__fprintf_callchain() was using map__fprintf_srcline() which won't report inline line numbers.

Fix by using the srcline from the callchain and falling back to the map variant.

Fixes 25da4fab5f66e659 ("perf evsel: Move fprintf methods to separate source file")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephen Brennan <[email protected]>
Cc Tony Jones <[email protected]>
---
 tools/perf/util/evsel_fprintf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/perf/util/evsel_fprintf.c +6 -2
index 10f1a03c28601..5521d00bff2c0 100644
@@ -185,8 +185,12 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
 			if (print_dso && (!sym || !sym->inlined))
 				printed += map__fprintf_dsoname_dsoff(map, print_dsoff, addr, fp);
 
-			if (print_srcline)
-				printed += map__fprintf_srcline(map, addr, "\n  ", fp);
+			if (print_srcline) {
+				if (node->srcline)
+					printed += fprintf(fp, "\n  %s", node->srcline);
+				else
+					printed += map__fprintf_srcline(map, addr, "\n  ", fp);
+			}
 
 			if (sym && sym->inlined)
 				printed += fprintf(fp, " (inlined)");
Signature · 1 line
2.51.0
author maintainer
#9 lore raw

PATCH 9/844 libsubcmd: Fix null intersection case in exclude_cmds()

In reply to Sasha Levin

From: Sri Jayaramappa <[email protected]>

[ Upstream commit b6ee9b6e206b288921c14c906eebf4b32fe0c0d8 ]

When there is no exclusion occurring from the cmds list - for example - cmds contains ["read-vdso32"] and excludes contains ["archive"] - the main loop completes with ci == cj == 0. In the original code the loop processing the remaining elements in the list was conditional:

    if (ci != cj) { ...}

So we end up in the assertion loop since ci < cmds->cnt and we incorrectly try to assert the list elements to be NULL and fail with the following error

help.c:104: exclude_cmds: Assertion `cmds->names[ci] == NULL' failed.

Fix this by moving the if (ci != cj) check inside of a broader loop. If ci != cj, left shift the list elements, as before, and then unconditionally advance the ci and cj indicies which also covers the ci == cj case.

---
 tools/lib/subcmd/help.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tools/lib/subcmd/help.c +6 -4
index ddaeb4eb3e249..db94aa685b73b 100644
@@ -97,11 +97,13 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
 			ei++;
 		}
 	}
-	if (ci != cj) {
-		while (ci < cmds->cnt) {
-			cmds->names[cj++] = cmds->names[ci];
-			cmds->names[ci++] = NULL;
+	while (ci < cmds->cnt) {
+		if (ci != cj) {
+			cmds->names[cj] = cmds->names[ci];
+			cmds->names[ci] = NULL;
 		}
+		ci++;
+		cj++;
 	}
 	for (ci = cj; ci < cmds->cnt; ci++)
 		assert(cmds->names[ci] == NULL);
Signature · 1 line
2.51.0
author maintainer
#10 lore raw

PATCH 10/844 rtc: nvvrs: Add ARCH_TEGRA to the NV VRS RTC driver

In reply to Sasha Levin

From: Peter Robinson <[email protected]>

[ Upstream commit f9ecfd9bfedba9fd9d4b015b33b847571f7fdd42 ]

The NV VRS RTC driver currently is only supported on the Tegra platform so add a dep for ARCH_TEGRA and compile test so it doesn't show up universally across all arches/platforms.

Fixes 9d6d6b06933c8 ("rtc: nvvrs: add NVIDIA VRS RTC device driver")
Cc Shubhi Garg <[email protected]>
Cc Jon Hunter <[email protected]>
---
 drivers/rtc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/Kconfig +1 -0
index 50dc779f7f983..50ba48609d74e 100644
@@ -418,6 +418,7 @@ config RTC_DRV_SPACEMIT_P1
 
 config RTC_DRV_NVIDIA_VRS10
 	tristate "NVIDIA VRS10 RTC device"
+	depends on ARCH_TEGRA || COMPILE_TEST
 	help
 	  If you say yes here you will get support for the battery backed RTC device
 	  of NVIDIA VRS (Voltage Regulator Specification). The RTC is connected via
Signature · 1 line
2.51.0
author maintainer
#11 lore raw

PATCH 11/844 rtc: max31335: use correct CONFIG symbol in IS_REACHABLE()

In reply to Sasha Levin

From: Randy Dunlap <[email protected]>

[ Upstream commit d5aca9a17f6de884febc56018f92d743b8ea1298 ]

IS_REACHABLE() is meant to be used with full symbol names from a kernel .config file, not the shortened symbols used in Kconfig files, so change HWMON to CONFIG_HWMON in 3 places.

---
 drivers/rtc/rtc-max31335.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-max31335.c +3 -3
index 23b7bf16b4cd5..952b455071d68 100644
@@ -591,7 +591,7 @@ static struct nvmem_config max31335_nvmem_cfg = {
 	.size = MAX31335_RAM_SIZE,
 };
 
-#if IS_REACHABLE(HWMON)
+#if IS_REACHABLE(CONFIG_HWMON)
 static int max31335_read_temp(struct device *dev, enum hwmon_sensor_types type,
 			      u32 attr, int channel, long *val)
 {
@@ -672,7 +672,7 @@ static int max31335_clkout_register(struct device *dev)
 static int max31335_probe(struct i2c_client *client)
 {
 	struct max31335_data *max31335;
-#if IS_REACHABLE(HWMON)
+#if IS_REACHABLE(CONFIG_HWMON)
 	struct device *hwmon;
 #endif
 	const struct chip_desc *match;
@@ -727,7 +727,7 @@ static int max31335_probe(struct i2c_client *client)
 		return dev_err_probe(&client->dev, ret,
 				     "cannot register rtc nvmem\n");
 
-#if IS_REACHABLE(HWMON)
+#if IS_REACHABLE(CONFIG_HWMON)
 	if (max31335->chip->temp_reg) {
 		hwmon = devm_hwmon_device_register_with_info(&client->dev, client->name, max31335,
 							     &max31335_chip_info, NULL);
Signature · 1 line
2.51.0
author maintainer
#12 lore raw

PATCH 12/844 perf symbol-elf: Fix leak of ELF files with GNU debugdata

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 92d65d9c31621befe0a5f7c0bd43bd217613c6b6 ]

The processing of DSO_BINARY_TYPE__GNU_DEBUGDATA in symsrc__init happens with an open ELF file but the error path only closes the associate fd.

Fix the goto so that the ELF file is also ended and memory released.

Fixes b10f74308e130527 ("perf symbol: Support .gnu_debugdata for symbols")
Cc Aditya Bodkhe <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Albert Ou <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Athira Rajeev <[email protected]>
Cc Chun-Tse Shao <[email protected]>
Cc Dmitriy Vyukov <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
Cc Guo Ren <[email protected]>
Cc Haibo Xu <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Garry <[email protected]>
Cc Krzysztof Łopatowski <[email protected]>
Cc Leo Yan <[email protected]>
Cc Mark Wielaard <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sergei Trofimovich <[email protected]>
Cc Shimin Guo <[email protected]>
Cc Stephen Brennan <[email protected]>
Cc Thomas Falcon <[email protected]>
Cc Will Deacon <[email protected]>
---
 tools/perf/util/symbol-elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/symbol-elf.c +1 -1
index d1dcafa4b3b80..439f252937b89 100644
@@ -1173,7 +1173,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 		Elf *embedded = read_gnu_debugdata(dso, elf, name, &new_fd);
 
 		if (!embedded)
-			goto out_close;
+			goto out_elf_end;
 
 		elf_end(elf);
 		close(fd);
Signature · 1 line
2.51.0
author maintainer
#13 lore raw

PATCH 13/844 perf tools: Get debug info of DSO properly

In reply to Sasha Levin

From: Namhyung Kim <[email protected]>

[ Upstream commit 069e603d8248dac98b1ef2909e2f1c4169b9da11 ]

The dso__debuginfo() just used the path name to open the file but it may be outdated. It should check build-ID and use the file in the build-ID cache if available rather than just using the path name.

Let's factor out dso__get_filename() to avoid code duplicate.

Fixes 53a61a6ca279165d ("perf annotate: Add dso__debuginfo() helper")
Cc Adrian Hunter <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/dso.c | 63 ++++++++++++++++++++++++++++++++-----------
 tools/perf/util/dso.h | 11 ++------
 2 files changed, 50 insertions(+), 24 deletions(-)
tools/perf/util/dso.c +48 -15
index 344e689567ee1..dc202d4943721 100644
@@ -111,7 +111,7 @@ bool dso__is_object_file(const struct dso *dso)
 
 int dso__read_binary_type_filename(const struct dso *dso,
 				   enum dso_binary_type type,
-				   char *root_dir, char *filename, size_t size)
+				   const char *root_dir, char *filename, size_t size)
 {
 	char build_id_hex[SBUILD_ID_SIZE];
 	int ret = 0;
@@ -563,20 +563,15 @@ char *dso__filename_with_chroot(const struct dso *dso, const char *filename)
 	return filename_with_chroot(nsinfo__pid(dso__nsinfo_const(dso)), filename);
 }
 
-static int __open_dso(struct dso *dso, struct machine *machine)
-	EXCLUSIVE_LOCKS_REQUIRED(_dso__data_open_lock)
+static char *dso__get_filename(struct dso *dso, const char *root_dir,
+			       bool *decomp)
 {
-	int fd = -EINVAL;
-	char *root_dir = (char *)"";
 	char *name = malloc(PATH_MAX);
-	bool decomp = false;
 
-	if (!name)
-		return -ENOMEM;
+	*decomp = false;
 
-	mutex_lock(dso__lock(dso));
-	if (machine)
-		root_dir = machine->root_dir;
+	if (name == NULL)
+		return NULL;
 
 	if (dso__read_binary_type_filename(dso, dso__binary_type(dso),
 					    root_dir, name, PATH_MAX))
@@ -601,20 +596,38 @@ static int __open_dso(struct dso *dso, struct machine *machine)
 		size_t len = sizeof(newpath);
 
 		if (dso__decompress_kmodule_path(dso, name, newpath, len) < 0) {
-			fd = -(*dso__load_errno(dso));
+			errno = *dso__load_errno(dso);
 			goto out;
 		}
 
-		decomp = true;
+		*decomp = true;
 		strcpy(name, newpath);
 	}
+	return name;
+
+out:
+	free(name);
+	return NULL;
+}
 
-	fd = do_open(name);
+static int __open_dso(struct dso *dso, struct machine *machine)
+	EXCLUSIVE_LOCKS_REQUIRED(_dso__data_open_lock)
+{
+	int fd = -EINVAL;
+	char *name;
+	bool decomp = false;
+
+	mutex_lock(dso__lock(dso));
+
+	name = dso__get_filename(dso, machine ? machine->root_dir : "", &decomp);
+	if (name)
+		fd = do_open(name);
+	else
+		fd = -errno;
 
 	if (decomp)
 		unlink(name);
 
-out:
 	mutex_unlock(dso__lock(dso));
 	free(name);
 	return fd;
@@ -1910,3 +1923,23 @@ const u8 *dso__read_symbol(struct dso *dso, const char *symfs_filename,
 	return __dso__read_symbol(dso, symfs_filename, start, len,
 				  out_buf, out_buf_len, is_64bit);
 }
+
+struct debuginfo *dso__debuginfo(struct dso *dso)
+{
+	char *name;
+	bool decomp = false;
+	struct debuginfo *dinfo = NULL;
+
+	mutex_lock(dso__lock(dso));
+
+	name = dso__get_filename(dso, "", &decomp);
+	if (name)
+		dinfo = debuginfo__new(name);
+
+	if (decomp)
+		unlink(name);
+
+	mutex_unlock(dso__lock(dso));
+	free(name);
+	return dinfo;
+}
tools/perf/util/dso.h +2 -9
index f8ccb9816b89c..54e470dd07305 100644
@@ -766,7 +766,7 @@ int dso__kernel_module_get_build_id(struct dso *dso, const char *root_dir);
 
 char dso__symtab_origin(const struct dso *dso);
 int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type type,
-				   char *root_dir, char *filename, size_t size);
+				   const char *root_dir, char *filename, size_t size);
 bool is_kernel_module(const char *pathname, int cpumode);
 bool dso__needs_decompress(struct dso *dso);
 int dso__decompress_kmodule_fd(struct dso *dso, const char *name);
@@ -915,14 +915,7 @@ u64 dso__findnew_global_type(struct dso *dso, u64 addr, u64 offset);
 bool perf_pid_map_tid(const char *dso_name, int *tid);
 bool is_perf_pid_map_name(const char *dso_name);
 
-/*
- * In the future, we may get debuginfo using build-ID (w/o path).
- * Add this helper is for the smooth conversion.
- */
-static inline struct debuginfo *dso__debuginfo(struct dso *dso)
-{
-	return debuginfo__new(dso__long_name(dso));
-}
+struct debuginfo *dso__debuginfo(struct dso *dso);
 
 const u8 *dso__read_symbol(struct dso *dso, const char *symfs_filename,
 			   const struct map *map, const struct symbol *sym,
Signature · 1 line
2.51.0
author maintainer
#14 lore raw

PATCH 14/844 perf tests kallsyms: Fix missed map__put()

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit a58807adbed5f532efb231e5490767f284f237c0 ]

Issue was caught by leak sanitizer and the test robot.

---
 tools/perf/tests/kallsyms-split.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/kallsyms-split.c +1 -0
index bbbc66957e5d0..117ed3b70f630 100644
@@ -148,6 +148,7 @@ static int test__kallsyms_split(struct test_suite *test __maybe_unused,
 	ret = TEST_OK;
 
 out:
+	map__put(map);
 	remove_proc_dir(0);
 	machine__exit(&m);
 	return ret;
Signature · 1 line
2.51.0
author maintainer
#15 lore raw

PATCH 15/844 perf cs-etm: Fix decoding for sparse CPU maps

In reply to Sasha Levin

From: James Clark <[email protected]>

[ Upstream commit a70493e2bb0878885aa7a8178162550270693eb1 ]

The ETM decoder incorrectly assumed that auxtrace queue indices were equivalent to CPU number. This assumption is used for inserting records into the queue, and for fetching queues when given a CPU number. This assumption held when Perf always opened a dummy event on every CPU, even if the user provided a subset of CPUs on the commandline, resulting in the indices aligning.

For example:

  # event : name = cs_etm//u, , id = { 2451, 2452 }, type = 11 (cs_etm), size = 136, config = 0x4010, { sample_period, samp>
  # event : name = dummy:u, , id = { 2453, 2454, 2455, 2456 }, type = 1 (PERF_TYPE_SOFTWARE), size = 136, config = 0x9 (PER>

0 0 0x200 [0xd0]: PERF_RECORD_ID_INDEX nr: 6

  ... id: 2451  idx: 2  cpu: 2  tid: -1
  ... id: 2452  idx: 3  cpu: 3  tid: -1
  ... id: 2453  idx: 0  cpu: 0  tid: -1
  ... id: 2454  idx: 1  cpu: 1  tid: -1
  ... id: 2455  idx: 2  cpu: 2  tid: -1
  ... id: 2456  idx: 3  cpu: 3  tid: -1

Since commit 811082e4b668 ("perf parse-events: Support user CPUs mixed with threads/processes") the dummy event no longer behaves in this way, making the ETM event indices start from 0 on the first CPU recorded regardless of its ID:

  # event : name = cs_etm//u, , id = { 771, 772 }, type = 11 (cs_etm), size = 144, config = 0x4010, { sample_period, sample>
  # event : name = dummy:u, , id = { 773, 774 }, type = 1 (PERF_TYPE_SOFTWARE), size = 144, config = 0x9 (PERF_COUNT_SW_DUM>

0 0 0x200 [0x90]: PERF_RECORD_ID_INDEX nr: 4

  ... id: 771  idx: 0  cpu: 2  tid: -1
  ... id: 772  idx: 1  cpu: 3  tid: -1
  ... id: 773  idx: 0  cpu: 2  tid: -1
  ... id: 774  idx: 1  cpu: 3  tid: -1

This causes the following segfault when decoding:

  $ perf record -e cs_etm//u -C 2,3 -- true
  $ perf report

perf: Segmentation fault
-------- backtrace --------
#0 0xaaaabf9fd020 in ui__signal_backtrace setup.c:110
#1 0xffffab5c7930 in __kernel_rt_sigreturn [vdso][930]
#2 0xaaaabfb68d30 in cs_etm_decoder__reset cs-etm-decoder.c:85 #3 0xaaaabfb65930 in cs_etm__get_data_block cs-etm.c:2032 #4 0xaaaabfb666fc in cs_etm__run_per_cpu_timeless_decoder cs-etm.c:2551 #5 0xaaaabfb6692c in (cs_etm__process_timeless_queues cs-etm.c:2612 #6 0xaaaabfb63390 in cs_etm__flush_events cs-etm.c:921
#7 0xaaaabfb324c0 in auxtrace__flush_events auxtrace.c:2915 #8 0xaaaabfaac378 in __perf_session__process_events session.c:2285 #9 0xaaaabfaacc9c in perf_session__process_events session.c:2442 #10 0xaaaabf8d3d90 in __cmd_report builtin-report.c:1085 #11 0xaaaabf8d6944 in cmd_report builtin-report.c:1866
#12 0xaaaabf95ebfc in run_builtin perf.c:351
#13 0xaaaabf95eeb0 in handle_internal_command perf.c:404 #14 0xaaaabf95f068 in run_argv perf.c:451
#15 0xaaaabf95f390 in main perf.c:558
#16 0xffffaab97400 in __libc_start_call_main libc_start_call_main.h:74 #17 0xffffaab974d8 in __libc_start_main@@GLIBC_2.34 libc-start.c:128 #18 0xaaaabf8aa8f0 in _start perf[7a8f0]

Fix it by inserting into the queues based on CPU number, rather than using the index.

Fixes 811082e4b668db96 ("perf parse-events: Support user CPUs mixed with threads/processes")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Garry <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Mike Leach <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Suzuki Poulouse <[email protected]>
Cc Thomas Falcon <[email protected]>
Cc Will Deacon <[email protected]>
---
 tools/perf/util/cs-etm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/cs-etm.c +2 -1
index 25d56e0f1c078..12b55c2bc2ca4 100644
@@ -3086,7 +3086,7 @@ static int cs_etm__queue_aux_fragment(struct perf_session *session, off_t file_o
 
 	if (aux_offset >= auxtrace_event->offset &&
 	    aux_offset + aux_size <= auxtrace_event->offset + auxtrace_event->size) {
-		struct cs_etm_queue *etmq = etm->queues.queue_array[auxtrace_event->idx].priv;
+		struct cs_etm_queue *etmq = cs_etm__get_queue(etm, auxtrace_event->cpu);
 
 		/*
 		 * If this AUX event was inside this buffer somewhere, create a new auxtrace event
@@ -3095,6 +3095,7 @@ static int cs_etm__queue_aux_fragment(struct perf_session *session, off_t file_o
 		auxtrace_fragment.auxtrace = *auxtrace_event;
 		auxtrace_fragment.auxtrace.size = aux_size;
 		auxtrace_fragment.auxtrace.offset = aux_offset;
+		auxtrace_fragment.auxtrace.idx = etmq->queue_nr;
 		file_offset += aux_offset - auxtrace_event->offset + auxtrace_event->header.size;
 
 		pr_debug3("CS ETM: Queue buffer size: %#"PRI_lx64" offset: %#"PRI_lx64
Signature · 1 line
2.51.0
author maintainer
#16 lore raw

PATCH 16/844 perf annotate: Fix args leak of map_symbol

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 00419892bac28bf148450d762bbff990a6bd5494 ]

map_symbol__exit() needs calling on an annotate_args.ms, however, rather than introduce proper reference count handling to symbol__annotate() just switch to passing the map_symbol pointer parameter around, making the puts the caller's responsibility.

Fix a number of cases to ensure the map in a map_symbol has a reference count increment and add the then necessary map_symbol_exits.

Fixes 56e144fe98260a0f ("perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit")
Cc Aditya Bodkhe <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Albert Ou <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Athira Rajeev <[email protected]>
Cc Bill Wendling <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
Cc Guo Ren <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Garry <[email protected]>
Cc Julia Lawall <[email protected]>
Cc Justin Stitt <[email protected]>
Cc Krzysztof Łopatowski <[email protected]>
Cc Leo Yan <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sergei Trofimovich <[email protected]>
Cc Shimin Guo <[email protected]>
Cc Suchit Karunakaran <[email protected]>
Cc Thomas Falcon <[email protected]>
Cc Tianyou Li <[email protected]>
Cc Will Deacon <[email protected]>
Cc Zecheng Li <[email protected]>
---
 .../arch/loongarch/annotate/instructions.c    | 14 ++++----
 tools/perf/arch/s390/annotate/instructions.c  | 11 +++---
 tools/perf/util/annotate.c                    |  2 +-
 tools/perf/util/capstone.c                    | 14 ++++----
 tools/perf/util/disasm.c                      | 36 ++++++++++---------
 tools/perf/util/disasm.h                      |  2 +-
 tools/perf/util/llvm.c                        |  6 ++--
 7 files changed, 47 insertions(+), 38 deletions(-)
tools/perf/arch/loongarch/annotate/instructions.c +8 -6
index 70262d5f14442..1c3abb43c8d72 100644
@@ -10,9 +10,7 @@ static int loongarch_call__parse(struct arch *arch, struct ins_operands *ops, st
 {
 	char *c, *endptr, *tok, *name;
 	struct map *map = ms->map;
-	struct addr_map_symbol target = {
-		.ms = { .map = map, },
-	};
+	struct addr_map_symbol target;
 
 	c = strchr(ops->raw, '#');
 	if (c++ == NULL)
@@ -38,12 +36,16 @@ static int loongarch_call__parse(struct arch *arch, struct ins_operands *ops, st
 	if (ops->target.name == NULL)
 		return -1;
 
-	target.addr = map__objdump_2mem(map, ops->target.addr);
+	target = (struct addr_map_symbol) {
+		.ms = { .map = map__get(map), },
+		.addr = map__objdump_2mem(map, ops->target.addr),
+	};
 
 	if (maps__find_ams(ms->maps, &target) == 0 &&
 	    map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
 		ops->target.sym = target.ms.sym;
 
+	addr_map_symbol__exit(&target);
 	return 0;
 }
 
@@ -58,7 +60,7 @@ static int loongarch_jump__parse(struct arch *arch, struct ins_operands *ops, st
 	struct map *map = ms->map;
 	struct symbol *sym = ms->sym;
 	struct addr_map_symbol target = {
-		.ms = { .map = map, },
+		.ms = { .map = map__get(map), },
 	};
 	const char *c = strchr(ops->raw, '#');
 	u64 start, end;
@@ -90,7 +92,7 @@ static int loongarch_jump__parse(struct arch *arch, struct ins_operands *ops, st
 	} else {
 		ops->target.offset_avail = false;
 	}
-
+	addr_map_symbol__exit(&target);
 	return 0;
 }
 
tools/perf/arch/s390/annotate/instructions.c +7 -4
index c61193f1e0964..626e6d2cbc81a 100644
@@ -6,9 +6,7 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops,
 {
 	char *endptr, *tok, *name;
 	struct map *map = ms->map;
-	struct addr_map_symbol target = {
-		.ms = { .map = map, },
-	};
+	struct addr_map_symbol target;
 
 	tok = strchr(ops->raw, ',');
 	if (!tok)
@@ -36,12 +34,17 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops,
 
 	if (ops->target.name == NULL)
 		return -1;
-	target.addr = map__objdump_2mem(map, ops->target.addr);
+
+	target = (struct addr_map_symbol) {
+		.ms = { .map = map__get(map), },
+		.addr = map__objdump_2mem(map, ops->target.addr),
+	};
 
 	if (maps__find_ams(ms->maps, &target) == 0 &&
 	    map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
 		ops->target.sym = target.ms.sym;
 
+	addr_map_symbol__exit(&target);
 	return 0;
 }
 
tools/perf/util/annotate.c +1 -1
index cc7764455faf6..791d60f97c23e 100644
@@ -1031,7 +1031,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
 		return 0;
 
 	args.arch = arch;
-	args.ms = *ms;
+	args.ms = ms;
 
 	if (notes->src == NULL) {
 		notes->src = annotated_source__new();
tools/perf/util/capstone.c +7 -7
index be5fd44b1f9dc..2c7feab61b7bf 100644
@@ -143,7 +143,7 @@ static void print_capstone_detail(cs_insn *insn, char *buf, size_t len,
 				  struct annotate_args *args, u64 addr)
 {
 	int i;
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct symbol *sym;
 
 	/* TODO: support more architectures */
@@ -222,7 +222,7 @@ int symbol__disassemble_capstone(const char *filename __maybe_unused,
 {
 #ifdef HAVE_LIBCAPSTONE_SUPPORT
 	struct annotation *notes = symbol__annotation(sym);
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	u64 start = map__rip_2objdump(map, sym->start);
 	u64 offset;
@@ -256,7 +256,7 @@ int symbol__disassemble_capstone(const char *filename __maybe_unused,
 	args->line = disasm_buf;
 	args->line_nr = 0;
 	args->fileloc = NULL;
-	args->ms.sym = sym;
+	args->ms->sym = sym;
 
 	dl = disasm_line__new(args);
 	if (dl == NULL)
@@ -268,7 +268,7 @@ int symbol__disassemble_capstone(const char *filename __maybe_unused,
 	    !strcmp(args->options->disassembler_style, "att"))
 		disassembler_style = true;
 
-	if (capstone_init(maps__machine(args->ms.maps), &handle, is_64bit, disassembler_style) < 0)
+	if (capstone_init(maps__machine(args->ms->maps), &handle, is_64bit, disassembler_style) < 0)
 		goto err;
 
 	needs_cs_close = true;
@@ -345,7 +345,7 @@ int symbol__disassemble_capstone_powerpc(const char *filename __maybe_unused,
 {
 #ifdef HAVE_LIBCAPSTONE_SUPPORT
 	struct annotation *notes = symbol__annotation(sym);
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	struct nscookie nsc;
 	u64 start = map__rip_2objdump(map, sym->start);
@@ -382,7 +382,7 @@ int symbol__disassemble_capstone_powerpc(const char *filename __maybe_unused,
 	    !strcmp(args->options->disassembler_style, "att"))
 		disassembler_style = true;
 
-	if (capstone_init(maps__machine(args->ms.maps), &handle, is_64bit, disassembler_style) < 0)
+	if (capstone_init(maps__machine(args->ms->maps), &handle, is_64bit, disassembler_style) < 0)
 		goto err;
 
 	needs_cs_close = true;
@@ -408,7 +408,7 @@ int symbol__disassemble_capstone_powerpc(const char *filename __maybe_unused,
 	args->line = disasm_buf;
 	args->line_nr = 0;
 	args->fileloc = NULL;
-	args->ms.sym = sym;
+	args->ms->sym = sym;
 
 	dl = disasm_line__new(args);
 	if (dl == NULL)
tools/perf/util/disasm.c +20 -16
index 50b9433f3f8e6..924429142631a 100644
@@ -269,9 +269,7 @@ static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_s
 {
 	char *endptr, *tok, *name;
 	struct map *map = ms->map;
-	struct addr_map_symbol target = {
-		.ms = { .map = map, },
-	};
+	struct addr_map_symbol target;
 
 	ops->target.addr = strtoull(ops->raw, &endptr, 16);
 
@@ -296,12 +294,16 @@ static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_s
 	if (ops->target.name == NULL)
 		return -1;
 find_target:
-	target.addr = map__objdump_2mem(map, ops->target.addr);
+	target = (struct addr_map_symbol) {
+		.ms = { .map = map__get(map), },
+		.addr = map__objdump_2mem(map, ops->target.addr),
+	};
 
 	if (maps__find_ams(ms->maps, &target) == 0 &&
 	    map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
 		ops->target.sym = target.ms.sym;
 
+	addr_map_symbol__exit(&target);
 	return 0;
 
 indirect_call:
@@ -366,7 +368,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s
 	struct map *map = ms->map;
 	struct symbol *sym = ms->sym;
 	struct addr_map_symbol target = {
-		.ms = { .map = map, },
+		.ms = { .map = map__get(map), },
 	};
 	const char *c = strchr(ops->raw, ',');
 	u64 start, end;
@@ -440,7 +442,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s
 	} else {
 		ops->target.offset_avail = false;
 	}
-
+	addr_map_symbol__exit(&target);
 	return 0;
 }
 
@@ -1046,7 +1048,7 @@ static size_t disasm_line_size(int nr)
 struct disasm_line *disasm_line__new(struct annotate_args *args)
 {
 	struct disasm_line *dl = NULL;
-	struct annotation *notes = symbol__annotation(args->ms.sym);
+	struct annotation *notes = symbol__annotation(args->ms->sym);
 	int nr = notes->src->nr_events;
 
 	dl = zalloc(disasm_line_size(nr));
@@ -1064,7 +1066,7 @@ struct disasm_line *disasm_line__new(struct annotate_args *args)
 		} else if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0)
 			goto out_free_line;
 
-		disasm_line__init_ins(dl, args->arch, &args->ms);
+		disasm_line__init_ins(dl, args->arch, args->ms);
 	}
 
 	return dl;
@@ -1119,7 +1121,7 @@ static int symbol__parse_objdump_line(struct symbol *sym,
 				      struct annotate_args *args,
 				      char *parsed_line, int *line_nr, char **fileloc)
 {
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct annotation *notes = symbol__annotation(sym);
 	struct disasm_line *dl;
 	char *tmp;
@@ -1151,7 +1153,7 @@ static int symbol__parse_objdump_line(struct symbol *sym,
 	args->line    = parsed_line;
 	args->line_nr = *line_nr;
 	args->fileloc = *fileloc;
-	args->ms.sym  = sym;
+	args->ms->sym  = sym;
 
 	dl = disasm_line__new(args);
 	(*line_nr)++;
@@ -1169,12 +1171,14 @@ static int symbol__parse_objdump_line(struct symbol *sym,
 	if (dl->ins.ops && ins__is_call(&dl->ins) && !dl->ops.target.sym) {
 		struct addr_map_symbol target = {
 			.addr = dl->ops.target.addr,
-			.ms = { .map = map, },
+			.ms = { .map = map__get(map), },
 		};
 
-		if (!maps__find_ams(args->ms.maps, &target) &&
+		if (!maps__find_ams(args->ms->maps, &target) &&
 		    target.ms.sym->start == target.al_addr)
 			dl->ops.target.sym = target.ms.sym;
+
+		addr_map_symbol__exit(&target);
 	}
 
 	annotation_line__add(&dl->al, &notes->src->source);
@@ -1338,7 +1342,7 @@ static int symbol__disassemble_raw(char *filename, struct symbol *sym,
 					struct annotate_args *args)
 {
 	struct annotation *notes = symbol__annotation(sym);
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	u64 start = map__rip_2objdump(map, sym->start);
 	u64 end = map__rip_2objdump(map, sym->end);
@@ -1375,7 +1379,7 @@ static int symbol__disassemble_raw(char *filename, struct symbol *sym,
 	args->line = disasm_buf;
 	args->line_nr = 0;
 	args->fileloc = NULL;
-	args->ms.sym = sym;
+	args->ms->sym = sym;
 
 	dl = disasm_line__new(args);
 	if (dl == NULL)
@@ -1501,7 +1505,7 @@ static int symbol__disassemble_objdump(const char *filename, struct symbol *sym,
 				       struct annotate_args *args)
 {
 	struct annotation_options *opts = &annotate_opts;
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	char *command;
 	FILE *file;
@@ -1644,7 +1648,7 @@ static int symbol__disassemble_objdump(const char *filename, struct symbol *sym,
 int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
 {
 	struct annotation_options *options = args->options;
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	char symfs_filename[PATH_MAX];
 	bool delete_extract = false;
tools/perf/util/disasm.h +1 -1
index d2cb555e4a3be..a3ea9d6762816 100644
@@ -97,7 +97,7 @@ struct ins_ops {
 
 struct annotate_args {
 	struct arch		  *arch;
-	struct map_symbol	  ms;
+	struct map_symbol	  *ms;
 	struct annotation_options *options;
 	s64			  offset;
 	char			  *line;
tools/perf/util/llvm.c +3 -3
index 2ebf1f5f65bf7..4ada9a10bd93f 100644
@@ -118,7 +118,7 @@ int symbol__disassemble_llvm(const char *filename, struct symbol *sym,
 {
 #ifdef HAVE_LIBLLVM_SUPPORT
 	struct annotation *notes = symbol__annotation(sym);
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct dso *dso = map__dso(map);
 	u64 start = map__rip_2objdump(map, sym->start);
 	/* Malloc-ed buffer containing instructions read from disk. */
@@ -184,7 +184,7 @@ int symbol__disassemble_llvm(const char *filename, struct symbol *sym,
 	args->line = disasm_buf;
 	args->line_nr = 0;
 	args->fileloc = NULL;
-	args->ms.sym = sym;
+	args->ms->sym = sym;
 
 	dl = disasm_line__new(args);
 	if (dl == NULL)
@@ -242,7 +242,7 @@ int symbol__disassemble_llvm(const char *filename, struct symbol *sym,
 					 &line_storage_len);
 		args->line_nr = 0;
 		args->fileloc = NULL;
-		args->ms.sym = sym;
+		args->ms->sym = sym;
 
 		llvm_addr2line(filename, pc, &args->fileloc,
 			       (unsigned int *)&args->line_nr, false, NULL);
Signature · 1 line
2.51.0
author maintainer
#17 lore raw

PATCH 17/844 perf maps: Fix reference count leak in maps__find_ams()

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 6fdd2676db55b503c52dd3f1359b5c57f774ab75 ]

ams and so ams->ms.map is an in argument, however, it is also overwritten. As a map is reference counted, ensure a map__put() is done before overwriting it.

Fixes 42fd623b58dbcc48 ("perf maps: Get map before returning in maps__find")
Cc Aditya Bodkhe <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Albert Ou <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Athira Rajeev <[email protected]>
Cc Bill Wendling <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
Cc Guo Ren <[email protected]>
Cc Howard Chu <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Garry <[email protected]>
Cc Julia Lawall <[email protected]>
Cc Justin Stitt <[email protected]>
Cc Krzysztof Łopatowski <[email protected]>
Cc Leo Yan <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sergei Trofimovich <[email protected]>
Cc Shimin Guo <[email protected]>
Cc Suchit Karunakaran <[email protected]>
Cc Thomas Falcon <[email protected]>
Cc Tianyou Li <[email protected]>
Cc Will Deacon <[email protected]>
Cc Zecheng Li <[email protected]>
---
 tools/perf/util/maps.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/maps.c +1 -0
index c321d4f4d8466..8885c95f02b3e 100644
@@ -676,6 +676,7 @@ int maps__find_ams(struct maps *maps, struct addr_map_symbol *ams)
 	if (ams->addr < map__start(ams->ms.map) || ams->addr >= map__end(ams->ms.map)) {
 		if (maps == NULL)
 			return -1;
+		map__put(ams->ms.map);
 		ams->ms.map = maps__find(maps, ams->addr);
 		if (ams->ms.map == NULL)
 			return -1;
Signature · 1 line
2.51.0
author maintainer
#18 lore raw

PATCH 18/844 perf tests sched: Avoid error in cleanup on loaded machines

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit c5e47e4d00fbc15f2390bb6ed8d9c21836363291 ]

The stop_noploops function will kill the noploop processes that are running for 10 seconds.

On a loaded machine they may have already terminated meaning the kill will return an error of no such process.

This doesn't matter and so ignore the error to avoid the test terminating in the cleanup.

Fixes 0e22c5ca44e68798 ("perf test: Add sched latency and script shell tests")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/tests/shell/sched.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/sched.sh +1 -1
index b9b81eaf856e6..b9637069adb1f 100755
@@ -53,7 +53,7 @@ start_noploops() {
 }
 
 cleanup_noploops() {
-  kill "$PID1" "$PID2"
+  kill "$PID1" "$PID2" || true
 }
 
 test_sched_record() {
Signature · 1 line
2.51.0
author maintainer
#19 lore raw

PATCH 19/844 perf annotate: Fix memcpy size in arch__grow_instructions()

In reply to Sasha Levin

From: Suchit Karunakaran <[email protected]>

[ Upstream commit f0d98c78f8bf73ce2a9b7793f66cda240fa9ab10 ]

The memcpy() in arch__grow_instructions() is copying the wrong number of bytes when growing from a non-allocated table.

It should copy arch->nr_instructions * sizeof(struct ins) bytes, not just arch->nr_instructions bytes.

This bug causes data corruption as only a partial copy of the instruction table is made, leading to garbage data in most entries and potential crashes

Fixes 2a1ff812c40be982 ("perf annotate: Introduce alternative method of keeping instructions table")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/disasm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/disasm.c +1 -1
index 924429142631a..88706b98b9064 100644
@@ -81,7 +81,7 @@ static int arch__grow_instructions(struct arch *arch)
 	if (new_instructions == NULL)
 		return -1;
 
-	memcpy(new_instructions, arch->instructions, arch->nr_instructions);
+	memcpy(new_instructions, arch->instructions, arch->nr_instructions * sizeof(struct ins));
 	goto out_update_instructions;
 }
 
Signature · 1 line
2.51.0
author maintainer
#20 lore raw

PATCH 20/844 tools headers: Go back to include asm-generic/unistd.h for arm64

In reply to Sasha Levin

From: Leo Yan <[email protected]>

[ Upstream commit 096b86ce08332fbcb0ec6ff6714c44899ec03970 ]

The header unistd.h is included under Arm64's uAPI folder (see tools/arch/arm64/include/uapi/asm/), but it does not include its dependent header unistd_64.h.

The intention is for unistd_64.h to be generated dynamically using scripts/Makefile.asm-headers.

However, this dynamic approach causes problems because the header is not available early enough, even though it is widely included throughout tools.

Using the perf build as an example:

1) Feature detection: Perf first runs feature tests.

The BPF feature program test-bpf.c includes unistd.h. Since unistd_64.h has not been generated yet, the program fails to build, and the BPF feature ends up being disabled.

2) libperf build:

The libperf Makefile later generates unistd_64.h on the fly, so libperf itself builds successfully.

3) Final perf build:

Although the perf binary can build successfully using the generated header, we never get a chance to build BPF skeleton programs, because BPF support was already disabled earlier.

Restore to include asm-generic/unistd.h for fixing the issue. This aligns with most architectures (x86 is a special case that keeps unistd_32.h/unistd_64.h for its particular syscall numbers) and ensures the header is available from the start.

Fixes 22f72088ffe69a37 ("tools headers: Update the syscall table with the kernel sources")
Cc Adrian Hunter <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/arch/arm64/include/uapi/asm/unistd.h | 24 +++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
tools/arch/arm64/include/uapi/asm/unistd.h +23 -1
index df36f23876e86..9306726337fe0 100644
@@ -1,2 +1,24 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#include <asm/unistd_64.h>
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define __ARCH_WANT_RENAMEAT
+#define __ARCH_WANT_NEW_STAT
+#define __ARCH_WANT_SET_GET_RLIMIT
+#define __ARCH_WANT_TIME32_SYSCALLS
+#define __ARCH_WANT_MEMFD_SECRET
+
+#include <asm-generic/unistd.h>
Signature · 1 line
2.51.0
author maintainer
#21 lore raw

PATCH 21/844 perf annotate: Fix BUILD_NONDISTRO=1 missing args->ms conversions to pointer

In reply to Sasha Levin

From: Arnaldo Carvalho de Melo <[email protected]>

[ Upstream commit dda5f926a1006c735b00ed5c27291fce64236656 ]

Fix a few missing conversions to pointer in the usage of 'struct annotate_args' 'ms' member in symbol__disassemble_bpf_libbfd().

Fixes 00419892bac28bf1 ("perf annotate: Fix args leak of map_symbol")
---
 tools/perf/util/libbfd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/libbfd.c +3 -3
index 79f4528234a9d..63ea3fb53e77d 100644
@@ -501,7 +501,7 @@ int symbol__disassemble_bpf_libbfd(struct symbol *sym __maybe_unused,
 	struct bpf_prog_info_node *info_node;
 	int len = sym->end - sym->start;
 	disassembler_ftype disassemble;
-	struct map *map = args->ms.map;
+	struct map *map = args->ms->map;
 	struct perf_bpil *info_linear;
 	struct disassemble_info info;
 	struct dso *dso = map__dso(map);
@@ -612,7 +612,7 @@ int symbol__disassemble_bpf_libbfd(struct symbol *sym __maybe_unused,
 			args->line = strdup(srcline);
 			args->line_nr = 0;
 			args->fileloc = NULL;
-			args->ms.sym  = sym;
+			args->ms->sym = sym;
 			dl = disasm_line__new(args);
 			if (dl) {
 				annotation_line__add(&dl->al,
@@ -624,7 +624,7 @@ int symbol__disassemble_bpf_libbfd(struct symbol *sym __maybe_unused,
 		args->line = buf + prev_buf_size;
 		args->line_nr = 0;
 		args->fileloc = NULL;
-		args->ms.sym  = sym;
+		args->ms->sym = sym;
 		dl = disasm_line__new(args);
 		if (dl)
 			annotation_line__add(&dl->al, &notes->src->source);
Signature · 1 line
2.51.0
author maintainer
#22 lore raw

PATCH 22/844 perf test: Fix test perf evlist for z/VM s390x

In reply to Sasha Levin

From: Thomas Richter <[email protected]>

[ Upstream commit 008603bda19b29687edce533e4c09acff68c1077 ]

Perf test case 'perf evlist tests' fails on z/VM machines on s390.

The failure is causes by event cycles. This event is not available on virtualized machines like z/VM on s390.

Change to software event cpu-clock to fix this.

    Output before:
      # ./perf test 78
      79: perf evlist tests              : FAILED!
      #

    Output after:
      # ./perf test 78
      79: perf evlist tests              : Ok
      #
Fixes b04d2b9199129f4f ("perf test: Fix test case perf evlist tests for s390x")
Cc Alexander Gordeev <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Sumanth Korikkar <[email protected]>
Cc Thomas Richter <[email protected]>
Cc Vasily Gorbik <[email protected]>
---
 tools/perf/tests/shell/evlist.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/shell/evlist.sh +2 -2
index 5632be3917109..8a22f4171c07c 100755
@@ -21,13 +21,13 @@ trap trap_cleanup EXIT TERM INT
 
 test_evlist_simple() {
 	echo "Simple evlist test"
-	if ! perf record -e cycles -o "${perfdata}" true 2> /dev/null
+	if ! perf record -e cpu-clock -o "${perfdata}" true 2> /dev/null
 	then
 		echo "Simple evlist [Failed record]"
 		err=1
 		return
 	fi
-	if ! perf evlist -i "${perfdata}" | grep -q "cycles"
+	if ! perf evlist -i "${perfdata}" | grep -q "cpu-clock"
 	then
 		echo "Simple evlist [Failed to list event]"
 		err=1
Signature · 1 line
2.51.0
author maintainer
#23 lore raw

PATCH 23/844 perf vendor events amd: Fix Zen 5 MAB allocation events

In reply to Sasha Levin

From: Sandipan Das <[email protected]>

[ Upstream commit 76b2cf07a6d2a836108f9c2486d76599f7adf6e8 ]

The unit masks for PMCx041 vary across different generations of Zen processors.

Fix the Zen 5 events based on PMCx041 as they incorrectly use the same unit masks as that of Zen 4.

Fixes 45c072f2537ab07b ("perf vendor events amd: Add Zen 5 core events")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ananth Narayan <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ravi Bangoria <[email protected]>
Cc Sandipan Das <[email protected]>
---
 tools/perf/pmu-events/arch/x86/amdzen5/load-store.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/pmu-events/arch/x86/amdzen5/load-store.json +3 -3
index ff6627a778057..06bbaea159259 100644
@@ -70,19 +70,19 @@
     "EventName": "ls_mab_alloc.load_store_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for load-store allocations.",
-    "UMask": "0x3f"
+    "UMask": "0x07"
   },
   {
     "EventName": "ls_mab_alloc.hardware_prefetcher_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for hardware prefetcher allocations.",
-    "UMask": "0x40"
+    "UMask": "0x08"
   },
   {
     "EventName": "ls_mab_alloc.all_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for all types of allocations.",
-    "UMask": "0x7f"
+    "UMask": "0x0f"
   },
   {
     "EventName": "ls_dmnd_fills_from_sys.local_l2",
Signature · 1 line
2.51.0
author maintainer
#24 lore raw

PATCH 24/844 perf jevents: Handle deleted JSONS in out of source builds

In reply to Sasha Levin

From: James Clark <[email protected]>

[ Upstream commit 297c9d96e3085116c5cde18170dba716a1f2591e ]

Make the source folders a dependency for the generated folder root so that whenever a file is deleted from the source it will force a new fresh copy of all the JSON files and avoid stale deleted files.

JSON_DIRS_OUTPUT_ROOT needs to be a dependency of LEGACY_CACHE_JSON so that the root folder doesn't get cleaned after the legacy JSON is generated. But this is a no-op with in-source builds as JSON_DIRS_OUTPUT_ROOT is unset.

JSON_DIRS is added as a dependency of PMU_EVENTS_C which also forces a re-build for in source builds when JSON files are deleted. This could have also resulted in stale builds, but never a broken one.

Fixes 4bb55de4ff03db3e ("perf jevents: Support copying the source json files to OUTPUT")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/pmu-events/Build | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
tools/perf/pmu-events/Build +11 -3
index a46ab7b612dfc..4f9ef624ba70d 100644
@@ -1,5 +1,6 @@
 pmu-events-y	+= pmu-events.o
 JSON		=  $(shell find pmu-events/arch -name '*.json' -o -name '*.csv')
+JSON_DIRS	=  $(shell find pmu-events/arch -type d)
 JDIR_TEST	=  pmu-events/arch/test
 JSON_TEST	=  $(shell [ -d $(JDIR_TEST) ] &&			\
 			find $(JDIR_TEST) -name '*.json')
@@ -31,16 +32,23 @@ $(PMU_EVENTS_C): $(EMPTY_PMU_EVENTS_C)
 else
 # Copy checked-in json to OUTPUT for generation if it's an out of source build
 ifneq ($(OUTPUT),)
-$(OUTPUT)pmu-events/arch/%: pmu-events/arch/%
+# Remove all output directories when any source directory timestamp changes
+# so there are no stale deleted files
+JSON_DIRS_ROOT = $(OUTPUT)pmu-events/arch/
+$(JSON_DIRS_ROOT): $(JSON_DIRS)
+	$(Q)$(call echo-cmd,gen)rm -rf $@
+	$(Q)mkdir -p $@
+
+$(OUTPUT)pmu-events/arch/%: pmu-events/arch/% $(JSON_DIRS_ROOT)
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,gen)cp $< $@
 endif
 
-$(LEGACY_CACHE_JSON): $(LEGACY_CACHE_PY)
+$(LEGACY_CACHE_JSON): $(LEGACY_CACHE_PY) $(JSON_DIRS_ROOT)
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,gen)$(PYTHON) $(LEGACY_CACHE_PY) > $@
 
-GEN_JSON = $(patsubst %,$(OUTPUT)%,$(JSON)) $(LEGACY_CACHE_JSON)
+GEN_JSON = $(patsubst %,$(OUTPUT)%,$(JSON)) $(LEGACY_CACHE_JSON) $(JSON_DIRS)
 
 $(METRIC_TEST_LOG): $(METRIC_TEST_PY) $(METRIC_PY)
 	$(call rule_mkdir)
Signature · 1 line
2.51.0
author maintainer
#25 lore raw

PATCH 25/844 perf build: Remove NO_LIBCAP that controls nothing

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 169343cc8ff2bd59758760d867bd26adae866a2b ]

Using libcap was removed in commit e25ebda78e230283 ("perf cap: Tidy up and improve capability testing") and improve capability testing"), however, some build documentation and a use of the NO_LIBCAP=1 were lingering.

Remove these left over bits.

Fixes e25ebda78e230283 ("perf cap: Tidy up and improve capability testing")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/Makefile.perf | 2 --
 tools/perf/tests/make    | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
tools/perf/Makefile.perf +0 -2
index e6895626c1872..fbeb5c81c8072 100644
@@ -86,8 +86,6 @@ include ../scripts/utilities.mak
 #
 # Define NO_LIBBPF if you do not want BPF support
 #
-# Define NO_LIBCAP if you do not want process capabilities considered by perf
-#
 # Define NO_SDT if you do not want to define SDT event in perf tools,
 # note that it doesn't disable SDT scanning support.
 #
tools/perf/tests/make +1 -1
index 6641701e48285..c721cd1bcaa9a 100644
@@ -122,7 +122,7 @@ make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1
 make_minimal        += NO_LIBNUMA=1 NO_LIBBIONIC=1 NO_LIBDW=1
 make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_LIBBPF=1
 make_minimal        += NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1
-make_minimal        += NO_LIBCAP=1 NO_CAPSTONE=1
+make_minimal        += NO_CAPSTONE=1
 
 # $(run) contains all available tests
 run := make_pure
Signature · 1 line
2.51.0
author maintainer
#26 lore raw

PATCH 26/844 libperf build: Always place libperf includes first

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 8c5b40678c63be6b85f1c2dc8c8b89d632faf988 ]

When building tools/perf the CFLAGS can contain a directory for the installed headers.

As the headers may be being installed while building libperf.a this can cause headers to be partially installed and found in the include path while building an object file for libperf.a.

The installed header may reference other installed headers that are missing given the partial nature of the install and then the build fails with a missing header file.

Avoid this by ensuring the libperf source headers are always first in the CFLAGS.

Fixes 3143504918105156 ("libperf: Make libperf.a part of the perf build")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/lib/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/perf/Makefile +1 -1
index 7fbb50b74c00b..5c64122bf5374 100644
@@ -51,9 +51,9 @@ INCLUDES = \
 -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
+override CFLAGS := $(INCLUDES) $(CFLAGS)
 override CFLAGS += -g -Werror -Wall
 override CFLAGS += -fPIC
-override CFLAGS += $(INCLUDES)
 override CFLAGS += -fvisibility=hidden
 override CFLAGS += $(EXTRA_WARNINGS)
 override CFLAGS += $(EXTRA_CFLAGS)
Signature · 1 line
2.51.0
author maintainer
#27 lore raw

PATCH 27/844 perf metricgroup: Don't early exit if no CPUID table exists

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit cee275edcdb1acfdc8270f80e96f30750b633220 ]

The failure to find a table of metrics with a CPUID shouldn't early exit as the metric code will now also consider the default table.

When searching for a metric or metric group, pmu_metrics_table__for_each_metric() considers all tables and so the caller doesn't need to switch the table to do this.

Fixes c7adeb0974f18da4 ("perf jevents: Add set of common metrics based on default ones")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/perf/util/metricgroup.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
tools/perf/util/metricgroup.c +5 -13
index 25c75fdbfc525..a21f2d4969c5c 100644
@@ -1563,8 +1563,6 @@ int metricgroup__parse_groups(struct evlist *perf_evlist,
 {
 	const struct pmu_metrics_table *table = pmu_metrics_table__find();
 
-	if (!table)
-		return -EINVAL;
 	if (hardware_aware_grouping)
 		pr_debug("Use hardware aware grouping instead of traditional metric grouping method\n");
 
@@ -1602,22 +1600,16 @@ static int metricgroup__has_metric_or_groups_callback(const struct pmu_metric *p
 
 bool metricgroup__has_metric_or_groups(const char *pmu, const char *metric_or_groups)
 {
-	const struct pmu_metrics_table *tables[2] = {
-		pmu_metrics_table__find(),
-		pmu_metrics_table__default(),
-	};
+	const struct pmu_metrics_table *table = pmu_metrics_table__find();
 	struct metricgroup__has_metric_data data = {
 		.pmu = pmu,
 		.metric_or_groups = metric_or_groups,
 	};
 
-	for (size_t i = 0; i < ARRAY_SIZE(tables); i++) {
-		if (pmu_metrics_table__for_each_metric(tables[i],
-							metricgroup__has_metric_or_groups_callback,
-							&data))
-			return true;
-	}
-	return false;
+	return pmu_metrics_table__for_each_metric(table,
+						  metricgroup__has_metric_or_groups_callback,
+						  &data)
+		? true : false;
 }
 
 static int metricgroup__topdown_max_level_callback(const struct pmu_metric *pm,
Signature · 1 line
2.51.0
author maintainer
#33 lore raw

PATCH 28/844 perf test: Fix test case perftool-testsuite_report for s390

In reply to Sasha Levin

From: Thomas Richter <[email protected]>

[ Upstream commit 3d012b8614ee020666f3dd15af9f65dc487e3f5f ]

Test case perftool-testsuite_report fails on s390 for some time now.

Root cause is a time out which is too tight for large s390 machines. The time out value addr2line_timeout_ms is per default set to 1 second.

This is the maximum time the function read_addr2line_record() waits for a reply from the forked off tool addr2line, which is started as a child in interactive mode.

It reads stdin (an address in hexadecimal) and replies on stdout with function name, file name and line number. This might take more than one second.

However one second is not always enough and the reply from addr2line tool is not received. Function read_addr2line_record() fails and emits a warning, which is not expected by the test case. It fails.

Output before:

 # perf test -F 133
 -- [ PASS ] -- perf_report :: setup :: prepare the perf.data file
 ==================
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.087 MB \
	/tmp/perftool-testsuite_report.FHz/perf_report/perf.data.1 \
	(207 samples) ]
 ==================
 -- [ PASS ] -- perf_report :: setup :: prepare the perf.data.1 file
 ## [ PASS ] ## perf_report :: setup SUMMARY
 -- [ SKIP ] -- perf_report :: test_basic :: help message :: testcase skipped
 Line did not match any pattern: "cmd__addr2line /usr/lib/debug/lib/modules/
 	6.19.0-20260205.rc8.git366.9845cf73f7db.300.fc43.s390x+next/
	vmlinux: could not read first record"
 Line did not match any pattern: "cmd__addr2line /usr/lib/debug/lib/modules/
	6.19.0-20260205.rc8.git366.9845cf73f7db.300.fc43.s390x+next/
	vmlinux: could not read first record"
 -- [ FAIL ] -- perf_report :: test_basic :: basic execution
	(output regexp parsing)
 ....
 133: perftool-testsuite_report      : FAILED!

Output after:

 # ./perf test -F 133
 -- [ PASS ] -- perf_report :: setup :: prepare the perf.data file
 ==================
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.087 MB \
	 /tmp/perftool-testsuite_report.Mlp/perf_report/perf.data.1
	 (188 samples) ]
 ==================
 -- [ PASS ] -- perf_report :: setup :: prepare the perf.data.1 file
 ## [ PASS ] ## perf_report :: setup SUMMARY
 -- [ SKIP ] -- perf_report :: test_basic :: help message :: testcase skipped
 -- [ PASS ] -- perf_report :: test_basic :: basic execution
 -- [ PASS ] -- perf_report :: test_basic :: number of samples
 -- [ PASS ] -- perf_report :: test_basic :: header
 -- [ PASS ] -- perf_report :: test_basic :: header timestamp
 -- [ PASS ] -- perf_report :: test_basic :: show CPU utilization
 -- [ PASS ] -- perf_report :: test_basic :: pid
 -- [ PASS ] -- perf_report :: test_basic :: non-existing symbol
 -- [ PASS ] -- perf_report :: test_basic :: symbol filter
 -- [ PASS ] -- perf_report :: test_basic :: latency header
 -- [ PASS ] -- perf_report :: test_basic :: default report for latency profile
 -- [ PASS ] -- perf_report :: test_basic :: latency report for latency profile
 -- [ PASS ] -- perf_report :: test_basic :: parallelism histogram
 ## [ PASS ] ## perf_report :: test_basic SUMMARY
 133: perftool-testsuite_report      : Ok
 #
Fixes 257046a36750a6db ("perf srcline: Fallback between addr2line implementations")
Cc Alexander Gordeev <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Sumanth Korikkar <[email protected]>
Cc Vasily Gorbik <[email protected]>
---
 tools/perf/util/addr2line.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/addr2line.c +2 -2
index f2d94a3272d71..a8b39f4f202b6 100644
@@ -18,8 +18,8 @@
 
 #define MAX_INLINE_NEST 1024
 
-/* If addr2line doesn't return data for 1 second then timeout. */
-int addr2line_timeout_ms = 1 * 1000;
+/* If addr2line doesn't return data for 5 seconds then timeout. */
+int addr2line_timeout_ms = 5 * 1000;
 
 static int filename_split(char *filename, unsigned int *line_nr)
 {
Signature · 1 line
2.51.0
author maintainer
#34 lore raw

PATCH 29/844 objtool/rust: add one more `noreturn` Rust function

In reply to Sasha Levin

From: Miguel Ojeda <[email protected]>

[ Upstream commit c431b00ca6afc5da3133636ecc34ee7edd38d6cc ]

objtool with Rust 1.84.0 reports:

rust/kernel.o: error: objtool: _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix14from_str_radix() falls through to next function _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix16from_u64_negated()

This is very similar to commit c18f35e49049 ("objtool/rust: add one more noreturn Rust function"), which added from_ascii_radix_panic for Rust 1.86.0, except that Rust 1.84.0 ends up needing from_str_radix_panic.

Thus add it to the list to fix the warning.

---
 tools/objtool/check.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/objtool/check.c +2 -1
index 3fd98c5b6e1a8..37ec0d757e9b1 100644
@@ -197,7 +197,8 @@ static bool is_rust_noreturn(const struct symbol *func)
 	 * as well as changes to the source code itself between versions (since
 	 * these come from the Rust standard library).
 	 */
-	return str_ends_with(func->name, "_4core3num22from_ascii_radix_panic")				||
+	return str_ends_with(func->name, "_4core3num20from_str_radix_panic")				||
+	       str_ends_with(func->name, "_4core3num22from_ascii_radix_panic")				||
 	       str_ends_with(func->name, "_4core5sliceSp15copy_from_slice17len_mismatch_fail")		||
 	       str_ends_with(func->name, "_4core6option13expect_failed")				||
 	       str_ends_with(func->name, "_4core6option13unwrap_failed")				||
Signature · 1 line
2.51.0
author maintainer
#35 lore raw

PATCH 30/844 perf stat: Ensure metrics are displayed even with failed events

In reply to Sasha Levin

From: Chun-Tse Shao <[email protected]>

[ Upstream commit bb5a920b9099127915706fdd23eb540c9a69c338 ]

Currently, perf stat skips or hides metrics when the underlying hardware events cannot be counted (e.g., due to insufficient permissions or unsupported events).

In --metric-only mode, this often results in missing columns or blank spaces, making the output difficult to parse.

Modify the logic to ensure metrics are consistently displayed by propagating NAN (Not a Number) through the expression evaluator. Specifically:

1. Update prepare_metric() in stat-shadow.c to treat uncounted events (where run == 0) as NAN. This leverages the existing math in expr.y to propagate NAN through metric expressions.

2. Remove the early return in the display logic's printout() function that was previously skipping metrics in --metric-only mode for failed events.
l
3. Simplify perf_stat__skip_metric_event() to no longer depend on event runtime.

Tested:

1. perf all metrics test did not crash while paranoid is 2.

2. Multiple combinations with CPUs_utilized while paranoid is 2.

  $ ./perf stat -M CPUs_utilized -a -- sleep 1

Performance counter stats for 'system wide':

     <not supported> msec cpu-clock:u                      #      nan CPUs  CPUs_utilized
       1,006,356,120      duration_time

         1.004375550 seconds time elapsed
  $ ./perf stat -M CPUs_utilized -a -j -- sleep 1
  {"counter-value" : "<not supported>", "unit" : "msec", "event" : "cpu-clock:u", "event-runtime" : 0, "pcnt-running" : 100.00, "metric-value" : "nan", "metric-unit" : "CPUs  CPUs_utilized"}
  {"counter-value" : "1006642462.000000", "unit" : "", "event" : "duration_time", "event-runtime" : 1, "pcnt-running" : 100.00}
  $ ./perf stat -M CPUs_utilized -a --metric-only -- sleep 1

Performance counter stats for 'system wide':

    CPUs  CPUs_utilized
                      nan

         1.004424652 seconds time elapsed
  $ ./perf stat -M CPUs_utilized -a --metric-only -j -- sleep 1
  {"CPUs  CPUs_utilized" : "none"}
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Yang Li <[email protected]>

Stable-dep-of: 63b320aaac08 ("perf stat-shadow: In prepare_metric fix guard on reading NULL perf_stat_evsel")

---
 tools/perf/util/stat-display.c | 59 +++++++++++++++-------------------
 tools/perf/util/stat-shadow.c  |  8 ++---
 tools/perf/util/stat.h         |  2 +-
 3 files changed, 29 insertions(+), 40 deletions(-)
tools/perf/util/stat-display.c +26 -33
index 6d02f84c5691a..f4bd579908b43 100644
@@ -820,12 +820,6 @@ static void printout(struct perf_stat_config *config, struct outstate *os,
 	}
 
 	if (run == 0 || ena == 0 || counter->counts->scaled == -1) {
-		if (config->metric_only) {
-			pm(config, os, METRIC_THRESHOLD_UNKNOWN, /*format=*/NULL,
-			   /*unit=*/NULL, /*val=*/0);
-			return;
-		}
-
 		ok = false;
 
 		if (counter->supported) {
@@ -848,33 +842,32 @@ static void printout(struct perf_stat_config *config, struct outstate *os,
 		print_running(config, os, run, ena, /*before_metric=*/true);
 	}
 
-	if (ok) {
-		if (!config->metric_only && counter->default_metricgroup && !counter->default_show_events) {
-			void *from = NULL;
-
-			aggr_printout(config, os, os->evsel, os->id, os->aggr_nr);
-			/* Print out all the metricgroup with the same metric event. */
-			do {
-				int num = 0;
-
-				/* Print out the new line for the next new metricgroup. */
-				if (from) {
-					if (config->json_output)
-						new_line_json(config, (void *)os);
-					else
-						__new_line_std_csv(config, os);
-				}
-
-				print_noise(config, os, counter, noise, /*before_metric=*/true);
-				print_running(config, os, run, ena, /*before_metric=*/true);
-				from = perf_stat__print_shadow_stats_metricgroup(config, counter, aggr_idx,
-										 &num, from, &out);
-			} while (from != NULL);
-		} else {
-			perf_stat__print_shadow_stats(config, counter, aggr_idx, &out);
-		}
+	if (!config->metric_only && counter->default_metricgroup &&
+	    !counter->default_show_events) {
+		void *from = NULL;
+
+		aggr_printout(config, os, os->evsel, os->id, os->aggr_nr);
+		/* Print out all the metricgroup with the same metric event. */
+		do {
+			int num = 0;
+
+			/* Print out the new line for the next new metricgroup. */
+			if (from) {
+				if (config->json_output)
+					new_line_json(config, (void *)os);
+				else
+					__new_line_std_csv(config, os);
+			}
+
+			print_noise(config, os, counter, noise,
+				    /*before_metric=*/true);
+			print_running(config, os, run, ena,
+				      /*before_metric=*/true);
+			from = perf_stat__print_shadow_stats_metricgroup(
+				config, counter, aggr_idx, &num, from, &out);
+		} while (from != NULL);
 	} else {
-		pm(config, os, METRIC_THRESHOLD_UNKNOWN, /*format=*/NULL, /*unit=*/NULL, /*val=*/0);
+		perf_stat__print_shadow_stats(config, counter, aggr_idx, &out);
 	}
 
 	if (!config->metric_only) {
@@ -987,7 +980,7 @@ static void print_counter_aggrdata(struct perf_stat_config *config,
 	ena = aggr->counts.ena;
 	run = aggr->counts.run;
 
-	if (perf_stat__skip_metric_event(counter, ena, run))
+	if (perf_stat__skip_metric_event(counter))
 		return;
 
 	if (val == 0 && should_skip_zero_counter(config, counter, &id))
tools/perf/util/stat-shadow.c +2 -6
index 9c83f7d96caa4..5d8d09e0e6ae5 100644
@@ -83,7 +83,7 @@ static int prepare_metric(struct perf_stat_config *config,
 		}
 		/* Time events are always on CPU0, the first aggregation index. */
 		aggr = &ps->aggr[is_tool_time ? tool_aggr_idx : aggr_idx];
-		if (!aggr || !metric_events[i]->supported) {
+		if (!aggr || !metric_events[i]->supported || aggr->counts.run == 0) {
 			/*
 			 * Not supported events will have a count of 0, which
 			 * can be confusing in a metric. Explicitly set the
@@ -335,14 +335,10 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
  * perf_stat__skip_metric_event - Skip the evsel in the Default metricgroup,
  *				  if it's not running or not the metric event.
  */
-bool perf_stat__skip_metric_event(struct evsel *evsel,
-				  u64 ena, u64 run)
+bool perf_stat__skip_metric_event(struct evsel *evsel)
 {
 	if (!evsel->default_metricgroup)
 		return false;
 
-	if (!ena || !run)
-		return true;
-
 	return !metricgroup__lookup(&evsel->evlist->metric_events, evsel, false);
 }
tools/perf/util/stat.h +1 -1
index f986911c9296e..4bced233d2fc0 100644
@@ -163,7 +163,7 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
 				   struct evsel *evsel,
 				   int aggr_idx,
 				   struct perf_stat_output_ctx *out);
-bool perf_stat__skip_metric_event(struct evsel *evsel, u64 ena, u64 run);
+bool perf_stat__skip_metric_event(struct evsel *evsel);
 void *perf_stat__print_shadow_stats_metricgroup(struct perf_stat_config *config,
 						struct evsel *evsel,
 						int aggr_idx,
Signature · 1 line
2.51.0
author maintainer
#38 lore raw

PATCH 31/844 perf stat-shadow: In prepare_metric fix guard on reading NULL perf_stat_evsel

In reply to Sasha Levin

From: Ian Rogers <[email protected]>

[ Upstream commit 63b320aaac08ba267268ec21a195ce3c82dcb8ab ]

The aggr value is setup to always be non-null creating a redundant guard for reading from it. Switch to using the perf_stat_evsel (ps) and narrow the scope of aggr so that it is known valid when used.

Fixes 3d65f6445fd93e3e ("perf stat-shadow: Read tool events directly")
Cc Adrian Hunter <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Dapeng Mi <[email protected]>
Cc Dr. David Alan Gilbert <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Falcon <[email protected]>
Cc Thomas Richter <[email protected]>
Cc Yang Li <[email protected]>
---
 tools/perf/util/stat-shadow.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
tools/perf/util/stat-shadow.c +16 -8
index 5d8d09e0e6ae5..59d2cd4f2188d 100644
@@ -57,7 +57,6 @@ static int prepare_metric(struct perf_stat_config *config,
 		bool is_tool_time =
 			tool_pmu__is_time_event(config, metric_events[i], &tool_aggr_idx);
 		struct perf_stat_evsel *ps = metric_events[i]->stats;
-		struct perf_stat_aggr *aggr;
 		char *n;
 		double val;
 
@@ -82,8 +81,7 @@ static int prepare_metric(struct perf_stat_config *config,
 			}
 		}
 		/* Time events are always on CPU0, the first aggregation index. */
-		aggr = &ps->aggr[is_tool_time ? tool_aggr_idx : aggr_idx];
-		if (!aggr || !metric_events[i]->supported || aggr->counts.run == 0) {
+		if (!ps || !metric_events[i]->supported) {
 			/*
 			 * Not supported events will have a count of 0, which
 			 * can be confusing in a metric. Explicitly set the
@@ -93,11 +91,21 @@ static int prepare_metric(struct perf_stat_config *config,
 			val = NAN;
 			source_count = 0;
 		} else {
-			val = aggr->counts.val;
-			if (is_tool_time)
-				val *= 1e-9; /* Convert time event nanoseconds to seconds. */
-			if (!source_count)
-				source_count = evsel__source_count(metric_events[i]);
+			struct perf_stat_aggr *aggr =
+				&ps->aggr[is_tool_time ? tool_aggr_idx : aggr_idx];
+
+			if (aggr->counts.run == 0) {
+				val = NAN;
+				source_count = 0;
+			} else {
+				val = aggr->counts.val;
+				if (is_tool_time) {
+					/* Convert time event nanoseconds to seconds. */
+					val *= 1e-9;
+				}
+				if (!source_count)
+					source_count = evsel__source_count(metric_events[i]);
+			}
 		}
 		n = strdup(evsel__metric_id(metric_events[i]));
 		if (!n)
Signature · 1 line
2.51.0
author maintainer
#39 lore raw

PATCH 32/844 io_uring: add IORING_OP_URING_CMD128 to opcode checks

In reply to Sasha Levin

From: Caleb Sander Mateos <[email protected]>

[ Upstream commit 42a6bd57ee9f930a72c26f863c72f666d6ed9ea5 ]

io_should_commit(), io_uring_classic_poll(), and io_do_iopoll() compare struct io_kiocb's opcode against IORING_OP_URING_CMD to implement special treatment for uring_cmds. The recently added opcode IORING_OP_URING_CMD128 is meant to be equivalent to IORING_OP_URING_CMD, so treat it the same way in these functions.

Fixes 1cba30bf9fdd ("io_uring: add support for IORING_SETUP_SQE_MIXED")
---
 io_uring/io_uring.h | 6 ++++++
 io_uring/kbuf.c     | 2 +-
 io_uring/rw.c       | 4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)
io_uring/io_uring.h +6 -0
index a790c16854d32..0f096f44d34bf 100644
@@ -595,6 +595,12 @@ static inline bool io_file_can_poll(struct io_kiocb *req)
 	return false;
 }
 
+static inline bool io_is_uring_cmd(const struct io_kiocb *req)
+{
+	return req->opcode == IORING_OP_URING_CMD ||
+	       req->opcode == IORING_OP_URING_CMD128;
+}
+
 static inline ktime_t io_get_time(struct io_ring_ctx *ctx)
 {
 	if (ctx->clockid == CLOCK_MONOTONIC)
io_uring/kbuf.c +1 -1
index 67d4fe576473a..dae5b4ab3819c 100644
@@ -171,7 +171,7 @@ static bool io_should_commit(struct io_kiocb *req, unsigned int issue_flags)
 		return true;
 
 	/* uring_cmd commits kbuf upfront, no need to auto-commit */
-	if (!io_file_can_poll(req) && req->opcode != IORING_OP_URING_CMD)
+	if (!io_file_can_poll(req) && !io_is_uring_cmd(req))
 		return true;
 	return false;
 }
io_uring/rw.c +2 -2
index 28555bc85ba0f..01367ac09531a 100644
@@ -1253,7 +1253,7 @@ static int io_uring_classic_poll(struct io_kiocb *req, struct io_comp_batch *iob
 {
 	struct file *file = req->file;
 
-	if (req->opcode == IORING_OP_URING_CMD) {
+	if (io_is_uring_cmd(req)) {
 		struct io_uring_cmd *ioucmd;
 
 		ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
@@ -1376,7 +1376,7 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
 			break;
 		nr_events++;
 		req->cqe.flags = io_put_kbuf(req, req->cqe.res, NULL);
-		if (req->opcode != IORING_OP_URING_CMD)
+		if (!io_is_uring_cmd(req))
 			io_req_rw_cleanup(req, 0);
 	}
 	if (unlikely(!nr_events))
Signature · 1 line
2.51.0
author maintainer
#40 lore raw

PATCH 33/844 rtc: interface: Alarm race handling should not discard preceding error

In reply to Sasha Levin

From: "Anthony Pighin (Nokia)" <[email protected]>

[ Upstream commit 81be22cd4ace020045cc6d31255c6f7c071eb7c0 ]

Commit 795cda8338ea ("rtc: interface: Fix long-standing race when setting alarm") should not discard any errors from the preceding validations.

Prior to that commit, if the alarm feature was disabled, or the set_alarm failed, a meaningful error code would be returned to the caller for further action.

After, more often than not, the __rtc_read_time will cause a success return code instead, misleading the caller.

An example of this is when timer_enqueue is called for a rtc-abx080x device. Since that driver does not clear the alarm feature bit, but instead relies on the set_alarm operation to return invalid, the discard of the return code causes very different behaviour; i.e.
hwclock: select() to /dev/rtc0 to wait for clock tick timed out

---
 drivers/rtc/interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/interface.c +1 -1
index b8b298efd9a9c..1906f4884a834 100644
@@ -457,7 +457,7 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
 	 * are in, we can return -ETIME to signal that the timer has already
 	 * expired, which is true in both cases.
 	 */
-	if ((scheduled - now) <= 1) {
+	if (!err && (scheduled - now) <= 1) {
 		err = __rtc_read_time(rtc, &tm);
 		if (err)
 			return err;
Signature · 1 line
2.51.0
author maintainer
#41 lore raw

PATCH 34/844 statmount: permission check should return EPERM

In reply to Sasha Levin

From: Bhavik Sachdev <[email protected]>

[ Upstream commit fccbe38a5d06dbe44bcd89196fe1d2c2272a1f4a ]

Currently, statmount() returns ENOENT when caller is not CAP_SYS_ADMIN in the user namespace owner of target mount namespace. This should be EPERM instead.

---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namespace.c +1 -1
index c58674a20cad5..f6879f282daec 100644
@@ -5780,7 +5780,7 @@ SYSCALL_DEFINE4(statmount, const struct mnt_id_req __user *, req,
 
 	if (kreq.mnt_ns_id && (ns != current->nsproxy->mnt_ns) &&
 	    !ns_capable_noaudit(ns->user_ns, CAP_SYS_ADMIN))
-		return -ENOENT;
+		return -EPERM;
 
 	ks = kmalloc(sizeof(*ks), GFP_KERNEL_ACCOUNT);
 	if (!ks)
Signature · 1 line
2.51.0
author maintainer
#42 lore raw

PATCH 35/844 hfsplus: fix volume corruption issue for generic/480

In reply to Sasha Levin

From: Viacheslav Dubeyko <[email protected]>

[ Upstream commit bea4429eb30190c59b5ac7c8ff6c90176c7c110f ]

The xfstests' test-case generic/480 leaves HFS+ volume in corrupted state:

sudo ./check generic/480
FSTYP -- hfsplus
PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.17.0-rc1+ #4 SMP PREEMPT_DYNAMIC Wed Oct 1 15:02:44 PDT 2025 MKFS_OPTIONS -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/480 _check_generic_filesystem: filesystem on /dev/loop51 is inconsistent (see XFSTESTS-2/xfstests-dev/results//generic/480.full for details)

Ran: generic/480
Failures: generic/480
Failed 1 of 1 tests

sudo fsck.hfsplus -d /dev/loop51
** /dev/loop51
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. Executing fsck_hfs (version 540.1-Linux).
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
CheckHardLinks: found 1 pre-Leopard file inodes. Incorrect number of file hard links
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
invalid VHB nextCatalogID
Volume header needs minor repair
(2, 0)
Verify Status: VIStat = 0x8000, ABTStat = 0x0000 EBTStat = 0x0000 CBTStat = 0x0000 CatStat = 0x00000002
** Repairing volume.
Incorrect flags for file hard link (id = 19)
(It should be 0x22 instead of 0x2)
Incorrect flags for file inode (id = 18)
(It should be 0x22 instead of 0x2)
first link ID=0 is < 16 for fileinode=18
Error getting first link ID for inode = 18 (result=2) Invalid first link in hard link chain (id = 18)
(It should be 19 instead of 0)
Indirect node 18 needs link count adjustment
(It should be 1 instead of 2)
** Rechecking volume.
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume untitled was repaired successfully.

The generic/480 test executes such steps on final phase:

"Now remove of the links of our file and create a new file with the same name and in the same parent directory, and finally fsync this new file."

unlink $SCRATCH_MNT/testdir/bar
touch $SCRATCH_MNT/testdir/bar
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/testdir/bar

"Simulate a power failure and mount the filesystem to check that replaying the fsync log/journal succeeds, that is the mount operation does not fail."

_flakey_drop_and_remount

The key issue in HFS+ logic is that hfsplus_link(), hfsplus_unlink(), hfsplus_rmdir(), hfsplus_symlink(), and hfsplus_mknod() methods don't call hfsplus_cat_write_inode() for the case of modified inode objects. As a result, even if hfsplus_file_fsync() is trying to flush the dirty Catalog File, but because of not calling hfsplus_cat_write_inode() not all modified inodes save the new state into Catalog File's records. Finally, simulation of power failure results in inconsistent state of Catalog File and FSCK tool reports about volume corruption.

This patch adds calling of hfsplus_cat_write_inode() method for modified inodes in hfsplus_link(), hfsplus_unlink(), hfsplus_rmdir(), hfsplus_symlink(), and hfsplus_mknod() methods. Also, it adds debug output in several methods.

sudo ./check generic/480

FSTYP         -- hfsplus
PLATFORM      -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc1+ #18 SMP PREEMPT_DYNAMIC Thu Dec  4 12:24:45 PST 2025
MKFS_OPTIONS  -- /dev/loop51

MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/480 16s ... 16s
Ran: generic/480
Passed all 1 tests

---
 fs/hfsplus/dir.c   | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 fs/hfsplus/inode.c |  5 +++++
 2 files changed, 50 insertions(+), 1 deletion(-)
fs/hfsplus/dir.c +45 -1
index cadf0b5f93422..ca5f74a140ec1 100644
@@ -313,6 +313,9 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
 	if (!S_ISREG(inode->i_mode))
 		return -EPERM;
 
+	hfs_dbg("src_dir->i_ino %lu, dst_dir->i_ino %lu, inode->i_ino %lu\n",
+		src_dir->i_ino, dst_dir->i_ino, inode->i_ino);
+
 	mutex_lock(&sbi->vh_mutex);
 	if (inode->i_ino == (u32)(unsigned long)src_dentry->d_fsdata) {
 		for (;;) {
@@ -332,7 +335,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
 		cnid = sbi->next_cnid++;
 		src_dentry->d_fsdata = (void *)(unsigned long)cnid;
 		res = hfsplus_create_cat(cnid, src_dir,
-			&src_dentry->d_name, inode);
+					 &src_dentry->d_name, inode);
 		if (res)
 			/* panic? */
 			goto out;
@@ -350,6 +353,21 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
 	mark_inode_dirty(inode);
 	sbi->file_count++;
 	hfsplus_mark_mdb_dirty(dst_dir->i_sb);
+
+	res = hfsplus_cat_write_inode(src_dir);
+	if (res)
+		goto out;
+
+	res = hfsplus_cat_write_inode(dst_dir);
+	if (res)
+		goto out;
+
+	res = hfsplus_cat_write_inode(sbi->hidden_dir);
+	if (res)
+		goto out;
+
+	res = hfsplus_cat_write_inode(inode);
+
 out:
 	mutex_unlock(&sbi->vh_mutex);
 	return res;
@@ -367,6 +385,9 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
 	if (HFSPLUS_IS_RSRC(inode))
 		return -EPERM;
 
+	hfs_dbg("dir->i_ino %lu, inode->i_ino %lu\n",
+		dir->i_ino, inode->i_ino);
+
 	mutex_lock(&sbi->vh_mutex);
 	cnid = (u32)(unsigned long)dentry->d_fsdata;
 	if (inode->i_ino == cnid &&
@@ -408,6 +429,15 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
 	inode_set_ctime_current(inode);
 	mark_inode_dirty(inode);
 out:
+	if (!res) {
+		res = hfsplus_cat_write_inode(dir);
+		if (!res) {
+			res = hfsplus_cat_write_inode(sbi->hidden_dir);
+			if (!res)
+				res = hfsplus_cat_write_inode(inode);
+		}
+	}
+
 	mutex_unlock(&sbi->vh_mutex);
 	return res;
 }
@@ -429,6 +459,8 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
 	inode_set_ctime_current(inode);
 	hfsplus_delete_inode(inode);
 	mark_inode_dirty(inode);
+
+	res = hfsplus_cat_write_inode(dir);
 out:
 	mutex_unlock(&sbi->vh_mutex);
 	return res;
@@ -465,6 +497,12 @@ static int hfsplus_symlink(struct mnt_idmap *idmap, struct inode *dir,
 
 	hfsplus_instantiate(dentry, inode, inode->i_ino);
 	mark_inode_dirty(inode);
+
+	res = hfsplus_cat_write_inode(dir);
+	if (res)
+		goto out;
+
+	res = hfsplus_cat_write_inode(inode);
 	goto out;
 
 out_err:
@@ -506,6 +544,12 @@ static int hfsplus_mknod(struct mnt_idmap *idmap, struct inode *dir,
 
 	hfsplus_instantiate(dentry, inode, inode->i_ino);
 	mark_inode_dirty(inode);
+
+	res = hfsplus_cat_write_inode(dir);
+	if (res)
+		goto out;
+
+	res = hfsplus_cat_write_inode(inode);
 	goto out;
 
 failed_mknod:
fs/hfsplus/inode.c +5 -0
index 7ae6745ca7ae1..c762bf909d1aa 100644
@@ -328,6 +328,9 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
 	struct hfsplus_vh *vhdr = sbi->s_vhdr;
 	int error = 0, error2;
 
+	hfs_dbg("inode->i_ino %lu, start %llu, end %llu\n",
+		inode->i_ino, start, end);
+
 	error = file_write_and_wait_range(file, start, end);
 	if (error)
 		return error;
@@ -616,6 +619,8 @@ int hfsplus_cat_write_inode(struct inode *inode)
 	hfsplus_cat_entry entry;
 	int res = 0;
 
+	hfs_dbg("inode->i_ino %lu\n", inode->i_ino);
+
 	if (HFSPLUS_IS_RSRC(inode))
 		main_inode = HFSPLUS_I(inode)->rsrc_inode;
 
Signature · 1 line
2.51.0
author maintainer
#43 lore raw

PATCH 36/844 audit: add fchmodat2() to change attributes class

In reply to Sasha Levin

From: Jeffrey Bencteux <[email protected]>

[ Upstream commit 4f493a6079b588cf1f04ce5ed6cdad45ab0d53dc ]

fchmodat2(), introduced in version 6.6 is currently not in the change attribute class of audit. Calling fchmodat2() to change a file attribute in the same fashion than chmod() or fchmodat() will bypass audit rules such as:

-w /tmp/test -p rwa -k test_rwa

The current patch adds fchmodat2() to the change attributes class.

---
 include/asm-generic/audit_change_attr.h | 3 +++
 1 file changed, 3 insertions(+)
include/asm-generic/audit_change_attr.h +3 -0
index cc840537885fb..ddd90bbe40dfc 100644
@@ -26,6 +26,9 @@ __NR_fremovexattr,
 __NR_fchownat,
 __NR_fchmodat,
 #endif
+#ifdef __NR_fchmodat2
+__NR_fchmodat2,
+#endif
 #ifdef __NR_chown32
 __NR_chown32,
 __NR_fchown32,
Signature · 1 line
2.51.0
author maintainer
#44 lore raw

PATCH 37/844 hfsplus: fix volume corruption issue for generic/498

In reply to Sasha Levin

From: Viacheslav Dubeyko <[email protected]>

[ Upstream commit 9a8c4ad44721da4c48e1ff240ac76286c82837fe ]

The xfstests' test-case generic/498 leaves HFS+ volume in corrupted state:

sudo ./check generic/498
FSTYP -- hfsplus
PLATFORM -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc1+ #18 SMP PREEMPT_DYNAMIC Thu Dec 4 12:24:45 PST 2025 MKFS_OPTIONS -- /dev/loop51
MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/498 _check_generic_filesystem: filesystem on /dev/loop51 is inconsistent (see XFSTESTS-2/xfstests-dev/results//generic/498.full for details)

Ran: generic/498
Failures: generic/498
Failed 1 of 1 tests

sudo fsck.hfsplus -d /dev/loop51
** /dev/loop51
Using cacheBlockSize=32K cacheTotalBlock=1024 cacheSize=32768K. Executing fsck_hfs (version 540.1-Linux).
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
Invalid leaf record count
(It should be 16 instead of 2)
** Checking multi-linked files.
CheckHardLinks: found 1 pre-Leopard file inodes.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000 CBTStat = 0x8000 CatStat = 0x00000000
** Repairing volume.
** Rechecking volume.
** Checking non-journaled HFS Plus Volume.
The volume name is untitled
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
CheckHardLinks: found 1 pre-Leopard file inodes.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume untitled was repaired successfully.

The generic/498 test executes such steps on final phase:

mkdir $SCRATCH_MNT/A
mkdir $SCRATCH_MNT/B
mkdir $SCRATCH_MNT/A/C
touch $SCRATCH_MNT/B/foo
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/B/foo

ln $SCRATCH_MNT/B/foo $SCRATCH_MNT/A/C/foo
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/A

"Simulate a power failure and mount the filesystem to check that what we explicitly fsync'ed exists."

_flakey_drop_and_remount

The FSCK tool complains about "Invalid leaf record count". HFS+ b-tree header contains leaf_count field is updated by hfs_brec_insert() and hfs_brec_remove(). The hfs_brec_insert() is involved into hard link creation process. However, modified in-core leaf_count field is stored into HFS+ b-tree header by hfs_btree_write() method. But, unfortunately, hfs_btree_write() hasn't been called
by hfsplus_cat_write_inode() and hfsplus_file_fsync() stores not fully consistent state of the Catalog File's b-tree.

This patch adds calling hfs_btree_write() method in the hfsplus_cat_write_inode() with the goal of storing consistent state of Catalog File's b-tree. Finally, it makes FSCK tool happy.

sudo ./check generic/498

FSTYP         -- hfsplus
PLATFORM      -- Linux/x86_64 hfsplus-testing-0001 6.18.0-rc1+ #22 SMP PREEMPT_DYNAMIC Sat Dec  6 17:01:31 PST 2025
MKFS_OPTIONS  -- /dev/loop51

MOUNT_OPTIONS -- /dev/loop51 /mnt/scratch

generic/498 33s ... 31s
Ran: generic/498
Passed all 1 tests

---
 fs/hfsplus/inode.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
fs/hfsplus/inode.c +11 -1
index c762bf909d1aa..6153e5cc6eb65 100644
@@ -615,6 +615,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
 int hfsplus_cat_write_inode(struct inode *inode)
 {
 	struct inode *main_inode = inode;
+	struct hfs_btree *tree = HFSPLUS_SB(inode->i_sb)->cat_tree;
 	struct hfs_find_data fd;
 	hfsplus_cat_entry entry;
 	int res = 0;
@@ -627,7 +628,7 @@ int hfsplus_cat_write_inode(struct inode *inode)
 	if (!main_inode->i_nlink)
 		return 0;
 
-	if (hfs_find_init(HFSPLUS_SB(main_inode->i_sb)->cat_tree, &fd))
+	if (hfs_find_init(tree, &fd))
 		/* panic? */
 		return -EIO;
 
@@ -692,6 +693,15 @@ int hfsplus_cat_write_inode(struct inode *inode)
 	set_bit(HFSPLUS_I_CAT_DIRTY, &HFSPLUS_I(inode)->flags);
 out:
 	hfs_find_exit(&fd);
+
+	if (!res) {
+		res = hfs_btree_write(tree);
+		if (res) {
+			pr_err("b-tree write err: %d, ino %lu\n",
+			       res, inode->i_ino);
+		}
+	}
+
 	return res;
 }
 
Signature · 1 line
2.51.0
author maintainer
#45 lore raw

PATCH 38/844 fs/buffer: add alert in try_to_free_buffers() for folios without buffers

In reply to Sasha Levin

From: Deepakkumar Karn <[email protected]>

[ Upstream commit b68f91ef3b3fe82ad78c417de71b675699a8467c ]

try_to_free_buffers() can be called on folios with no buffers attached when filemap_release_folio() is invoked on a folio belonging to a mapping with AS_RELEASE_ALWAYS set but no release_folio operation defined.

In such cases, folio_needs_release() returns true because of the AS_RELEASE_ALWAYS flag, but the folio has no private buffer data. This causes try_to_free_buffers() to call drop_buffers() on a folio with no buffers, leading to a null pointer dereference.

Adding a check in try_to_free_buffers() to return early if the folio has no buffers attached, with WARN_ON_ONCE() to alert about the misconfiguration. This provides defensive hardening.

---
 fs/buffer.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/buffer.c +4 -0
index 838c0c5710229..28e4d53f17173 100644
@@ -2948,6 +2948,10 @@ bool try_to_free_buffers(struct folio *folio)
 	if (folio_test_writeback(folio))
 		return false;
 
+	/* Misconfigured folio check */
+	if (WARN_ON_ONCE(!folio_buffers(folio)))
+		return true;
+
 	if (mapping == NULL) {		/* can this still happen? */
 		ret = drop_buffers(folio, &buffers_to_free);
 		goto out;
Signature · 1 line
2.51.0
author maintainer
#46 lore raw

PATCH 39/844 kselftest/kublk: include message in _Static_assert for C11 compatibility

In reply to Sasha Levin

From: Clint George <[email protected]>

[ Upstream commit 3e6ad272bb8b3199bad952e7b077102af2d8df03 ]

Add descriptive message in the _Static_assert to comply with the C11 standard requirement to prevent compiler from throwing out error. The compiler throws an error when _Static_assert is used without a message as that is a C23 extension.

[] Testing:
The diff between before and after of running the kselftest test of the module shows no regression on system with x86 architecture

[] Error log:
~/Desktop/kernel-dev/linux-v1/tools/testing/selftests/ublk$ make LLVM=1 W=1
CC kublk
In file included from kublk.c:6:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]

  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""
1 error generated.
In file included from null.c:3:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]
  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""
1 error generated.
In file included from file_backed.c:3:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]
  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""
1 error generated.
In file included from common.c:3:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]
  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""
1 error generated.
In file included from stripe.c:3:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]
  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""
1 error generated.
In file included from fault_inject.c:11:
./kublk.h:220:43: error: '_Static_assert' with no message is a C23 extension [-Werror,-Wc23-extensions]
  220 |         _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
      |                                                  ^
      |                                                  , ""

1 error generated.
make: *** [../lib.mk:225: ~/Desktop/kernel-dev/linux-v1/tools/testing/selftests/ublk/kublk] Error 1

---
 tools/testing/selftests/ublk/kublk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ublk/kublk.h +1 -1
index 8a83b90ec603a..cae2e30f0cdd5 100644
@@ -223,7 +223,7 @@ static inline __u64 build_user_data(unsigned tag, unsigned op,
 		unsigned tgt_data, unsigned q_id, unsigned is_target_io)
 {
 	/* we only have 7 bits to encode q_id */
-	_Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7);
+	_Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7, "UBLK_MAX_QUEUES_SHIFT must be <= 7");
 	assert(!(tag >> 16) && !(op >> 8) && !(tgt_data >> 16) && !(q_id >> 7));
 
 	return tag | (op << 16) | (tgt_data << 24) |
Signature · 1 line
2.51.0
author maintainer
#47 lore raw

PATCH 40/844 hfs: Replace BUG_ON with error handling for CNID count checks

In reply to Sasha Levin

From: Jori Koolstra <[email protected]>

[ Upstream commit b226804532a875c10276168dc55ce752944096bd ]

In a06ec283e125 next_id, folder_count, and file_count in the super block info were expanded to 64 bits, and BUG_ONs were added to detect overflow. This triggered an error reported by syzbot: if the MDB is corrupted, the BUG_ON is triggered. This patch replaces this mechanism with proper error handling and resolves the syzbot reported bug.

---
 fs/hfs/dir.c    | 15 +++++++++++----
 fs/hfs/hfs_fs.h |  1 +
 fs/hfs/inode.c  | 30 ++++++++++++++++++++++++------
 fs/hfs/mdb.c    | 31 +++++++++++++++++++++++++++----
 fs/hfs/super.c  |  3 +++
 5 files changed, 66 insertions(+), 14 deletions(-)
fs/hfs/dir.c +11 -4
index 86a6b317b474a..0c615c078650c 100644
@@ -196,8 +196,8 @@ static int hfs_create(struct mnt_idmap *idmap, struct inode *dir,
 	int res;
 
 	inode = hfs_new_inode(dir, &dentry->d_name, mode);
-	if (!inode)
-		return -ENOMEM;
+	if (IS_ERR(inode))
+		return PTR_ERR(inode);
 
 	res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
 	if (res) {
@@ -226,8 +226,8 @@ static struct dentry *hfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
 	int res;
 
 	inode = hfs_new_inode(dir, &dentry->d_name, S_IFDIR | mode);
-	if (!inode)
-		return ERR_PTR(-ENOMEM);
+	if (IS_ERR(inode))
+		return ERR_CAST(inode);
 
 	res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
 	if (res) {
@@ -254,11 +254,18 @@ static struct dentry *hfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
  */
 static int hfs_remove(struct inode *dir, struct dentry *dentry)
 {
+	struct super_block *sb = dir->i_sb;
 	struct inode *inode = d_inode(dentry);
 	int res;
 
 	if (S_ISDIR(inode->i_mode) && inode->i_size != 2)
 		return -ENOTEMPTY;
+
+	if (unlikely(!is_hfs_cnid_counts_valid(sb))) {
+	    pr_err("cannot remove file/folder\n");
+	    return -ERANGE;
+	}
+
 	res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);
 	if (res)
 		return res;
fs/hfs/hfs_fs.h +1 -0
index e94dbc04a1e43..ac0e83f77a0f1 100644
@@ -199,6 +199,7 @@ extern void hfs_delete_inode(struct inode *inode);
 extern const struct xattr_handler * const hfs_xattr_handlers[];
 
 /* mdb.c */
+extern bool is_hfs_cnid_counts_valid(struct super_block *sb);
 extern int hfs_mdb_get(struct super_block *sb);
 extern void hfs_mdb_commit(struct super_block *sb);
 extern void hfs_mdb_close(struct super_block *sb);
fs/hfs/inode.c +24 -6
index 524db1389737d..878535db64d67 100644
@@ -187,16 +187,23 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
 	s64 next_id;
 	s64 file_count;
 	s64 folder_count;
+	int err = -ENOMEM;
 
 	if (!inode)
-		return NULL;
+		goto out_err;
+
+	err = -ERANGE;
 
 	mutex_init(&HFS_I(inode)->extents_lock);
 	INIT_LIST_HEAD(&HFS_I(inode)->open_dir_list);
 	spin_lock_init(&HFS_I(inode)->open_dir_lock);
 	hfs_cat_build_key(sb, (btree_key *)&HFS_I(inode)->cat_key, dir->i_ino, name);
 	next_id = atomic64_inc_return(&HFS_SB(sb)->next_id);
-	BUG_ON(next_id > U32_MAX);
+	if (next_id > U32_MAX) {
+		atomic64_dec(&HFS_SB(sb)->next_id);
+		pr_err("cannot create new inode: next CNID exceeds limit\n");
+		goto out_discard;
+	}
 	inode->i_ino = (u32)next_id;
 	inode->i_mode = mode;
 	inode->i_uid = current_fsuid();
@@ -210,7 +217,11 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
 	if (S_ISDIR(mode)) {
 		inode->i_size = 2;
 		folder_count = atomic64_inc_return(&HFS_SB(sb)->folder_count);
-		BUG_ON(folder_count > U32_MAX);
+		if (folder_count> U32_MAX) {
+			atomic64_dec(&HFS_SB(sb)->folder_count);
+			pr_err("cannot create new inode: folder count exceeds limit\n");
+			goto out_discard;
+		}
 		if (dir->i_ino == HFS_ROOT_CNID)
 			HFS_SB(sb)->root_dirs++;
 		inode->i_op = &hfs_dir_inode_operations;
@@ -220,7 +231,11 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
 	} else if (S_ISREG(mode)) {
 		HFS_I(inode)->clump_blocks = HFS_SB(sb)->clumpablks;
 		file_count = atomic64_inc_return(&HFS_SB(sb)->file_count);
-		BUG_ON(file_count > U32_MAX);
+		if (file_count > U32_MAX) {
+			atomic64_dec(&HFS_SB(sb)->file_count);
+			pr_err("cannot create new inode: file count exceeds limit\n");
+			goto out_discard;
+		}
 		if (dir->i_ino == HFS_ROOT_CNID)
 			HFS_SB(sb)->root_files++;
 		inode->i_op = &hfs_file_inode_operations;
@@ -244,6 +259,11 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
 	hfs_mark_mdb_dirty(sb);
 
 	return inode;
+
+	out_discard:
+		iput(inode);
+	out_err:
+		return ERR_PTR(err);
 }
 
 void hfs_delete_inode(struct inode *inode)
@@ -252,7 +272,6 @@ void hfs_delete_inode(struct inode *inode)
 
 	hfs_dbg("ino %lu\n", inode->i_ino);
 	if (S_ISDIR(inode->i_mode)) {
-		BUG_ON(atomic64_read(&HFS_SB(sb)->folder_count) > U32_MAX);
 		atomic64_dec(&HFS_SB(sb)->folder_count);
 		if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
 			HFS_SB(sb)->root_dirs--;
@@ -261,7 +280,6 @@ void hfs_delete_inode(struct inode *inode)
 		return;
 	}
 
-	BUG_ON(atomic64_read(&HFS_SB(sb)->file_count) > U32_MAX);
 	atomic64_dec(&HFS_SB(sb)->file_count);
 	if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
 		HFS_SB(sb)->root_files--;
fs/hfs/mdb.c +27 -4
index f28cd24dee842..a97cea35ca2e1 100644
@@ -64,6 +64,27 @@ static int hfs_get_last_session(struct super_block *sb,
 	return 0;
 }
 
+bool is_hfs_cnid_counts_valid(struct super_block *sb)
+{
+	struct hfs_sb_info *sbi = HFS_SB(sb);
+	bool corrupted = false;
+
+	if (unlikely(atomic64_read(&sbi->next_id) > U32_MAX)) {
+		pr_warn("next CNID exceeds limit\n");
+		corrupted = true;
+	}
+	if (unlikely(atomic64_read(&sbi->file_count) > U32_MAX)) {
+		pr_warn("file count exceeds limit\n");
+		corrupted = true;
+	}
+	if (unlikely(atomic64_read(&sbi->folder_count) > U32_MAX)) {
+		pr_warn("folder count exceeds limit\n");
+		corrupted = true;
+	}
+
+	return !corrupted;
+}
+
 /*
  * hfs_mdb_get()
  *
@@ -159,6 +180,11 @@ int hfs_mdb_get(struct super_block *sb)
 	atomic64_set(&HFS_SB(sb)->file_count, be32_to_cpu(mdb->drFilCnt));
 	atomic64_set(&HFS_SB(sb)->folder_count, be32_to_cpu(mdb->drDirCnt));
 
+	if (!is_hfs_cnid_counts_valid(sb)) {
+		pr_warn("filesystem possibly corrupted, running fsck.hfs is recommended. Mounting read-only.\n");
+		sb->s_flags |= SB_RDONLY;
+	}
+
 	/* TRY to get the alternate (backup) MDB. */
 	sect = part_start + part_size - 2;
 	bh = sb_bread512(sb, sect, mdb2);
@@ -212,7 +238,7 @@ int hfs_mdb_get(struct super_block *sb)
 
 	attrib = mdb->drAtrb;
 	if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
-		pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended.  mounting read-only.\n");
+		pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended.	Mounting read-only.\n");
 		sb->s_flags |= SB_RDONLY;
 	}
 	if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) {
@@ -270,15 +296,12 @@ void hfs_mdb_commit(struct super_block *sb)
 		/* These parameters may have been modified, so write them back */
 		mdb->drLsMod = hfs_mtime();
 		mdb->drFreeBks = cpu_to_be16(HFS_SB(sb)->free_ablocks);
-		BUG_ON(atomic64_read(&HFS_SB(sb)->next_id) > U32_MAX);
 		mdb->drNxtCNID =
 			cpu_to_be32((u32)atomic64_read(&HFS_SB(sb)->next_id));
 		mdb->drNmFls = cpu_to_be16(HFS_SB(sb)->root_files);
 		mdb->drNmRtDirs = cpu_to_be16(HFS_SB(sb)->root_dirs);
-		BUG_ON(atomic64_read(&HFS_SB(sb)->file_count) > U32_MAX);
 		mdb->drFilCnt =
 			cpu_to_be32((u32)atomic64_read(&HFS_SB(sb)->file_count));
-		BUG_ON(atomic64_read(&HFS_SB(sb)->folder_count) > U32_MAX);
 		mdb->drDirCnt =
 			cpu_to_be32((u32)atomic64_read(&HFS_SB(sb)->folder_count));
 
fs/hfs/super.c +3 -0
index df289cbdd4e85..97546d6b41f47 100644
@@ -34,6 +34,7 @@ MODULE_LICENSE("GPL");
 
 static int hfs_sync_fs(struct super_block *sb, int wait)
 {
+	is_hfs_cnid_counts_valid(sb);
 	hfs_mdb_commit(sb);
 	return 0;
 }
@@ -65,6 +66,8 @@ static void flush_mdb(struct work_struct *work)
 	sbi->work_queued = 0;
 	spin_unlock(&sbi->work_lock);
 
+	is_hfs_cnid_counts_valid(sb);
+
 	hfs_mdb_commit(sb);
 }
 
Signature · 1 line
2.51.0
author maintainer
#48 lore raw

PATCH 41/844 audit: add missing syscalls to read class

In reply to Sasha Levin

From: Jeffrey Bencteux <[email protected]>

[ Upstream commit bcb90a2834c7393c26df9609b889a3097b7700cd ]

The "at" variant of getxattr() and listxattr() are missing from the audit read class. Calling getxattrat() or listxattrat() on a file to read its extended attributes will bypass audit rules such as:

-w /tmp/test -p rwa -k test_rwa

The current patch adds missing syscalls to the audit read class.

---
 include/asm-generic/audit_read.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/asm-generic/audit_read.h +6 -0
index 7bb7b5a83ae2e..fb9991f53fb6f 100644
@@ -4,9 +4,15 @@ __NR_readlink,
 #endif
 __NR_quotactl,
 __NR_listxattr,
+#ifdef __NR_listxattrat
+__NR_listxattrat,
+#endif
 __NR_llistxattr,
 __NR_flistxattr,
 __NR_getxattr,
+#ifdef __NR_getxattrat
+__NR_getxattrat,
+#endif
 __NR_lgetxattr,
 __NR_fgetxattr,
 #ifdef __NR_readlinkat
Signature · 1 line
2.51.0
author maintainer
#49 lore raw

PATCH 42/844 hfsplus: pretend special inodes as regular files

In reply to Sasha Levin

From: Tetsuo Handa <[email protected]>

[ Upstream commit ed8889ca21b6ab37bc1435c4009ce37a79acb9e6 ]

Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()") requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/ S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.

---
 fs/hfsplus/super.c | 6 ++++++
 1 file changed, 6 insertions(+)
fs/hfsplus/super.c +6 -0
index aaffa9e060a0a..7f327b777ece8 100644
@@ -53,6 +53,12 @@ static int hfsplus_system_read_inode(struct inode *inode)
 		return -EIO;
 	}
 
+	/*
+	 * Assign a dummy file type, for may_open() requires that
+	 * an inode has a valid file type.
+	 */
+	inode->i_mode = S_IFREG;
+
 	return 0;
 }
 
Signature · 1 line
2.51.0
author maintainer
#50 lore raw

PATCH 43/844 i3c: master: svc: Initialize 'dev' to NULL in svc_i3c_master_ibi_isr()

In reply to Sasha Levin

From: Frank Li <[email protected]>

[ Upstream commit 3c9ffb4db787428a5851d5865823ab23842d5103 ]

Initialize the 'dev' pointer to NULL in svc_i3c_master_ibi_isr() and add a NULL check in the error path.

---
 drivers/i3c/master/svc-i3c-master.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i3c/master/svc-i3c-master.c +2 -2
index a62f22ff8b576..857504d36e186 100644
@@ -533,8 +533,8 @@ static int svc_i3c_master_handle_ibi_won(struct svc_i3c_master *master, u32 msta
 static void svc_i3c_master_ibi_isr(struct svc_i3c_master *master)
 {
 	struct svc_i3c_i2c_dev_data *data;
+	struct i3c_dev_desc *dev = NULL;
 	unsigned int ibitype, ibiaddr;
-	struct i3c_dev_desc *dev;
 	u32 status, val;
 	int ret;
 
@@ -627,7 +627,7 @@ static void svc_i3c_master_ibi_isr(struct svc_i3c_master *master)
 	 * for the slave to interrupt again.
 	 */
 	if (svc_i3c_master_error(master)) {
-		if (master->ibi.tbq_slot) {
+		if (master->ibi.tbq_slot && dev) {
 			data = i3c_dev_get_master_data(dev);
 			i3c_generic_ibi_recycle_slot(data->ibi_pool,
 						     master->ibi.tbq_slot);
Signature · 1 line
2.51.0
author maintainer
#51 lore raw

PATCH 44/844 i3c: mipi-i3c-hci: Stop reading Extended Capabilities if capability ID is 0

In reply to Sasha Levin

From: Adrian Hunter <[email protected]>

[ Upstream commit 0818e4aa8fdeeed5973e0a8faeddc9da599fc897 ]

Extended Capability ID value 0 is special. It signifies the end of the list. Stop reading Extended Capabilities if capability ID is 0.

---
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master/mipi-i3c-hci/ext_caps.c +1 -1
index 7714f00ea9cc0..533a495e14c86 100644
@@ -272,7 +272,7 @@ int i3c_hci_parse_ext_caps(struct i3c_hci *hci)
 		cap_length = FIELD_GET(CAP_HEADER_LENGTH, cap_header);
 		dev_dbg(&hci->master.dev, "id=0x%02x length=%d",
 			cap_id, cap_length);
-		if (!cap_length)
+		if (!cap_id || !cap_length)
 			break;
 		if (curr_cap + cap_length * 4 >= end) {
 			dev_err(&hci->master.dev,
Signature · 1 line
2.51.0
author maintainer
#52 lore raw

PATCH 45/844 i3c: mipi-i3c-hci: Reset RING_OPERATION1 fields during init

In reply to Sasha Levin

From: Adrian Hunter <[email protected]>

[ Upstream commit 78f63ae4a82db173f93adca462e63d11ba06b126 ]

The MIPI I3C HCI specification does not define reset values for RING_OPERATION1 fields, and some controllers (e.g., Intel) do not clear them during a software reset. Ensure the ring pointers are explicitly set to zero during bus initialization to avoid inconsistent state.

---
 drivers/i3c/master/mipi-i3c-hci/dma.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/i3c/master/mipi-i3c-hci/dma.c +8 -0
index c401a9425cdc5..951abfea5a6fd 100644
@@ -342,6 +342,14 @@ static int hci_dma_init(struct i3c_hci *hci)
 		rh_reg_write(INTR_SIGNAL_ENABLE, regval);
 
 ring_ready:
+		/*
+		 * The MIPI I3C HCI specification does not document reset values for
+		 * RING_OPERATION1 fields and some controllers (e.g. Intel controllers)
+		 * do not reset the values, so ensure the ring pointers are set to zero
+		 * here.
+		 */
+		rh_reg_write(RING_OPERATION1, 0);
+
 		rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE |
 					   RING_CTRL_RUN_STOP);
 	}
Signature · 1 line
2.51.0
author maintainer
#53 lore raw

PATCH 46/844 dlm: fix recovery pending middle conversion

In reply to Sasha Levin

From: Alexander Aring <[email protected]>

[ Upstream commit 1416bd508c78bdfdb9ae0b4511369e5581f348ea ]

During a workload involving conversions between lock modes PR and CW, lock recovery can create a "conversion deadlock" state between locks that have been recovered. When this occurs, kernel warning messages are logged, e.g.

"dlm: WARN: pending deadlock 1e node 0 2 1bf21"

"dlm: receive_rcom_lock_args 2e middle convert gr 3 rq 2 remote 2 1e"

After this occurs, the deadlocked conversions both appear on the convert queue of the resource being locked, and the conversion requests do not complete.

Outside of recovery, conversions that would produce a deadlock are resolved immediately, and return -EDEADLK. The locks are not placed on the convert queue in the deadlocked state.

To fix this problem, an lkb under conversion between PR/CW is rebuilt during recovery on a new master's granted queue, with the currently granted mode, rather than being rebuilt on the new master's convert queue, with the currently granted mode and the newly requested mode. The in-progress convert is then resent to the new master after recovery, so the conversion deadlock will be processed outside of the recovery context and handled as described above.

---
 fs/dlm/lock.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
fs/dlm/lock.c +1 -18
index be938fdf17d96..c01a291db401b 100644
@@ -5014,25 +5014,8 @@ void dlm_receive_buffer(const union dlm_packet *p, int nodeid)
 static void recover_convert_waiter(struct dlm_ls *ls, struct dlm_lkb *lkb,
 				   struct dlm_message *ms_local)
 {
-	if (middle_conversion(lkb)) {
-		log_rinfo(ls, "%s %x middle convert in progress", __func__,
-			 lkb->lkb_id);
-
-		/* We sent this lock to the new master. The new master will
-		 * tell us when it's granted.  We no longer need a reply, so
-		 * use a fake reply to put the lkb into the right state.
-		 */
-		hold_lkb(lkb);
-		memset(ms_local, 0, sizeof(struct dlm_message));
-		ms_local->m_type = cpu_to_le32(DLM_MSG_CONVERT_REPLY);
-		ms_local->m_result = cpu_to_le32(to_dlm_errno(-EINPROGRESS));
-		ms_local->m_header.h_nodeid = cpu_to_le32(lkb->lkb_nodeid);
-		_receive_convert_reply(lkb, ms_local, true);
-		unhold_lkb(lkb);
-
-	} else if (lkb->lkb_rqmode >= lkb->lkb_grmode) {
+	if (middle_conversion(lkb) || lkb->lkb_rqmode >= lkb->lkb_grmode)
 		set_bit(DLM_IFL_RESEND_BIT, &lkb->lkb_iflags);
-	}
 
 	/* lkb->lkb_rqmode < lkb->lkb_grmode shouldn't happen since down
 	   conversions are async; there's no reply from the remote master */
Signature · 1 line
2.51.0
author maintainer
#54 lore raw

PATCH 47/844 minix: Add required sanity checking to minix_check_superblock()

In reply to Sasha Levin

From: Jori Koolstra <[email protected]>

[ Upstream commit 8c97a6ddc95690a938ded44b4e3202f03f15078c ]

The fs/minix implementation of the minix filesystem does not currently support any other value for s_log_zone_size than 0. This is also the only value supported in util-linux; see mkfs.minix.c line 511. In addition, this patch adds some sanity checking for the other minix superblock fields, and moves the minix_blocks_needed() checks for the zmap and imap also to minix_check_super_block().

This also closes a related syzbot bug report.

---
 fs/minix/inode.c | 50 ++++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 21 deletions(-)
fs/minix/inode.c +29 -21
index 51ea9bdc813f7..c8c6b2135abe7 100644
@@ -170,10 +170,38 @@ static int minix_reconfigure(struct fs_context *fc)
 static bool minix_check_superblock(struct super_block *sb)
 {
 	struct minix_sb_info *sbi = minix_sb(sb);
+	unsigned long block;
 
-	if (sbi->s_imap_blocks == 0 || sbi->s_zmap_blocks == 0)
+	if (sbi->s_log_zone_size != 0) {
+		printk("minix-fs error: zone size must equal block size. "
+		       "s_log_zone_size > 0 is not supported.\n");
+		return false;
+	}
+
+	if (sbi->s_ninodes < 1 || sbi->s_firstdatazone <= 4 ||
+	    sbi->s_firstdatazone >= sbi->s_nzones)
 		return false;
 
+	/* Apparently minix can create filesystems that allocate more blocks for
+	 * the bitmaps than needed.  We simply ignore that, but verify it didn't
+	 * create one with not enough blocks and bail out if so.
+	 */
+	block = minix_blocks_needed(sbi->s_ninodes, sb->s_blocksize);
+	if (sbi->s_imap_blocks < block) {
+		printk("MINIX-fs: file system does not have enough "
+		       "imap blocks allocated. Refusing to mount.\n");
+		return false;
+	}
+
+	block = minix_blocks_needed(
+			(sbi->s_nzones - sbi->s_firstdatazone + 1),
+			sb->s_blocksize);
+	if (sbi->s_zmap_blocks < block) {
+		printk("MINIX-fs: file system does not have enough "
+		       "zmap blocks allocated. Refusing to mount.\n");
+		return false;
+	}
+
 	/*
 	 * s_max_size must not exceed the block mapping limitation.  This check
 	 * is only needed for V1 filesystems, since V2/V3 support an extra level
@@ -293,26 +321,6 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc)
 	minix_set_bit(0,sbi->s_imap[0]->b_data);
 	minix_set_bit(0,sbi->s_zmap[0]->b_data);
 
-	/* Apparently minix can create filesystems that allocate more blocks for
-	 * the bitmaps than needed.  We simply ignore that, but verify it didn't
-	 * create one with not enough blocks and bail out if so.
-	 */
-	block = minix_blocks_needed(sbi->s_ninodes, s->s_blocksize);
-	if (sbi->s_imap_blocks < block) {
-		printk("MINIX-fs: file system does not have enough "
-				"imap blocks allocated.  Refusing to mount.\n");
-		goto out_no_bitmap;
-	}
-
-	block = minix_blocks_needed(
-			(sbi->s_nzones - sbi->s_firstdatazone + 1),
-			s->s_blocksize);
-	if (sbi->s_zmap_blocks < block) {
-		printk("MINIX-fs: file system does not have enough "
-				"zmap blocks allocated.  Refusing to mount.\n");
-		goto out_no_bitmap;
-	}
-
 	/* set up enough so that it can read an inode */
 	s->s_op = &minix_sops;
 	s->s_time_min = 0;
Signature · 1 line
2.51.0
author maintainer
#55 lore raw

PATCH 48/844 dlm: validate length in dlm_search_rsb_tree

In reply to Sasha Levin

From: Ezrak1e <[email protected]>

[ Upstream commit 080e5563f878c64e697b89e7439d730d0daad882 ]

The len parameter in dlm_dump_rsb_name() is not validated and comes from network messages. When it exceeds DLM_RESNAME_MAXLEN, it can cause out-of-bounds write in dlm_search_rsb_tree().

Add length validation to prevent potential buffer overflow.

---
 fs/dlm/lock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/lock.c +2 -1
index c01a291db401b..a393ecaf3442a 100644
@@ -626,7 +626,8 @@ int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name, int len,
 			struct dlm_rsb **r_ret)
 {
 	char key[DLM_RESNAME_MAXLEN] = {};
-
+	if (len > DLM_RESNAME_MAXLEN)
+		return -EINVAL;
 	memcpy(key, name, len);
 	*r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params);
 	if (*r_ret)
Signature · 1 line
2.51.0
author maintainer
#56 lore raw

PATCH 49/844 btrfs: don't BUG() on unexpected delayed ref type in run_one_delayed_ref()

In reply to Sasha Levin

From: Filipe Manana <[email protected]>

[ Upstream commit c7d1d4ff56744074e005771aff193b927392d51f ]

There is no need to BUG(), we can just return an error and log an error message.

---
 fs/btrfs/extent-tree.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
fs/btrfs/extent-tree.c +12 -8
index e4cae34620d19..1bf081243efb2 100644
@@ -1761,32 +1761,36 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans,
 			       struct btrfs_delayed_extent_op *extent_op,
 			       bool insert_reserved)
 {
+	struct btrfs_fs_info *fs_info = trans->fs_info;
 	int ret = 0;
 
 	if (TRANS_ABORTED(trans)) {
 		if (insert_reserved) {
 			btrfs_pin_extent(trans, node->bytenr, node->num_bytes);
-			free_head_ref_squota_rsv(trans->fs_info, href);
+			free_head_ref_squota_rsv(fs_info, href);
 		}
 		return 0;
 	}
 
 	if (node->type == BTRFS_TREE_BLOCK_REF_KEY ||
-	    node->type == BTRFS_SHARED_BLOCK_REF_KEY)
+	    node->type == BTRFS_SHARED_BLOCK_REF_KEY) {
 		ret = run_delayed_tree_ref(trans, href, node, extent_op,
 					   insert_reserved);
-	else if (node->type == BTRFS_EXTENT_DATA_REF_KEY ||
-		 node->type == BTRFS_SHARED_DATA_REF_KEY)
+	} else if (node->type == BTRFS_EXTENT_DATA_REF_KEY ||
+		   node->type == BTRFS_SHARED_DATA_REF_KEY) {
 		ret = run_delayed_data_ref(trans, href, node, extent_op,
 					   insert_reserved);
-	else if (node->type == BTRFS_EXTENT_OWNER_REF_KEY)
+	} else if (node->type == BTRFS_EXTENT_OWNER_REF_KEY) {
 		ret = 0;
-	else
-		BUG();
+	} else {
+		ret = -EUCLEAN;
+		btrfs_err(fs_info, "unexpected delayed ref node type: %u", node->type);
+	}
+
 	if (ret && insert_reserved)
 		btrfs_pin_extent(trans, node->bytenr, node->num_bytes);
 	if (ret < 0)
-		btrfs_err(trans->fs_info,
+		btrfs_err(fs_info,
 "failed to run delayed ref for logical %llu num_bytes %llu type %u action %u ref_mod %d: %d",
 			  node->bytenr, node->num_bytes, node->type,
 			  node->action, node->ref_mod, ret);
Signature · 1 line
2.51.0
author maintainer
#57 lore raw

PATCH 50/844 btrfs: fallback to buffered IO if the data profile has duplication

In reply to Sasha Levin

From: Qu Wenruo <[email protected]>

[ Upstream commit 7c2830f00c3e086292c1ee9f27b61efaf8e76c9a ]

[BACKGROUND]
Inspired by a recent kernel bug report, which is related to direct IO buffer modification during writeback, that leads to contents mismatch of different RAID1 mirrors.

[CAUSE AND PROBLEMS]
The root cause is exactly the same explained in commit 968f19c5b1b7 ("btrfs: always fallback to buffered write if the inode requires checksum"), that we can not trust direct IO buffer which can be modified halfway during writeback.

Unlike data checksum verification, if this happened on inodes without data checksum but has the data has extra mirrors, it will lead to stealth data mismatch on different mirrors.

This will be way harder to detect without data checksum.

Furthermore for RAID56, we can even have data without checksum and data with checksum mixed inside the same full stripe.

In that case if the direct IO buffer got changed halfway for the nodatasum part, the data with checksum immediately lost its ability to recover, e.g.:

" " = Good old data or parity calculated using good old data "X" = Data modified during writeback

              0                32K                      64K
  Data 1      |                                         |  Has csum
  Data 2      |XXXXXXXXXXXXXXXX                         |  No csum
  Parity      |                                         |

In above case, the parity is calculated using data 1 (has csum, from page cache, won't change during writeback), and old data 2 (has no csum, direct IO write).

After parity is calculated, but before submission to the storage, direct IO buffer of data 2 is modified, causing the range [0, 32K) of data 2 has a different content.

Now all data is submitted to the storage, and the fs got fully synced.

Then the device of data 1 is lost, has to be rebuilt from data 2 and parity. But since the data 2 has some modified data, and the parity is calculated using old data, the recovered data is no the same for data 1, causing data checksum mismatch.

[FIX]
Fix the problem by checking the data allocation profile.
If our data allocation profile is either RAID0 or SINGLE, we can allow true zero-copy direct IO and the end user is fully responsible for any race.

However this is not going to fix all situations, as it's still possible to race with balance where the fs got a new data profile after the data allocation profile check.
But this fix should still greatly reduce the window of the original bug.

---
 fs/btrfs/direct-io.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
fs/btrfs/direct-io.c +12 -0
index 07e19e88ba4b3..5443d69efe956 100644
@@ -814,6 +814,8 @@ ssize_t btrfs_direct_write(struct kiocb *iocb, struct iov_iter *from)
 	ssize_t ret;
 	unsigned int ilock_flags = 0;
 	struct iomap_dio *dio;
+	const u64 data_profile = btrfs_data_alloc_profile(fs_info) &
+				 BTRFS_BLOCK_GROUP_PROFILE_MASK;
 
 	if (iocb->ki_flags & IOCB_NOWAIT)
 		ilock_flags |= BTRFS_ILOCK_TRY;
@@ -827,6 +829,16 @@ ssize_t btrfs_direct_write(struct kiocb *iocb, struct iov_iter *from)
 	if (iocb->ki_pos + iov_iter_count(from) <= i_size_read(inode) && IS_NOSEC(inode))
 		ilock_flags |= BTRFS_ILOCK_SHARED;
 
+	/*
+	 * If our data profile has duplication (either extra mirrors or RAID56),
+	 * we can not trust the direct IO buffer, the content may change during
+	 * writeback and cause different contents written to different mirrors.
+	 *
+	 * Thus only RAID0 and SINGLE can go true zero-copy direct IO.
+	 */
+	if (data_profile != BTRFS_BLOCK_GROUP_RAID0 && data_profile != 0)
+		goto buffered;
+
 relock:
 	ret = btrfs_inode_lock(BTRFS_I(inode), ilock_flags);
 	if (ret < 0)
Signature · 1 line
2.51.0
author maintainer
#58 lore raw

PATCH 51/844 btrfs: handle user interrupt properly in btrfs_trim_fs()

In reply to Sasha Levin

From: jinbaohong <[email protected]>

[ Upstream commit bfb670b9183b0e4ba660aff2e396ec1cc01d0761 ]

When a fatal signal is pending or the process is freezing, btrfs_trim_block_group() and btrfs_trim_free_extents() return -ERESTARTSYS. Currently this is treated as a regular error: the loops continue to the next iteration and count it as a block group or device failure.

Instead, break out of the loops immediately and return -ERESTARTSYS to userspace without counting it as a failure. Also skip the device loop entirely if the block group loop was interrupted.

---
 fs/btrfs/extent-tree.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fs/btrfs/extent-tree.c +11 -0
index 1bf081243efb2..8bdb609f58a7e 100644
@@ -6555,6 +6555,10 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
 						     range->minlen);
 
 			trimmed += group_trimmed;
+			if (ret == -ERESTARTSYS || ret == -EINTR) {
+				btrfs_put_block_group(cache);
+				break;
+			}
 			if (ret) {
 				bg_failed++;
 				bg_ret = ret;
@@ -6568,6 +6572,9 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
 			"failed to trim %llu block group(s), last error %d",
 			bg_failed, bg_ret);
 
+	if (ret == -ERESTARTSYS || ret == -EINTR)
+		return ret;
+
 	mutex_lock(&fs_devices->device_list_mutex);
 	list_for_each_entry(device, &fs_devices->devices, dev_list) {
 		if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state))
@@ -6576,6 +6583,8 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
 		ret = btrfs_trim_free_extents(device, &group_trimmed);
 
 		trimmed += group_trimmed;
+		if (ret == -ERESTARTSYS || ret == -EINTR)
+			break;
 		if (ret) {
 			dev_failed++;
 			dev_ret = ret;
@@ -6589,6 +6598,8 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
 			"failed to trim %llu device(s), last error %d",
 			dev_failed, dev_ret);
 	range->len = trimmed;
+	if (ret == -ERESTARTSYS || ret == -EINTR)
+		return ret;
 	if (bg_ret)
 		return bg_ret;
 	return dev_ret;
Signature · 1 line
2.51.0
author maintainer
#59 lore raw

PATCH 52/844 netfs: when subreq is marked for retry, do not check if it faced an error

In reply to Sasha Levin

From: Shyam Prasad N <[email protected]>

[ Upstream commit 82e8885bd7633a36ee9050e6d7f348a4155eed5f ]

The *_subreq_terminated functions today only process the NEED_RETRY flag when the subreq was successful or failed with EAGAIN error. However, there could be other retriable errors for network filesystems.

Avoid this by processing the NEED_RETRY irrespective of the error code faced by the subreq. If it was specifically marked for retry, the error code must not matter.

---
 fs/netfs/read_collect.c  | 10 ++++++++++
 fs/netfs/read_retry.c    |  4 ++--
 fs/netfs/write_collect.c |  8 ++++----
 fs/netfs/write_issue.c   |  1 +
 4 files changed, 17 insertions(+), 6 deletions(-)
fs/netfs/read_collect.c +10 -0
index 7a0ffa675fb17..137f0e28a44c5 100644
@@ -546,6 +546,15 @@ void netfs_read_subreq_terminated(struct netfs_io_subrequest *subreq)
 		}
 	}
 
+	/* If need retry is set, error should not matter unless we hit too many
+	 * retries. Pause the generation of new subreqs
+	 */
+	if (test_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags)) {
+		trace_netfs_rreq(rreq, netfs_rreq_trace_set_pause);
+		set_bit(NETFS_RREQ_PAUSE, &rreq->flags);
+		goto skip_error_checks;
+	}
+
 	if (unlikely(subreq->error < 0)) {
 		trace_netfs_failure(rreq, subreq, subreq->error, netfs_fail_read);
 		if (subreq->source == NETFS_READ_FROM_CACHE) {
@@ -559,6 +568,7 @@ void netfs_read_subreq_terminated(struct netfs_io_subrequest *subreq)
 		set_bit(NETFS_RREQ_PAUSE, &rreq->flags);
 	}
 
+skip_error_checks:
 	trace_netfs_sreq(subreq, netfs_sreq_trace_terminated);
 	netfs_subreq_clear_in_progress(subreq);
 	netfs_put_subrequest(subreq, netfs_sreq_trace_put_terminated);
fs/netfs/read_retry.c +2 -2
index b99e84a8170af..7793ba5e3e8fc 100644
@@ -12,6 +12,7 @@
 static void netfs_reissue_read(struct netfs_io_request *rreq,
 			       struct netfs_io_subrequest *subreq)
 {
+	subreq->error = 0;
 	__clear_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
 	__set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);
 	netfs_stat(&netfs_n_rh_retry_read_subreq);
@@ -242,8 +243,7 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq)
 	subreq = list_next_entry(subreq, rreq_link);
 abandon:
 	list_for_each_entry_from(subreq, &stream->subrequests, rreq_link) {
-		if (!subreq->error &&
-		    !test_bit(NETFS_SREQ_FAILED, &subreq->flags) &&
+		if (!test_bit(NETFS_SREQ_FAILED, &subreq->flags) &&
 		    !test_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags))
 			continue;
 		subreq->error = -ENOMEM;
fs/netfs/write_collect.c +4 -4
index cbf3d9194c7bf..61eab34ea67ef 100644
@@ -492,11 +492,11 @@ void netfs_write_subrequest_terminated(void *_op, ssize_t transferred_or_error)
 
 	if (IS_ERR_VALUE(transferred_or_error)) {
 		subreq->error = transferred_or_error;
-		if (subreq->error == -EAGAIN)
-			set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);
-		else
+		/* if need retry is set, error should not matter */
+		if (!test_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags)) {
 			set_bit(NETFS_SREQ_FAILED, &subreq->flags);
-		trace_netfs_failure(wreq, subreq, transferred_or_error, netfs_fail_write);
+			trace_netfs_failure(wreq, subreq, transferred_or_error, netfs_fail_write);
+		}
 
 		switch (subreq->source) {
 		case NETFS_WRITE_TO_CACHE:
fs/netfs/write_issue.c +1 -0
index dd8743bc8d7fe..34894da5a23ec 100644
@@ -250,6 +250,7 @@ void netfs_reissue_write(struct netfs_io_stream *stream,
 	iov_iter_truncate(&subreq->io_iter, size);
 
 	subreq->retry_count++;
+	subreq->error = 0;
 	__clear_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
 	__set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);
 	netfs_stat(&netfs_n_wh_retry_write_subreq);
Signature · 1 line
2.51.0
author maintainer
#60 lore raw

PATCH 53/844 smb: client: add proper locking around ses->iface_last_update

In reply to Sasha Levin

From: Henrique Carvalho <[email protected]>

[ Upstream commit e97dcac3dc0bd37e4b56aaa6874b572a3a461102 ]

There is a missing ses->iface_lock in cifs_setup_session, around ses->iface_last_update.

---
 fs/smb/client/connect.c | 2 ++
 1 file changed, 2 insertions(+)
fs/smb/client/connect.c +2 -0
index ce620503e9f70..60c76375f0f50 100644
@@ -4270,7 +4270,9 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 		ses->ses_status = SES_IN_SETUP;
 
 		/* force iface_list refresh */
+		spin_lock(&ses->iface_lock);
 		ses->iface_last_update = 0;
+		spin_unlock(&ses->iface_lock);
 	}
 	spin_unlock(&ses->ses_lock);
 
Signature · 1 line
2.51.0
author maintainer
#61 lore raw

PATCH 54/844 gfs2: fiemap page fault fix

In reply to Sasha Levin

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit e411d74cc5ba290f85d0dd5e4d1df8f1d6d975d2 ]

In gfs2_fiemap(), we are calling iomap_fiemap() while holding the inode glock. This can lead to recursive glock taking if the fiemap buffer is memory mapped to the same inode and accessing it triggers a page fault.

Fix by disabling page faults for iomap_fiemap() and faulting in the buffer by hand if necessary.

Fixes xfstest generic/742.

---
 fs/gfs2/inode.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
fs/gfs2/inode.c +16 -0
index b6ed069b34872..4d65e4a752626 100644
@@ -2192,6 +2192,14 @@ static int gfs2_getattr(struct mnt_idmap *idmap,
 	return 0;
 }
 
+static bool fault_in_fiemap(struct fiemap_extent_info *fi)
+{
+	struct fiemap_extent __user *dest = fi->fi_extents_start;
+	size_t size = sizeof(*dest) * fi->fi_extents_max;
+
+	return fault_in_safe_writeable((char __user *)dest, size) == 0;
+}
+
 static int gfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 		       u64 start, u64 len)
 {
@@ -2201,14 +2209,22 @@ static int gfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 
 	inode_lock_shared(inode);
 
+retry:
 	ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
 	if (ret)
 		goto out;
 
+	pagefault_disable();
 	ret = iomap_fiemap(inode, fieinfo, start, len, &gfs2_iomap_ops);
+	pagefault_enable();
 
 	gfs2_glock_dq_uninit(&gh);
 
+	if (ret == -EFAULT && fault_in_fiemap(fieinfo)) {
+		fieinfo->fi_extents_mapped = 0;
+		goto retry;
+	}
+
 out:
 	inode_unlock_shared(inode);
 	return ret;
Signature · 1 line
2.51.0
author maintainer
#62 lore raw

PATCH 55/844 smb: client: prevent races in ->query_interfaces()

In reply to Sasha Levin

From: Henrique Carvalho <[email protected]>

[ Upstream commit c3c06e42e1527716c54f3ad2ced6a034b5f3a489 ]

It was possible for two query interface works to be concurrently trying to update the interfaces.

Prevent this by checking and updating iface_last_update under iface_lock.

---
 fs/smb/client/smb2ops.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
fs/smb/client/smb2ops.c +8 -11
index c1aaf77e187b6..edfd6a4e87e8b 100644
@@ -637,13 +637,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
 	p = buf;
 
 	spin_lock(&ses->iface_lock);
-	/* do not query too frequently, this time with lock held */
-	if (ses->iface_last_update &&
-	    time_before(jiffies, ses->iface_last_update +
-			(SMB_INTERFACE_POLL_INTERVAL * HZ))) {
-		spin_unlock(&ses->iface_lock);
-		return 0;
-	}
 
 	/*
 	 * Go through iface_list and mark them as inactive
@@ -666,7 +659,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
 				 "Empty network interface list returned by server %s\n",
 				 ses->server->hostname);
 		rc = -EOPNOTSUPP;
-		ses->iface_last_update = jiffies;
 		goto out;
 	}
 
@@ -795,8 +787,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
 	     + sizeof(p->Next) && p->Next))
 		cifs_dbg(VFS, "%s: incomplete interface info\n", __func__);
 
-	ses->iface_last_update = jiffies;
-
 out:
 	/*
 	 * Go through the list again and put the inactive entries
@@ -825,10 +815,17 @@ SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_
 	struct TCP_Server_Info *pserver;
 
 	/* do not query too frequently */
+	spin_lock(&ses->iface_lock);
 	if (ses->iface_last_update &&
 	    time_before(jiffies, ses->iface_last_update +
-			(SMB_INTERFACE_POLL_INTERVAL * HZ)))
+			(SMB_INTERFACE_POLL_INTERVAL * HZ))) {
+		spin_unlock(&ses->iface_lock);
 		return 0;
+	}
+
+	ses->iface_last_update = jiffies;
+
+	spin_unlock(&ses->iface_lock);
 
 	rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
 			FSCTL_QUERY_NETWORK_INTERFACE_INFO,
Signature · 1 line
2.51.0
author maintainer
#63 lore raw

PATCH 56/844 tools/cpupower: Fix inverted APERF capability check

In reply to Sasha Levin

From: Kaushlendra Kumar <[email protected]>

[ Upstream commit 24858a84163c8d04827166b3bcaed80612bb62fc ]

The capability check was inverted, causing the function to return error when APERF support is available and proceed when it is not.

Negate the condition to return error only when APERF capability is absent.

---
 tools/power/cpupower/utils/cpufreq-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/cpupower/utils/cpufreq-info.c +1 -1
index 7d3732f5f2f6f..5fe01e516817e 100644
@@ -270,7 +270,7 @@ static int get_freq_hardware(unsigned int cpu, unsigned int human)
 {
 	unsigned long freq;
 
-	if (cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)
+	if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF))
 		return -EINVAL;
 
 	freq = cpufreq_get_freq_hardware(cpu);
Signature · 1 line
2.51.0
author maintainer
#64 lore raw

PATCH 57/844 s390/boot: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS

In reply to Sasha Levin

From: Heiko Carstens <[email protected]>

[ Upstream commit 5ba35a6c13fff0929c34aba6b7602dacbe68686c ]

Add -Wno-default-const-init-unsafe to boot KBUILD_CFLAGS, similar to scripts/Makefile.extrawarn, since clang generates warnings for the dummy variable in typecheck():

    CC      arch/s390/boot/version.o
      arch/s390/include/asm/ptrace.h:221:9: warning: default initialization of an object of type 'typeof (regs->psw)' (aka 'const psw_t') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
        221 |         return psw_bits(regs->psw).pstate;
            |                ^
      arch/s390/include/asm/ptrace.h:98:2: note: expanded from macro 'psw_bits'
         98 |         typecheck(psw_t, __psw);                \
            |         ^
      include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck'
         11 |         typeof(x) __dummy2; \
            |                   ^
---
 arch/s390/boot/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/s390/boot/Makefile +1 -0
index 490167faba7a4..a1e719a79d38c 100644
@@ -21,6 +21,7 @@ KBUILD_AFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_AFLAGS_DECOMPRESSOR))
 KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_CFLAGS_DECOMPRESSOR))
 KBUILD_AFLAGS += $(CC_FLAGS_MARCH_MINIMUM) -D__DISABLE_EXPORTS
 KBUILD_CFLAGS += $(CC_FLAGS_MARCH_MINIMUM) -D__DISABLE_EXPORTS
+KBUILD_CFLAGS += $(call cc-option, -Wno-default-const-init-unsafe)
 
 CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
 
Signature · 1 line
2.51.0
author maintainer
#65 lore raw

PATCH 58/844 tools/power cpupower: Reset errno before strtoull()

In reply to Sasha Levin

From: Kaushlendra Kumar <[email protected]>

[ Upstream commit f9bd3762cf1bd0c2465f2e6121b340883471d1bf ]

cpuidle_state_get_one_value() never cleared errno before calling strtoull(), so a prior ERANGE caused every cpuidle counter read to return zero. Reset errno to 0 before the conversion so each sysfs read is evaluated independently.

---
 tools/power/cpupower/lib/cpuidle.c | 1 +
 1 file changed, 1 insertion(+)
tools/power/cpupower/lib/cpuidle.c +1 -0
index f2c1139adf716..bd857ee7541a7 100644
@@ -150,6 +150,7 @@ unsigned long long cpuidle_state_get_one_value(unsigned int cpu,
 	if (len == 0)
 		return 0;
 
+	errno = 0;
 	value = strtoull(linebuf, &endp, 0);
 
 	if (endp == linebuf || errno == ERANGE)
Signature · 1 line
2.51.0
author maintainer
#66 lore raw

PATCH 59/844 s390/purgatory: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS

In reply to Sasha Levin

From: Heiko Carstens <[email protected]>

[ Upstream commit b4780fe4ddf04b51127a33d705f4a2e224df00fa ]

Add -Wno-default-const-init-unsafe to purgatory KBUILD_CFLAGS, similar to scripts/Makefile.extrawarn, since clang generates warnings for the dummy variable in typecheck():

    CC      arch/s390/purgatory/purgatory.o
      arch/s390/include/asm/ptrace.h:221:9: warning: default initialization of an object of type 'typeof (regs->psw)' (aka 'const psw_t') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
        221 |         return psw_bits(regs->psw).pstate;
            |                ^
      arch/s390/include/asm/ptrace.h:98:2: note: expanded from macro 'psw_bits'
         98 |         typecheck(psw_t, __psw);                \
            |         ^
      include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck'
         11 |         typeof(x) __dummy2; \
            |                   ^
---
 arch/s390/purgatory/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/s390/purgatory/Makefile +1 -0
index 0c196a5b194af..61d240a37633d 100644
@@ -23,6 +23,7 @@ KBUILD_CFLAGS += -D__DISABLE_EXPORTS
 KBUILD_CFLAGS += $(CLANG_FLAGS)
 KBUILD_CFLAGS += $(if $(CONFIG_CC_IS_CLANG),-Wno-microsoft-anon-tag)
 KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+KBUILD_CFLAGS += $(call cc-option, -Wno-default-const-init-unsafe)
 KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
 KBUILD_AFLAGS += -D__DISABLE_EXPORTS
 
Signature · 1 line
2.51.0
author maintainer
#67 lore raw

PATCH 60/844 perf/arm-cmn: Support CMN-600AE

In reply to Sasha Levin

From: Robin Murphy <[email protected]>

[ Upstream commit 12a94953c37e834c3eabb839ce057094946fe67a ]

The functional safety features of CMN-600AE have little to no impact on the PMU relative to the base CMN-600 design, so for simplicity we can reasonably just treat it as the same thing. The only obvious difference is that the revision numbers aren't aligned, so we may hide some aliases for events which do actually exist, but those can still be specified via the underlying "type,eventid" format so it's not too big a deal.

---
 drivers/perf/arm-cmn.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/perf/arm-cmn.c +4 -0
index 23245352a3fc0..651edd73bfcb1 100644
@@ -210,6 +210,7 @@ enum cmn_model {
 enum cmn_part {
 	PART_CMN600 = 0x434,
 	PART_CMN650 = 0x436,
+	PART_CMN600AE = 0x438,
 	PART_CMN700 = 0x43c,
 	PART_CI700 = 0x43a,
 	PART_CMN_S3 = 0x43e,
@@ -2266,6 +2267,9 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
 	reg = readq_relaxed(cfg_region + CMN_CFGM_PERIPH_ID_01);
 	part = FIELD_GET(CMN_CFGM_PID0_PART_0, reg);
 	part |= FIELD_GET(CMN_CFGM_PID1_PART_1, reg) << 8;
+	/* 600AE is close enough that it's not really worth more complexity */
+	if (part == PART_CMN600AE)
+		part = PART_CMN600;
 	if (cmn->part && cmn->part != part)
 		dev_warn(cmn->dev,
 			 "Firmware binding mismatch: expected part number 0x%x, found 0x%x\n",
Signature · 1 line
2.51.0
author maintainer
#68 lore raw

PATCH 61/844 arm64: Add support for TSV110 Spectre-BHB mitigation

In reply to Sasha Levin

From: Jinqian Yang <[email protected]>

[ Upstream commit e3baa5d4b361276efeb87b20d8beced451a7dbd5 ]

The TSV110 processor is vulnerable to the Spectre-BHB (Branch History Buffer) attack, which can be exploited to leak information through branch prediction side channels. This commit adds the MIDR of TSV110 to the list for software mitigation.

---
 arch/arm64/kernel/proton-pack.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/kernel/proton-pack.c +1 -0
index 80a580e019c50..b3801f532b10b 100644
@@ -887,6 +887,7 @@ static u8 spectre_bhb_loop_affected(void)
 		MIDR_ALL_VERSIONS(MIDR_CORTEX_X2),
 		MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
 		MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
+		MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
 		{},
 	};
 	static const struct midr_range spectre_bhb_k24_list[] = {
Signature · 1 line
2.51.0
author maintainer
#69 lore raw

PATCH 62/844 rnbd-srv: Zero the rsp buffer before using it

In reply to Sasha Levin

From: Md Haris Iqbal <[email protected]>

[ Upstream commit 69d26698e4fd44935510553809007151b2fe4db5 ]

Before using the data buffer to send back the response message, zero it completely. This prevents any stray bytes to be picked up by the client side when there the message is exchanged between different protocol versions.

---
 drivers/block/rnbd/rnbd-srv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/block/rnbd/rnbd-srv.c +3 -0
index 9b3fdc202e152..7eeb321d61402 100644
@@ -551,6 +551,8 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
 {
 	struct block_device *bdev = file_bdev(sess_dev->bdev_file);
 
+	memset(rsp, 0, sizeof(*rsp));
+
 	rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
 	rsp->device_id = cpu_to_le32(sess_dev->device_id);
 	rsp->nsectors = cpu_to_le64(bdev_nr_sectors(bdev));
@@ -657,6 +659,7 @@ static void process_msg_sess_info(struct rnbd_srv_session *srv_sess,
 
 	trace_process_msg_sess_info(srv_sess, sess_info_msg);
 
+	memset(rsp, 0, sizeof(*rsp));
 	rsp->hdr.type = cpu_to_le16(RNBD_MSG_SESS_INFO_RSP);
 	rsp->ver = srv_sess->ver;
 }
Signature · 1 line
2.51.0
author maintainer
#70 lore raw

PATCH 63/844 x86/xen/pvh: Enable PAE mode for 32-bit guest only when CONFIG_X86_PAE is set

In reply to Sasha Levin

From: Hou Wenlong <[email protected]>

[ Upstream commit db9aded979b491a24871e1621cd4e8822dbca859 ]

The PVH entry is available for 32-bit KVM guests, and 32-bit KVM guests do not depend on CONFIG_X86_PAE. However, mk_early_pgtbl_32() builds different pagetables depending on whether CONFIG_X86_PAE is set. Therefore, enabling PAE mode for 32-bit KVM guests without CONFIG_X86_PAE being set would result in a boot failure during CR3 loading.

Message-ID: <d09ce9a134eb9cbc16928a5b316969f8ba606b81.1768017442.git.houwenlong.hwl@antgroup.com>

---
 arch/x86/platform/pvh/head.S | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/platform/pvh/head.S +2 -0
index 344030c1a81d4..53ee2d53fcf8e 100644
@@ -91,10 +91,12 @@ SYM_CODE_START(pvh_start_xen)
 
 	leal rva(early_stack_end)(%ebp), %esp
 
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
 	/* Enable PAE mode. */
 	mov %cr4, %eax
 	orl $X86_CR4_PAE, %eax
 	mov %eax, %cr4
+#endif
 
 #ifdef CONFIG_X86_64
 	/* Enable Long mode. */
Signature · 1 line
2.51.0
author maintainer
#71 lore raw

PATCH 64/844 ntfs: ->d_compare() must not block

In reply to Sasha Levin

From: Al Viro <[email protected]>

[ Upstream commit ca2a04e84af79596e5cd9cfe697d5122ec39c8ce ]

... so don't use __getname() there. Switch it (and ntfs_d_hash(), while we are at it) to kmalloc(PATH_MAX, GFP_NOWAIT). Yes, ntfs_d_hash() almost certainly can do with smaller allocations, but let ntfs folks deal with that - keep the allocation size as-is for now.

Stop abusing names_cachep in ntfs, period - various uses of that thing in there have nothing to do with pathnames; just use k[mz]alloc() and be done with that. For now let's keep sizes as-in, but AFAICS none of the users actually want PATH_MAX.

---
 fs/ntfs3/dir.c    |  5 ++---
 fs/ntfs3/fsntfs.c |  4 ++--
 fs/ntfs3/inode.c  | 13 ++++++-------
 fs/ntfs3/namei.c  | 17 ++++++++---------
 fs/ntfs3/xattr.c  |  5 ++---
 5 files changed, 20 insertions(+), 24 deletions(-)
fs/ntfs3/dir.c +2 -3
index b98e95d6b4d99..cf038d713f507 100644
@@ -423,8 +423,7 @@ static int ntfs_readdir(struct file *file, struct dir_context *ctx)
 	if (!dir_emit_dots(file, ctx))
 		return 0;
 
-	/* Allocate PATH_MAX bytes. */
-	name = __getname();
+	name = kmalloc(PATH_MAX, GFP_KERNEL);
 	if (!name)
 		return -ENOMEM;
 
@@ -502,7 +501,7 @@ static int ntfs_readdir(struct file *file, struct dir_context *ctx)
 
 out:
 
-	__putname(name);
+	kfree(name);
 	put_indx_node(node);
 
 	if (err == 1) {
fs/ntfs3/fsntfs.c +2 -2
index 5f138f7158357..bd67ba7b50153 100644
@@ -2627,7 +2627,7 @@ int ntfs_set_label(struct ntfs_sb_info *sbi, u8 *label, int len)
 	u32 uni_bytes;
 	struct ntfs_inode *ni = sbi->volume.ni;
 	/* Allocate PATH_MAX bytes. */
-	struct cpu_str *uni = __getname();
+	struct cpu_str *uni = kmalloc(PATH_MAX, GFP_KERNEL);
 
 	if (!uni)
 		return -ENOMEM;
@@ -2671,6 +2671,6 @@ int ntfs_set_label(struct ntfs_sb_info *sbi, u8 *label, int len)
 		err = _ni_write_inode(&ni->vfs_inode, 0);
 
 out:
-	__putname(uni);
+	kfree(uni);
 	return err;
 }
fs/ntfs3/inode.c +6 -7
index ec8e954f4426c..bf6ef525d9562 100644
@@ -1280,7 +1280,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
 		fa |= FILE_ATTRIBUTE_READONLY;
 
 	/* Allocate PATH_MAX bytes. */
-	new_de = kmem_cache_zalloc(names_cachep, GFP_KERNEL);
+	new_de = kzalloc(PATH_MAX, GFP_KERNEL);
 	if (!new_de) {
 		err = -ENOMEM;
 		goto out1;
@@ -1701,7 +1701,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
 	ntfs_mark_rec_free(sbi, ino, false);
 
 out2:
-	__putname(new_de);
+	kfree(new_de);
 	kfree(rp);
 
 out1:
@@ -1722,7 +1722,7 @@ int ntfs_link_inode(struct inode *inode, struct dentry *dentry)
 	struct NTFS_DE *de;
 
 	/* Allocate PATH_MAX bytes. */
-	de = kmem_cache_zalloc(names_cachep, GFP_KERNEL);
+	de = kzalloc(PATH_MAX, GFP_KERNEL);
 	if (!de)
 		return -ENOMEM;
 
@@ -1736,7 +1736,7 @@ int ntfs_link_inode(struct inode *inode, struct dentry *dentry)
 
 	err = ni_add_name(ntfs_i(d_inode(dentry->d_parent)), ni, de);
 out:
-	__putname(de);
+	kfree(de);
 	return err;
 }
 
@@ -1759,8 +1759,7 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry)
 	if (ntfs_is_meta_file(sbi, ni->mi.rno))
 		return -EINVAL;
 
-	/* Allocate PATH_MAX bytes. */
-	de = kmem_cache_zalloc(names_cachep, GFP_KERNEL);
+	de = kzalloc(PATH_MAX, GFP_KERNEL);
 	if (!de)
 		return -ENOMEM;
 
@@ -1796,7 +1795,7 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry)
 
 out:
 	ni_unlock(ni);
-	__putname(de);
+	kfree(de);
 	return err;
 }
 
fs/ntfs3/namei.c +8 -9
index 3b24ca02de614..b2af8f695e60f 100644
@@ -68,7 +68,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
 				  u32 flags)
 {
 	struct ntfs_inode *ni = ntfs_i(dir);
-	struct cpu_str *uni = __getname();
+	struct cpu_str *uni = kmalloc(PATH_MAX, GFP_KERNEL);
 	struct inode *inode;
 	int err;
 
@@ -85,7 +85,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
 			inode = dir_search_u(dir, uni, NULL);
 			ni_unlock(ni);
 		}
-		__putname(uni);
+		kfree(uni);
 	}
 
 	/*
@@ -303,8 +303,7 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir,
 			return err;
 	}
 
-	/* Allocate PATH_MAX bytes. */
-	de = __getname();
+	de = kmalloc(PATH_MAX, GFP_KERNEL);
 	if (!de)
 		return -ENOMEM;
 
@@ -349,7 +348,7 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir,
 	ni_unlock(ni);
 	ni_unlock(dir_ni);
 out:
-	__putname(de);
+	kfree(de);
 	return err;
 }
 
@@ -407,7 +406,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name)
 	/*
 	 * Try slow way with current upcase table
 	 */
-	uni = kmem_cache_alloc(names_cachep, GFP_NOWAIT);
+	uni = kmalloc(PATH_MAX, GFP_NOWAIT);
 	if (!uni)
 		return -ENOMEM;
 
@@ -429,7 +428,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name)
 	err = 0;
 
 out:
-	kmem_cache_free(names_cachep, uni);
+	kfree(uni);
 	return err;
 }
 
@@ -468,7 +467,7 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,
 	 * Try slow way with current upcase table
 	 */
 	sbi = dentry->d_sb->s_fs_info;
-	uni1 = __getname();
+	uni1 = kmalloc(PATH_MAX, GFP_NOWAIT);
 	if (!uni1)
 		return -ENOMEM;
 
@@ -498,7 +497,7 @@ static int ntfs_d_compare(const struct dentry *dentry, unsigned int len1,
 	ret = !ntfs_cmp_names_cpu(uni1, uni2, sbi->upcase, false) ? 0 : 1;
 
 out:
-	__putname(uni1);
+	kfree(uni1);
 	return ret;
 }
 
fs/ntfs3/xattr.c +2 -3
index c93df55e98d07..f3bb2c41c000f 100644
@@ -556,8 +556,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
 	if (unlikely(is_bad_ni(ni)))
 		return ERR_PTR(-EINVAL);
 
-	/* Allocate PATH_MAX bytes. */
-	buf = __getname();
+	buf = kmalloc(PATH_MAX, GFP_KERNEL);
 	if (!buf)
 		return ERR_PTR(-ENOMEM);
 
@@ -588,7 +587,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,
 	if (!IS_ERR(acl))
 		set_cached_acl(inode, type, acl);
 
-	__putname(buf);
+	kfree(buf);
 
 	return acl;
 }
Signature · 1 line
2.51.0
author maintainer
#72 lore raw

PATCH 65/844 EFI/CPER: don't dump the entire memory region

In reply to Sasha Levin

From: Mauro Carvalho Chehab <[email protected]>

[ Upstream commit 55cc6fe5716f678f06bcb95140882dfa684464ec ]

The current logic at cper_print_fw_err() doesn't check if the error record length is big enough to handle offset. On a bad firmware, if the ofset is above the actual record, length -= offset will underflow, making it dump the entire memory.

The end result can be:

- the logic taking a lot of time dumping large regions of memory;
- data disclosure due to the memory dumps;
- an OOPS, if it tries to dump an unmapped memory region.

Fix it by checking if the section length is too small before doing a hex dump.

---
 drivers/firmware/efi/cper.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/firmware/efi/cper.c +5 -0
index bd99802cb0cad..09a4f0168df80 100644
@@ -560,6 +560,11 @@ static void cper_print_fw_err(const char *pfx,
 	} else {
 		offset = sizeof(*fw_err);
 	}
+	if (offset > length) {
+		printk("%s""error section length is too small: offset=%d, length=%d\n",
+		       pfx, offset, length);
+		return;
+	}
 
 	buf += offset;
 	length -= offset;
Signature · 1 line
2.51.0
author maintainer
#73 lore raw

PATCH 66/844 APEI/GHES: ensure that won't go past CPER allocated record

In reply to Sasha Levin

From: Mauro Carvalho Chehab <[email protected]>

[ Upstream commit fa2408a24f8f0db14d9cfc613ef162dc267d7ad4 ]

The logic at ghes_new() prevents allocating too large records, by checking if they're bigger than GHES_ESTATUS_MAX_SIZE (currently, 64KB). Yet, the allocation is done with the actual number of pages from the CPER bios table location, which can be smaller.

Yet, a bad firmware could send data with a different size, which might be bigger than the allocated memory, causing an OOPS:

    Unable to handle kernel paging request at virtual address fff00000f9b40000
    Mem abort info:
      ESR = 0x0000000096000007
      EC = 0x25: DABT (current EL), IL = 32 bits
      SET = 0, FnV = 0
      EA = 0, S1PTW = 0
      FSC = 0x07: level 3 translation fault
    Data abort info:
      ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
      CM = 0, WnR = 0, TnD = 0, TagAccess = 0
      GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    swapper pgtable: 4k pages, 52-bit VAs, pgdp=000000008ba16000
    [fff00000f9b40000] pgd=180000013ffff403, p4d=180000013fffe403, pud=180000013f85b403, pmd=180000013f68d403, pte=0000000000000000
    Internal error: Oops: 0000000096000007 [#1]  SMP
    Modules linked in:
    CPU: 0 UID: 0 PID: 303 Comm: kworker/0:1 Not tainted 6.19.0-rc1-00002-gda407d200220 #34 PREEMPT
    Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 02/02/2022
    Workqueue: kacpi_notify acpi_os_execute_deferred
    pstate: 214020c5 (nzCv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
    pc : hex_dump_to_buffer+0x30c/0x4a0
    lr : hex_dump_to_buffer+0x328/0x4a0
    sp : ffff800080e13880
    x29: ffff800080e13880 x28: ffffac9aba86f6a8 x27: 0000000000000083
    x26: fff00000f9b3fffc x25: 0000000000000004 x24: 0000000000000004
    x23: ffff800080e13905 x22: 0000000000000010 x21: 0000000000000083
    x20: 0000000000000001 x19: 0000000000000008 x18: 0000000000000010
    x17: 0000000000000001 x16: 00000007c7f20fec x15: 0000000000000020
    x14: 0000000000000008 x13: 0000000000081020 x12: 0000000000000008
    x11: ffff800080e13905 x10: ffff800080e13988 x9 : 0000000000000000
    x8 : 0000000000000000 x7 : 0000000000000001 x6 : 0000000000000020
    x5 : 0000000000000030 x4 : 00000000fffffffe x3 : 0000000000000000
    x2 : ffffac9aba78c1c8 x1 : ffffac9aba76d0a8 x0 : 0000000000000008
    Call trace:
     hex_dump_to_buffer+0x30c/0x4a0 (P)
     print_hex_dump+0xac/0x170
     cper_estatus_print_section+0x90c/0x968
     cper_estatus_print+0xf0/0x158
     __ghes_print_estatus+0xa0/0x148
     ghes_proc+0x1bc/0x220
     ghes_notify_hed+0x5c/0xb8
     notifier_call_chain+0x78/0x148
     blocking_notifier_call_chain+0x4c/0x80
     acpi_hed_notify+0x28/0x40
     acpi_ev_notify_dispatch+0x50/0x80
     acpi_os_execute_deferred+0x24/0x48
     process_one_work+0x15c/0x3b0
     worker_thread+0x2d0/0x400
     kthread+0x148/0x228
     ret_from_fork+0x10/0x20
    Code: 6b14033f 540001ad a94707e2 f100029f (b8747b44)
    ---[ end trace 0000000000000000 ]---

Prevent that by taking the actual allocated are into account when checking for CPER length.

---
 drivers/acpi/apei/ghes.c | 6 +++++-
 include/acpi/ghes.h      | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +5 -1
index 0dc767392a6c6..a37c8fb574832 100644
@@ -29,6 +29,7 @@
 #include <linux/cper.h>
 #include <linux/cleanup.h>
 #include <linux/platform_device.h>
+#include <linux/minmax.h>
 #include <linux/mutex.h>
 #include <linux/ratelimit.h>
 #include <linux/vmalloc.h>
@@ -294,6 +295,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
 		error_block_length = GHES_ESTATUS_MAX_SIZE;
 	}
 	ghes->estatus = kmalloc(error_block_length, GFP_KERNEL);
+	ghes->estatus_length = error_block_length;
 	if (!ghes->estatus) {
 		rc = -ENOMEM;
 		goto err_unmap_status_addr;
@@ -365,13 +367,15 @@ static int __ghes_check_estatus(struct ghes *ghes,
 				struct acpi_hest_generic_status *estatus)
 {
 	u32 len = cper_estatus_len(estatus);
+	u32 max_len = min(ghes->generic->error_block_length,
+			  ghes->estatus_length);
 
 	if (len < sizeof(*estatus)) {
 		pr_warn_ratelimited(FW_WARN GHES_PFX "Truncated error status block!\n");
 		return -EIO;
 	}
 
-	if (len > ghes->generic->error_block_length) {
+	if (!len || len > max_len) {
 		pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid error status block length!\n");
 		return -EIO;
 	}
include/acpi/ghes.h +1 -0
index ebd21b05fe6ed..93db60da5934e 100644
@@ -21,6 +21,7 @@ struct ghes {
 		struct acpi_hest_generic_v2 *generic_v2;
 	};
 	struct acpi_hest_generic_status *estatus;
+	unsigned int estatus_length;
 	unsigned long flags;
 	union {
 		struct list_head list;
Signature · 1 line
2.51.0
author maintainer
#74 lore raw

PATCH 67/844 APEI/GHES: ARM processor Error: don't go past allocated memory

In reply to Sasha Levin

From: Mauro Carvalho Chehab <[email protected]>

[ Upstream commit 87880af2d24e62a84ed19943dbdd524f097172f2 ]

If the BIOS generates a very small ARM Processor Error, or an incomplete one, the current logic will fail to deferrence

	err->section_length
and
	ctx_info->size

Add checks to avoid that. With such changes, such GHESv2 records won't cause OOPSes like this:

[    1.492129] Internal error: Oops: 0000000096000005 [#1]  SMP
[    1.495449] Modules linked in:
[    1.495820] CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.18.0-rc1-00017-gabadcc3553dd-dirty #18 PREEMPT
[    1.496125] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 02/02/2022
[    1.496433] Workqueue: kacpi_notify acpi_os_execute_deferred
[    1.496967] pstate: 814000c5 (Nzcv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[    1.497199] pc : log_arm_hw_error+0x5c/0x200
[    1.497380] lr : ghes_handle_arm_hw_error+0x94/0x220

0xffff8000811c5324 is in log_arm_hw_error (../drivers/ras/ras.c:75).
70 err_info = (struct cper_arm_err_info *)(err + 1);
71 ctx_info = (struct cper_arm_ctx_info *)(err_info + err->err_info_num);
72 ctx_err = (u8 *)ctx_info;
73
74 for (n = 0; n < err->context_info_num; n++) {
75 sz = sizeof(struct cper_arm_ctx_info) + ctx_info->size;
76 ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + sz);
77 ctx_len += sz;
78 }
79

and similar ones while trying to access section_length on an error dump with too small size.

---
 drivers/acpi/apei/ghes.c | 32 ++++++++++++++++++++++++++++----
 drivers/ras/ras.c        |  6 +++++-
 2 files changed, 33 insertions(+), 5 deletions(-)
drivers/acpi/apei/ghes.c +28 -4
index a37c8fb574832..77ea7a5b761f1 100644
@@ -556,21 +556,45 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,
 {
 	struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata);
 	int flags = sync ? MF_ACTION_REQUIRED : 0;
+	int length = gdata->error_data_length;
 	char error_type[120];
 	bool queued = false;
 	int sec_sev, i;
 	char *p;
 
 	sec_sev = ghes_severity(gdata->error_severity);
-	log_arm_hw_error(err, sec_sev);
+	if (length >= sizeof(*err)) {
+		log_arm_hw_error(err, sec_sev);
+	} else {
+		pr_warn(FW_BUG "arm error length: %d\n", length);
+		pr_warn(FW_BUG "length is too small\n");
+		pr_warn(FW_BUG "firmware-generated error record is incorrect\n");
+		return false;
+	}
+
 	if (sev != GHES_SEV_RECOVERABLE || sec_sev != GHES_SEV_RECOVERABLE)
 		return false;
 
 	p = (char *)(err + 1);
+	length -= sizeof(err);
+
 	for (i = 0; i < err->err_info_num; i++) {
-		struct cper_arm_err_info *err_info = (struct cper_arm_err_info *)p;
-		bool is_cache = err_info->type & CPER_ARM_CACHE_ERROR;
-		bool has_pa = (err_info->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR);
+		struct cper_arm_err_info *err_info;
+		bool is_cache, has_pa;
+
+		/* Ensure we have enough data for the error info header */
+		if (length < sizeof(*err_info))
+			break;
+
+		err_info = (struct cper_arm_err_info *)p;
+
+		/* Validate the claimed length before using it */
+		length -= err_info->length;
+		if (length < 0)
+			break;
+
+		is_cache = err_info->type & CPER_ARM_CACHE_ERROR;
+		has_pa = (err_info->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR);
 
 		/*
 		 * The field (err_info->error_info & BIT(26)) is fixed to set to
drivers/ras/ras.c +5 -1
index 2a5b5a9fdcb36..03df3db623346 100644
@@ -72,7 +72,11 @@ void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev)
 	ctx_err = (u8 *)ctx_info;
 
 	for (n = 0; n < err->context_info_num; n++) {
-		sz = sizeof(struct cper_arm_ctx_info) + ctx_info->size;
+		sz = sizeof(struct cper_arm_ctx_info);
+
+		if (sz + (long)ctx_info - (long)err >= err->section_length)
+			sz += ctx_info->size;
+
 		ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + sz);
 		ctx_len += sz;
 	}
Signature · 1 line
2.51.0
author maintainer
#75 lore raw

PATCH 68/844 EFI/CPER: don't go past the ARM processor CPER record buffer

In reply to Sasha Levin

From: Mauro Carvalho Chehab <[email protected]>

[ Upstream commit eae21beecb95a3b69ee5c38a659f774e171d730e ]

There's a logic inside GHES/CPER to detect if the section_length is too small, but it doesn't detect if it is too big.

Currently, if the firmware receives an ARM processor CPER record stating that a section length is big, kernel will blindly trust section_length, producing a very long dump. For instance, a 67 bytes record with ERR_INFO_NUM set 46198 and section length set to 854918320 would dump a lot of data going a way past the firmware memory-mapped area.

Fix it by adding a logic to prevent it to go past the buffer if ERR_INFO_NUM is too big, making it report instead:

[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1 [Hardware Error]: event severity: recoverable
[Hardware Error]: Error 0, type: recoverable
[Hardware Error]: section_type: ARM processor error
[Hardware Error]: MIDR: 0xff304b2f8476870a
[Hardware Error]: section length: 854918320, CPER size: 67
[Hardware Error]: section length is too big
[Hardware Error]: firmware-generated error record is incorrect
[Hardware Error]: ERR_INFO_NUM is 46198

---
 drivers/firmware/efi/cper-arm.c | 12 ++++++++----
 drivers/firmware/efi/cper.c     |  3 ++-
 include/linux/cper.h            |  3 ++-
 3 files changed, 12 insertions(+), 6 deletions(-)
drivers/firmware/efi/cper-arm.c +8 -4
index 76542a53e2027..b21cb1232d820 100644
@@ -226,7 +226,8 @@ static void cper_print_arm_err_info(const char *pfx, u32 type,
 }
 
 void cper_print_proc_arm(const char *pfx,
-			 const struct cper_sec_proc_arm *proc)
+			 const struct cper_sec_proc_arm *proc,
+			 u32 length)
 {
 	int i, len, max_ctx_type;
 	struct cper_arm_err_info *err_info;
@@ -238,9 +239,12 @@ void cper_print_proc_arm(const char *pfx,
 
 	len = proc->section_length - (sizeof(*proc) +
 		proc->err_info_num * (sizeof(*err_info)));
-	if (len < 0) {
-		printk("%ssection length: %d\n", pfx, proc->section_length);
-		printk("%ssection length is too small\n", pfx);
+
+	if (len < 0 || proc->section_length > length) {
+		printk("%ssection length: %d, CPER size: %d\n",
+		       pfx, proc->section_length, length);
+		printk("%ssection length is too %s\n", pfx,
+		       (len < 0) ? "small" : "big");
 		printk("%sfirmware-generated error record is incorrect\n", pfx);
 		printk("%sERR_INFO_NUM is %d\n", pfx, proc->err_info_num);
 		return;
drivers/firmware/efi/cper.c +2 -1
index 09a4f0168df80..06b4fdb59917a 100644
@@ -664,7 +664,8 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata
 
 		printk("%ssection_type: ARM processor error\n", newpfx);
 		if (gdata->error_data_length >= sizeof(*arm_err))
-			cper_print_proc_arm(newpfx, arm_err);
+			cper_print_proc_arm(newpfx, arm_err,
+					    gdata->error_data_length);
 		else
 			goto err_section_too_small;
 #endif
include/linux/cper.h +2 -1
index 5b1236d8c65bb..440b35e459e53 100644
@@ -595,7 +595,8 @@ void cper_mem_err_pack(const struct cper_sec_mem_err *,
 const char *cper_mem_err_unpack(struct trace_seq *,
 				struct cper_mem_err_compact *);
 void cper_print_proc_arm(const char *pfx,
-			 const struct cper_sec_proc_arm *proc);
+			 const struct cper_sec_proc_arm *proc,
+			 u32 length);
 void cper_print_proc_ia(const char *pfx,
 			const struct cper_sec_proc_ia *proc);
 int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg);
Signature · 1 line
2.51.0
author maintainer
#76 lore raw

PATCH 69/844 ACPI: processor: Fix NULL-pointer dereference in acpi_processor_errata_piix4()

In reply to Sasha Levin

From: Tuo Li <[email protected]>

[ Upstream commit f132e089fe89cadc2098991f0a3cb05c3f824ac6 ]

In acpi_processor_errata_piix4(), the pointer dev is first assigned an IDE device and then reassigned an ISA device:

  dev = pci_get_subsys(..., PCI_DEVICE_ID_INTEL_82371AB, ...);
  dev = pci_get_subsys(..., PCI_DEVICE_ID_INTEL_82371AB_0, ...);

If the first lookup succeeds but the second fails, dev becomes NULL. This leads to a potential null-pointer dereference when dev_dbg() is called:

  if (errata.piix4.bmisx)
    dev_dbg(&dev->dev, ...);

To prevent this, use two temporary pointers and retrieve each device independently, avoiding overwriting dev with a possible NULL value.

[ rjw: Subject adjustment, added an empty code line ]
---
 drivers/acpi/acpi_processor.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/acpi/acpi_processor.c +15 -13
index 7ec1dc04fd11b..85096ce7b658b 100644
@@ -50,6 +50,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
 {
 	u8 value1 = 0;
 	u8 value2 = 0;
+	struct pci_dev *ide_dev = NULL, *isa_dev = NULL;
 
 
 	if (!dev)
@@ -107,12 +108,12 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
 		 * each IDE controller's DMA status to make sure we catch all
 		 * DMA activity.
 		 */
-		dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
+		ide_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
 				     PCI_DEVICE_ID_INTEL_82371AB,
 				     PCI_ANY_ID, PCI_ANY_ID, NULL);
-		if (dev) {
-			errata.piix4.bmisx = pci_resource_start(dev, 4);
-			pci_dev_put(dev);
+		if (ide_dev) {
+			errata.piix4.bmisx = pci_resource_start(ide_dev, 4);
+			pci_dev_put(ide_dev);
 		}
 
 		/*
@@ -124,24 +125,25 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
 		 * disable C3 support if this is enabled, as some legacy
 		 * devices won't operate well if fast DMA is disabled.
 		 */
-		dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
+		isa_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
 				     PCI_DEVICE_ID_INTEL_82371AB_0,
 				     PCI_ANY_ID, PCI_ANY_ID, NULL);
-		if (dev) {
-			pci_read_config_byte(dev, 0x76, &value1);
-			pci_read_config_byte(dev, 0x77, &value2);
+		if (isa_dev) {
+			pci_read_config_byte(isa_dev, 0x76, &value1);
+			pci_read_config_byte(isa_dev, 0x77, &value2);
 			if ((value1 & 0x80) || (value2 & 0x80))
 				errata.piix4.fdma = 1;
-			pci_dev_put(dev);
+			pci_dev_put(isa_dev);
 		}
 
 		break;
 	}
 
-	if (errata.piix4.bmisx)
-		dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
-	if (errata.piix4.fdma)
-		dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
+	if (ide_dev)
+		dev_dbg(&ide_dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
+
+	if (isa_dev)
+		dev_dbg(&isa_dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
 
 	return 0;
 }
Signature · 1 line
2.51.0
author maintainer
#77 lore raw

PATCH 70/844 ACPI: resource: Add JWIPC JVC9100 to irq1_level_low_skip_override[]

In reply to Sasha Levin

From: Ai Chao <[email protected]>

[ Upstream commit ba6ded26dffe511b862a98a25955955e7154bfa8 ]

Like the JWIPC JVC9100 has its serial IRQ (10 and 11) described as ActiveLow in the DSDT, which the kernel overrides to EdgeHigh which breaks the serial.

irq 10, level, active-low, shared, skip-override
irq 11, level, active-low, shared, skip-override

Add the JVC9100 to the irq1_level_low_skip_override[] quirk table to fix this.

---
 drivers/acpi/resource.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/acpi/resource.c +8 -0
index d16906f46484d..bc8050d8a6f51 100644
@@ -532,6 +532,12 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
 			DMI_MATCH(DMI_BOARD_NAME, "16T90SP"),
 		},
 	},
+	{
+		/* JWIPC JVC9100 */
+		.matches = {
+			DMI_MATCH(DMI_BOARD_NAME, "JVC9100"),
+		},
+	},
 	{ }
 };
 
@@ -706,6 +712,8 @@ struct irq_override_cmp {
 
 static const struct irq_override_cmp override_table[] = {
 	{ irq1_level_low_skip_override, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
+	{ irq1_level_low_skip_override, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false },
+	{ irq1_level_low_skip_override, 11, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false },
 	{ irq1_edge_low_force_override, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 };
 
Signature · 1 line
2.51.0
author maintainer
#78 lore raw

PATCH 71/844 ACPICA: Abort AML bytecode execution when executing AML_FATAL_OP

In reply to Sasha Levin

From: Armin Wolf <[email protected]>

[ Upstream commit 026ad376a6a48538b576f3589331daa94daae6f0 ]

The ACPI specification states that when executing AML_FATAL_OP, the OS should log the fatal error event and shutdown in a timely fashion.

Windows complies with this requirement by immediatly entering a Bso_d, effectively aborting the execution of the AML bytecode in question.

ACPICA however might continue with the AML bytecode execution should acpi_os_signal() simply return AE_OK. This will cause issues because ACPI BIOS implementations might assume that the Fatal() operator does not return.

Fix this by aborting the AML bytecode execution in such a case by returning AE_ERROR. Also turn struct acpi_signal_fatal_info into a local variable because of its small size (12 bytes) and to ensure that acpi_os_signal() always receives valid information about the fatal ACPI BIOS error.

---
 drivers/acpi/acpica/exoparg3.c | 46 +++++++++++++---------------------
 1 file changed, 18 insertions(+), 28 deletions(-)
drivers/acpi/acpica/exoparg3.c +18 -28
index bf08110ed6d25..c8c8c4e49563e 100644
@@ -10,6 +10,7 @@
 #include <acpi/acpi.h>
 #include "accommon.h"
 #include "acinterp.h"
+#include <acpi/acoutput.h>
 #include "acparser.h"
 #include "amlcode.h"
 
@@ -51,8 +52,7 @@ ACPI_MODULE_NAME("exoparg3")
 acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 {
 	union acpi_operand_object **operand = &walk_state->operands[0];
-	struct acpi_signal_fatal_info *fatal;
-	acpi_status status = AE_OK;
+	struct acpi_signal_fatal_info fatal;
 
 	ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_0T_0R,
 				acpi_ps_get_opcode_name(walk_state->opcode));
@@ -60,28 +60,23 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 	switch (walk_state->opcode) {
 	case AML_FATAL_OP:	/* Fatal (fatal_type fatal_code fatal_arg) */
 
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "FatalOp: Type %X Code %X Arg %X "
-				  "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
-				  (u32)operand[0]->integer.value,
-				  (u32)operand[1]->integer.value,
-				  (u32)operand[2]->integer.value));
-
-		fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
-		if (fatal) {
-			fatal->type = (u32) operand[0]->integer.value;
-			fatal->code = (u32) operand[1]->integer.value;
-			fatal->argument = (u32) operand[2]->integer.value;
-		}
+		fatal.type = (u32)operand[0]->integer.value;
+		fatal.code = (u32)operand[1]->integer.value;
+		fatal.argument = (u32)operand[2]->integer.value;
 
-		/* Always signal the OS! */
+		ACPI_BIOS_ERROR((AE_INFO,
+				 "Fatal ACPI BIOS error (Type 0x%X Code 0x%X Arg 0x%X)\n",
+				 fatal.type, fatal.code, fatal.argument));
 
-		status = acpi_os_signal(ACPI_SIGNAL_FATAL, fatal);
+		/* Always signal the OS! */
 
-		/* Might return while OS is shutting down, just continue */
+		acpi_os_signal(ACPI_SIGNAL_FATAL, &fatal);
 
-		ACPI_FREE(fatal);
-		goto cleanup;
+		/*
+		 * Might return while OS is shutting down, so abort the AML execution
+		 * by returning an error.
+		 */
+		return_ACPI_STATUS(AE_ERROR);
 
 	case AML_EXTERNAL_OP:
 		/*
@@ -93,21 +88,16 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 		 * wrong if an external opcode ever gets here.
 		 */
 		ACPI_ERROR((AE_INFO, "Executed External Op"));
-		status = AE_OK;
-		goto cleanup;
+
+		return_ACPI_STATUS(AE_OK);
 
 	default:
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
 
-		status = AE_AML_BAD_OPCODE;
-		goto cleanup;
+		return_ACPI_STATUS(AE_AML_BAD_OPCODE);
 	}
-
-cleanup:
-
-	return_ACPI_STATUS(status);
 }
 
 /*******************************************************************************
Signature · 1 line
2.51.0
author maintainer
#79 lore raw

PATCH 72/844 powercap: intel_rapl: Add PL4 support for Ice Lake

In reply to Sasha Levin

From: Daniel Tang <[email protected]>

[ Upstream commit 54b3cd55a515c7c0fcfa0c1f0b10d62c11d64bcc ]

Microsoft Surface Pro 7 firmware throttles the processor upon boot/resume. Userspace needs to be able to restore the correct value.

---
 drivers/powercap/intel_rapl_msr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/powercap/intel_rapl_msr.c +1 -0
index 152893dca5653..3d5e7f56d68a1 100644
@@ -160,6 +160,7 @@ static int rapl_msr_write_raw(int cpu, struct reg_action *ra)
 
 /* List of verified CPUs. */
 static const struct x86_cpu_id pl4_support_ids[] = {
+	X86_MATCH_VFM(INTEL_ICELAKE_L, NULL),
 	X86_MATCH_VFM(INTEL_TIGERLAKE_L, NULL),
 	X86_MATCH_VFM(INTEL_ALDERLAKE, NULL),
 	X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL),
Signature · 1 line
2.51.0
author maintainer
#80 lore raw

PATCH 73/844 io_uring/timeout: annotate data race in io_flush_timeouts()

In reply to Sasha Levin

From: Jens Axboe <[email protected]>

[ Upstream commit 42b12cb5fd4554679bac06bbdd05dc8b643bcc42 ]

syzbot correctly reports this as a KCSAN race, as ctx->cached_cq_tail should be read under ->uring_lock. This isn't immediately feasible in io_flush_timeouts(), but as long as we read a stable value, that should be good enough. If two io-wq threads compete on this value, then they will both end up calling io_flush_timeouts() and at least one of them will see the correct value.

---
 io_uring/timeout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/timeout.c +1 -1
index d8fbbaf31cf35..84dda24f3eb24 100644
@@ -130,7 +130,7 @@ __cold void io_flush_timeouts(struct io_ring_ctx *ctx)
 	u32 seq;
 
 	raw_spin_lock_irq(&ctx->timeout_lock);
-	seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts);
+	seq = READ_ONCE(ctx->cached_cq_tail) - atomic_read(&ctx->cq_timeouts);
 
 	list_for_each_entry_safe(timeout, tmp, &ctx->timeout_list, list) {
 		struct io_kiocb *req = cmd_to_io_kiocb(timeout);
Signature · 1 line
2.51.0
author maintainer
#81 lore raw

PATCH 74/844 alpha: fix user-space corruption during memory compaction

In reply to Sasha Levin

From: Magnus Lindholm <[email protected]>

[ Upstream commit dd5712f3379cfe760267cdd28ff957d9ab4e51c7 ]

Alpha systems can suffer sporadic user-space crashes and heap corruption when memory compaction is enabled.

Symptoms include SIGSEGV, glibc allocator failures (e.g. "unaligned tcache chunk"), and compiler internal errors. The failures disappear when compaction is disabled or when using global TLB invalidation.

The root cause is insufficient TLB shootdown during page migration. Alpha relies on ASN-based MM context rollover for instruction cache coherency, but this alone is not sufficient to prevent stale data or instruction translations from surviving migration.

Fix this by introducing a migration-specific helper that combines:
- MM context invalidation (ASN rollover),
- immediate per-CPU TLB invalidation (TBI),
- synchronous cross-CPU shootdown when required.

The helper is used only by migration/compaction paths to avoid changing global TLB semantics.

Additionally, update flush_tlb_other(), pte_clear(), to use READ_ONCE()/WRITE_ONCE() for correct SMP memory ordering.

This fixes observed crashes on both UP and SMP Alpha systems.

---
 arch/alpha/include/asm/pgtable.h  |  33 ++++++++-
 arch/alpha/include/asm/tlbflush.h |   4 +-
 arch/alpha/mm/Makefile            |   2 +-
 arch/alpha/mm/tlbflush.c          | 112 ++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+), 3 deletions(-)
 create mode 100644 arch/alpha/mm/tlbflush.c
arch/alpha/include/asm/pgtable.h +32 -1
index 90e7a95391022..c9508ec37efc4 100644
@@ -17,6 +17,7 @@
 #include <asm/processor.h>	/* For TASK_SIZE */
 #include <asm/machvec.h>
 #include <asm/setup.h>
+#include <linux/page_table_check.h>
 
 struct mm_struct;
 struct vm_area_struct;
@@ -183,6 +184,9 @@ extern inline void pud_set(pud_t * pudp, pmd_t * pmdp)
 { pud_val(*pudp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
 
 
+extern void migrate_flush_tlb_page(struct vm_area_struct *vma,
+					unsigned long addr);
+
 extern inline unsigned long
 pmd_page_vaddr(pmd_t pmd)
 {
@@ -202,7 +206,7 @@ extern inline int pte_none(pte_t pte)		{ return !pte_val(pte); }
 extern inline int pte_present(pte_t pte)	{ return pte_val(pte) & _PAGE_VALID; }
 extern inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 {
-	pte_val(*ptep) = 0;
+	WRITE_ONCE(pte_val(*ptep), 0);
 }
 
 extern inline int pmd_none(pmd_t pmd)		{ return !pmd_val(pmd); }
@@ -264,6 +268,33 @@ extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address)
 
 extern pgd_t swapper_pg_dir[1024];
 
+#ifdef CONFIG_COMPACTION
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+
+static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
+					unsigned long address,
+					pte_t *ptep)
+{
+	pte_t pte = READ_ONCE(*ptep);
+
+	pte_clear(mm, address, ptep);
+	return pte;
+}
+
+#define __HAVE_ARCH_PTEP_CLEAR_FLUSH
+
+static inline pte_t ptep_clear_flush(struct vm_area_struct *vma,
+				unsigned long addr, pte_t *ptep)
+{
+	struct mm_struct *mm = vma->vm_mm;
+	pte_t pte = ptep_get_and_clear(mm, addr, ptep);
+
+	page_table_check_pte_clear(mm, pte);
+	migrate_flush_tlb_page(vma, addr);
+	return pte;
+}
+
+#endif
 /*
  * The Alpha doesn't have any external MMU info:  the kernel page
  * tables contain all the necessary information.
arch/alpha/include/asm/tlbflush.h +3 -1
index ba4b359d6c395..0c8529997f54e 100644
@@ -58,7 +58,9 @@ flush_tlb_other(struct mm_struct *mm)
 	unsigned long *mmc = &mm->context[smp_processor_id()];
 	/* Check it's not zero first to avoid cacheline ping pong
 	   when possible.  */
-	if (*mmc) *mmc = 0;
+
+	if (READ_ONCE(*mmc))
+		WRITE_ONCE(*mmc, 0);
 }
 
 #ifndef CONFIG_SMP
arch/alpha/mm/Makefile +1 -1
index 101dbd06b4ceb..2d05664058f64 100644
@@ -3,4 +3,4 @@
 # Makefile for the linux alpha-specific parts of the memory manager.
 #
 
-obj-y	:= init.o fault.o
+obj-y	:= init.o fault.o tlbflush.o
arch/alpha/mm/tlbflush.c new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
2.51.0
author maintainer
#82 lore raw

PATCH 75/844 md-cluster: fix NULL pointer dereference in process_metadata_update

In reply to Sasha Levin

From: Jiasheng Jiang <[email protected]>

[ Upstream commit f150e753cb8dd756085f46e86f2c35ce472e0a3c ]

The function process_metadata_update() blindly dereferences the 'thread' pointer (acquired via rcu_dereference_protected) within the wait_event() macro.

While the code comment states "daemon thread must exist", there is a valid race condition window during the MD array startup sequence (md_run):

1. bitmap_load() is called, which invokes md_cluster_ops->join().
2. join() starts the "cluster_recv" thread (recv_daemon).
3. At this point, recv_daemon is active and processing messages.
4. However, mddev->thread (the main MD thread) is not initialized until later in md_run().

If a METADATA_UPDATED message is received from a remote node during this specific window, process_metadata_update() will be called while mddev->thread is still NULL, leading to a kernel panic.

To fix this, we must validate the 'thread' pointer. If it is NULL, we release the held lock (no_new_dev_lockres) and return early, safely ignoring the update request as the array is not yet fully ready to process it.

---
 drivers/md/md-cluster.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/md/md-cluster.c +6 -1
index 11f1e91d387d8..896279988dfd5 100644
@@ -549,8 +549,13 @@ static void process_metadata_update(struct mddev *mddev, struct cluster_msg *msg
 
 	dlm_lock_sync(cinfo->no_new_dev_lockres, DLM_LOCK_CR);
 
-	/* daemaon thread must exist */
 	thread = rcu_dereference_protected(mddev->thread, true);
+	if (!thread) {
+		pr_warn("md-cluster: Received metadata update but MD thread is not ready\n");
+		dlm_unlock_sync(cinfo->no_new_dev_lockres);
+		return;
+	}
+
 	wait_event(thread->wqueue,
 		   (got_lock = mddev_trylock(mddev)) ||
 		    test_bit(MD_CLUSTER_HOLDING_MUTEX_FOR_RECVD, &cinfo->state));
Signature · 1 line
2.51.0
author maintainer
#83 lore raw

PATCH 76/844 md raid: fix hang when stopping arrays with metadata through dm-raid

In reply to Sasha Levin

From: Heinz Mauelshagen <[email protected]>

[ Upstream commit cefcb9297fbdb6d94b61787b4f8d84f55b741470 ]

When using device-mapper's dm-raid target, stopping a RAID array can cause the system to hang under specific conditions.

This occurs when:

- A dm-raid managed device tree is suspended from top to bottom (the top-level RAID device is suspended first, followed by its underlying metadata and data devices)

- The top-level RAID device is then removed

Removing the top-level device triggers a hang in the following sequence:
the dm-raid destructor calls md_stop(), which tries to flush the write-intent bitmap by writing to the metadata sub-devices. However, these devices are already suspended, making them unable to complete the write-intent operations and causing an indefinite block.

Fix:

- Prevent bitmap flushing when md_stop() is called from dm-raid destructor context
and avoid a quiescing/unquescing cycle which could also cause I/O

- Still allow write-intent bitmap flushing when called from dm-raid suspend context

This ensures that RAID array teardown can complete successfully even when the underlying devices are in a suspended state.

This second patch uses md_is_rdwr() to distinguish between suspend and destructor paths as elaborated on above.

---
 drivers/md/md.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/md/md.c +8 -6
index 6d73f6e196a9f..ac71640ff3a81 100644
@@ -6848,13 +6848,15 @@ static void __md_stop_writes(struct mddev *mddev)
 {
 	timer_delete_sync(&mddev->safemode_timer);
 
-	if (mddev->pers && mddev->pers->quiesce) {
-		mddev->pers->quiesce(mddev, 1);
-		mddev->pers->quiesce(mddev, 0);
-	}
+	if (md_is_rdwr(mddev) || !mddev_is_dm(mddev)) {
+		if (mddev->pers && mddev->pers->quiesce) {
+			mddev->pers->quiesce(mddev, 1);
+			mddev->pers->quiesce(mddev, 0);
+		}
 
-	if (md_bitmap_enabled(mddev, true))
-		mddev->bitmap_ops->flush(mddev);
+		if (md_bitmap_enabled(mddev, true))
+			mddev->bitmap_ops->flush(mddev);
+	}
 
 	if (md_is_rdwr(mddev) &&
 	    ((!mddev->in_sync && !mddev_is_clustered(mddev)) ||
Signature · 1 line
2.51.0
author maintainer
#84 lore raw

PATCH 77/844 rust: cpufreq: always inline functions using build_assert with arguments

In reply to Sasha Levin

From: Alexandre Courbot <[email protected]>

[ Upstream commit 8c8b12a55614ea05953e8d695e700e6e1322a05d ]

build_assert relies on the compiler to optimize out its error path. Functions using it with its arguments must thus always be inlined, otherwise the error path of build_assert might not be optimized out, triggering a build error.

---
 rust/kernel/cpufreq.rs | 2 ++
 1 file changed, 2 insertions(+)
rust/kernel/cpufreq.rs +2 -0
index f968fbd228905..0879a79485f8e 100644
@@ -1015,6 +1015,8 @@ impl<T: Driver> Registration<T> {
         ..pin_init::zeroed()
     };
 
+    // Always inline to optimize out error path of `build_assert`.
+    #[inline(always)]
     const fn copy_name(name: &'static CStr) -> [c_char; CPUFREQ_NAME_LEN] {
         let src = name.to_bytes_with_nul();
         let mut dst = [0; CPUFREQ_NAME_LEN];
Signature · 1 line
2.51.0
author maintainer
#85 lore raw

PATCH 78/844 cpufreq: dt-platdev: Block the driver from probing on more QC platforms

In reply to Sasha Levin

From: Konrad Dybcio <[email protected]>

[ Upstream commit 7b781899072c5701ef9538c365757ee9ab9c00bd ]

Add a number of QC platforms to the blocklist, they all use either the qcom-cpufreq-hw driver.

---
 drivers/cpufreq/cpufreq-dt-platdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/cpufreq/cpufreq-dt-platdev.c +3 -0
index b06a43143d23c..2fecab989dacc 100644
@@ -169,8 +169,11 @@ static const struct of_device_id blocklist[] __initconst = {
 	{ .compatible = "qcom,sdm845", },
 	{ .compatible = "qcom,sdx75", },
 	{ .compatible = "qcom,sm6115", },
+	{ .compatible = "qcom,sm6125", },
+	{ .compatible = "qcom,sm6150", },
 	{ .compatible = "qcom,sm6350", },
 	{ .compatible = "qcom,sm6375", },
+	{ .compatible = "qcom,sm7125", },
 	{ .compatible = "qcom,sm7225", },
 	{ .compatible = "qcom,sm7325", },
 	{ .compatible = "qcom,sm8150", },
Signature · 1 line
2.51.0
author maintainer
#86 lore raw

PATCH 79/844 s390/perf: Disable register readout on sampling events

In reply to Sasha Levin

From: Thomas Richter <[email protected]>

[ Upstream commit b2c04fc1239062b39ddfdd8731ee1a10810dfb74 ]

Running commands

 # ./perf record  -IR0,R1 -a sleep 1
extracts and displays register value of general purpose register r1 and r0.
However the value displayed of any register is random and does not
reflect the register value recorded at the time of the sample interrupt.

The sampling device driver on s390 creates a very large buffer for the hardware to store the samples. Only when that large buffer gets full an interrupt is generated and many hundreds of sample entries are processed and copied to the kernel ring buffer and eventually get copied to the perf tool. It is during the copy to the kernel ring buffer that each sample is processed (on s390) and at that time the register values are extracted.
This is not the original goal, the register values should be read when the samples are created not when the samples are copied to the kernel ring buffer.

Prevent this event from being installed in the first place and return -EOPNOTSUPP. This is already the case for PERF_SAMPLE_REGS_USER.

---
 arch/s390/kernel/perf_cpum_sf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/perf_cpum_sf.c +1 -1
index 459af23a47a5e..e8bd19ac82c7d 100644
@@ -841,7 +841,7 @@ static bool is_callchain_event(struct perf_event *event)
 	u64 sample_type = event->attr.sample_type;
 
 	return sample_type & (PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER |
-			      PERF_SAMPLE_STACK_USER);
+			      PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_STACK_USER);
 }
 
 static int cpumsf_pmu_event_init(struct perf_event *event)
Signature · 1 line
2.51.0
author maintainer
#87 lore raw

PATCH 80/844 arm64: mte: Set TCMA1 whenever MTE is present in the kernel

In reply to Sasha Levin

From: Carl Worth <[email protected]>

[ Upstream commit a4e5927115f30a301f9939ed43e6a21a343e06ad ]

Set the TCMA1 bit so that access to TTBR1 addresses with 0xf in their tag bits will be treated as tag unchecked.

This is important to avoid unwanted tag checking on some systems. Specifically, SCTLR_EL1.TCF can be set to indicate that no tag check faults are desired. But the architecture doesn't guarantee that in this case the system won't still perform tag checks.

Use TCMA1 to ensure that undesired tag checks are not performed. This bit was already set in the KASAN case. Adding it to the non-KASAN case prevents tag checking since all TTBR1 address will have a value of 0xf in their tag bits.

This patch has been measured on an Ampere system to improve the following:

* Eliminate over 98% of kernel-side tag checks during "perf bench futex hash", as measured with "perf stat".

* Eliminate all MTE overhead (was previously a 25% performance penalty) from the Phoronix pts/memcached benchmark (1:10 Set:Get ration with 96 cores).

---
 arch/arm64/mm/proc.S | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/mm/proc.S +5 -5
index 5d907ce3b6d3f..22866b49be372 100644
@@ -48,14 +48,14 @@
 #define TCR_KASAN_SW_FLAGS 0
 #endif
 
-#ifdef CONFIG_KASAN_HW_TAGS
-#define TCR_MTE_FLAGS TCR_EL1_TCMA1 | TCR_EL1_TBI1 | TCR_EL1_TBID1
-#elif defined(CONFIG_ARM64_MTE)
+#ifdef CONFIG_ARM64_MTE
 /*
  * The mte_zero_clear_page_tags() implementation uses DC GZVA, which relies on
- * TBI being enabled at EL1.
+ * TBI being enabled at EL1.  TCMA1 is needed to treat accesses with the
+ * match-all tag (0xF) as Tag Unchecked, irrespective of the SCTLR_EL1.TCF
+ * setting.
  */
-#define TCR_MTE_FLAGS TCR_EL1_TBI1 | TCR_EL1_TBID1
+#define TCR_MTE_FLAGS TCR_EL1_TCMA1 | TCR_EL1_TBI1 | TCR_EL1_TBID1
 #else
 #define TCR_MTE_FLAGS 0
 #endif
Signature · 1 line
2.51.0
author maintainer
#88 lore raw

PATCH 81/844 perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sasha Levin

From: Sebastian Andrzej Siewior <[email protected]>

[ Upstream commit ab26d9c85554c4ff1d95ca8341522880ed9219d6 ]

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

---
 drivers/perf/cxl_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/cxl_pmu.c +1 -1
index d094030220bf2..68a54d97d2a8a 100644
@@ -877,7 +877,7 @@ static int cxl_pmu_probe(struct device *dev)
 	if (!irq_name)
 		return -ENOMEM;
 
-	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_ONESHOT,
+	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_NO_THREAD,
 			      irq_name, info);
 	if (rc)
 		return rc;
Signature · 1 line
2.51.0
author maintainer
#89 lore raw

PATCH 82/844 ACPI: x86: s2idle: Invoke Microsoft _DSM Function 9 (Turn On Display)

In reply to Sasha Levin

From: Jakob Riemenschneider <[email protected]>

[ Upstream commit 229ecbaac6b31f89c554b77eb407377a5eade7d4 ]

Windows 11, version 22H2 introduced a new function index (Function 9) to the Microsoft LPS0 _DSM, titled "Turn On Display Notification".

According to Microsoft documentation, this function signals to the system firmware that the OS intends to turn on the display when exiting Modern Standby. This allows the firmware to release Power Limits (PLx) earlier.

Crucially, this patch fixes a functional issue observed on the Lenovo Yoga Slim 7i Aura (15ILL9), where system fans and keyboard backlights fail to resume after suspend. Investigation linked shows the EC on this device turns off these components during sleep but requires the Function 9 notification to wake them up again.

This patch defines the new function index (ACPI_MS_TURN_ON_DISPLAY) and invokes it in acpi_s2idle_restore_early_lps0(). The execution order is updated to match the logic of an "intent" signal:

1. LPS0 Exit (Function 6)
2. Turn On Display Intent (Function 9)
3. Modern Standby Exit (Function 8)
4. Screen On (Function 4)

Invoking Function 9 before the Modern Standby Exit ensures the firmware has time to restore power rails and functionality (like fans) before the software fully exits the sleep state.

---
 drivers/acpi/x86/s2idle.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/acpi/x86/s2idle.c +6 -0
index cc3c83e4cc23b..2189330ffc6d3 100644
@@ -49,6 +49,7 @@ static const struct acpi_device_id lps0_device_ids[] = {
 #define ACPI_LPS0_EXIT		6
 #define ACPI_LPS0_MS_ENTRY      7
 #define ACPI_LPS0_MS_EXIT       8
+#define ACPI_MS_TURN_ON_DISPLAY 9
 
 /* AMD */
 #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-932122d37721"
@@ -356,6 +357,8 @@ static const char *acpi_sleep_dsm_state_to_str(unsigned int state)
 			return "lps0 ms entry";
 		case ACPI_LPS0_MS_EXIT:
 			return "lps0 ms exit";
+		case ACPI_MS_TURN_ON_DISPLAY:
+			return "lps0 ms turn on display";
 		}
 	} else {
 		switch (state) {
@@ -617,6 +620,9 @@ static void acpi_s2idle_restore_early_lps0(void)
 	if (lps0_dsm_func_mask_microsoft > 0) {
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT,
 				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		/* Intent to turn on display */
+		acpi_sleep_run_lps0_dsm(ACPI_MS_TURN_ON_DISPLAY,
+				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
 		/* Modern Standby exit */
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
 				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
Signature · 1 line
2.51.0
author maintainer
#90 lore raw

PATCH 83/844 ACPI: scan: Use async schedule function in acpi_scan_clear_dep_fn()

In reply to Sasha Levin

From: Yicong Yang <[email protected]>

[ Upstream commit 7cf28b3797a81b616bb7eb3e90cf131afc452919 ]

The device object rescan in acpi_scan_clear_dep_fn() is scheduled on a system workqueue which is not guaranteed to be finished before entering userspace. This may cause some key devices to be missing when userspace init task tries to find them. Two issues observed on RISCV platforms:

- Kernel panic due to userspace init cannot have an opened console.

The console device scanning is queued by acpi_scan_clear_dep_queue() and not finished by the time userspace init process running, thus by the time userspace init runs, no console is present.

- Entering rescue shell due to the lack of root devices (PCIe nvme in our case).

Same reason as above, the PCIe host bridge scanning is queued on a system workqueue and finished after init process runs.

The reason is because both devices (console, PCIe host bridge) depend on riscv-aplic irqchip to serve their interrupts (console's wired interrupt and PCI's INTx interrupts). In order to keep the dependency, these devices are scanned and created after initializing riscv-aplic. The riscv-aplic is initialized in device_initcall() and a device scan work is queued via acpi_scan_clear_dep_queue(), which is close to the time userspace init process is run. Since system_dfl_wq is used in acpi_scan_clear_dep_queue() with no synchronization, the issues will happen if userspace init runs before these devices are ready.

The solution is to wait for the queued work to complete before entering userspace init. One possible way would be to use a dedicated workqueue instead of system_dfl_wq, and explicitly flush it somewhere in the initcall stage before entering userspace. Another way is to use async_schedule_dev_nocall() for scanning these devices. It's designed for asynchronous initialization and will work in the same way as before because it's using a dedicated unbound workqueue as well, but the kernel init code calls async_synchronize_full() right before entering userspace init which will wait for the work to complete.

Compared to a dedicated workqueue, the second approach is simpler because the async schedule framework takes care of all of the details. The ACPI code only needs to focus on its job. A dedicated workqueue for this could also be redundant because some platforms don't need acpi_scan_clear_dep_queue() for their device scanning.

---
 drivers/acpi/scan.c | 41 +++++++++++++++--------------------------
 1 file changed, 15 insertions(+), 26 deletions(-)
drivers/acpi/scan.c +15 -26
index 416d87f9bd107..b78f6be2f9468 100644
@@ -5,6 +5,7 @@
 
 #define pr_fmt(fmt) "ACPI: " fmt
 
+#include <linux/async.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -2360,46 +2361,34 @@ static int acpi_dev_get_next_consumer_dev_cb(struct acpi_dep_data *dep, void *da
 	return 0;
 }
 
-struct acpi_scan_clear_dep_work {
-	struct work_struct work;
-	struct acpi_device *adev;
-};
-
-static void acpi_scan_clear_dep_fn(struct work_struct *work)
+static void acpi_scan_clear_dep_fn(void *dev, async_cookie_t cookie)
 {
-	struct acpi_scan_clear_dep_work *cdw;
-
-	cdw = container_of(work, struct acpi_scan_clear_dep_work, work);
+	struct acpi_device *adev = to_acpi_device(dev);
 
 	acpi_scan_lock_acquire();
-	acpi_bus_attach(cdw->adev, (void *)true);
+	acpi_bus_attach(adev, (void *)true);
 	acpi_scan_lock_release();
 
-	acpi_dev_put(cdw->adev);
-	kfree(cdw);
+	acpi_dev_put(adev);
 }
 
 static bool acpi_scan_clear_dep_queue(struct acpi_device *adev)
 {
-	struct acpi_scan_clear_dep_work *cdw;
-
 	if (adev->dep_unmet)
 		return false;
 
-	cdw = kmalloc(sizeof(*cdw), GFP_KERNEL);
-	if (!cdw)
-		return false;
-
-	cdw->adev = adev;
-	INIT_WORK(&cdw->work, acpi_scan_clear_dep_fn);
 	/*
-	 * Since the work function may block on the lock until the entire
-	 * initial enumeration of devices is complete, put it into the unbound
-	 * workqueue.
+	 * Async schedule the deferred acpi_scan_clear_dep_fn() since:
+	 * - acpi_bus_attach() needs to hold acpi_scan_lock which cannot
+	 *   be acquired under acpi_dep_list_lock (held here)
+	 * - the deferred work at boot stage is ensured to be finished
+	 *   before userspace init task by the async_synchronize_full()
+	 *   barrier
+	 *
+	 * Use _nocall variant since it'll return on failure instead of
+	 * run the function synchronously.
 	 */
-	queue_work(system_dfl_wq, &cdw->work);
-
-	return true;
+	return async_schedule_dev_nocall(acpi_scan_clear_dep_fn, &adev->dev);
 }
 
 static void acpi_scan_delete_dep_data(struct acpi_dep_data *dep)
Signature · 1 line
2.51.0
author maintainer
#91 lore raw

PATCH 84/844 ACPI: battery: fix incorrect charging status when current is zero

In reply to Sasha Levin

From: Ata İlhan Köktürk <[email protected]>

[ Upstream commit bb1256e0ddc7e9e406164319769b9f8d8389f056 ]

On some laptops, such as the Huawei Matebook series, the embedded controller continues to report "Charging" status even when the charge threshold is reached and no current is being drawn.

This incorrect reporting prevents the system from switching to battery power profiles, leading to significantly higher power (e.g., 18W instead of 7W during browsing) and missed remaining battery time estimation.

Validate the "Charging" state by checking if rate_now is zero. If the hardware reports charging but the current is zero, report "Not Charging" to user space.

[ rjw: Whitespace fix, braces added to an inner if (), new comment rewrite ]
[ rjw: Changelog edits ]
---
 drivers/acpi/battery.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/acpi/battery.c +8 -1
index 34181fa52e937..4b28ef79e6ac8 100644
@@ -211,7 +211,14 @@ static int acpi_battery_get_property(struct power_supply *psy,
 		if (battery->state & ACPI_BATTERY_STATE_DISCHARGING)
 			val->intval = acpi_battery_handle_discharging(battery);
 		else if (battery->state & ACPI_BATTERY_STATE_CHARGING)
-			val->intval = POWER_SUPPLY_STATUS_CHARGING;
+			/* Validate the status by checking the current. */
+			if (battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN &&
+			    battery->rate_now == 0) {
+				/* On charge but no current (0W/0mA). */
+				val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
+			} else {
+				val->intval = POWER_SUPPLY_STATUS_CHARGING;
+			}
 		else if (battery->state & ACPI_BATTERY_STATE_CHARGE_LIMITING)
 			val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
 		else if (acpi_battery_is_charged(battery))
Signature · 1 line
2.51.0
author maintainer
#92 lore raw

PATCH 85/844 xenbus: Use .freeze/.thaw to handle xenbus devices

In reply to Sasha Levin

From: Jason Andryuk <[email protected]>

[ Upstream commit e08dd1ee49838750a514e83c0aa60cd12ba6ecbb ]

The goal is to fix s2idle and S3 for Xen PV devices. A domain resuming from s3 or s2idle disconnects its PV devices during resume. The backends are not expecting this and do not reconnect.

b3e96c0c7562 ("xen: use freeze/restore/thaw PM events for suspend/ resume/chkpt") changed xen_suspend()/do_suspend() from PMSG_SUSPEND/PMSG_RESUME to PMSG_FREEZE/PMSG_THAW/PMSG_RESTORE, but the suspend/resume callbacks remained.

.freeze/restore are used with hiberation where Linux restarts in a new place in the future. .suspend/resume are useful for runtime power management for the duration of a boot.

The current behavior of the callbacks works for an xl save/restore or live migration where the domain is restored/migrated to a new location and connecting to a not-already-connected backend.

Change xenbus_pm_ops to use .freeze/thaw/restore and drop the .suspend/resume hook. This matches the use in drivers/xen/manage.c for save/restore and live migration. With .suspend/resume empty, PV devices are left connected during s2idle and s3, so PV devices are not changed and work after resume.

Message-ID: <[email protected]>

---
 drivers/xen/xenbus/xenbus_probe_frontend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/xen/xenbus/xenbus_probe_frontend.c +1 -3
index 6d1819269cbe5..199917b6f77ca 100644
@@ -148,11 +148,9 @@ static void xenbus_frontend_dev_shutdown(struct device *_dev)
 }
 
 static const struct dev_pm_ops xenbus_pm_ops = {
-	.suspend	= xenbus_dev_suspend,
-	.resume		= xenbus_frontend_dev_resume,
 	.freeze		= xenbus_dev_suspend,
 	.thaw		= xenbus_dev_cancel,
-	.restore	= xenbus_dev_resume,
+	.restore	= xenbus_frontend_dev_resume,
 };
 
 static struct xen_bus_type xenbus_frontend = {
Signature · 1 line
2.51.0
author maintainer
#93 lore raw

PATCH 86/844 blk-mq-debugfs: add missing debugfs_mutex in blk_mq_debugfs_register_hctxs()

In reply to Sasha Levin

From: Yu Kuai <[email protected]>

[ Upstream commit 9d20fd6ce1ba9733cd5ac96fcab32faa9fc404dd ]

In blk_mq_update_nr_hw_queues(), debugfs_mutex is not held while creating debugfs entries for hctxs. Hence add debugfs_mutex there, it's safe because queue is not frozen.

---
 block/blk-mq-debugfs.c | 2 ++
 1 file changed, 2 insertions(+)
block/blk-mq-debugfs.c +2 -0
index 4896525b1c054..553d93b88e194 100644
@@ -686,8 +686,10 @@ void blk_mq_debugfs_register_hctxs(struct request_queue *q)
 	struct blk_mq_hw_ctx *hctx;
 	unsigned long i;
 
+	mutex_lock(&q->debugfs_mutex);
 	queue_for_each_hw_ctx(q, hctx, i)
 		blk_mq_debugfs_register_hctx(q, hctx);
+	mutex_unlock(&q->debugfs_mutex);
 }
 
 void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
Signature · 1 line
2.51.0
author maintainer
#94 lore raw

PATCH 87/844 blk-mq-sched: unify elevators checking for async requests

In reply to Sasha Levin

From: Yu Kuai <[email protected]>

[ Upstream commit 1db61b0afdd7e8aa9289c423fdff002603b520b5 ]

bfq and mq-deadline consider sync writes as async requests and only reserve tags for sync reads by async_depth, however, kyber doesn't consider sync writes as async requests for now.

Consider the case there are lots of dirty pages, and user use fsync to flush dirty pages. In this case sched_tags can be exhausted by sync writes and sync reads can stuck waiting for tag. Hence let kyber follow what mq-deadline and bfq did, and unify async requests checking for all elevators.

---
 block/bfq-iosched.c   | 2 +-
 block/blk-mq-sched.h  | 5 +++++
 block/kyber-iosched.c | 2 +-
 block/mq-deadline.c   | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)
block/bfq-iosched.c +1 -1
index 6e54b1d3d8bc2..9e9d081e86bb2 100644
@@ -697,7 +697,7 @@ static void bfq_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
 	unsigned int limit, act_idx;
 
 	/* Sync reads have full depth available */
-	if (op_is_sync(opf) && !op_is_write(opf))
+	if (blk_mq_is_sync_read(opf))
 		limit = data->q->nr_requests;
 	else
 		limit = bfqd->async_depths[!!bfqd->wr_busy_queues][op_is_sync(opf)];
block/blk-mq-sched.h +5 -0
index 02c40a72e9598..5678e15bd33c4 100644
@@ -137,4 +137,9 @@ static inline void blk_mq_set_min_shallow_depth(struct request_queue *q,
 						depth);
 }
 
+static inline bool blk_mq_is_sync_read(blk_opf_t opf)
+{
+	return op_is_sync(opf) && !op_is_write(opf);
+}
+
 #endif
block/kyber-iosched.c +1 -1
index c1b36ffd19ceb..2b3f5b8959af0 100644
@@ -556,7 +556,7 @@ static void kyber_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
 	 * We use the scheduler tags as per-hardware queue queueing tokens.
 	 * Async requests can be limited at this stage.
 	 */
-	if (!op_is_sync(opf)) {
+	if (!blk_mq_is_sync_read(opf)) {
 		struct kyber_queue_data *kqd = data->q->elevator->elevator_data;
 
 		data->shallow_depth = kqd->async_depth;
block/mq-deadline.c +1 -1
index 3e3719093aec7..29d00221fbea6 100644
@@ -495,7 +495,7 @@ static void dd_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
 	struct deadline_data *dd = data->q->elevator->elevator_data;
 
 	/* Do not throttle synchronous reads. */
-	if (op_is_sync(opf) && !op_is_write(opf))
+	if (blk_mq_is_sync_read(opf))
 		return;
 
 	/*
Signature · 1 line
2.51.0
author maintainer
#95 lore raw

PATCH 88/844 block: decouple secure erase size limit from discard size limit

In reply to Sasha Levin

From: Luke Wang <[email protected]>

[ Upstream commit ee81212f74a57c5d2b56cf504f40d528dac6faaf ]

Secure erase should use max_secure_erase_sectors instead of being limited by max_discard_sectors. Separate the handling of REQ_OP_SECURE_ERASE from REQ_OP_DISCARD to allow each operation to use its own size limit.

---
 block/blk-merge.c | 21 +++++++++++++++++----
 block/blk.h       |  6 +++++-
 2 files changed, 22 insertions(+), 5 deletions(-)
block/blk-merge.c +17 -4
index d3115d7469df0..bf8faadb0bd46 100644
@@ -158,8 +158,9 @@ static struct bio *bio_submit_split(struct bio *bio, int split_sectors)
 	return bio;
 }
 
-struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
-		unsigned *nsegs)
+static struct bio *__bio_split_discard(struct bio *bio,
+		const struct queue_limits *lim, unsigned *nsegs,
+		unsigned int max_sectors)
 {
 	unsigned int max_discard_sectors, granularity;
 	sector_t tmp;
@@ -169,8 +170,7 @@ struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
 
 	granularity = max(lim->discard_granularity >> 9, 1U);
 
-	max_discard_sectors =
-		min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
+	max_discard_sectors = min(max_sectors, bio_allowed_max_sectors(lim));
 	max_discard_sectors -= max_discard_sectors % granularity;
 	if (unlikely(!max_discard_sectors))
 		return bio;
@@ -194,6 +194,19 @@ struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
 	return bio_submit_split(bio, split_sectors);
 }
 
+struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
+		unsigned *nsegs)
+{
+	unsigned int max_sectors;
+
+	if (bio_op(bio) == REQ_OP_SECURE_ERASE)
+		max_sectors = lim->max_secure_erase_sectors;
+	else
+		max_sectors = lim->max_discard_sectors;
+
+	return __bio_split_discard(bio, lim, nsegs, max_sectors);
+}
+
 static inline unsigned int blk_boundary_sectors(const struct queue_limits *lim,
 						bool is_atomic)
 {
block/blk.h +5 -1
index e4c433f62dfc7..4cd5a91346d8a 100644
@@ -208,10 +208,14 @@ static inline unsigned int blk_queue_get_max_sectors(struct request *rq)
 	struct request_queue *q = rq->q;
 	enum req_op op = req_op(rq);
 
-	if (unlikely(op == REQ_OP_DISCARD || op == REQ_OP_SECURE_ERASE))
+	if (unlikely(op == REQ_OP_DISCARD))
 		return min(q->limits.max_discard_sectors,
 			   UINT_MAX >> SECTOR_SHIFT);
 
+	if (unlikely(op == REQ_OP_SECURE_ERASE))
+		return min(q->limits.max_secure_erase_sectors,
+			   UINT_MAX >> SECTOR_SHIFT);
+
 	if (unlikely(op == REQ_OP_WRITE_ZEROES))
 		return q->limits.max_write_zeroes_sectors;
 
Signature · 1 line
2.51.0
author maintainer
#96 lore raw

PATCH 89/844 sparc: Synchronize user stack on fork and clone

In reply to Sasha Levin

From: Andreas Larsson <[email protected]>

[ Upstream commit e38eba3b77878ada327a572a41596a3b0b44e522 ]

Flush all uncommitted user windows before calling the generic syscall handlers for clone, fork, and vfork.

Prior to entering the arch common handlers sparc_{clone|fork|vfork}, the arch-specific syscall wrappers for these syscalls will attempt to flush all windows (including user windows).

In the window overflow trap handlers on both SPARC{32|64},
if the window can't be stored (i.e due to MMU related faults) the routine backups the user window and increments a thread counter (wsaved).

By adding a synchronization point after the flush attempt, when fault handling is enabled, any uncommitted user windows will be flushed.

---
 arch/sparc/kernel/process.c | 38 +++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)
arch/sparc/kernel/process.c +24 -14
index 0442ab00518d3..7d69877511fac 100644
@@ -17,14 +17,18 @@
 
 asmlinkage long sparc_fork(struct pt_regs *regs)
 {
-	unsigned long orig_i1 = regs->u_regs[UREG_I1];
+	unsigned long orig_i1;
 	long ret;
 	struct kernel_clone_args args = {
 		.exit_signal	= SIGCHLD,
-		/* Reuse the parent's stack for the child. */
-		.stack		= regs->u_regs[UREG_FP],
 	};
 
+	synchronize_user_stack();
+
+	orig_i1 = regs->u_regs[UREG_I1];
+	/* Reuse the parent's stack for the child. */
+	args.stack = regs->u_regs[UREG_FP];
+
 	ret = kernel_clone(&args);
 
 	/* If we get an error and potentially restart the system
@@ -40,16 +44,19 @@ asmlinkage long sparc_fork(struct pt_regs *regs)
 
 asmlinkage long sparc_vfork(struct pt_regs *regs)
 {
-	unsigned long orig_i1 = regs->u_regs[UREG_I1];
+	unsigned long orig_i1;
 	long ret;
-
 	struct kernel_clone_args args = {
 		.flags		= CLONE_VFORK | CLONE_VM,
 		.exit_signal	= SIGCHLD,
-		/* Reuse the parent's stack for the child. */
-		.stack		= regs->u_regs[UREG_FP],
 	};
 
+	synchronize_user_stack();
+
+	orig_i1 = regs->u_regs[UREG_I1];
+	/* Reuse the parent's stack for the child. */
+	args.stack = regs->u_regs[UREG_FP];
+
 	ret = kernel_clone(&args);
 
 	/* If we get an error and potentially restart the system
@@ -65,15 +72,18 @@ asmlinkage long sparc_vfork(struct pt_regs *regs)
 
 asmlinkage long sparc_clone(struct pt_regs *regs)
 {
-	unsigned long orig_i1 = regs->u_regs[UREG_I1];
-	unsigned int flags = lower_32_bits(regs->u_regs[UREG_I0]);
+	unsigned long orig_i1;
+	unsigned int flags;
 	long ret;
+	struct kernel_clone_args args = {0};
 
-	struct kernel_clone_args args = {
-		.flags		= (flags & ~CSIGNAL),
-		.exit_signal	= (flags & CSIGNAL),
-		.tls		= regs->u_regs[UREG_I3],
-	};
+	synchronize_user_stack();
+
+	orig_i1 = regs->u_regs[UREG_I1];
+	flags = lower_32_bits(regs->u_regs[UREG_I0]);
+	args.flags		= (flags & ~CSIGNAL);
+	args.exit_signal	= (flags & CSIGNAL);
+	args.tls		= regs->u_regs[UREG_I3];
 
 #ifdef CONFIG_COMPAT
 	if (test_thread_flag(TIF_32BIT)) {
Signature · 1 line
2.51.0
author maintainer
#97 lore raw

PATCH 90/844 sparc: don't reference obsolete termio struct for TC* constants

In reply to Sasha Levin

From: Sam James <[email protected]>

[ Upstream commit be0bccffcde3308150d2a90e55fc10e249098909 ]

Similar in nature to commit ab107276607a ("powerpc: Fix struct termio related ioctl macros").

glibc-2.42 drops the legacy termio struct, but the ioctls.h header still defines some TC* constants in terms of termio (via sizeof). Hardcode the values instead.

This fixes building Python for example, which falls over like:
./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'

---
 arch/sparc/include/uapi/asm/ioctls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/sparc/include/uapi/asm/ioctls.h +4 -4
index 7fd2f5873c9e7..a8bbdf9877a41 100644
@@ -5,10 +5,10 @@
 #include <asm/ioctl.h>
 
 /* Big T */
-#define TCGETA		_IOR('T', 1, struct termio)
-#define TCSETA		_IOW('T', 2, struct termio)
-#define TCSETAW		_IOW('T', 3, struct termio)
-#define TCSETAF		_IOW('T', 4, struct termio)
+#define TCGETA          0x40125401 /* _IOR('T', 1, struct termio) */
+#define TCSETA          0x80125402 /* _IOW('T', 2, struct termio) */
+#define TCSETAW         0x80125403 /* _IOW('T', 3, struct termio) */
+#define TCSETAF         0x80125404 /* _IOW('T', 4, struct termio) */
 #define TCSBRK		_IO('T', 5)
 #define TCXONC		_IO('T', 6)
 #define TCFLSH		_IO('T', 7)
Signature · 1 line
2.51.0
author maintainer
#98 lore raw

PATCH 91/844 bpf: verifier improvement in 32bit shift sign extension pattern

In reply to Sasha Levin

From: Cupertino Miranda <[email protected]>

[ Upstream commit d18dec4b8990048ce75f0ece32bb96b3fbd3f422 ]

This patch improves the verifier to correctly compute bounds for sign extension compiler pattern composed of left shift by 32bits followed by a sign right shift by 32bits. Pattern in the verifier was limitted to positive value bounds and would reset bound computation for negative values. New code allows both positive and negative values for sign extension without compromising bound computation and verifier to pass.

This change is required by GCC which generate such pattern, and was detected in the context of systemd, as described in the following GCC
bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119731

Three new tests were added in verifier_subreg.c.

---
 kernel/bpf/verifier.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
kernel/bpf/verifier.c +7 -11
index fe01edfcc34c6..7069e9f527eaa 100644
@@ -15305,21 +15305,17 @@ static void __scalar64_min_max_lsh(struct bpf_reg_state *dst_reg,
 				   u64 umin_val, u64 umax_val)
 {
 	/* Special case <<32 because it is a common compiler pattern to sign
-	 * extend subreg by doing <<32 s>>32. In this case if 32bit bounds are
-	 * positive we know this shift will also be positive so we can track
-	 * bounds correctly. Otherwise we lose all sign bit information except
-	 * what we can pick up from var_off. Perhaps we can generalize this
-	 * later to shifts of any length.
+	 * extend subreg by doing <<32 s>>32. smin/smax assignments are correct
+	 * because s32 bounds don't flip sign when shifting to the left by
+	 * 32bits.
 	 */
-	if (umin_val == 32 && umax_val == 32 && dst_reg->s32_max_value >= 0)
+	if (umin_val == 32 && umax_val == 32) {
 		dst_reg->smax_value = (s64)dst_reg->s32_max_value << 32;
-	else
-		dst_reg->smax_value = S64_MAX;
-
-	if (umin_val == 32 && umax_val == 32 && dst_reg->s32_min_value >= 0)
 		dst_reg->smin_value = (s64)dst_reg->s32_min_value << 32;
-	else
+	} else {
+		dst_reg->smax_value = S64_MAX;
 		dst_reg->smin_value = S64_MIN;
+	}
 
 	/* If we might shift our top bit out, then we know nothing */
 	if (dst_reg->umax_value > 1ULL << (63 - umax_val)) {
Signature · 1 line
2.51.0
author maintainer
#99 lore raw

PATCH 92/844 irqchip/riscv-imsic: Add a CPU pm notifier to restore the IMSIC on exit

In reply to Sasha Levin

From: Nick Hu <[email protected]>

[ Upstream commit f48b4bd0915bf61ac12b8c65c7939ebd03bc8abf ]

The IMSIC might be reset when the system enters a low power state, but on exit nothing restores the registers, which prevents interrupt delivery.

Solve this by registering a CPU power management notifier, which restores the IMSIC on exit.

---
 drivers/irqchip/irq-riscv-imsic-early.c | 39 ++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 8 deletions(-)
drivers/irqchip/irq-riscv-imsic-early.c +31 -8
index 6bac67cc0b6d9..ba903fa689bd5 100644
@@ -7,6 +7,7 @@
 #define pr_fmt(fmt) "riscv-imsic: " fmt
 #include <linux/acpi.h>
 #include <linux/cpu.h>
+#include <linux/cpu_pm.h>
 #include <linux/export.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
@@ -123,14 +124,8 @@ static void imsic_handle_irq(struct irq_desc *desc)
 	chained_irq_exit(chip, desc);
 }
 
-static int imsic_starting_cpu(unsigned int cpu)
+static void imsic_hw_states_init(void)
 {
-	/* Mark per-CPU IMSIC state as online */
-	imsic_state_online();
-
-	/* Enable per-CPU parent interrupt */
-	enable_percpu_irq(imsic_parent_irq, irq_get_trigger_type(imsic_parent_irq));
-
 	/* Setup IPIs */
 	imsic_ipi_starting_cpu();
 
@@ -142,6 +137,18 @@ static int imsic_starting_cpu(unsigned int cpu)
 
 	/* Enable local interrupt delivery */
 	imsic_local_delivery(true);
+}
+
+static int imsic_starting_cpu(unsigned int cpu)
+{
+	/* Mark per-CPU IMSIC state as online */
+	imsic_state_online();
+
+	/* Enable per-CPU parent interrupt */
+	enable_percpu_irq(imsic_parent_irq, irq_get_trigger_type(imsic_parent_irq));
+
+	/* Initialize the IMSIC registers to enable the interrupt delivery */
+	imsic_hw_states_init();
 
 	return 0;
 }
@@ -157,6 +164,22 @@ static int imsic_dying_cpu(unsigned int cpu)
 	return 0;
 }
 
+static int imsic_pm_notifier(struct notifier_block *self, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_PM_EXIT:
+		/* Initialize the IMSIC registers to enable the interrupt delivery */
+		imsic_hw_states_init();
+		break;
+	}
+
+	return NOTIFY_OK;
+}
+
+static struct notifier_block imsic_pm_notifier_block = {
+	.notifier_call = imsic_pm_notifier,
+};
+
 static int __init imsic_early_probe(struct fwnode_handle *fwnode)
 {
 	struct irq_domain *domain;
@@ -194,7 +217,7 @@ static int __init imsic_early_probe(struct fwnode_handle *fwnode)
 	cpuhp_setup_state(CPUHP_AP_IRQ_RISCV_IMSIC_STARTING, "irqchip/riscv/imsic:starting",
 			  imsic_starting_cpu, imsic_dying_cpu);
 
-	return 0;
+	return cpu_pm_register_notifier(&imsic_pm_notifier_block);
 }
 
 static int __init imsic_early_dt_init(struct device_node *node, struct device_node *parent)
Signature · 1 line
2.51.0
author maintainer
#100 lore raw

PATCH 93/844 perf/x86/msr: Add Airmont NP

In reply to Sasha Levin

From: Martin Schiller <[email protected]>

[ Upstream commit 63dbadcafc1f4d1da796a8e2c0aea1e561f79ece ]

Like Airmont, the Airmont NP (aka Intel / MaxLinear Lightning Mountain) supports SMI_COUNT MSR.

---
 arch/x86/events/msr.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/events/msr.c +1 -0
index 7f5007a4752a1..8052596b85036 100644
@@ -78,6 +78,7 @@ static bool test_intel(int idx, void *data)
 	case INTEL_ATOM_SILVERMONT:
 	case INTEL_ATOM_SILVERMONT_D:
 	case INTEL_ATOM_AIRMONT:
+	case INTEL_ATOM_AIRMONT_NP:
 
 	case INTEL_ATOM_GOLDMONT:
 	case INTEL_ATOM_GOLDMONT_D:
Signature · 1 line
2.51.0
author maintainer
#101 lore raw

PATCH 94/844 perf/x86/cstate: Add Airmont NP

In reply to Sasha Levin

From: Martin Schiller <[email protected]>

[ Upstream commit 3006911f284d769b0f66c12b39da130325ef1440 ]

From the perspective of Intel cstate residency counters, the Airmont NP (aka Lightning Mountain) is identical to the Airmont.

---
 arch/x86/events/intel/cstate.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/events/intel/cstate.c +1 -0
index fa67fda6e45b4..c1e318bdaa397 100644
@@ -599,6 +599,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
 	X86_MATCH_VFM(INTEL_ATOM_SILVERMONT,	&slm_cstates),
 	X86_MATCH_VFM(INTEL_ATOM_SILVERMONT_D,	&slm_cstates),
 	X86_MATCH_VFM(INTEL_ATOM_AIRMONT,	&slm_cstates),
+	X86_MATCH_VFM(INTEL_ATOM_AIRMONT_NP,	&slm_cstates),
 
 	X86_MATCH_VFM(INTEL_BROADWELL,		&snb_cstates),
 	X86_MATCH_VFM(INTEL_BROADWELL_D,	&snb_cstates),
Signature · 1 line
2.51.0
author maintainer
#102 lore raw

PATCH 95/844 perf/x86/intel: Add Airmont NP

In reply to Sasha Levin

From: Martin Schiller <[email protected]>

[ Upstream commit a08340fd291671c54d379d285b2325490ce90ddd ]

The Intel / MaxLinear Airmont NP (aka Lightning Mountain) supports the same architectual and non-architecural events as Airmont.

---
 arch/x86/events/intel/core.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/events/intel/core.c +1 -0
index bdf3f0d0fe216..d85df652334fb 100644
@@ -7405,6 +7405,7 @@ __init int intel_pmu_init(void)
 	case INTEL_ATOM_SILVERMONT_D:
 	case INTEL_ATOM_SILVERMONT_MID:
 	case INTEL_ATOM_AIRMONT:
+	case INTEL_ATOM_AIRMONT_NP:
 	case INTEL_ATOM_SILVERMONT_MID2:
 		memcpy(hw_cache_event_ids, slm_hw_cache_event_ids,
 			sizeof(hw_cache_event_ids));
Signature · 1 line
2.51.0
author maintainer
#103 lore raw

PATCH 96/844 gendwarfksyms: Fix build on 32-bit hosts

In reply to Sasha Levin

From: Sami Tolvanen <[email protected]>

[ Upstream commit ddc54f912a551f6eb0bbcfc3880f45fe27a252cb ]

We have interchangeably used unsigned long for some of the types defined in elfutils, assuming they're always 64-bit. This obviously fails when building gendwarfksyms on 32-bit hosts. Fix the types.

---
 scripts/gendwarfksyms/dwarf.c   | 4 +++-
 scripts/gendwarfksyms/symbols.c | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)
scripts/gendwarfksyms/dwarf.c +3 -1
index 3538a7d9cb070..e76d732f5f602 100644
@@ -750,6 +750,7 @@ static void process_enumerator_type(struct state *state, struct die *cache,
 				    Dwarf_Die *die)
 {
 	bool overridden = false;
+	unsigned long override;
 	Dwarf_Word value;
 
 	if (stable) {
@@ -761,7 +762,8 @@ static void process_enumerator_type(struct state *state, struct die *cache,
 			return;
 
 		overridden = kabi_get_enumerator_value(
-			state->expand.current_fqn, cache->fqn, &value);
+			state->expand.current_fqn, cache->fqn, &override);
+		value = override;
 	}
 
 	process_list_comma(state, cache);
scripts/gendwarfksyms/symbols.c +3 -2
index ecddcb5ffcdfb..42cd27c9cec4f 100644
@@ -3,6 +3,7 @@
  * Copyright (C) 2024 Google LLC
  */
 
+#include <inttypes.h>
 #include "gendwarfksyms.h"
 
 #define SYMBOL_HASH_BITS 12
@@ -242,7 +243,7 @@ static void elf_for_each_global(int fd, elf_symbol_callback_t func, void *arg)
 				error("elf_getdata failed: %s", elf_errmsg(-1));
 
 			if (shdr->sh_entsize != sym_size)
-				error("expected sh_entsize (%lu) to be %zu",
+				error("expected sh_entsize (%" PRIu64 ") to be %zu",
 				      shdr->sh_entsize, sym_size);
 
 			nsyms = shdr->sh_size / shdr->sh_entsize;
@@ -292,7 +293,7 @@ static void set_symbol_addr(struct symbol *sym, void *arg)
 		hash_add(symbol_addrs, &sym->addr_hash,
 			 symbol_addr_hash(&sym->addr));
 
-		debug("%s -> { %u, %lx }", sym->name, sym->addr.section,
+		debug("%s -> { %u, %" PRIx64 " }", sym->name, sym->addr.section,
 		      sym->addr.address);
 	} else if (sym->addr.section != addr->section ||
 		   sym->addr.address != addr->address) {
Signature · 1 line
2.51.0
author maintainer
#104 lore raw

PATCH 97/844 bpf: crypto: Use the correct destructor kfunc type

In reply to Sasha Levin

From: Sami Tolvanen <[email protected]>

[ Upstream commit b40a5d724f29fc2eed23ff353808a9aae616b48a ]

With CONFIG_CFI enabled, the kernel strictly enforces that indirect function calls use a function pointer type that matches the target function. I ran into the following type mismatch when running BPF self-tests:

CFI failure at bpf_obj_free_fields+0x190/0x238 (target:

    bpf_crypto_ctx_release+0x0/0x94; expected type: 0xa488ebfc)
  Internal error: Oops - CFI: 00000000f2008228 [#1]  SMP
  ...

As bpf_crypto_ctx_release() is also used in BPF programs and using a void pointer as the argument would make the verifier unhappy, add a simple stub function with the correct type and register it as the destructor kfunc instead.

---
 kernel/bpf/crypto.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
kernel/bpf/crypto.c +7 -1
index 83c4d9943084b..1d024fe7248ac 100644
@@ -261,6 +261,12 @@ __bpf_kfunc void bpf_crypto_ctx_release(struct bpf_crypto_ctx *ctx)
 		call_rcu(&ctx->rcu, crypto_free_cb);
 }
 
+__bpf_kfunc void bpf_crypto_ctx_release_dtor(void *ctx)
+{
+	bpf_crypto_ctx_release(ctx);
+}
+CFI_NOSEAL(bpf_crypto_ctx_release_dtor);
+
 static int bpf_crypto_crypt(const struct bpf_crypto_ctx *ctx,
 			    const struct bpf_dynptr_kern *src,
 			    const struct bpf_dynptr_kern *dst,
@@ -368,7 +374,7 @@ static const struct btf_kfunc_id_set crypt_kfunc_set = {
 
 BTF_ID_LIST(bpf_crypto_dtor_ids)
 BTF_ID(struct, bpf_crypto_ctx)
-BTF_ID(func, bpf_crypto_ctx_release)
+BTF_ID(func, bpf_crypto_ctx_release_dtor)
 
 static int __init crypto_kfunc_init(void)
 {
Signature · 1 line
2.51.0
author maintainer
#105 lore raw

PATCH 98/844 bpf: net_sched: Use the correct destructor kfunc type

In reply to Sasha Levin

From: Sami Tolvanen <[email protected]>

[ Upstream commit c99d97b46631c4bea0c14b7581b7a59214601e63 ]

With CONFIG_CFI enabled, the kernel strictly enforces that indirect function calls use a function pointer type that matches the target function. As bpf_kfree_skb() signature differs from the btf_dtor_kfunc_t pointer type used for the destructor calls in bpf_obj_free_fields(), add a stub function with the correct type to fix the type mismatch.

---
 net/sched/bpf_qdisc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
net/sched/bpf_qdisc.c +7 -1
index adcb618a2bfca..e9bea9890777d 100644
@@ -202,6 +202,12 @@ __bpf_kfunc void bpf_kfree_skb(struct sk_buff *skb)
 	kfree_skb(skb);
 }
 
+__bpf_kfunc void bpf_kfree_skb_dtor(void *skb)
+{
+	bpf_kfree_skb(skb);
+}
+CFI_NOSEAL(bpf_kfree_skb_dtor);
+
 /* bpf_qdisc_skb_drop - Drop an skb by adding it to a deferred free list.
  * @skb: The skb whose reference to be released and dropped.
  * @to_free_list: The list of skbs to be dropped.
@@ -449,7 +455,7 @@ static struct bpf_struct_ops bpf_Qdisc_ops = {
 	.owner = THIS_MODULE,
 };
 
-BTF_ID_LIST_SINGLE(bpf_sk_buff_dtor_ids, func, bpf_kfree_skb)
+BTF_ID_LIST_SINGLE(bpf_sk_buff_dtor_ids, func, bpf_kfree_skb_dtor)
 
 static int __init bpf_qdisc_kfunc_init(void)
 {
Signature · 1 line
2.51.0
author maintainer
#106 lore raw

PATCH 99/844 bpf: Recognize special arithmetic shift in the verifier

In reply to Sasha Levin

From: Alexei Starovoitov <[email protected]>

[ Upstream commit bffacdb80b93b7b5e96b26fad64cc490a6c7d6c7 ]

cilium bpf_wiregard.bpf.c when compiled with -O1 fails to load with the following verifier log:

192: (79) r2 = *(u64 *)(r10 -304) ; R2=pkt(r=40) R10=fp0 fp-304=pkt(r=40)
...
227: (85) call bpf_skb_store_bytes#9 ; R0=scalar()

228: (bc) w2 = w0                     ; R0=scalar() R2=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
229: (c4) w2 s>>= 31                  ; R2=scalar(smin=0,smax=umax=0xffffffff,smin32=-1,smax32=0,var_off=(0x0; 0xffffffff))
230: (54) w2 &= -134                  ; R2=scalar(smin=0,smax=umax=umax32=0xffffff7a,smax32=0x7fffff7a,var_off=(0x0; 0xffffff7a))

...
232: (66) if w2 s> 0xffffffff goto pc+125 ; R2=scalar(smin=umin=umin32=0x80000000,smax=umax=umax32=0xffffff7a,smax32=-134,var_off=(0x80000000; 0x7fffff7a))
...
238: (79) r4 = *(u64 *)(r10 -304) ; R4=scalar() R10=fp0 fp-304=scalar()
239: (56) if w2 != 0xffffff78 goto pc+210 ; R2=0xffffff78 // -136
...
258: (71) r1 = *(u8 *)(r4 +0)
R4 invalid mem access 'scalar'

The error might confuse most bpf authors, since fp-304 slot had 'pkt' pointer at insn 192 and became 'scalar' at 238. That happened because bpf_skb_store_bytes() clears all packet pointers including those in the stack. On the first glance it might look like a bug in the source code, since ctx->data pointer should have been reloaded after the call to bpf_skb_store_bytes().

The relevant part of cilium source code looks like this:

// bpf/lib/nodeport.h
int dsr_set_ipip6()

{
	if (ctx_adjust_hroom(...))
		return DROP_INVALID; // -134
	if (ctx_store_bytes(...))
		return DROP_WRITE_ERROR; // -141
	return 0;
}

bool dsr_fail_needs_reply(int code)

{
	if (code == DROP_FRAG_NEEDED) // -136
		return true;
	return false;
}

tail_nodeport_ipv6_dsr()

{
	ret = dsr_set_ipip6(...);
	if (!IS_ERR(ret)) {
		...
	} else {
		if (dsr_fail_needs_reply(ret))
			return dsr_reply_icmp6(...);
	}
}

The code doesn't have arithmetic shift by 31 and it reloads ctx->data every time it needs to access it. So it's not a bug in the source code.

The reason is DAGCombiner::foldSelectCCToShiftAnd() LLVM transformation:

// If this is a select where the false operand is zero and the compare is a // check of the sign bit, see if we can perform the "gzip trick":
// select_cc setlt X, 0, A, 0 -> and (sra X, size(X)-1), A
// select_cc setgt X, 0, A, 0 -> and (not (sra X, size(X)-1)), A

The conditional branch in dsr_set_ipip6() and its return values are optimized into BPF_ARSH plus BPF_AND:

227: (85) call bpf_skb_store_bytes#9
228: (bc) w2 = w0
229: (c4) w2 s>>= 31 ; R2=scalar(smin=0,smax=umax=0xffffffff,smin32=-1,smax32=0,var_off=(0x0; 0xffffffff))
230: (54) w2 &= -134 ; R2=scalar(smin=0,smax=umax=umax32=0xffffff7a,smax32=0x7fffff7a,var_off=(0x0; 0xffffff7a))

after insn 230 the register w2 can only be 0 or -134, but the verifier approximates it, since there is no way to represent two scalars in bpf_reg_state.
After fallthough at insn 232 the w2 can only be -134, hence the branch at insn
239: (56) if w2 != -136 goto pc+210
should be always taken, and trapping insn 258 should never execute. LLVM generated correct code, but the verifier follows impossible path and rejects valid program. To fix this issue recognize this special LLVM optimization and fork the verifier state. So after insn 229: (c4) w2 s>>= 31
the verifier has two states to explore:
one with w2 = 0 and another with w2 = 0xffffffff
which makes the verifier accept bpf_wiregard.c

A similar pattern exists were OR operation is used in place of the AND operation, the verifier detects that pattern as well by forking the state before the OR operation with a scalar in range [-1,0].

Note there are 20+ such patterns in bpf_wiregard.o compiled with -O1 and -O2, but they're rarely seen in other production bpf programs, so push_stack() approach is not a concern.

---
 kernel/bpf/verifier.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
kernel/bpf/verifier.c +39 -0
index 7069e9f527eaa..1999b8d244f64 100644
@@ -15499,6 +15499,35 @@ static bool is_safe_to_compute_dst_reg_range(struct bpf_insn *insn,
 	}
 }
 
+static int maybe_fork_scalars(struct bpf_verifier_env *env, struct bpf_insn *insn,
+			      struct bpf_reg_state *dst_reg)
+{
+	struct bpf_verifier_state *branch;
+	struct bpf_reg_state *regs;
+	bool alu32;
+
+	if (dst_reg->smin_value == -1 && dst_reg->smax_value == 0)
+		alu32 = false;
+	else if (dst_reg->s32_min_value == -1 && dst_reg->s32_max_value == 0)
+		alu32 = true;
+	else
+		return 0;
+
+	branch = push_stack(env, env->insn_idx + 1, env->insn_idx, false);
+	if (IS_ERR(branch))
+		return PTR_ERR(branch);
+
+	regs = branch->frame[branch->curframe]->regs;
+	if (alu32) {
+		__mark_reg32_known(&regs[insn->dst_reg], 0);
+		__mark_reg32_known(dst_reg, -1ull);
+	} else {
+		__mark_reg_known(&regs[insn->dst_reg], 0);
+		__mark_reg_known(dst_reg, -1ull);
+	}
+	return 0;
+}
+
 /* WARNING: This function does calculations on 64-bit values, but the actual
  * execution may occur on 32-bit values. Therefore, things like bitshifts
  * need extra checks in the 32-bit case.
@@ -15561,11 +15590,21 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env,
 		scalar_min_max_mul(dst_reg, &src_reg);
 		break;
 	case BPF_AND:
+		if (tnum_is_const(src_reg.var_off)) {
+			ret = maybe_fork_scalars(env, insn, dst_reg);
+			if (ret)
+				return ret;
+		}
 		dst_reg->var_off = tnum_and(dst_reg->var_off, src_reg.var_off);
 		scalar32_min_max_and(dst_reg, &src_reg);
 		scalar_min_max_and(dst_reg, &src_reg);
 		break;
 	case BPF_OR:
+		if (tnum_is_const(src_reg.var_off)) {
+			ret = maybe_fork_scalars(env, insn, dst_reg);
+			if (ret)
+				return ret;
+		}
 		dst_reg->var_off = tnum_or(dst_reg->var_off, src_reg.var_off);
 		scalar32_min_max_or(dst_reg, &src_reg);
 		scalar_min_max_or(dst_reg, &src_reg);
Signature · 1 line
2.51.0
author maintainer
#107 lore raw

PATCH 100/844 genirq/cpuhotplug: Notify about affinity changes breaking the affinity mask

In reply to Sasha Levin

From: Imran Khan <[email protected]>

[ Upstream commit dd9f6d30c64001ca4dde973ac04d8d155e856743 ]

During CPU offlining the interrupts affined to that CPU are moved to other online CPUs, which might break the original affinity mask if the outgoing CPU was the last online CPU in that mask. This change is not propagated to irq_desc::affinity_notify(), which leaves users of the affinity notifier mechanism with stale information.

Avoid this by scheduling affinity change notification work for interrupts that were affined to the CPU being offlined, if the new target CPU is not part of the original affinity mask.

Since irq_set_affinity_locked() uses the same logic to schedule affinity change notification work, split out this logic into a dedicated function and use that at both places.

[ tglx: Removed the EXPORT(), removed the !SMP stub, moved the prototype,
added a lockdep assert instead of a comment, fixed up coding style and name space. Polished and clarified the change log ]

---
 kernel/irq/cpuhotplug.c |  6 ++++--
 kernel/irq/internals.h  |  2 +-
 kernel/irq/manage.c     | 26 ++++++++++++++++++--------
 3 files changed, 23 insertions(+), 11 deletions(-)
kernel/irq/cpuhotplug.c +4 -2
index 755346ea98196..cd5689e383b00 100644
@@ -177,9 +177,11 @@ void irq_migrate_all_off_this_cpu(void)
 		bool affinity_broken;
 
 		desc = irq_to_desc(irq);
-		scoped_guard(raw_spinlock, &desc->lock)
+		scoped_guard(raw_spinlock, &desc->lock) {
 			affinity_broken = migrate_one_irq(desc);
-
+			if (affinity_broken && desc->affinity_notify)
+				irq_affinity_schedule_notify_work(desc);
+		}
 		if (affinity_broken) {
 			pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n",
 					    irq, smp_processor_id());
kernel/irq/internals.h +1 -1
index 0164ca48da59e..5568ed3a8b852 100644
@@ -135,6 +135,7 @@ extern bool irq_can_set_affinity_usr(unsigned int irq);
 
 extern int irq_do_set_affinity(struct irq_data *data,
 			       const struct cpumask *dest, bool force);
+extern void irq_affinity_schedule_notify_work(struct irq_desc *desc);
 
 #ifdef CONFIG_SMP
 extern int irq_setup_affinity(struct irq_desc *desc);
@@ -142,7 +143,6 @@ extern int irq_setup_affinity(struct irq_desc *desc);
 static inline int irq_setup_affinity(struct irq_desc *desc) { return 0; }
 #endif
 
-
 #define for_each_action_of_desc(desc, act)			\
 	for (act = desc->action; act; act = act->next)
 
kernel/irq/manage.c +18 -8
index 349ae7979da0e..4873b0f73df96 100644
@@ -347,6 +347,21 @@ static bool irq_set_affinity_deactivated(struct irq_data *data,
 	return true;
 }
 
+/**
+ * irq_affinity_schedule_notify_work - Schedule work to notify about affinity change
+ * @desc:  Interrupt descriptor whose affinity changed
+ */
+void irq_affinity_schedule_notify_work(struct irq_desc *desc)
+{
+	lockdep_assert_held(&desc->lock);
+
+	kref_get(&desc->affinity_notify->kref);
+	if (!schedule_work(&desc->affinity_notify->work)) {
+		/* Work was already scheduled, drop our extra ref */
+		kref_put(&desc->affinity_notify->kref, desc->affinity_notify->release);
+	}
+}
+
 int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
 			    bool force)
 {
@@ -367,14 +382,9 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
 		irq_copy_pending(desc, mask);
 	}
 
-	if (desc->affinity_notify) {
-		kref_get(&desc->affinity_notify->kref);
-		if (!schedule_work(&desc->affinity_notify->work)) {
-			/* Work was already scheduled, drop our extra ref */
-			kref_put(&desc->affinity_notify->kref,
-				 desc->affinity_notify->release);
-		}
-	}
+	if (desc->affinity_notify)
+		irq_affinity_schedule_notify_work(desc);
+
 	irqd_set(data, IRQD_AFFINITY_SET);
 
 	return ret;
Signature · 1 line
2.51.0
author maintainer
#108 lore raw

PATCH 101/844 bpf: Properly mark live registers for indirect jumps

In reply to Sasha Levin

From: Anton Protopopov <[email protected]>

[ Upstream commit d1aab1ca576c90192ba961094d51b0be6355a4d6 ]

For a gotox rX instruction the rX register should be marked as used in the compute_insn_live_regs() function. Fix this.

---
 kernel/bpf/verifier.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/bpf/verifier.c +6 -0
index 1999b8d244f64..783d984d7884d 100644
@@ -24852,6 +24852,12 @@ static void compute_insn_live_regs(struct bpf_verifier_env *env,
 	case BPF_JMP32:
 		switch (code) {
 		case BPF_JA:
+			def = 0;
+			if (BPF_SRC(insn->code) == BPF_X)
+				use = dst;
+			else
+				use = 0;
+			break;
 		case BPF_JCOND:
 			def = 0;
 			use = 0;
Signature · 1 line
2.51.0
author maintainer
#109 lore raw

PATCH 102/844 perf/core: Fix slow perf_event_task_exit() with LBR callstacks

In reply to Sasha Levin

From: Namhyung Kim <[email protected]>

[ Upstream commit 4960626f956d63dce57f099016c2ecbe637a8229 ]

I got a report that a task is stuck in perf_event_exit_task() waiting for global_ctx_data_rwsem. On large systems with lots threads, it'd have performance issues when it grabs the lock to iterate all threads in the system to allocate the context data.

And it'd block task exit path which is problematic especially under memory pressure.

perf_event_open
perf_event_alloc
attach_perf_ctx_data
attach_global_ctx_data
percpu_down_write (global_ctx_data_rwsem)
for_each_process_thread
alloc_task_ctx_data
do_exit
perf_event_exit_task
percpu_down_read (global_ctx_data_rwsem)

It should not hold the global_ctx_data_rwsem on the exit path. Let's skip allocation for exiting tasks and free the data carefully.

---
 kernel/events/core.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
kernel/events/core.c +18 -2
index 8cca800946248..69c56cad88a89 100644
@@ -5280,9 +5280,20 @@ attach_task_ctx_data(struct task_struct *task, struct kmem_cache *ctx_cache,
 		return -ENOMEM;
 
 	for (;;) {
-		if (try_cmpxchg((struct perf_ctx_data **)&task->perf_ctx_data, &old, cd)) {
+		if (try_cmpxchg(&task->perf_ctx_data, &old, cd)) {
 			if (old)
 				perf_free_ctx_data_rcu(old);
+			/*
+			 * Above try_cmpxchg() pairs with try_cmpxchg() from
+			 * detach_task_ctx_data() such that
+			 * if we race with perf_event_exit_task(), we must
+			 * observe PF_EXITING.
+			 */
+			if (task->flags & PF_EXITING) {
+				/* detach_task_ctx_data() may free it already */
+				if (try_cmpxchg(&task->perf_ctx_data, &cd, NULL))
+					perf_free_ctx_data_rcu(cd);
+			}
 			return 0;
 		}
 
@@ -5328,6 +5339,8 @@ attach_global_ctx_data(struct kmem_cache *ctx_cache)
 	/* Allocate everything */
 	scoped_guard (rcu) {
 		for_each_process_thread(g, p) {
+			if (p->flags & PF_EXITING)
+				continue;
 			cd = rcu_dereference(p->perf_ctx_data);
 			if (cd && !cd->global) {
 				cd->global = 1;
@@ -14294,8 +14307,11 @@ void perf_event_exit_task(struct task_struct *task)
 
 	/*
 	 * Detach the perf_ctx_data for the system-wide event.
+	 *
+	 * Done without holding global_ctx_data_rwsem; typically
+	 * attach_global_ctx_data() will skip over this task, but otherwise
+	 * attach_task_ctx_data() will observe PF_EXITING.
 	 */
-	guard(percpu_read)(&global_ctx_data_rwsem);
 	detach_task_ctx_data(task);
 }
 
Signature · 1 line
2.51.0
author maintainer
#110 lore raw

PATCH 103/844 arm64/ftrace,bpf: Fix partial regs after bpf_prog_run

In reply to Sasha Levin

From: Jiri Olsa <[email protected]>

[ Upstream commit 276f3b6daf6024ae2742afd161e7418a5584a660 ]

Mahe reported issue with bpf_override_return helper not working when executed from kprobe.multi bpf program on arm.

The problem is that on arm we use alternate storage for pt_regs object that is passed to bpf_prog_run and if any register is changed (which is the case of bpf_override_return) it's not propagated back to actual pt_regs object.

Fixing this by introducing and calling ftrace_partial_regs_update function to propagate the values of changed registers (ip and stack).

---
 include/linux/ftrace_regs.h | 25 +++++++++++++++++++++++++
 kernel/trace/bpf_trace.c    |  1 +
 2 files changed, 26 insertions(+)
include/linux/ftrace_regs.h +25 -0
index 15627ceea9bcc..386fa48c4a957 100644
@@ -33,6 +33,31 @@ struct ftrace_regs;
 #define ftrace_regs_get_frame_pointer(fregs) \
 	frame_pointer(&arch_ftrace_regs(fregs)->regs)
 
+static __always_inline void
+ftrace_partial_regs_update(struct ftrace_regs *fregs, struct pt_regs *regs) { }
+
+#else
+
+/*
+ * ftrace_partial_regs_update - update the original ftrace_regs from regs
+ * @fregs: The ftrace_regs to update from @regs
+ * @regs: The partial regs from ftrace_partial_regs() that was updated
+ *
+ * Some architectures have the partial regs living in the ftrace_regs
+ * structure, whereas other architectures need to make a different copy
+ * of the @regs. If a partial @regs is retrieved by ftrace_partial_regs() and
+ * if the code using @regs updates a field (like the instruction pointer or
+ * stack pointer) it may need to propagate that change to the original @fregs
+ * it retrieved the partial @regs from. Use this function to guarantee that
+ * update happens.
+ */
+static __always_inline void
+ftrace_partial_regs_update(struct ftrace_regs *fregs, struct pt_regs *regs)
+{
+	ftrace_regs_set_instruction_pointer(fregs, instruction_pointer(regs));
+	ftrace_regs_set_return_value(fregs, regs_return_value(regs));
+}
+
 #endif /* HAVE_ARCH_FTRACE_REGS */
 
 /* This can be overridden by the architectures */
kernel/trace/bpf_trace.c +1 -0
index 59c2394981c72..325579c7da260 100644
@@ -2564,6 +2564,7 @@ kprobe_multi_link_prog_run(struct bpf_kprobe_multi_link *link,
 	old_run_ctx = bpf_set_run_ctx(&run_ctx.session_ctx.run_ctx);
 	err = bpf_prog_run(link->link.prog, regs);
 	bpf_reset_run_ctx(old_run_ctx);
+	ftrace_partial_regs_update(fregs, bpf_kprobe_multi_pt_regs_ptr());
 	rcu_read_unlock();
 
  out:
Signature · 1 line
2.51.0
author maintainer
#111 lore raw

PATCH 104/844 clocksource/drivers/sh_tmu: Always leave device running after probe

In reply to Sasha Levin

From: Niklas Söderlund <[email protected]>

[ Upstream commit b1278972b08e480990e2789bdc6a7c918bc349be ]

The TMU device can be used as both a clocksource and a clockevent provider. The driver tries to be smart and power itself on and off, as well as enabling and disabling its clock when it's not in operation. This behavior is slightly altered if the TMU is used as an early platform device in which case the device is left powered on after probe, but the clock is still enabled and disabled at runtime.

This has worked for a long time, but recent improvements in PREEMPT_RT and PROVE_LOCKING have highlighted an issue. As the TMU registers itself as a clockevent provider, clockevents_register_device(), it needs to use raw spinlocks internally as this is the context of which the clockevent framework interacts with the TMU driver. However in the context of holding a raw spinlock the TMU driver can't really manage its power state or clock with calls to pm_runtime_*() and clk_*() as these calls end up in other platform drivers using regular spinlocks to control power and clocks.

This mix of spinlock contexts trips a lockdep warning.

    =============================
    [ BUG: Invalid wait context ]
    6.18.0-arm64-renesas-09926-gee959e7c5e34 #1 Not tainted
    -----------------------------
    swapper/0/0 is trying to lock:
    ffff000008c9e180 (&dev->power.lock){-...}-{3:3}, at: __pm_runtime_resume+0x38/0x88
    other info that might help us debug this:
    context-{5:5}
    1 lock held by swapper/0/0:
    ccree e6601000.crypto: ARM CryptoCell 630P Driver: HW version 0xAF400001/0xDCC63000, Driver version 5.0
     #0: ffff8000817ec298
    ccree e6601000.crypto: ARM ccree device initialized
     (tick_broadcast_lock){-...}-{2:2}, at: __tick_broadcast_oneshot_control+0xa4/0x3a8
    stack backtrace:
    CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.18.0-arm64-renesas-09926-gee959e7c5e34 #1 PREEMPT
    Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
    Call trace:
     show_stack+0x14/0x1c (C)
     dump_stack_lvl+0x6c/0x90
     dump_stack+0x14/0x1c
     __lock_acquire+0x904/0x1584
     lock_acquire+0x220/0x34c
     _raw_spin_lock_irqsave+0x58/0x80
     __pm_runtime_resume+0x38/0x88
     sh_tmu_clock_event_set_oneshot+0x84/0xd4
     clockevents_switch_state+0xfc/0x13c
     tick_broadcast_set_event+0x30/0xa4
     __tick_broadcast_oneshot_control+0x1e0/0x3a8
     tick_broadcast_oneshot_control+0x30/0x40
     cpuidle_enter_state+0x40c/0x680
     cpuidle_enter+0x30/0x40
     do_idle+0x1f4/0x280
     cpu_startup_entry+0x34/0x40
     kernel_init+0x0/0x130
     do_one_initcall+0x0/0x230
     __primary_switched+0x88/0x90

For non-PREEMPT_RT builds this is not really an issue, but for PREEMPT_RT builds where normal spinlocks can sleep this might be an issue. Be cautious and always leave the power and clock running after probe.

---
 drivers/clocksource/sh_tmu.c | 18 ------------------
 1 file changed, 18 deletions(-)
drivers/clocksource/sh_tmu.c +0 -18
index beffff81c00f3..3fc6ed9b56300 100644
@@ -143,16 +143,6 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_channel *ch, int start)
 
 static int __sh_tmu_enable(struct sh_tmu_channel *ch)
 {
-	int ret;
-
-	/* enable clock */
-	ret = clk_enable(ch->tmu->clk);
-	if (ret) {
-		dev_err(&ch->tmu->pdev->dev, "ch%u: cannot enable clock\n",
-			ch->index);
-		return ret;
-	}
-
 	/* make sure channel is disabled */
 	sh_tmu_start_stop_ch(ch, 0);
 
@@ -174,7 +164,6 @@ static int sh_tmu_enable(struct sh_tmu_channel *ch)
 	if (ch->enable_count++ > 0)
 		return 0;
 
-	pm_runtime_get_sync(&ch->tmu->pdev->dev);
 	dev_pm_syscore_device(&ch->tmu->pdev->dev, true);
 
 	return __sh_tmu_enable(ch);
@@ -187,9 +176,6 @@ static void __sh_tmu_disable(struct sh_tmu_channel *ch)
 
 	/* disable interrupts in TMU block */
 	sh_tmu_write(ch, TCR, TCR_TPSC_CLK4);
-
-	/* stop clock */
-	clk_disable(ch->tmu->clk);
 }
 
 static void sh_tmu_disable(struct sh_tmu_channel *ch)
@@ -203,7 +189,6 @@ static void sh_tmu_disable(struct sh_tmu_channel *ch)
 	__sh_tmu_disable(ch);
 
 	dev_pm_syscore_device(&ch->tmu->pdev->dev, false);
-	pm_runtime_put(&ch->tmu->pdev->dev);
 }
 
 static void sh_tmu_set_next(struct sh_tmu_channel *ch, unsigned long delta,
@@ -552,7 +537,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
 		goto err_clk_unprepare;
 
 	tmu->rate = clk_get_rate(tmu->clk) / 4;
-	clk_disable(tmu->clk);
 
 	/* Map the memory resource. */
 	ret = sh_tmu_map_memory(tmu);
@@ -626,8 +610,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
  out:
 	if (tmu->has_clockevent || tmu->has_clocksource)
 		pm_runtime_irq_safe(&pdev->dev);
-	else
-		pm_runtime_idle(&pdev->dev);
 
 	return 0;
 }
Signature · 1 line
2.51.0
author maintainer
#112 lore raw

PATCH 105/844 clocksource/drivers/timer-integrator-ap: Add missing Kconfig dependency on OF

In reply to Sasha Levin

From: Bartosz Golaszewski <[email protected]>

[ Upstream commit 2246464821e2820572e6feefca2029f17629cc50 ]

This driver accesses the of_aliases global variable declared in linux/of.h and defined in drivers/base/of.c. It requires OF support or will cause a link failure. Add the missing Kconfig dependency.

---
 drivers/clocksource/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/clocksource/Kconfig +1 -0
index aa59e5b133510..fd91127065454 100644
@@ -254,6 +254,7 @@ config KEYSTONE_TIMER
 
 config INTEGRATOR_AP_TIMER
 	bool "Integrator-AP timer driver" if COMPILE_TEST
+	depends on OF
 	select CLKSRC_MMIO
 	help
 	  Enables support for the Integrator-AP timer.
Signature · 1 line
2.51.0
author maintainer
#113 lore raw

PATCH 106/844 PCI/MSI: Unmap MSI-X region on error

In reply to Sasha Levin

From: Haoxiang Li <[email protected]>

[ Upstream commit 1a8d4c6ecb4c81261bcdf13556abd4a958eca202 ]

msix_capability_init() fails to unmap the MSI-X region if msix_setup_interrupts() fails.

Add the missing iounmap() for that error path.

[ tglx: Massaged change log ]

---
 drivers/pci/msi/msi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/msi/msi.c +3 -1
index 34d664139f48f..e010ecd9f90dd 100644
@@ -737,7 +737,7 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
 
 	ret = msix_setup_interrupts(dev, entries, nvec, affd);
 	if (ret)
-		goto out_disable;
+		goto out_unmap;
 
 	/* Disable INTX */
 	pci_intx_for_msi(dev, 0);
@@ -758,6 +758,8 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
 	pcibios_free_irq(dev);
 	return 0;
 
+out_unmap:
+	iounmap(dev->msix_base);
 out_disable:
 	dev->msix_enabled = 0;
 	pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);
Signature · 1 line
2.51.0
author maintainer
#114 lore raw

PATCH 107/844 bpftool: Fix dependencies for static build

In reply to Sasha Levin

From: Ihor Solodrai <[email protected]>

[ Upstream commit 08a7491843224f8b96518fbe70d9e48163046054 ]

When building selftests/bpf with EXTRA_LDFLAGS=-static the follwoing error happens:

LINK /ws/linux/tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-dso_dlfcn.o): in function `dlfcn_globallookup':
[...]
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-c_zlib.o): in function `zlib_oneshot_expand_block':
(.text+0xc64): undefined reference to `uncompress'
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-c_zlib.o): in function `zlib_oneshot_compress_block':
(.text+0xce4): undefined reference to `compress'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:252: /ws/linux/tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool] Error 1
make: *** [Makefile:327: /ws/linux/tools/testing/selftests/bpf/tools/sbin/bpftool] Error 2
make: *** Waiting for unfinished jobs....

This is caused by wrong order of dependencies in the Makefile. Fix it.

---
 tools/bpf/bpftool/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/bpf/bpftool/Makefile +2 -2
index 5442073a2e428..519ea5cb8ab1c 100644
@@ -130,8 +130,8 @@ include $(FEATURES_DUMP)
 endif
 endif
 
-LIBS = $(LIBBPF) -lelf -lz -lcrypto
-LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz -lcrypto
+LIBS = $(LIBBPF) -lelf -lcrypto -lz
+LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lcrypto -lz
 
 ifeq ($(feature-libelf-zstd),1)
 LIBS += -lzstd
Signature · 1 line
2.51.0
author maintainer
#115 lore raw

PATCH 108/844 crypto: hisilicon/qm - move the barrier before writing to the mailbox register

In reply to Sasha Levin

From: Chenghai Huang <[email protected]>

[ Upstream commit ebf35d8f9368816c930f5d70783a72716fab5e19 ]

Before sending the data via the mailbox to the hardware, to ensure that the data accessed by the hardware is the most up-to-date, a write barrier should be added before writing to the mailbox register. The current memory barrier is placed after writing to the register, the barrier order should be modified to be before writing to the register.

---
 drivers/crypto/hisilicon/qm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/crypto/hisilicon/qm.c +5 -1
index b8e59f99f7007..cf58d0d01b199 100644
@@ -609,9 +609,13 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src)
 	}
 
 #if IS_ENABLED(CONFIG_ARM64)
+	/*
+	 * The dmb oshst instruction ensures that the data in the
+	 * mailbox is written before it is sent to the hardware.
+	 */
 	asm volatile("ldp %0, %1, %3\n"
-		     "stp %0, %1, %2\n"
 		     "dmb oshst\n"
+		     "stp %0, %1, %2\n"
 		     : "=&r" (tmp0),
 		       "=&r" (tmp1),
 		       "+Q" (*((char __iomem *)fun_base))
Signature · 1 line
2.51.0
author maintainer
#116 lore raw

PATCH 109/844 mailbox: bcm-ferxrm-mailbox: Use default primary handler

In reply to Sasha Levin

From: Sebastian Andrzej Siewior <[email protected]>

[ Upstream commit 03843d95a4a4e0ba22ad4fcda65ccf21822b104c ]

request_threaded_irq() is invoked with a primary and a secondary handler and no flags are passed. The primary handler is the same as irq_default_primary_handler() so there is no need to have an identical copy.

The lack of the IRQF_ONESHOT flag can be dangerous because the interrupt source is not masked while the threaded handler is active. This means, especially on LEVEL typed interrupt lines, the interrupt can fire again before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

---
 drivers/mailbox/bcm-flexrm-mailbox.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/mailbox/bcm-flexrm-mailbox.c +2 -12
index 41f79e51d9e5a..4255fefc3a5a0 100644
@@ -1173,14 +1173,6 @@ static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
 
 /* ====== FlexRM interrupt handler ===== */
 
-static irqreturn_t flexrm_irq_event(int irq, void *dev_id)
-{
-	/* We only have MSI for completions so just wakeup IRQ thread */
-	/* Ring related errors will be informed via completion descriptors */
-
-	return IRQ_WAKE_THREAD;
-}
-
 static irqreturn_t flexrm_irq_thread(int irq, void *dev_id)
 {
 	flexrm_process_completions(dev_id);
@@ -1271,10 +1263,8 @@ static int flexrm_startup(struct mbox_chan *chan)
 		ret = -ENODEV;
 		goto fail_free_cmpl_memory;
 	}
-	ret = request_threaded_irq(ring->irq,
-				   flexrm_irq_event,
-				   flexrm_irq_thread,
-				   0, dev_name(ring->mbox->dev), ring);
+	ret = request_threaded_irq(ring->irq, NULL, flexrm_irq_thread,
+				   IRQF_ONESHOT, dev_name(ring->mbox->dev), ring);
 	if (ret) {
 		dev_err(ring->mbox->dev,
 			"failed to request ring%d IRQ\n", ring->num);
Signature · 1 line
2.51.0
author maintainer
#117 lore raw

PATCH 110/844 char: tpm: cr50: Remove IRQF_ONESHOT

In reply to Sasha Levin

From: Sebastian Andrzej Siewior <[email protected]>

[ Upstream commit 1affd29ffbd50125a5492c6be1dbb1f04be18d4f ]

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.

The flag also prevents force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

---
 drivers/char/tpm/tpm_tis_i2c_cr50.c | 3 +--
 drivers/char/tpm/tpm_tis_spi_cr50.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm_tis_i2c_cr50.c +1 -2
index fc6891a0b6936..b48cacacc0664 100644
@@ -749,8 +749,7 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
 
 	if (client->irq > 0) {
 		rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
-				      IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
-				      IRQF_NO_AUTOEN,
+				      IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
 				      dev->driver->name, chip);
 		if (rc < 0) {
 			dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
drivers/char/tpm/tpm_tis_spi_cr50.c +1 -1
index f4937280e9406..32920b4cecfb4 100644
@@ -287,7 +287,7 @@ int cr50_spi_probe(struct spi_device *spi)
 	if (spi->irq > 0) {
 		ret = devm_request_irq(&spi->dev, spi->irq,
 				       cr50_spi_irq_handler,
-				       IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				       IRQF_TRIGGER_RISING,
 				       "cr50_spi", cr50_phy);
 		if (ret < 0) {
 			if (ret == -EPROBE_DEFER)
Signature · 1 line
2.51.0
author maintainer
#118 lore raw

PATCH 111/844 sched/debug: Fix updating of ppos on server write ops

In reply to Sasha Levin

From: Joel Fernandes <[email protected]>

[ Upstream commit 6080fb211672aec6ce8f2f5a2e0b4eae736f2027 ]

Updating "ppos" on error conditions does not make much sense. The pattern is to return the error code directly without modifying the position, or modify the position on success and return the number of bytes written.

Since on success, the return value of apply is 0, there is no point in modifying ppos either. Fix it by removing all this and just returning error code or number of bytes written on success.

---
 kernel/sched/debug.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
kernel/sched/debug.c +4 -3
index 41caa22e0680a..93f009e1076d8 100644
@@ -345,8 +345,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
 	long cpu = (long) ((struct seq_file *) filp->private_data)->private;
 	struct rq *rq = cpu_rq(cpu);
 	u64 runtime, period;
+	int retval = 0;
 	size_t err;
-	int retval;
 	u64 value;
 
 	err = kstrtoull_from_user(ubuf, cnt, 10, &value);
@@ -380,8 +380,6 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
 		dl_server_stop(&rq->fair_server);
 
 		retval = dl_server_apply_params(&rq->fair_server, runtime, period, 0);
-		if (retval)
-			cnt = retval;
 
 		if (!runtime)
 			printk_deferred("Fair server disabled in CPU %d, system may crash due to starvation.\n",
@@ -389,6 +387,9 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
 
 		if (rq->cfs.h_nr_queued)
 			dl_server_start(&rq->fair_server);
+
+		if (retval < 0)
+			return retval;
 	}
 
 	*ppos += cnt;
Signature · 1 line
2.51.0
author maintainer
#119 lore raw

PATCH 112/844 pstore: ram_core: fix incorrect success return when vmap() fails

In reply to Sasha Levin

From: Ruipeng Qi <[email protected]>

[ Upstream commit 05363abc7625cf18c96e67f50673cd07f11da5e9 ]

In persistent_ram_vmap(), vmap() may return NULL on failure.

If offset is non-zero, adding offset_in_page(start) causes the function to return a non-NULL pointer even though the mapping failed. persistent_ram_buffer_map() therefore incorrectly returns success.

Subsequent access to prz->buffer may dereference an invalid address and cause crashes.

Add proper NULL checking for vmap() failures.

---
 fs/pstore/ram_core.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/pstore/ram_core.c +7 -0
index c9eaacdec37e4..7b6d6378a3b87 100644
@@ -457,6 +457,13 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,
 	vaddr = vmap(pages, page_count, VM_MAP | VM_IOREMAP, prot);
 	kfree(pages);
 
+	/*
+	 * vmap() may fail and return NULL. Do not add the offset in this
+	 * case, otherwise a NULL mapping would appear successful.
+	 */
+	if (!vaddr)
+		return NULL;
+
 	/*
 	 * Since vmap() uses page granularity, we must add the offset
 	 * into the page here, to get the byte granularity address
Signature · 1 line
2.51.0
author maintainer
#120 lore raw

PATCH 113/844 firmware: arm_ffa: Unmap Rx/Tx buffers on init failure

In reply to Sasha Levin

From: Haoxiang Li <[email protected]>

[ Upstream commit 9fda364cb78c8b9e1abe4029f877300c94655742 ]

ffa_init() maps the Rx/Tx buffers via ffa_rxtx_map() but on the partition setup failure path it never unmaps them.

Add the missing ffa_rxtx_unmap() call in the error path so that the Rx/Tx buffers are properly released before freeing the backing pages.

Message-Id: <[email protected]>

---
 drivers/firmware/arm_ffa/driver.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/arm_ffa/driver.c +1 -0
index c501c3104b3a4..11a702e7f641c 100644
@@ -2093,6 +2093,7 @@ static int __init ffa_init(void)
 
 	pr_err("failed to setup partitions\n");
 	ffa_notifications_cleanup();
+	ffa_rxtx_unmap(drv_info->vm_id);
 free_pages:
 	if (drv_info->tx_buffer)
 		free_pages_exact(drv_info->tx_buffer, rxtx_bufsz);
Signature · 1 line
2.51.0
author maintainer
#121 lore raw

PATCH 114/844 Revert "arm64: zynqmp: Add an OP-TEE node to the device tree"

In reply to Sasha Levin

From: Tomas Melin <[email protected]>

[ Upstream commit c197179990124f991fca220d97fac56779a02c6d ]

This reverts commit 06d22ed6b6635b17551f386b50bb5aaff9b75fbe.

OP-TEE logic in U-Boot automatically injects a reserved-memory node along with optee firmware node to kernel device tree. The injection logic is dependent on that there is no manually defined optee node. Having the node in zynqmp.dtsi effectively breaks OP-TEE's insertion of the reserved-memory node, causing memory access violations during runtime.

---
 arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 5 -----
 1 file changed, 5 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp.dtsi +0 -5
index 938b014ca9231..b55c6b2e8e0e1 100644
@@ -192,11 +192,6 @@ psci {
 	};
 
 	firmware {
-		optee: optee  {
-			compatible = "linaro,optee-tz";
-			method = "smc";
-		};
-
 		zynqmp_firmware: zynqmp-firmware {
 			compatible = "xlnx,zynqmp-firmware";
 			#power-domain-cells = <1>;
Signature · 1 line
2.51.0
author maintainer
#122 lore raw

PATCH 115/844 EDAC/igen6: Add more Intel Panther Lake-H SoCs support

In reply to Sasha Levin

From: Lili Li <[email protected]>

[ Upstream commit 4c36e6106997b6ad8f4a279b4bdbca3ed6f53c6c ]

Add more Intel Panther Lake-H SoC compute die IDs for EDAC support.

---
 drivers/edac/igen6_edac.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/edac/igen6_edac.c +20 -0
index 553c31a2d9226..839b6dd3629e9 100644
@@ -274,6 +274,16 @@ static struct work_struct ecclog_work;
 #define DID_PTL_H_SKU1	0xb000
 #define DID_PTL_H_SKU2	0xb001
 #define DID_PTL_H_SKU3	0xb002
+#define DID_PTL_H_SKU4	0xb003
+#define DID_PTL_H_SKU5	0xb004
+#define DID_PTL_H_SKU6	0xb005
+#define DID_PTL_H_SKU7	0xb008
+#define DID_PTL_H_SKU8	0xb011
+#define DID_PTL_H_SKU9	0xb014
+#define DID_PTL_H_SKU10	0xb015
+#define DID_PTL_H_SKU11	0xb028
+#define DID_PTL_H_SKU12	0xb029
+#define DID_PTL_H_SKU13	0xb02a
 
 /* Compute die IDs for Wildcat Lake with IBECC */
 #define DID_WCL_SKU1	0xfd00
@@ -636,6 +646,16 @@ static struct pci_device_id igen6_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU1), (kernel_ulong_t)&mtl_p_cfg },
 	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU2), (kernel_ulong_t)&mtl_p_cfg },
 	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU3), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU4), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU5), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU6), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU7), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU8), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU9), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU10), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU11), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU12), (kernel_ulong_t)&mtl_p_cfg },
+	{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU13), (kernel_ulong_t)&mtl_p_cfg },
 	{ PCI_VDEVICE(INTEL, DID_WCL_SKU1), (kernel_ulong_t)&wcl_cfg },
 	{ },
 };
Signature · 1 line
2.51.0
author maintainer
#123 lore raw

PATCH 116/844 EDAC/igen6: Add two Intel Amston Lake SoCs support

In reply to Sasha Levin

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit 41ca2155d62b0b0d217f59e1bce18362d0c2446f ]

Intel Amston Lake SoCs with IBECC (In-Band ECC) capability share the same IBECC registers as Alder Lake-N SoCs. Add two new compute die IDs for Amston Lake SoC products to enable EDAC support.

---
 drivers/edac/igen6_edac.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/edac/igen6_edac.c +4 -0
index 839b6dd3629e9..f2c9270c1893c 100644
@@ -246,6 +246,8 @@ static struct work_struct ecclog_work;
 
 /* Compute did IDs for Amston Lake with IBECC */
 #define DID_ASL_SKU1	0x464a
+#define DID_ASL_SKU2	0x4646
+#define DID_ASL_SKU3	0x4652
 
 /* Compute die IDs for Raptor Lake-P with IBECC */
 #define DID_RPL_P_SKU1	0xa706
@@ -628,6 +630,8 @@ static struct pci_device_id igen6_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, DID_ADL_N_SKU12), (kernel_ulong_t)&adl_n_cfg },
 	{ PCI_VDEVICE(INTEL, DID_AZB_SKU1), (kernel_ulong_t)&adl_n_cfg },
 	{ PCI_VDEVICE(INTEL, DID_ASL_SKU1), (kernel_ulong_t)&adl_n_cfg },
+	{ PCI_VDEVICE(INTEL, DID_ASL_SKU2), (kernel_ulong_t)&adl_n_cfg },
+	{ PCI_VDEVICE(INTEL, DID_ASL_SKU3), (kernel_ulong_t)&adl_n_cfg },
 	{ PCI_VDEVICE(INTEL, DID_RPL_P_SKU1), (kernel_ulong_t)&rpl_p_cfg },
 	{ PCI_VDEVICE(INTEL, DID_RPL_P_SKU2), (kernel_ulong_t)&rpl_p_cfg },
 	{ PCI_VDEVICE(INTEL, DID_RPL_P_SKU3), (kernel_ulong_t)&rpl_p_cfg },
Signature · 1 line
2.51.0
author maintainer
#124 lore raw

PATCH 117/844 arm64: tegra: smaug: Add usb-role-switch support

In reply to Sasha Levin

From: Diogo Ivo <[email protected]>

[ Upstream commit dfa93788dd8b2f9c59adf45ecf592082b1847b7b ]

The USB2 port on Smaug is configured for OTG operation but lacked the required 'usb-role-switch' property, leading to a failed probe and a non-functioning USB port. Add the property along with setting the default role to host.

---
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/nvidia/tegra210-smaug.dts +2 -0
index 5aa6afd56cbc6..dfbd1c72388c1 100644
@@ -1809,6 +1809,8 @@ usb2-0 {
 				status = "okay";
 				vbus-supply = <&usbc_vbus>;
 				mode = "otg";
+				usb-role-switch;
+				role-switch-default-mode = "host";
 			};
 
 			usb3-0 {
Signature · 1 line
2.51.0