From 3e5ba97c181e32ca9b810414272b57bb7600998e Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:35 -0700 Subject: [PATCH 001/250] efi/runtime-wrappers: factor out efi_rts_park_worker() x86's efi_crash_gracefully_on_page_fault() ends in an infinite schedule() loop so the kworker that faulted in firmware never runs efi_rts_wq again. A later change needs the same "park this worker forever" primitive on the runtime service timeout path, so factor the loop into a shared efi_rts_park_worker() and call it from the x86 page-fault handler. No functional change. Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 9 +-------- drivers/firmware/efi/runtime-wrappers.c | 13 +++++++++++++ include/linux/efi.h | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 90a065fcb1fab2..02c56a02eb9bc4 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -832,12 +832,5 @@ void efi_crash_gracefully_on_page_fault(unsigned long phys_addr, clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); pr_info("Froze efi_rts_wq and disabled EFI Runtime Services\n"); - /* - * Call schedule() in an infinite loop, so that any spurious wake ups - * will never run efi_rts_wq again. - */ - for (;;) { - set_current_state(TASK_IDLE); - schedule(); - } + efi_rts_park_worker(); } diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index da8d2962164410..a1e46ab0036683 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -211,6 +211,19 @@ static struct task_struct *efi_runtime_lock_owner; extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock); #endif +/* + * Park a worker that must never run efi_rts_wq again: EFI runtime services + * have been disabled and its efi_rts_work is abandoned. Loop in schedule() + * so a spurious wakeup cannot resume it. + */ +void efi_rts_park_worker(void) +{ + for (;;) { + set_current_state(TASK_IDLE); + schedule(); + } +} + /* * Calls the appropriate efi_runtime_service() with the appropriate * arguments. diff --git a/include/linux/efi.h b/include/linux/efi.h index 24221a8424121b..015505423277ea 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1256,6 +1256,8 @@ extern struct efi_runtime_work efi_rts_work; /* Workqueue to queue EFI Runtime Services */ extern struct workqueue_struct *efi_rts_wq; +void efi_rts_park_worker(void); + struct linux_efi_memreserve { int size; // allocated size of the array atomic_t count; // number of entries used From cd856d1ef1b62baef990c22d98d10b4aec681db1 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:36 -0700 Subject: [PATCH 002/250] efi/runtime-wrappers: handle queue_work() failure with goto exit Convert the queue_work() failure path in __efi_queue_work() to a goto exit instead of falling through to the wait and the WARN_ON_ONCE(status == EFI_ABORTED) below it. A failed queue_work() leaves the status at its initial EFI_ABORTED, so that warning would fire even though no call ran; it is meant for a completed call that returned EFI_ABORTED. No change for the common (successful enqueue) path. This also prepares __efi_queue_work() for the timeout handling added later. Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index a1e46ab0036683..13857e5291b916 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -351,10 +351,12 @@ static efi_status_t __efi_queue_work(enum efi_rts_ids id, * queue_work() returns 0 if work was already on queue, * _ideally_ this should never happen. */ - if (queue_work(efi_rts_wq, &efi_rts_work.work)) - wait_for_completion(&efi_rts_work.efi_rts_comp); - else + if (!queue_work(efi_rts_wq, &efi_rts_work.work)) { pr_err("Failed to queue work to efi_rts_wq.\n"); + goto exit; + } + + wait_for_completion(&efi_rts_work.efi_rts_comp); WARN_ON_ONCE(efi_rts_work.status == EFI_ABORTED); exit: From 690ab48d353e00648c02166864d375d5e2d7689d Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:37 -0700 Subject: [PATCH 003/250] efi/runtime-wrappers: check EFI_RUNTIME_SERVICES before using efi_rts_work Move the EFI_RUNTIME_SERVICES check to the top of __efi_queue_work() and return directly, so a caller that finds runtime services disabled returns without touching the shared efi_rts_work. No functional change. This prepares for bounding the wait, where a timeout will clear EFI_RUNTIME_SERVICES while the leaked worker still owns efi_rts_work; a later caller must then bail out before reinitialising it. Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 13857e5291b916..ae974edc0b04ec 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -333,17 +333,16 @@ static void __nocfi efi_call_rts(struct work_struct *work) static efi_status_t __efi_queue_work(enum efi_rts_ids id, union efi_rts_args *args) { + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + pr_warn_once("EFI Runtime Services are disabled!\n"); + return EFI_DEVICE_ERROR; + } + efi_rts_work.efi_rts_id = id; efi_rts_work.args = args; efi_rts_work.caller = __builtin_return_address(0); efi_rts_work.status = EFI_ABORTED; - if (!efi_enabled(EFI_RUNTIME_SERVICES)) { - pr_warn_once("EFI Runtime Services are disabled!\n"); - efi_rts_work.status = EFI_DEVICE_ERROR; - goto exit; - } - init_completion(&efi_rts_work.efi_rts_comp); INIT_WORK(&efi_rts_work.work, efi_call_rts); From 9de683dabde3e15717587252ba52231f93ac537a Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:38 -0700 Subject: [PATCH 004/250] efi/runtime-wrappers: bound the wait for EFI runtime service calls When an EFI runtime service hangs in firmware, the efi_rts_wq worker is stuck inside the call and cannot be cancelled. __efi_queue_work() then waits on the completion forever while holding efi_runtime_lock, so every later EFI caller is wedged until reboot; the only symptom is a "workqueue lockup" and tasks piling up on the semaphore. Replace wait_for_completion() with wait_for_completion_timeout() bounded by EFI_RTS_TIMEOUT (120 seconds). On timeout, clear EFI_RUNTIME_SERVICES and return EFI_ABORTED so later callers fail fast at the entry check instead of each paying another 120 seconds. The wedged worker is intentionally leaked and keeps ownership of efi_rts_work. A worker that only starts running after the timeout would otherwise dereference efi_rts_work.args, now pointing into the caller's freed stack frame, and hand stale pointers to firmware. Park it with efi_rts_park_worker() at the entry of efi_call_rts() when runtime services are already disabled, before it touches args or enters firmware. Known limitation: a worker already inside firmware when the timeout fires still holds efi_rts_args pointing into the caller's stack frame; if firmware unblocks afterwards and writes the output buffers, they land in reused memory. Firmware hung this long rarely recovers; a follow-up could bounce the buffers through kmalloc. Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index ae974edc0b04ec..2ec5cbdf46d07e 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -118,6 +118,14 @@ union efi_rts_args { struct efi_runtime_work efi_rts_work; +/* + * Upper bound on how long we wait for a single EFI runtime service + * call to finish before declaring firmware wedged. Chosen to be longer + * than any plausible legitimate call (including UpdateCapsule on slow + * SPI-NOR) while still bounding userspace wait time. + */ +#define EFI_RTS_TIMEOUT (120 * HZ) + /* * efi_queue_work: Queue EFI runtime service call and wait for completion * @_rts: EFI runtime service function identifier @@ -234,6 +242,9 @@ static void __nocfi efi_call_rts(struct work_struct *work) efi_status_t status = EFI_NOT_FOUND; unsigned long flags; + if (!efi_enabled(EFI_RUNTIME_SERVICES)) + efi_rts_park_worker(); + efi_runtime_lock_owner = current; arch_efi_call_virt_setup(); @@ -355,7 +366,13 @@ static efi_status_t __efi_queue_work(enum efi_rts_ids id, goto exit; } - wait_for_completion(&efi_rts_work.efi_rts_comp); + if (!wait_for_completion_timeout(&efi_rts_work.efi_rts_comp, + EFI_RTS_TIMEOUT)) { + pr_err("EFI runtime service %d wedged in firmware; disabling EFI runtime services\n", + id); + clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); + return EFI_ABORTED; + } WARN_ON_ONCE(efi_rts_work.status == EFI_ABORTED); exit: From ccb525c984a634491bde786c559ec1c819795924 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:39 -0700 Subject: [PATCH 005/250] efi/runtime-wrappers: honour EFI_RUNTIME_SERVICES in the non-blocking paths Three wrappers call firmware directly instead of going through __efi_queue_work(), and none of them check whether runtime services are still enabled: virt_efi_set_variable_nb(), virt_efi_query_variable_info_nb() and virt_efi_reset_system(). Once a hang has cleared EFI_RUNTIME_SERVICES - or efi_recover_from_page_fault() has cleared it on a firmware page fault - these paths still enter the (possibly wedged) firmware, e.g. an EFI pstore write through the non-blocking SetVariable() variant, in violation of UEFI's non-reentrancy rules. reset_system() is reachable too: efi_reboot() only gates it on the static efi_rt_services_supported() mask, which does not track the runtime disable. Check efi_enabled(EFI_RUNTIME_SERVICES) in each before calling into firmware. Test it after taking efi_runtime_lock rather than before: the bit is only ever cleared at runtime while that lock is held, so checking it under the lock avoids racing with a concurrent timeout that clears the bit and drops the lock. Suggested-by: Ard Biesheuvel Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 2ec5cbdf46d07e..2b0a7caf90944a 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -480,6 +480,11 @@ virt_efi_set_variable_nb(efi_char16_t *name, efi_guid_t *vendor, u32 attr, if (down_trylock(&efi_runtime_lock)) return EFI_NOT_READY; + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + up(&efi_runtime_lock); + return EFI_DEVICE_ERROR; + } + efi_runtime_lock_owner = current; status = efi_call_virt_pointer(efi.runtime, set_variable, name, vendor, attr, data_size, data); @@ -519,6 +524,11 @@ virt_efi_query_variable_info_nb(u32 attr, u64 *storage_space, if (down_trylock(&efi_runtime_lock)) return EFI_NOT_READY; + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + up(&efi_runtime_lock); + return EFI_DEVICE_ERROR; + } + efi_runtime_lock_owner = current; status = efi_call_virt_pointer(efi.runtime, query_variable_info, attr, storage_space, remaining_space, @@ -549,6 +559,12 @@ virt_efi_reset_system(int reset_type, efi_status_t status, return; } + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + pr_warn("EFI Runtime Services are disabled, not invoking reset_system()\n"); + up(&efi_runtime_lock); + return; + } + efi_runtime_lock_owner = current; arch_efi_call_virt_setup(); efi_rts_work.efi_rts_id = EFI_RESET_SYSTEM; From cf790fdb851867532b9a0f88588dcce648dbffe9 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 16 Jun 2026 05:09:40 -0700 Subject: [PATCH 006/250] efi/runtime-wrappers: retire the worker if a wedged call ever returns When __efi_queue_work() times out it disables runtime services and returns, but the kworker is still blocked inside firmware. If the firmware eventually unblocks, efi_call_rts() would run its tail on an efi_rts_work that the timed-out caller has long abandoned: signalling a stale completion and clearing efi_runtime_lock_owner that may by then belong to another caller. If runtime services have been disabled by the time the call returns, park the worker with efi_rts_park_worker() instead, so it never touches efi_rts_work again or returns to the workqueue. Suggested-by: Ard Biesheuvel Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 2b0a7caf90944a..591a725b106131 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -336,6 +336,9 @@ static void __nocfi efi_call_rts(struct work_struct *work) efi_call_virt_check_flags(flags, efi_rts_work.caller); arch_efi_call_virt_teardown(); + if (!efi_enabled(EFI_RUNTIME_SERVICES)) + efi_rts_park_worker(); + efi_rts_work.status = status; complete(&efi_rts_work.efi_rts_comp); efi_runtime_lock_owner = NULL; From 9633e384bff9acb91e3ec8a05933fb358d53fa4f Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 13 Jul 2026 06:06:47 -0700 Subject: [PATCH 007/250] efi/runtime-wrappers: mark efi_rts_park_worker() as __noreturn efi_rts_park_worker() loops in schedule() forever and never returns, but it is not annotated as such. When efi_crash_gracefully_on_page_fault() calls it, objtool cannot tell the call is a dead end and warns about the unreachable code that follows it: vmlinux.o: warning: objtool: efi_crash_gracefully_on_page_fault+0xc3: efi_rts_park_worker() missing __noreturn in .c/.h or NORETURN() in noreturns.h Mark both the declaration and the definition __noreturn, and add the function to objtool's noreturn list. Fixes: 3e5ba97c181e ("efi/runtime-wrappers: factor out efi_rts_park_worker()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202607100848.iWPxdkhX-lkp@intel.com/ Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 2 +- include/linux/efi.h | 2 +- tools/objtool/noreturns.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 591a725b106131..6f42da11a91783 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -224,7 +224,7 @@ extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock); * have been disabled and its efi_rts_work is abandoned. Loop in schedule() * so a spurious wakeup cannot resume it. */ -void efi_rts_park_worker(void) +void __noreturn efi_rts_park_worker(void) { for (;;) { set_current_state(TASK_IDLE); diff --git a/include/linux/efi.h b/include/linux/efi.h index 015505423277ea..b3c83516593d1d 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1256,7 +1256,7 @@ extern struct efi_runtime_work efi_rts_work; /* Workqueue to queue EFI Runtime Services */ extern struct workqueue_struct *efi_rts_wq; -void efi_rts_park_worker(void); +void __noreturn efi_rts_park_worker(void); struct linux_efi_memreserve { int size; // allocated size of the array diff --git a/tools/objtool/noreturns.h b/tools/objtool/noreturns.h index 14f8ab653449c4..0e9dfd0a2446c3 100644 --- a/tools/objtool/noreturns.h +++ b/tools/objtool/noreturns.h @@ -26,6 +26,7 @@ NORETURN(cpu_startup_entry) NORETURN(do_exit) NORETURN(do_group_exit) NORETURN(do_task_dead) +NORETURN(efi_rts_park_worker) NORETURN(ex_handler_msr_mce) NORETURN(hlt_play_dead) NORETURN(hv_ghcb_terminate) From 4953e0a8a149d68e3e02b2e7713513bffdb7a746 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 13 Jul 2026 06:06:48 -0700 Subject: [PATCH 008/250] efi/runtime-wrappers: mark efi_runtime_lock_owner as __used efi_runtime_lock_owner is only ever read by efi_runtime_assert_lock_held(). When CONFIG_BUG=n, WARN_ON() collapses to a statement that discards its condition, so the compiler drops that read, treats the variable as write-only and eliminates it. Debug info still references the symbol, so a build carrying it (e.g. CONFIG_DEBUG_INFO_SPLIT) fails to link: ld: drivers/firmware/efi/runtime-wrappers.o:(.debug_addr+0x104): undefined reference to `efi_runtime_lock_owner' Mark the variable __used so its storage is always emitted. This seems to be better than alternatives (READ_ONCE/__maybe_unused). Fixes: a2860501203c ("efi/runtime-wrappers: Keep track of the efi_runtime_lock owner") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202607100518.uMJJPDfP-lkp@intel.com/ Signed-off-by: Breno Leitao Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/runtime-wrappers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 6f42da11a91783..2344b9d1e81f8e 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -210,7 +210,7 @@ void efi_call_virt_check_flags(unsigned long flags, const void *caller) */ static DEFINE_SEMAPHORE(efi_runtime_lock, 1); -static struct task_struct *efi_runtime_lock_owner; +static struct task_struct *efi_runtime_lock_owner __used; /* * Expose the EFI runtime lock to the UV platform From bf5de8335a1fa188348938ecf4f30af2e07b0405 Mon Sep 17 00:00:00 2001 From: Theodore Tucker Date: Thu, 25 Jun 2026 18:12:14 +0100 Subject: [PATCH 009/250] efi: Make EFI_VARS_PSTORE depend on EFIVAR_FS The efivars backend to pstore will not register if the efivarfs is not available. The efivars sysfs interface was removed in Linux 6.0, meaning efivarfs is now the only way pstore can write into EFI variables. Making the dependency on the efivarfs explicit removes a stumbling block when configuring a kernel with pstore. Signed-off-by: Theodore Tucker Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig index 29e0729299f5bd..8dfd21e7a8e4d7 100644 --- a/drivers/firmware/efi/Kconfig +++ b/drivers/firmware/efi/Kconfig @@ -9,7 +9,7 @@ config EFI_ESRT config EFI_VARS_PSTORE tristate "Register efivars backend for pstore" - depends on PSTORE + depends on PSTORE && EFIVAR_FS select UCS2_STRING default y help From b4c1bfc231521b627214bf654417bfef3721da79 Mon Sep 17 00:00:00 2001 From: Vincent Mailhol Date: Wed, 22 Jul 2026 23:22:25 +0200 Subject: [PATCH 010/250] efi: make efi_guid_to_str() take a const GUID pointer efi_guid_to_str() only formats the GUID through the byte array passed to the UUID printf formatter. It does not modify the GUID contents. Make the input pointer const so callers can stringify GUIDs from const data without a cast. Signed-off-by: Vincent Mailhol Signed-off-by: Ard Biesheuvel --- include/linux/efi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/efi.h b/include/linux/efi.h index b3c83516593d1d..aa15ff88539bdf 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -705,7 +705,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) } static inline char * -efi_guid_to_str(efi_guid_t *guid, char *out) +efi_guid_to_str(const efi_guid_t *guid, char *out) { sprintf(out, "%pUl", guid->b); return out; From 44e4ec1a802d2078743f7a77f46af3e2213a3b4e Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Mon, 6 Jul 2026 17:18:13 +0800 Subject: [PATCH 011/250] efi: apple-properties: validate setup data header length map_properties() remaps the Apple properties setup_data payload and then reads the properties header fields. Reject a truncated payload before checking the header version and length fields. Signed-off-by: Pengpeng Hou Reviewed-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/apple-properties.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c index 2e525e17fba778..f401a04edf4c71 100644 --- a/drivers/firmware/efi/apple-properties.c +++ b/drivers/firmware/efi/apple-properties.c @@ -207,7 +207,10 @@ static int __init map_properties(void) } properties = (struct properties_header *)data->data; - if (properties->version != 1) { + if (data_len < sizeof(*properties)) { + pr_err("truncated properties header\n"); + ret = -EINVAL; + } else if (properties->version != 1) { pr_err("unsupported version:\n"); print_hex_dump(KERN_ERR, pr_fmt(), DUMP_PREFIX_OFFSET, 16, 1, properties, data_len, true); From d239c5a8828cbf615a968e449efed9634d6b1f0a Mon Sep 17 00:00:00 2001 From: Chengfeng Ye Date: Tue, 11 Aug 2026 02:56:03 +0300 Subject: [PATCH 012/250] KEYS: trusted: Fix TPM teardown ordering trusted_tpm_exit() drops the TPM chip reference and frees the digest array before unregistering the trusted key type. key_type_lookup() holds key_types_sem for reading until the key operation finishes, while unregister_key_type() takes it for writing. It therefore provides the synchronization point that must precede backend teardown. The current order permits this interleaving: CPU 0 CPU 1 trusted_tpm_exit() key_type_lookup("trusted") put_device(&chip->dev) trusted_tpm_seal() kfree(digests) pcrlock() unregister_key_type() tpm_pcr_extend(..., digests) CPU 1 can consequently dereference the freed digest array. The chip can also be released before callbacks stop using it. KASAN reported: BUG: KASAN: slab-use-after-free in tpm_pcr_extend+0x1f0/0x200 Read of size 2 at addr ffff88810872d000 by task poc/89 Call Trace: tpm_pcr_extend+0x1f0/0x200 pcrlock+0x42/0x70 [trusted] trusted_tpm_seal+0x1b6/0x570 [trusted] trusted_instantiate+0x293/0x340 [trusted] __key_instantiate_and_link+0xb2/0x2b0 __key_create_or_update+0x61e/0xb50 __do_sys_add_key+0x1b8/0x310 Allocated by task 88: __kmalloc_noprof+0x1a7/0x490 do_one_initcall+0xa1/0x390 do_init_module+0x2df/0x840 Freed by task 90: kfree+0x131/0x3c0 trusted_tpm_exit+0x59/0xa0 [trusted] __do_sys_delete_module+0x346/0x510 Move unregister_key_type() before releasing either resource. This stops new lookups and waits for in-flight key operations to finish before the backend state is destroyed. Fixes: 0b6cf6b97b7e ("tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()") Cc: stable@vger.kernel.org Signed-off-by: Chengfeng Ye Link: https://lore.kernel.org/r/20260731140925.2973492-1-nicoyip.dev@gmail.com Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- security/keys/trusted-keys/trusted_tpm1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c index 13513819991e72..8f57c6111e7e41 100644 --- a/security/keys/trusted-keys/trusted_tpm1.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -987,9 +987,9 @@ static int __init trusted_tpm_init(void) static void trusted_tpm_exit(void) { if (chip) { + unregister_key_type(&key_type_trusted); put_device(&chip->dev); kfree(digests); - unregister_key_type(&key_type_trusted); } } From 67c9068fd3ca9d889b68d40a9b1681d8c5d5f3d9 Mon Sep 17 00:00:00 2001 From: Myeonghun Pak Date: Fri, 26 Jun 2026 19:35:52 +0300 Subject: [PATCH 013/250] tpm: tpm_i2c_nuvoton: disable IRQ on wait timeout i2c_nuvoton_wait_for_stat() enables the IRQ before waiting for the interrupt handler to report a status change. If the wait times out, or is interrupted before the handler runs, the function returns without balancing the enable_irq() call. Disable the IRQ before leaving the failed wait path. Also preserve an interrupted wait's original error code instead of converting it to -ETIMEDOUT inside the helper. Cc: stable@vger.kernel.org # v5.10+ Fixes: 4c336e4b1556 ("tpm: Add support for the Nuvoton NPCT501 I2C TPM") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20260626091653.54929-1-mhun512@gmail.com Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_i2c_nuvoton.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index d44903b299294d..aa3673002f3aa6 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -182,8 +182,10 @@ static int i2c_nuvoton_wait_for_stat(struct tpm_chip *chip, u8 mask, u8 value, timeout); if (rc > 0) return 0; - /* At this point we know that the SINT pin is asserted, so we - * do not need to do i2c_nuvoton_check_status */ + + disable_irq(priv->irq); + if (rc < 0) + return rc; } else { unsigned long ten_msec, stop; bool status_valid; From 8fafb05b6dc1d4df06d93f172bf40f7ad3f76c37 Mon Sep 17 00:00:00 2001 From: Pan Chuang Date: Sat, 11 Jul 2026 20:36:37 +0300 Subject: [PATCH 014/250] tpm: Remove redundant dev_err() Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20260710105318.376496-3-panchuang@vivo.com Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/st33zp24.c | 5 +---- drivers/char/tpm/tpm_i2c_nuvoton.c | 2 -- drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 +--- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c index e2b7451ea7ccd3..8d5179367eac6e 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.c +++ b/drivers/char/tpm/st33zp24/st33zp24.c @@ -506,11 +506,8 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, ret = devm_request_irq(dev, irq, tpm_ioserirq_handler, IRQF_TRIGGER_HIGH, "TPM SERIRQ management", chip); - if (ret < 0) { - dev_err(&chip->dev, "TPM SERIRQ signals %d not available\n", - irq); + if (ret < 0) goto _tpm_clean_answer; - } intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_STS_VALID_INT diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index aa3673002f3aa6..c84afb29d548de 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -576,8 +576,6 @@ static int i2c_nuvoton_probe(struct i2c_client *client) dev_name(&chip->dev), chip); if (rc) { - dev_err(dev, "%s() Unable to request irq: %d for use\n", - __func__, priv->irq); priv->irq = 0; } else { chip->flags |= TPM_CHIP_FLAG_IRQ; diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c index b48cacacc0664a..7f828fae70d3e1 100644 --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c @@ -751,10 +751,8 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler, IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN, dev->driver->name, chip); - if (rc < 0) { - dev_err(dev, "Failed to probe IRQ %d\n", client->irq); + if (rc < 0) return rc; - } priv->irq = client->irq; } else { From 9ab874896167123cb4b035bf457a96dc752ff15e Mon Sep 17 00:00:00 2001 From: Karl Mehltretter Date: Sun, 12 Jul 2026 20:32:34 +0200 Subject: [PATCH 015/250] tpm: atmel: depend on X86 tpm_atmel probes for the chip at fixed x86 Super-I/O ports (0x4e) with inb()/outb(), so it only works on x86. TCG_ATMEL nevertheless depends only on HAS_IOPORT_MAP/HAS_IOPORT, which arm and arm64 also satisfy. There the probe is useless, and on platforms whose unbacked I/O access faults it oopses in init_atmel() at boot (e.g. arm/versatile): Unable to handle kernel paging request at virtual address fee0004e PC is at init_atmel+0x34/0x244 TCG_NSC and TCG_TIS already "depends on X86" (commit 2f592f2a7d74 ("TPM: NSC and TIS drivers X86 dependency fix")); TCG_ATMEL was missed. Add the same dependency. Signed-off-by: Karl Mehltretter Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20260712183234.23125-1-kmehltretter@gmail.com Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 8a8f692b60880c..5f672f2c01b04c 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig @@ -163,8 +163,7 @@ config TCG_NSC config TCG_ATMEL tristate "Atmel TPM Interface" - depends on HAS_IOPORT_MAP - depends on HAS_IOPORT + depends on X86 help If you have a TPM security chip from Atmel say Yes and it will be accessible from within Linux. To compile this driver From 784f45c1fc0e07592b996093a3b2ff73a2c61953 Mon Sep 17 00:00:00 2001 From: Xiaofeng Yuan Date: Fri, 14 Aug 2026 08:27:41 +0000 Subject: [PATCH 016/250] riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX When CONFIG_STRICT_MODULE_RWX is not set, execmem cannot create temporary writable mappings for read-only executable pages. In this case, the execmem ranges must already have writable permissions. Currently EXECMEM_KPROBES unconditionally uses PAGE_KERNEL_READ_EXEC, which causes kprobe instruction slot writes to trigger page faults on systems where CONFIG_STRICT_MODULE_RWX is not enabled. Fix this by using PAGE_KERNEL_EXEC when CONFIG_STRICT_MODULE_RWX is not available. Signed-off-by: Xiaofeng Yuan Tested-by: Lad Prabhakar Reviewed-by: Nam Cao Link: https://patch.msgid.link/20260814082742.148403-2-xiaofengmian@163.com Signed-off-by: Paul Walmsley --- arch/riscv/mm/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 25ccee50e6dd47..8a0efbbd225c3f 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -1466,7 +1466,9 @@ struct execmem_info __init *execmem_arch_setup(void) [EXECMEM_KPROBES] = { .start = VMALLOC_START, .end = VMALLOC_END, - .pgprot = PAGE_KERNEL_READ_EXEC, + .pgprot = IS_ENABLED(CONFIG_STRICT_MODULE_RWX) ? + PAGE_KERNEL_READ_EXEC : + PAGE_KERNEL_EXEC, .alignment = 1, }, [EXECMEM_BPF] = { From 8d9d4fd2a15ff961a5f4ddd8ac672ec4628542be Mon Sep 17 00:00:00 2001 From: Xiaofeng Yuan Date: Fri, 14 Aug 2026 08:27:42 +0000 Subject: [PATCH 017/250] riscv: patch: skip fixmap mapping when kernel text is already writable patch_map() always creates a temporary writable mapping via fixmap for kernel text addresses, even when CONFIG_STRICT_KERNEL_RWX is disabled and the kernel text is already mapped with _PAGE_WRITE. This is unnecessary overhead at best, and on minimal configurations it can cause page faults. Skip the fixmap path for kernel text when CONFIG_STRICT_KERNEL_RWX is not enabled, since the text pages are already writable in that case. The module text path is already gated on CONFIG_STRICT_MODULE_RWX and is kept unchanged. Reported-by: Klara Modin Closes: https://lore.kernel.org/all/ant_8TaBbov_GS4i@soda.int.kasm.eu/ Reported-by: Lad Prabhakar Closes: https://lore.kernel.org/all/CA+V-a8tQK8rih9SGGTyqrEBGpNkx4H0eX2YccCRrgkVAPr+EBg@mail.gmail.com/ Tested-by: Klara Modin Tested-by: Lad Prabhakar Link: https://patch.msgid.link/20260814082742.148403-3-xiaofengmian@163.com Signed-off-by: Paul Walmsley --- arch/riscv/kernel/patch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/kernel/patch.c b/arch/riscv/kernel/patch.c index 16b243376f3621..2239c28981bc39 100644 --- a/arch/riscv/kernel/patch.c +++ b/arch/riscv/kernel/patch.c @@ -45,6 +45,8 @@ static __always_inline void *patch_map(void *addr, const unsigned int fixmap) phys_addr_t phys; if (core_kernel_text(uintaddr) || is_kernel_exittext(uintaddr)) { + if (!IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)) + return addr; phys = __pa_symbol(addr); } else if (IS_ENABLED(CONFIG_STRICT_MODULE_RWX)) { struct page *page = vmalloc_to_page(addr); From 440ae4dc179aab8a53327ed91b52159c2d0a44fb Mon Sep 17 00:00:00 2001 From: Miro Kropacek Date: Fri, 14 Aug 2026 15:17:42 +1200 Subject: [PATCH 018/250] fbdev: atafb: Link to parent device The atafb fb device registers no parent, causing a missing symlink (/sys/class/graphics/fb0/device). Xorg fbdevhw driver looks for that symlink when scanning for devices, so add a parent node for atafb. Signed-off-by: Miro Kropacek Reviewed-by: Michael Schmitz Cc: linux-fbdev@vger.kernel.org Link: https://lists.debian.org/debian-68k/2026/08/msg00000.html Signed-off-by: Helge Deller --- drivers/video/fbdev/atafb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index b8ed1c537293dc..3d540803dc2b67 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -3101,6 +3101,11 @@ static int __init atafb_probe(struct platform_device *pdev) #endif /* ATAFB_EXT */ // strcpy(fb_info.mode->name, "Atari Builtin "); + /* Parent the fb device properly: without this fb0 registers as a + * virtual sysfs device with no /sys/class/graphics/fb0/device link, + * which makes Xorg's fbdevhw reject it ("No devices detected"). + */ + fb_info.device = &pdev->dev; fb_info.fbops = &atafb_ops; // try to set default (detected; requested) var do_fb_set_var(&atafb_predefined[default_par - 1], 1); From 73438d9ccd484f2c5461f30ad5200452633592c7 Mon Sep 17 00:00:00 2001 From: Miro Kropacek Date: Fri, 14 Aug 2026 15:17:43 +1200 Subject: [PATCH 019/250] fbdev: atafb: Add support for further video bit depths on atafb:external Supervidel offers additional video bit depths (8-bit chunky, 16-bit RGB565 (also on the originaln Videl) and ARGB888. Add code to support these bit depths. Signed-off-by: Miro Kropacek Reviewed-by: Michael Schmitz Cc: linux-fbdev@vger.kernel.org Link: https://lists.debian.org/debian-68k/2026/08/msg00000.html Signed-off-by: Helge Deller --- drivers/video/fbdev/atafb.c | 89 ++++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 3d540803dc2b67..50853d7a08e3d3 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2081,8 +2081,12 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) external_pmode == FB_TYPE_PACKED_PIXELS) ? FB_VISUAL_MONO10 : FB_VISUAL_MONO01; } else { - /* Use STATIC if we don't know how to access color registers */ - int visual = external_vgaiobase ? + /* Use STATIC if we don't know how to access color registers; + * SuperVidel 8bpp chunky (fb in SV RAM) uses the Falcon palette + */ + int visual = (external_vgaiobase || + (external_depth == 8 && + external_addr >= 0xa0000000)) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; switch (external_pmode) { @@ -2159,6 +2163,35 @@ static int ext_encode_var(struct fb_var_screeninfo *var, struct atafb_par *par) var->transp.offset = 0; var->transp.length = 0; var->transp.msb_right = 0; + if (external_pmode == -1 && external_depth == 16) { + /* RGB565 truecolor (e.g. SuperVidel native mode) */ + var->red.offset = 11; + var->red.length = 5; + var->green.offset = 5; + var->green.length = 6; + var->blue.offset = 0; + var->blue.length = 5; + } else if (external_pmode == -1 && external_depth == 32) { + /* ARGB8888 truecolor (e.g. SuperVidel native mode) */ + var->red.offset = 16; + var->red.length = 8; + var->green.offset = 8; + var->green.length = 8; + var->blue.offset = 0; + var->blue.length = 8; + var->transp.offset = 24; + var->transp.length = 8; + } else if (external_pmode == FB_TYPE_PACKED_PIXELS && + external_depth == 8 && external_addr >= 0xa0000000) { + /* SuperVidel 8bpp chunky: palette has 8 bits per channel. + * Without this, fb_get_color_depth() sees length 0 and + * fbcon falls back to its 2-color palette — the console + * text (color 7) stays black on black. + */ + var->red.length = 8; + var->green.length = 8; + var->blue.length = 8; + } var->yres_virtual = var->yres; var->xoffset = 0; var->yoffset = 0; @@ -2193,6 +2226,38 @@ static int ext_setcolreg(unsigned int regno, unsigned int red, { unsigned char colmask = (1 << external_bitspercol) - 1; + if (external_pmode == -1 && external_depth == 16) { + /* truecolor: only the pseudo palette for fbcon is needed */ + if (regno > 15) + return 1; + ((u32 *)info->pseudo_palette)[regno] = (red & 0xf800) | + ((green & 0xfc00) >> 5) | + ((blue & 0xf800) >> 11); + return 0; + } + if (external_pmode == -1 && external_depth == 32) { + /* ARGB8888, alpha forced opaque */ + if (regno > 15) + return 1; + ((u32 *)info->pseudo_palette)[regno] = 0xff000000 | + ((red & 0xff00) << 8) | + (green & 0xff00) | + ((blue & 0xff00) >> 8); + return 0; + } + if (external_pmode == FB_TYPE_PACKED_PIXELS && external_depth == 8 && + external_addr >= 0xa0000000) { + /* SuperVidel native 8bpp chunky scans out via the Falcon + * palette registers, honoring all 8 bits per channel + */ + if (regno > 255) + return 1; + f030_col[regno] = ((red & 0xff00) << 16) | + ((green & 0xff00) << 8) | + ((blue & 0xff00) >> 8); + return 0; + } + if (!external_vgaiobase) return 1; @@ -2422,7 +2487,9 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) return; #ifdef ATAFB_FALCON - if (info->var.bits_per_pixel == 16) { + /* chunky modes (Falcon hicolor, external packed/truecolor) */ + if (info->fix.type == FB_TYPE_PACKED_PIXELS && + info->var.bits_per_pixel > 1) { cfb_fillrect(info, rect); return; } @@ -2463,7 +2530,9 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) int rev_copy = 0; #ifdef ATAFB_FALCON - if (info->var.bits_per_pixel == 16) { + /* chunky modes (Falcon hicolor, external packed/truecolor) */ + if (info->fix.type == FB_TYPE_PACKED_PIXELS && + info->var.bits_per_pixel > 1) { cfb_copyarea(info, area); return; } @@ -2517,7 +2586,9 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) u32 dx, dy, width, height, pitch; #ifdef ATAFB_FALCON - if (info->var.bits_per_pixel == 16) { + /* chunky modes (Falcon hicolor, external packed/truecolor) */ + if (info->fix.type == FB_TYPE_PACKED_PIXELS && + info->var.bits_per_pixel > 1) { cfb_imageblit(info, image); return; } @@ -2753,7 +2824,7 @@ static void __init atafb_setup_ext(char *spec) return; depth = simple_strtoul(p, NULL, 10); if (depth != 1 && depth != 2 && depth != 4 && depth != 8 && - depth != 16 && depth != 24) + depth != 16 && depth != 24 && depth != 32) return; p = strsep(&spec, ";"); @@ -3131,7 +3202,11 @@ static int __init atafb_probe(struct platform_device *pdev) atafb_set_disp(&fb_info); - fb_alloc_cmap(&(fb_info.cmap), 1 << fb_info.var.bits_per_pixel, 0); + /* truecolor visuals only need the 16-entry console palette; this + * also avoids 1 << 32 overflowing at 32bpp + */ + fb_alloc_cmap(&(fb_info.cmap), fb_info.var.bits_per_pixel > 8 ? + 16 : 1 << fb_info.var.bits_per_pixel, 0); dev_info(&pdev->dev, "Determined %dx%d, depth %d\n", fb_info.var.xres, From a3a343f4f045c05370c62b116c4c16dbd7983da8 Mon Sep 17 00:00:00 2001 From: Miro Kropacek Date: Fri, 14 Aug 2026 15:17:44 +1200 Subject: [PATCH 020/250] fbdev: atafb: Add support for SuperVidel's SuperBlitter The SuperVidel graphics FPGA includes a hardware blitter (bit block transfer engine) operating within the SuperVidel DDR2 video RAM. Two versions of this blitter exist. Later versions (>= 9) of the SuperVidel firmware support an asynchronous command FIFO, older versions must be polled for command completion. Add hardware-accelerated copyarea, fillrect and imageblit fb operations (falling back to the non-accelerated versions for anything that exceeds blitter capabilities). Signed-off-by: Miro Kropacek Reviewed-by: Michael Schmitz Cc: linux-fbdev@vger.kernel.org Link: https://lists.debian.org/debian-68k/2026/08/msg00000.html Signed-off-by: Helge Deller --- drivers/video/fbdev/atafb.c | 197 ++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 50853d7a08e3d3..dc2d4154e1b6e6 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2304,6 +2304,185 @@ static int ext_detect(void) return 1; } +/* ------------------- SuperVidel SuperBlitter ---------------------- */ + +/* + * Hardware blitter in the SuperVidel FPGA, operating within SV DDR2 RAM. + * FW revision >= 9 provides a command FIFO (async operation); older + * revisions are programmed directly with busy-polling. + */ +#define SVBLIT_REGS_PHYS 0x80010000 +#define SVBLIT_SRC1 0x58 /* bits 26:0 */ +#define SVBLIT_SRC2 0x5c +#define SVBLIT_DST 0x60 +#define SVBLIT_COUNT 0x64 /* bytes per line - 1 */ +#define SVBLIT_SRC1_OFFSET 0x68 /* line start to next line start */ +#define SVBLIT_SRC2_OFFSET 0x6c +#define SVBLIT_DST_OFFSET 0x70 +#define SVBLIT_MASK_AND_LINES 0x74 /* bits 11:0: number of lines */ +#define SVBLIT_CONTROL 0x78 /* bit 0: busy/start, bits 4:1: mode */ +#define SVBLIT_VERSION 0x7c /* bits 9:0: FW revision */ +#define SVBLIT_FIFO 0x80 /* wr: data; rd: bit 0 empty, bit 1 full */ + +/* + * SuperBlitter bug: Instead of declared 2048 bytes, 2032 is the real maximum. + */ +#define SVBLIT_MAX_SPAN 2032 + +static void __iomem *svblit_regs; +static int svblit_fw; + +static inline u32 svblit_rd(unsigned int reg) +{ + return __raw_readl(svblit_regs + reg); +} + +static inline void svblit_wr(unsigned int reg, u32 val) +{ + __raw_writel(val, svblit_regs + reg); +} + +/* wait until all queued blits have finished */ +static void svblit_wait(void) +{ + if (svblit_fw >= 9) + /* FIFO empty flag = fewer than 9 longwords queued */ + while (!(svblit_rd(SVBLIT_FIFO) & 1)) + cpu_relax(); + while (svblit_rd(SVBLIT_CONTROL) & 1) + cpu_relax(); +} + +/* + * FW >= 9 queues commands through the 512-longword FIFO: a command is + * 9 longwords (registers 0x58..0x78 in order), executed whenever >= 9 + * words are queued and the blitter is idle. The full flag rises at + * >= 500 queued words, so below it there is always room for a whole + * command — one flag check per command prevents overflow (dropped + * words would desync the 9-word framing until an SV reinit, which is + * exactly what overflowing did before this guard existed). Older FW + * is programmed directly with busy-polling. + * + * The line byte count field is 11 bits but see SVBLIT_MAX_SPAN. + */ +static void svblit_copy(u32 src, u32 dst, u32 nbytes, u32 src_offset, + u32 dst_offset, u32 lines) +{ + while (nbytes) { + u32 chunk = min(nbytes, SVBLIT_MAX_SPAN); + + if (svblit_fw >= 9) { + while (svblit_rd(SVBLIT_FIFO) & 2) + cpu_relax(); + svblit_wr(SVBLIT_FIFO, src); + svblit_wr(SVBLIT_FIFO, 0); + svblit_wr(SVBLIT_FIFO, dst); + svblit_wr(SVBLIT_FIFO, chunk - 1); + svblit_wr(SVBLIT_FIFO, src_offset); + svblit_wr(SVBLIT_FIFO, 0); + svblit_wr(SVBLIT_FIFO, dst_offset); + svblit_wr(SVBLIT_FIFO, lines); + svblit_wr(SVBLIT_FIFO, 0x01); + } else { + while (svblit_rd(SVBLIT_CONTROL) & 1) + cpu_relax(); + svblit_wr(SVBLIT_SRC1, src); + svblit_wr(SVBLIT_SRC2, 0); + svblit_wr(SVBLIT_DST, dst); + svblit_wr(SVBLIT_COUNT, chunk - 1); + svblit_wr(SVBLIT_SRC1_OFFSET, src_offset); + svblit_wr(SVBLIT_SRC2_OFFSET, 0); + svblit_wr(SVBLIT_DST_OFFSET, dst_offset); + svblit_wr(SVBLIT_MASK_AND_LINES, lines); + svblit_wr(SVBLIT_CONTROL, 0x01); + } + + src += chunk; + dst += chunk; + nbytes -= chunk; + } +} + +static int svblit_sync(struct fb_info *info) +{ + svblit_wait(); + return 0; +} + +static void svblit_copyarea(struct fb_info *info, + const struct fb_copyarea *area) +{ + u32 bytespp = info->var.bits_per_pixel / 8; + u32 pitch = info->fix.line_length; + + /* + * The blitter walks lines in ascending order, so overlapping + * moves down/right would read already overwritten data. Those + * are rare for fbcon (scrolling backwards); leave them and + * oversized areas to the CPU. + */ + if (area->height > 4095 || + area->dy > area->sy || + (area->dy == area->sy && area->dx > area->sx)) { + svblit_wait(); + cfb_copyarea(info, area); + return; + } + + svblit_copy(external_addr + area->sy * pitch + area->sx * bytespp, + external_addr + area->dy * pitch + area->dx * bytespp, + area->width * bytespp, pitch, pitch, area->height); + /* async: every CPU access to the fb goes through svblit_wait() */ +} + +static void svblit_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +{ + u32 bytespp = info->var.bits_per_pixel / 8; + u32 pitch = info->fix.line_length; + u8 *line; + u32 pix; + + svblit_wait(); /* the CPU is about to touch the fb */ + + if (rect->rop != ROP_COPY || rect->height <= 1 || + rect->height > 4096) { + cfb_fillrect(info, rect); + return; + } + + pix = (info->fix.visual == FB_VISUAL_TRUECOLOR) ? + ((u32 *)info->pseudo_palette)[rect->color] : rect->color; + + /* draw the first line with the CPU ... */ + line = (u8 *)info->screen_base + rect->dy * pitch + + rect->dx * bytespp; + switch (bytespp) { + case 1: + memset(line, pix, rect->width); + break; + case 2: + memset16((u16 *)line, pix, rect->width); + break; + default: + memset32((u32 *)line, pix, rect->width); + break; + } + + /* ... and let the blitter replicate it into the other lines */ + svblit_copy(external_addr + rect->dy * pitch + rect->dx * bytespp, + external_addr + (rect->dy + 1) * pitch + + rect->dx * bytespp, + rect->width * bytespp, 0, pitch, rect->height - 1); +} + +static void svblit_imageblit(struct fb_info *info, + const struct fb_image *image) +{ + svblit_wait(); /* CPU rendering must not race queued blits */ + cfb_imageblit(info, image); +} + #endif /* ATAFB_EXT */ /* ------ This is the same for most hardware types -------- */ @@ -3168,6 +3347,24 @@ static int __init atafb_probe(struct platform_device *pdev) phys_screen_base = external_addr; screen_len = external_len & PAGE_MASK; memset (screen_base, 0, external_len); + + /* framebuffer in SV RAM: enable the SuperBlitter */ + if (external_addr >= 0xa0000000) { + svblit_regs = ioremap(SVBLIT_REGS_PHYS, 0x100); + if (svblit_regs) { + svblit_fw = svblit_rd(SVBLIT_VERSION) & 0x1ff; + atafb_ops.fb_fillrect = svblit_fillrect; + atafb_ops.fb_copyarea = svblit_copyarea; + atafb_ops.fb_imageblit = svblit_imageblit; + atafb_ops.fb_sync = svblit_sync; + fb_info.flags |= FBINFO_HWACCEL_COPYAREA | + FBINFO_HWACCEL_FILLRECT; + dev_info(&pdev->dev, + "SuperBlitter enabled, FW revision %d (%s)\n", + svblit_fw, svblit_fw >= 9 ? + "async FIFO" : "sync"); + } + } } #endif /* ATAFB_EXT */ From dbf5c1e3b863e2aafdb21c34f01a253f9fa5efb4 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 13 Aug 2026 16:29:32 -0700 Subject: [PATCH 021/250] fbdev: maxine: make functions static Make 3 functions static so that they don't need to be declared in a header file. ../drivers/video/fbdev/maxinefb.c:64:6: warning: no previous prototype for 'maxinefb_ims332_write_register' [-Wmissing-prototypes] 64 | void maxinefb_ims332_write_register(int regno, register unsigned int val) ../drivers/video/fbdev/maxinefb.c:74:14: warning: no previous prototype for 'maxinefb_ims332_read_register' [-Wmissing-prototypes] 74 | unsigned int maxinefb_ims332_read_register(int regno) ../drivers/video/fbdev/maxinefb.c:114:12: warning: no previous prototype for 'maxinefb_init' [-Wmissing-prototypes] 114 | int __init maxinefb_init(void) Signed-off-by: Randy Dunlap Acked-by: Maciej W. Rozycki Signed-off-by: Helge Deller --- drivers/video/fbdev/maxinefb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c index 52528eb4dfb412..a9410a553113d0 100644 --- a/drivers/video/fbdev/maxinefb.c +++ b/drivers/video/fbdev/maxinefb.c @@ -61,7 +61,7 @@ static struct fb_fix_screeninfo maxinefb_fix __initdata = { /* Handle the funny Inmos RamDAC/video controller ... */ -void maxinefb_ims332_write_register(int regno, register unsigned int val) +static void maxinefb_ims332_write_register(int regno, register unsigned int val) { register unsigned char *regs = (char *) MAXINEFB_IMS332_ADDRESS; unsigned char *wptr; @@ -71,7 +71,7 @@ void maxinefb_ims332_write_register(int regno, register unsigned int val) *((volatile unsigned short *) (wptr)) = val; } -unsigned int maxinefb_ims332_read_register(int regno) +static unsigned int maxinefb_ims332_read_register(int regno) { register unsigned char *regs = (char *) MAXINEFB_IMS332_ADDRESS; unsigned char *rptr; @@ -111,7 +111,7 @@ static const struct fb_ops maxinefb_ops = { .fb_setcolreg = maxinefb_setcolreg, }; -int __init maxinefb_init(void) +static int __init maxinefb_init(void) { unsigned long fboff; unsigned long fb_start; From 326b1dc54ba8ab99c728470f9ee7e3541ccea859 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 13 Aug 2026 16:29:33 -0700 Subject: [PATCH 022/250] fbdev: maxine: elide an unused function maxinefb_ims332_read_register() is not used, but since it describes a hardware interface, leave it in the source file as documentation and surround it inside an #if 0/#endif block. ../drivers/video/fbdev/maxinefb.c:74:21: warning: 'maxinefb_ims332_read_register' defined but not used [-Wunused-function] 74 | static unsigned int maxinefb_ims332_read_register(int regno) Signed-off-by: Randy Dunlap Acked-by: Maciej W. Rozycki Signed-off-by: Helge Deller --- drivers/video/fbdev/maxinefb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c index a9410a553113d0..10249a1cfc7294 100644 --- a/drivers/video/fbdev/maxinefb.c +++ b/drivers/video/fbdev/maxinefb.c @@ -71,6 +71,8 @@ static void maxinefb_ims332_write_register(int regno, register unsigned int val) *((volatile unsigned short *) (wptr)) = val; } +#if 0 +/* dead code: leave here for hardware interface documentation */ static unsigned int maxinefb_ims332_read_register(int regno) { register unsigned char *regs = (char *) MAXINEFB_IMS332_ADDRESS; @@ -83,6 +85,7 @@ static unsigned int maxinefb_ims332_read_register(int regno) return (j & 0xffff) | ((k & 0xff00) << 8); } +#endif /* Set the palette */ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green, From 85d7529e6e33eea430f54ccf0ca461cb6299db93 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 13 Aug 2026 16:29:34 -0700 Subject: [PATCH 023/250] fbdev: maxine: fix 64-bit build error The KSEG1ADDR() macro is only defined for non-64BIT builds. Use the CKSEG1ADDR() macro instead. In file included from ../drivers/video/fbdev/maxinefb.c:34: ../drivers/video/fbdev/maxinefb.c: In function 'maxinefb_ims332_write_register': ../include/video/maxinefb.h:16:41: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'? [-Wimplicit-function-declaration] 16 | #define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000) ../drivers/video/fbdev/maxinefb.c:66:49: note: in expansion of macro 'MAXINEFB_IMS332_ADDRESS' 66 | register unsigned char *regs = (char *) MAXINEFB_IMS332_ADDRESS; ../drivers/video/fbdev/maxinefb.c:66:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 66 | register unsigned char *regs = (char *) MAXINEFB_IMS332_ADDRESS; Signed-off-by: Randy Dunlap Acked-by: Maciej W. Rozycki Signed-off-by: Helge Deller --- include/video/maxinefb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/video/maxinefb.h b/include/video/maxinefb.h index 6aeb4acca2bdb7..2b66b32f355cf7 100644 --- a/include/video/maxinefb.h +++ b/include/video/maxinefb.h @@ -13,13 +13,13 @@ /* * IMS332 video controller register base address */ -#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000) +#define MAXINEFB_IMS332_ADDRESS CKSEG1ADDR(0x1c140000) /* * Begin of DECstation 5000/xx onboard framebuffer memory, default resolution * is 1024x768x8 */ -#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000) +#define DS5000_xx_ONBOARD_FBMEM_START CKSEG1ADDR(0x0a000000) /* * The IMS 332 video controller used in the DECstation 5000/xx series From 206f3746a6ecd648fd5661de5f65bfc0147a9550 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 13 Aug 2026 19:56:40 -0700 Subject: [PATCH 024/250] fbdev: maxine: fix maxinefb_init() return value A driver should return a negative error code on failure of its module_init() function so that the system recognizes the failure. Change the "return 1" to "return -ENODEV". Suggested-by: sashiko-bot@kernel.org Link: https://sashiko.dev/#/patchset/20260809234810.982500-1-rdunlap@infradead.org?part=1 Signed-off-by: Randy Dunlap Acked-by: Maciej W. Rozycki Signed-off-by: Helge Deller --- drivers/video/fbdev/maxinefb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c index 10249a1cfc7294..06de6cfbceb12a 100644 --- a/drivers/video/fbdev/maxinefb.c +++ b/drivers/video/fbdev/maxinefb.c @@ -160,7 +160,7 @@ static int __init maxinefb_init(void) fb_alloc_cmap(&fb_info.cmap, 256, 0); if (register_framebuffer(&fb_info) < 0) - return 1; + return -ENODEV; return 0; } From 259019bb96992577d8740bdd8a4dfd0c437e9f7c Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Fri, 14 Aug 2026 11:42:34 -0700 Subject: [PATCH 025/250] fbdev: maxine: use MODULE_LICENSE() unconditionally This driver cannot be built as a loadable module so testing for "#ifdef MODULE" is not appropriate here. Also, MODULE_LICENSE() is always available. Signed-off-by: Randy Dunlap Acked-by: Maciej W. Rozycki Signed-off-by: Helge Deller --- drivers/video/fbdev/maxinefb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c index 06de6cfbceb12a..67d4bd88104149 100644 --- a/drivers/video/fbdev/maxinefb.c +++ b/drivers/video/fbdev/maxinefb.c @@ -169,9 +169,7 @@ static void __exit maxinefb_exit(void) unregister_framebuffer(&fb_info); } -#ifdef MODULE -MODULE_LICENSE("GPL"); -#endif module_init(maxinefb_init); module_exit(maxinefb_exit); +MODULE_LICENSE("GPL"); From c4a74d53f3df4af9573b689f1c4752d01ebbab0c Mon Sep 17 00:00:00 2001 From: yuebingkun Date: Mon, 17 Aug 2026 14:39:42 +0800 Subject: [PATCH 026/250] fbdev: platinumfb: add error checking for ioremap calls The ioremap() and ioremap_wt() calls in platinumfb_probe() were not checked for failure. If any of these mappings fail, the driver would dereference NULL pointers, leading to a kernel panic. Add proper error checking and use goto-based cleanup to avoid code duplication across the error paths. Signed-off-by: yuebingkun Signed-off-by: Helge Deller --- drivers/video/fbdev/platinumfb.c | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c index a08d955d9b4394..f74c937c839f85 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -567,15 +567,30 @@ static int platinumfb_probe(struct platform_device* odev) /* frame buffer - map only 4MB */ pinfo->frame_buffer_phys = pinfo->rsrc_fb.start; pinfo->frame_buffer = ioremap_wt(pinfo->rsrc_fb.start, 0x400000); + if (!pinfo->frame_buffer) { + dev_err(&odev->dev, "failed to ioremap frame buffer\n"); + rc = -ENOMEM; + goto err_release_fb; + } pinfo->base_frame_buffer = pinfo->frame_buffer; /* registers */ pinfo->platinum_regs_phys = pinfo->rsrc_reg.start; pinfo->platinum_regs = ioremap(pinfo->rsrc_reg.start, 0x1000); + if (!pinfo->platinum_regs) { + dev_err(&odev->dev, "failed to ioremap registers\n"); + rc = -ENOMEM; + goto err_unmap_fb; + } pinfo->cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ request_mem_region(pinfo->cmap_regs_phys, 0x1000, "platinumfb cmap"); pinfo->cmap_regs = ioremap(pinfo->cmap_regs_phys, 0x1000); + if (!pinfo->cmap_regs) { + dev_err(&odev->dev, "failed to ioremap cmap registers\n"); + rc = -ENOMEM; + goto err_release_cmap; + } /* Grok total video ram */ out_be32(&pinfo->platinum_regs->reg[16].r, (unsigned)pinfo->frame_buffer_phys); @@ -623,13 +638,22 @@ static int platinumfb_probe(struct platform_device* odev) dev_set_drvdata(&odev->dev, info); rc = platinum_init_fb(info); - if (rc != 0) { - iounmap(pinfo->frame_buffer); - iounmap(pinfo->platinum_regs); - iounmap(pinfo->cmap_regs); - framebuffer_release(info); - } + if (rc != 0) + goto err_unmap_cmap; + + return 0; +err_unmap_cmap: + iounmap(pinfo->cmap_regs); +err_release_cmap: + release_mem_region(pinfo->cmap_regs_phys, 0x1000); +err_unmap_regs: + iounmap(pinfo->platinum_regs); +err_unmap_fb: + iounmap(pinfo->frame_buffer); +err_release_fb: + release_mem_region(pinfo->rsrc_fb.start, resource_size(&pinfo->rsrc_fb)); + framebuffer_release(info); return rc; } From 382b8802a01d9034bc91417ef981ae66722c6bfc Mon Sep 17 00:00:00 2001 From: Ajith P V Date: Tue, 18 Aug 2026 11:17:22 +0000 Subject: [PATCH 027/250] fbdev: viafb: refactor strcpy and viafb_name Eliminate the single-use file-scope variable `viafb_name` and pass the "Via" string literal directly to strcpy(). Since "Via" is a literal constant, the compiler safely executes compile-time bounds checking during fortify verification. This satisfies the security initiative requirements while minimizing code complexity. Signed-off-by: Ajith P V Signed-off-by: Helge Deller --- drivers/video/fbdev/via/viafbdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 80f95dac32c8c1..dd9374e8ad098b 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -16,7 +16,6 @@ #define _MASTER_FILE #include "global.h" -static char *viafb_name = "Via"; static u32 pseudo_pal[17]; /* video mode */ @@ -144,7 +143,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix, struct viafb_par *viaparinfo) { memset(fix, 0, sizeof(struct fb_fix_screeninfo)); - strcpy(fix->id, viafb_name); + strcpy(fix->id, "Via"); fix->smem_start = viaparinfo->fbmem; fix->smem_len = viaparinfo->fbmem_free; From 8c3c7f132f1464211ebf01d57533462637b82e73 Mon Sep 17 00:00:00 2001 From: Runyu Xiao Date: Tue, 18 Aug 2026 21:53:18 +0800 Subject: [PATCH 028/250] fbdev: omapfb: panel-dsi-cm: initialize lock before registering display dsicm_probe() registers the display before initializing ddata->lock. Once omapdss_register_display() publishes the display, another consumer can reach a dsicm callback that takes this mutex while it is still uninitialized. Initialize the mutex before registering the display so the published callbacks always see a valid lock. Fixes: f76ee892a99e ("omapfb: copy omapdss & displays for omapfb") Cc: stable@vger.kernel.org Signed-off-by: Runyu Xiao Signed-off-by: Helge Deller --- drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index 7c3463ee02ef1e..b2328671e067cb 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -1150,14 +1150,14 @@ static int dsicm_probe(struct platform_device *pdev) dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; + mutex_init(&ddata->lock); + r = omapdss_register_display(dssdev); if (r) { dev_err(dev, "Failed to register panel\n"); goto err_reg; } - mutex_init(&ddata->lock); - atomic_set(&ddata->do_update, 0); ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); From 265e3f27bb8796a958fcb2a533f62012e7721d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Jean?= Date: Mon, 17 Aug 2026 21:16:00 +0000 Subject: [PATCH 029/250] NFSv4.1: initialize referring call pointers before decoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit decode_cb_sequence_args() allocates csa_rclists with kmalloc_objs(), so each referring_call_list starts uninitialized. decode_rc_list() assigns rcl_refcalls only when rcl_nrefcalls is nonzero. A valid list with zero referring calls therefore leaves the pointer uninitialized, and nfs4_callback_sequence() later passes it to kfree(). KASAN reports a double free in nfs_cb_sequence_empty_refcalls_test(). Initialize the pointer before decoding the list. Fixes: 4aece6a19cf7 ("nfs41: cb_sequence xdr implementation") Assisted-by: Codex:gpt-5 Signed-off-by: Jérémy Jean Signed-off-by: Trond Myklebust --- fs/nfs/callback_xdr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 4382baddc9eed2..5857f57f064464 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -360,6 +360,7 @@ static __be32 decode_rc_list(struct xdr_stream *xdr, int i; __be32 status; + rc_list->rcl_refcalls = NULL; status = decode_sessionid(xdr, &rc_list->rcl_sessionid); if (status) goto out; From 73cee2bd5c96ace0acccedc50a63ef74cb83c933 Mon Sep 17 00:00:00 2001 From: "Cen Zhang (Microsoft)" Date: Thu, 13 Aug 2026 17:53:28 -0400 Subject: [PATCH 030/250] xsk: fix NULL pointer dereference in __xsk_rcv() In the __xsk_rcv() multi-buffer path, xsk_buff_alloc() is called in a loop without checking its return value. xsk_buff_can_alloc() only counts fill queue entries without validating their addresses, so it can succeed while xsk_buff_alloc() rejects all remaining entries and returns NULL. Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000 KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:__xsk_rcv+0x426/0xc20 (net/xdp/xsk.c:350) Call Trace: xsk_generic_rcv+0x26d/0x5f0 xdp_do_generic_redirect+0x3c5/0xcf0 do_xdp_generic+0x92f/0xe70 __netif_receive_skb_core.constprop.0+0xf7e/0x2b30 Fix this with a two-stage transaction. First allocate and stage all buffers required for the packet, recycling all staged buffers with xsk_buff_free() if any allocation fails. Only after this stage succeeds, copy the data, reserve the RX descriptors, and release the buffers in an error-free loop. Fixes: 804627751b42 ("xsk: add support for AF_XDP multi-buffer on Rx path") Reported-by: AutonomousCodeSecurity@microsoft.com Signed-off-by: Cen Zhang (Microsoft) Reviewed-by: Simon Horman Reviewed-by: Jason Xing Signed-off-by: David S. Miller --- net/xdp/xsk.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 7855ee09c4b640..33475b180ea6f3 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -298,9 +298,11 @@ static int __xsk_rcv(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) u32 frame_size = __xsk_pool_get_rx_frame_size(xs->pool); void *copy_from = xsk_copy_xdp_start(xdp), *copy_to; u32 from_len, meta_len, rem, num_desc; - struct xdp_buff_xsk *xskb; + struct xdp_buff_xsk *xskb, *tmp; struct xdp_buff *xsk_xdp; + LIST_HEAD(xsk_buffs); skb_frag_t *frag; + u32 i; from_len = xdp->data_end - copy_from; meta_len = xdp->data - copy_from; @@ -343,23 +345,45 @@ static int __xsk_rcv(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) frag = &sinfo->frags[0]; } + for (i = 0; i < num_desc; i++) { + xsk_xdp = xsk_buff_alloc(xs->pool); + if (!xsk_xdp) + goto err_alloc; + + xskb = container_of(xsk_xdp, struct xdp_buff_xsk, xdp); + if (unlikely(!list_empty(&xskb->list_node))) + goto err_alloc; + + list_add_tail(&xskb->list_node, &xsk_buffs); + } + do { u32 to_len = frame_size + meta_len; u32 copied; - xsk_xdp = xsk_buff_alloc(xs->pool); + xskb = list_first_entry(&xsk_buffs, struct xdp_buff_xsk, + list_node); + list_del_init(&xskb->list_node); + xsk_xdp = &xskb->xdp; copy_to = xsk_xdp->data - meta_len; copied = xsk_copy_xdp(copy_to, ©_from, to_len, &from_len, &frag, rem); rem -= copied; - xskb = container_of(xsk_xdp, struct xdp_buff_xsk, xdp); __xsk_rcv_zc_safe(xs, xskb, copied - meta_len, rem ? XDP_PKT_CONTD : 0); meta_len = 0; } while (rem); return 0; + +err_alloc: + list_for_each_entry_safe(xskb, tmp, &xsk_buffs, list_node) { + list_del_init(&xskb->list_node); + xsk_buff_free(&xskb->xdp); + } + xs->rx_dropped++; + return -ENOMEM; } static bool xsk_tx_writeable(struct xdp_sock *xs) From 40f04b51758e479ddbd0d000ef079bc2e8136243 Mon Sep 17 00:00:00 2001 From: Ruoyu Wang Date: Fri, 14 Aug 2026 21:40:53 +0800 Subject: [PATCH 031/250] net: bridge: Reject descending VLAN tunnel ranges A pair of descending VLAN and tunnel IDs can pass the tunnel range span check. The VLAN subtraction produces a negative int, which is converted to unsigned when compared with the u32 tunnel ID subtraction. It can therefore equal the wrapped tunnel ID delta. The range loop then performs no iterations. Since the batched notification handling added a post-loop error check, this leaves err uninitialized and makes the request's return value unpredictable. Reject descending VLAN ranges before comparing the spans. Valid ascending and single-entry ranges remain unchanged, while malformed descending ranges consistently return -EINVAL. This issue was found by a static analysis checker and confirmed by manual source review. Fixes: 94339443686b ("net: bridge: notify on vlan tunnel changes done via the old api") Signed-off-by: Ruoyu Wang Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller --- net/bridge/br_netlink_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c index a713668ea34f0e..e7eceab5b515d4 100644 --- a/net/bridge/br_netlink_tunnel.c +++ b/net/bridge/br_netlink_tunnel.c @@ -302,7 +302,8 @@ int br_process_vlan_tunnel_info(const struct net_bridge *br, if (!(tinfo_last->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN)) return -EINVAL; - if ((tinfo_curr->vid - tinfo_last->vid) != + if (tinfo_curr->vid < tinfo_last->vid || + (tinfo_curr->vid - tinfo_last->vid) != (tinfo_curr->tunid - tinfo_last->tunid)) return -EINVAL; t = tinfo_last->tunid; From c8c69c9a6d817a1c198c08ea6eb82acfdcad55fa Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 15 Aug 2026 06:03:02 +0200 Subject: [PATCH 032/250] net: ipa: fix stalled modem TX queue after runtime resume ipa_start_xmit() unconditionally stops the TX queue before calling pm_runtime_get(), relying on the wake scheduled by runtime resume (ipa_modem_wake_queue_work()) to restart it once power is ACTIVE. But that work is queued from within the runtime resume callback, before the device's power state reaches RPM_ACTIVE, so it can run while the device is still RPM_RESUMING. The wake is then consumed too early: the transmit it restarts stops the queue again, pm_runtime_get() returns -EINPROGRESS without arranging any future wake (deferred_resume exists only for RPM_SUSPENDING), and after the resume completes nothing is left to wake the queue. Transmit stalls permanently: packets pile up in the qdisc behind the stopped queue, the device runtime-suspends, and since the netdev registers no ndo_tx_timeout the watchdog never fires. Observed on SM7635 (Fairphone 6) as the cellular data path going permanently deaf within hours, RX included, since nothing resumes the suspended endpoints. Close the window by making the wake work wait for the resume to complete (pm_runtime_get_sync()) before waking the queue. Every queue stop is then guaranteed a later wake that happens while power is ACTIVE; a transmit racing a new suspend/resume cycle re-schedules the work. If the device could not be resumed, wake the queue anyway so pending packets are dropped by the transmit path rather than stranded. The STARTED power flag used to narrow this window: a wake running before the transmit path's stop suppressed that stop, but only once, as the flag was cleared by the first stop it absorbed. Removing the flag made a single transmit during an in-flight resume sufficient to strand the queue, which is the form observed. With an accelerated reproducer (autosuspend delay shortened to 5 ms, ~20 packets/s of TX), an unpatched kernel stalled three times in 230 s / 4380 packets; with this patch the same test ran 3601 s / 70298 packets without a stall. Fixes: 688de12f080f ("net: ipa: kill the STARTED IPA power flag") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- drivers/net/ipa/ipa_modem.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index 9b136f6b8b4ae8..d84c1dbd3b1a84 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -266,13 +266,29 @@ void ipa_modem_suspend(struct net_device *netdev) * the modem. We can't enable the queue directly in ipa_modem_resume() * because transmits restart the instant the queue is awakened; but the * device power state won't be ACTIVE until *after* ipa_modem_resume() - * returns. + * returns. A transmit restarted before that would stop the queue + * again and get -EINPROGRESS from pm_runtime_get(), and with this + * work having already run, nothing would ever wake the queue again. + * So wait for the resume to complete before waking the queue. */ static void ipa_modem_wake_queue_work(struct work_struct *work) { struct ipa_priv *priv = container_of(work, struct ipa_priv, work); + struct device *dev = priv->ipa->dev; + int ret; + + ret = pm_runtime_get_sync(dev); + /* Wake the queue even if the device could not be resumed, so + * that pending packets are dropped by the transmit path rather + * than stranded behind a stopped queue. + */ netif_wake_queue(priv->tx->netdev); + + if (ret < 0) + pm_runtime_put_noidle(dev); + else + (void)pm_runtime_put_autosuspend(dev); } /** ipa_modem_resume() - resume callback for runtime_pm From 564973a259ec76f2dad0853420e7034cc43994c4 Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Sat, 15 Aug 2026 17:46:51 +0900 Subject: [PATCH 033/250] ipv6: use RCU iterator to dump route exceptions rt6_nh_dump_exceptions() uses hlist_for_each_entry() to iterate over RCU-protected exception lists. The caller holds rcu_read_lock(), but does not hold rt6_exception_lock, so rt6_insert_exception() can concurrently add an entry with hlist_add_head_rcu(). KCSAN reports this race (irrelevant details omitted): ================================================================== BUG: KCSAN: data-race in rt6_insert_exception / rt6_nh_dump_exceptions write (marked) to 0xffff8a7c44c59620 of 8 bytes by interrupt on cpu 5: rt6_insert_exception+0x3bb/0x760 __ip6_rt_update_pmtu+0x4fe/0x750 ip6_sk_update_pmtu+0x19a/0x3b0 udpv6_err+0x3ff/0x800 icmpv6_notify+0x1e1/0x440 icmpv6_rcv+0x8c0/0xab0 ip6_protocol_deliver_rcu+0x616/0x840 ip6_input_finish+0xb9/0x160 ... entry_SYSCALL_64_after_hwframe+0x77/0x7f read to 0xffff8a7c44c59620 of 8 bytes by task 549 on cpu 14: rt6_nh_dump_exceptions+0xb3/0x260 rt6_dump_route+0x53e/0x5f0 fib6_dump_node+0x6d/0xf0 fib6_walk_continue+0x290/0x2d0 fib6_dump_table+0x28d/0x360 inet6_dump_fib+0x37d/0x620 rtnl_dumpit+0x7b/0xd0 netlink_dump+0x3ae/0x7e0 ... entry_SYSCALL_64_after_hwframe+0x77/0x7f 4 locks held by dumper/549: ... #1: (rcu_read_lock){....}-{1:3}, at: inet6_dump_fib+0x88/0x620 #2: (&tb->tb6_lock){+.-.}-{3:3}, at: fib6_dump_table+0x1e9/0x360 #3: (rcu_read_lock){....}-{1:3}, at: rt6_dump_route+0x483/0x5f0 value changed: 0xffff8a7c44e05700 -> 0xffff8a7c45d60100 Reported by Kernel Concurrency Sanitizer on: CPU: 14 UID: 0 PID: 549 Comm: dumper Not tainted 7.2.0-rc7-virtme #38 PREEMPT(lazy) ... Use hlist_for_each_entry_rcu() to safely iterate over the exception list. Fixes: 1e47b4837f3b ("ipv6: Dump route exceptions if requested") Cc: stable@vger.kernel.org Signed-off-by: Yuyang Huang Reviewed-by: Stefano Brivio Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 5968ce5ad15082..64fdf1a7d5f480 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6029,7 +6029,7 @@ static int rt6_nh_dump_exceptions(struct fib6_nh *nh, void *arg) return 0; for (i = 0; i < FIB6_EXCEPTION_BUCKET_SIZE; i++) { - hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) { + hlist_for_each_entry_rcu(rt6_ex, &bucket->chain, hlist) { if (w->skip) { w->skip--; continue; From f56c000d6f5e0b98c1475b2af4fc7c5103afd202 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Sat, 1 Aug 2026 17:28:04 +0300 Subject: [PATCH 034/250] efivarfs: Rate limit statfs() handler Ravi reports that statfs() may be called by unprivileged users on the efivarfs mount point, which may result in a flood of calls to the QueryVariableInfo() runtime service. These calls are disproportionately costly on x86 systems where the variable store is backed by SMM, as each SMM entry requires a rendez-vous of all the CPUs. So rate limit the calls to QueryVariableInfo() at twice per second, and return the most recently obtained value for calls that are elided. Cc: Reported-by: Ravi Bangoria Fixes: d86ff3333cb1 ("efivarfs: expose used and total size") Reviewed-by: Anisse Astier Signed-off-by: Ard Biesheuvel --- fs/efivarfs/super.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 733c19571f1cfe..8d33f11db2a1b3 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -89,12 +89,30 @@ static int efivarfs_statfs(struct dentry *dentry, struct kstatfs *buf) /* Some UEFI firmware does not implement QueryVariableInfo() */ storage_space = remaining_space = 0; if (efi_rt_services_supported(EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO)) { - status = efivar_query_variable_info(attr, &storage_space, - &remaining_space, - &max_variable_size); - if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED) - pr_warn_ratelimited("query_variable_info() failed: 0x%lx\n", - status); + static DEFINE_RATELIMIT_STATE(_rs, 2 * HZ, 5); + static u64 storage, remaining; + static DEFINE_SPINLOCK(lock); + + if (!__ratelimit(&_rs)) { + ratelimit_set_flags(&_rs, RATELIMIT_MSG_ON_RELEASE); + + spin_lock(&lock); + storage_space = storage; + remaining_space = remaining; + spin_unlock(&lock); + } else { + status = efivar_query_variable_info(attr, &storage_space, + &remaining_space, + &max_variable_size); + if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED) + pr_warn("query_variable_info() failed: 0x%lx\n", + status); + + spin_lock(&lock); + storage = storage_space; + remaining = remaining_space; + spin_unlock(&lock); + } } /* From 16989c88e98fb6b795d514ba81ecb5493babfe09 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 19 Aug 2026 21:05:18 +0200 Subject: [PATCH 035/250] iio: frequency: adf4377: Make sure clk_init_data is fully initialized The clk_init_data structure contains several mutually-exclusive members for different methods to specify the possible parents of a clock, prompting drivers to initialize only the members they need. However, not initializing all members may cause subtle issues, which are only exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is enabled. adf4377_clk_register() fills in init.parent_data, and assumes that init.parent_names is NULL. However, the latter in uninitialized, and thus may cause a crash. Make sure all members are fully initialized, to fix such bugs, and to avoid future breakage when converting drivers to a different method for specifying the parents. Fixes: 60e5448ddbec2dc2 ("iio: frequency: adf4377: add clk provider support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Brian Masney Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/frequency/adf4377.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c index ff6077e29c7398..fa56ad066cd57e 100644 --- a/drivers/iio/frequency/adf4377.c +++ b/drivers/iio/frequency/adf4377.c @@ -999,7 +999,7 @@ static int adf4377_clk_register(struct adf4377_state *st) { struct spi_device *spi = st->spi; struct device *dev = &spi->dev; - struct clk_init_data init; + struct clk_init_data init = {}; struct clk_parent_data parent_data; int ret; From dc9208cfce3c1fadbe3d93dd11a24519de9307e4 Mon Sep 17 00:00:00 2001 From: Sourav Panda Date: Tue, 11 Aug 2026 05:29:09 +0000 Subject: [PATCH 036/250] mm/hugetlb_cma: fix null nodemask dereference in hugetlb_cma_alloc_frozen_folio alloc_buddy_hugetlb_folio_with_mpol() can pass a NULL nodemask to alloc_fresh_hugetlb_folio() as a fallback to allocate from all nodes. If order is gigantic, alloc_fresh_hugetlb_folio() propagates the NULL nodemask down to hugetlb_cma_alloc_frozen_folio() via alloc_gigantic_frozen_folio(). Additionally, hugetlb_cma_alloc_frozen_folio() previously attempted allocation on hugetlb_cma[nid] without verifying if nid is included in the caller's nodemask. Adding a node_isset(nid, *nodemask) check ensures the initial preferred node allocation honors the memory policy / nodemask. However, hugetlb_cma_alloc_frozen_folio() dereferences the nodemask in node_isset(nid, *nodemask) and for_each_node_mask(node, *nodemask), leading to a null pointer dereference kernel panic when nodemask is NULL. Fix this by checking if nodemask is NULL in hugetlb_cma_alloc_frozen_folio() and defaulting it to cpuset_current_mems_allowed. Enclose the allocation attempts within the cpuset seqcount retry loop so that if the cpuset changes concurrently during allocation, the attempts are retried using the updated nodemask. This ensures that the initial node check and fallback loop safely honor the task's cpuset without violating cpuset constraints or causing NULL pointer dereferences or unexpected allocation failures. From a userspace perspective, this bug allows an unprivileged user to crash the kernel (trigger a panic) by requesting a gigantic hugepage allocation with MPOL_PREFERRED_MANY on a system where CMA is only configured on a subset of NUMA nodes. This can be reproduced by booting a VM with two NUMA nodes, restricting CMA to Node 1 (e.g., hugetlb_cma=1:1G default_hugepagesz=1G hugepagesz=1G hugepages=0), and running a program that allocates a 1GB hugepage area without reserving, restricts allocation to Node 0 using mbind() with MPOL_PREFERRED_MANY, and triggers a page fault: void *ptr = mmap(NULL, 1UL << 30, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_HUGE_1GB | MAP_NORESERVE, -1, 0); unsigned long nodemask = 1; /* Node 0 */ mbind(ptr, 1UL << 30, MPOL_PREFERRED_MANY, &nodemask, sizeof(nodemask) * 8, 0); memset(ptr, 0, 1UL << 30); /* Trigger fault */ This results in a NULL pointer dereference: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page Oops: Oops: 0000 [#1] SMP NOPTI RIP: 0010:hugetlb_cma_alloc_frozen_folio+0x75/0x120 Call Trace: only_alloc_fresh_hugetlb_folio.isra.0+0x2c/0x160 alloc_surplus_hugetlb_folio+0x6d/0x100 alloc_hugetlb_folio+0x3c5/0x660 hugetlb_no_page+0x3d9/0x650 Link: https://lore.kernel.org/20260811052909.475635-1-souravpanda@google.com Fixes: eb02f14c4a2b ("mm/hugetlb: allow overcommitting gigantic hugepages") Signed-off-by: Sourav Panda Reviewed-by: Muchun Song Reviewed-by: Anshuman Khandual Cc: David Hildenbrand Cc: Frank van der Linden Cc: Greg Thelen Cc: Johannes Weiner Cc: Kefeng Wang Cc: Michal Hocko Cc: Oscar Salvador Cc: Rik van Riel Cc: SeongJae Park Cc: Shakeel Butt Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton --- mm/hugetlb_cma.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/mm/hugetlb_cma.c b/mm/hugetlb_cma.c index 39344d6c78d84e..3e22161686d2f5 100644 --- a/mm/hugetlb_cma.c +++ b/mm/hugetlb_cma.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -30,15 +31,25 @@ struct folio *hugetlb_cma_alloc_frozen_folio(int order, gfp_t gfp_mask, int node; struct folio *folio; struct page *page = NULL; + const nodemask_t *nmask; + unsigned int cpuset_mems_cookie; if (!hugetlb_cma_size) return NULL; - if (hugetlb_cma[nid]) +retry_cpuset: + if (!nodemask) { + cpuset_mems_cookie = read_mems_allowed_begin(); + nmask = &cpuset_current_mems_allowed; + } else { + nmask = nodemask; + } + + if (hugetlb_cma[nid] && node_isset(nid, *nmask)) page = cma_alloc_frozen_compound(hugetlb_cma[nid], order); if (!page && !(gfp_mask & __GFP_THISNODE)) { - for_each_node_mask(node, *nodemask) { + for_each_node_mask(node, *nmask) { if (node == nid || !hugetlb_cma[node]) continue; @@ -48,8 +59,12 @@ struct folio *hugetlb_cma_alloc_frozen_folio(int order, gfp_t gfp_mask, } } - if (!page) + if (!page) { + if (!nodemask && + unlikely(read_mems_allowed_retry(cpuset_mems_cookie))) + goto retry_cpuset; return NULL; + } folio = page_folio(page); folio_set_hugetlb_cma(folio); From 9c0dcbe06dad13a0cb8903d96224b43162a0071b Mon Sep 17 00:00:00 2001 From: Shakeel Butt Date: Tue, 11 Aug 2026 13:31:55 -0700 Subject: [PATCH 037/250] memcg: make the v1 soft limit knob inert The v1 soft limit has been deprecated since v6.12 and nobody has reported depending on it. Start the removal by decoupling the interface from the implementation: keep memory.soft_limit_in_bytes, but ignore writes to it and always report the maximum value on read similar to what memory.kmem.limit_in_bytes already does. Writes are still parsed, so malformed input keeps returning -EINVAL. The knob now also behaves the same everywhere: it used to return -EOPNOTSUPP on PREEMPT_RT, where soft limit reclaim has always been disabled. This also fixes the syzbot report linked below. Soft limit reclaim is the only caller that runs shrink_lruvec() from kswapd against a specific memcg, so it is the only way to reach lru_gen_shrink_lruvec() and in turn set_mm_walk(), which warns when called from kswapd. Link: https://lore.kernel.org/20260811203203.3456029-2-shakeel.butt@linux.dev Signed-off-by: Shakeel Butt Reported-by: syzbot+12ee2725d5fde63a9c96@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/6a7a6929.b50370da.49fe0.005e.GAE@google.com/ Acked-by: Michal Hocko Cc: Axel Rasmussen Cc: Barry Song Cc: David Hildenbrand Cc: Johannes Weiner Cc: Kairui Song Cc: Lorenzo Stoakes Cc: Muchun Song Cc: Roman Gushchin Cc: Signed-off-by: Andrew Morton --- .../admin-guide/cgroup-v1/memory.rst | 49 +++---------------- mm/memcontrol-v1.c | 43 +++++++++------- 2 files changed, 32 insertions(+), 60 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst index 7db63c0029221e..7d2a44af52c932 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -47,7 +47,6 @@ Features: - pages are linked to per-memcg LRU exclusively, and there is no global LRU. - optionally, memory+swap usage can be accounted and limited. - hierarchical accounting - - soft limit - moving (recharging) account at moving a task is selectable. - usage threshold notifier - memory pressure notifier @@ -76,10 +75,9 @@ Brief summary of control files. memory.memsw.failcnt show the number of memory+Swap hits limits memory.max_usage_in_bytes show max memory usage recorded memory.memsw.max_usage_in_bytes show max memory+Swap usage recorded - memory.soft_limit_in_bytes set/show soft limit of memory usage - This knob is not available on CONFIG_PREEMPT_RT systems. - This knob is deprecated and shouldn't be - used. + memory.soft_limit_in_bytes This knob is deprecated and has no effect. + Writes are ignored and reads always + return the maximum value. memory.stat show various statistics memory.use_hierarchy set/show hierarchical account enabled This knob is deprecated and shouldn't be @@ -340,9 +338,6 @@ memory.kmem.usage_in_bytes, or in a separate counter when it makes sense. The main "kmem" counter is fed into the main counter, so kmem charges will also be visible from the user counter. -Currently no soft limit is implemented for kernel memory. It is future work -to trigger slab reclaim when those limits are reached. - 2.7.1 Current Kernel Memory resources accounted ----------------------------------------------- @@ -710,42 +705,10 @@ For compatibility reasons writing 1 to memory.use_hierarchy will always pass:: THIS IS DEPRECATED! -Soft limits allow for greater sharing of memory. The idea behind soft limits -is to allow control groups to use as much of the memory as needed, provided - -a. There is no memory contention -b. They do not exceed their hard limit - -When the system detects memory contention or low memory, control groups -are pushed back to their soft limits. If the soft limit of each control -group is very high, they are pushed back as much as possible to make -sure that one control group does not starve the others of memory. - -Please note that soft limits is a best-effort feature; it comes with -no guarantees, but it does its best to make sure that when memory is -heavily contended for, memory is allocated based on the soft limit -hints/setup. Currently soft limit based reclaim is set up such that -it gets invoked from balance_pgdat (kswapd). - -7.1 Interface -------------- - -Soft limits can be setup by using the following commands (in this example we -assume a soft limit of 256 MiB):: - - # echo 256M > memory.soft_limit_in_bytes - -If we want to change this to 1G, we can at any time use:: +Writing to memory.soft_limit_in_bytes has no effect and reading it will +always return the maximum value. - # echo 1G > memory.soft_limit_in_bytes - -.. note:: - Soft limits take effect over a long period of time, since they involve - reclaiming memory for balancing between memory cgroups - -.. note:: - It is recommended to set the soft limit always below the hard limit, - otherwise the hard limit will take precedence. +Use memory.low and memory.min in cgroup v2 instead. .. _cgroup-v1-memory-move-charges: diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 7650692115678c..9495fa7a5fd9ff 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -95,7 +95,6 @@ enum { RES_LIMIT, RES_MAX_USAGE, RES_FAILCNT, - RES_SOFT_LIMIT, }; #ifdef CONFIG_LOCKDEP @@ -1589,6 +1588,30 @@ static int mem_cgroup_hierarchy_write(struct cgroup_subsys_state *css, return -EINVAL; } +static u64 mem_cgroup_soft_limit_read(struct cgroup_subsys_state *css, + struct cftype *cft) +{ + return (u64)PAGE_COUNTER_MAX * PAGE_SIZE; +} + +static ssize_t mem_cgroup_soft_limit_write(struct kernfs_open_file *of, + char *buf, size_t nbytes, loff_t off) +{ + unsigned long nr_pages; + int ret; + + ret = page_counter_memparse(strstrip(buf), "-1", &nr_pages); + if (ret) + return ret; + + pr_warn_once("soft_limit_in_bytes is deprecated and will be removed. " + "Writing any value to this file has no effect. " + "Please report your usecase to linux-mm@kvack.org if you " + "depend on this functionality.\n"); + + return nbytes; +} + static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, struct cftype *cft) { @@ -1625,8 +1648,6 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, return (u64)counter->watermark * PAGE_SIZE; case RES_FAILCNT: return counter->failcnt; - case RES_SOFT_LIMIT: - return (u64)READ_ONCE(memcg->soft_limit) * PAGE_SIZE; default: BUG(); } @@ -1721,17 +1742,6 @@ static ssize_t mem_cgroup_write(struct kernfs_open_file *of, break; } break; - case RES_SOFT_LIMIT: - if (IS_ENABLED(CONFIG_PREEMPT_RT)) { - ret = -EOPNOTSUPP; - } else { - pr_warn_once("soft_limit_in_bytes is deprecated and will be removed. " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); - WRITE_ONCE(memcg->soft_limit, nr_pages); - ret = 0; - } - break; } return ret ?: nbytes; } @@ -2085,9 +2095,8 @@ struct cftype mem_cgroup_legacy_files[] = { }, { .name = "soft_limit_in_bytes", - .private = MEMFILE_PRIVATE(_MEM, RES_SOFT_LIMIT), - .write = mem_cgroup_write, - .read_u64 = mem_cgroup_read_u64, + .write = mem_cgroup_soft_limit_write, + .read_u64 = mem_cgroup_soft_limit_read, }, { .name = "failcnt", From 9879f62b2df20abaa24910968bab000fc6a37c11 Mon Sep 17 00:00:00 2001 From: Narek Jilavyan Date: Mon, 17 Aug 2026 10:34:33 +0000 Subject: [PATCH 038/250] mm/hugetlb_cgroup: call page_counter_set_max() outside VM_BUG_ON() hugetlb_cgroup_css_alloc() rounds the counter limit down to a multiple of the huge page size and then applies it inside an assertion: VM_BUG_ON(page_counter_set_max(fault, limit)); VM_BUG_ON(page_counter_set_max(rsvd, limit)); With CONFIG_DEBUG_VM=n, VM_BUG_ON(cond) is BUILD_BUG_ON_INVALID(cond), i.e. ((void)(sizeof((__force long)(cond)))), whose operand is never evaluated. page_counter_set_max() is not a predicate - it performs xchg(&counter->max, nr_pages) - so on every non-debug kernel the limit is never applied and the counters keep page_counter_init()'s PAGE_COUNTER_MAX. That is user-visible, because hugetlb_cgroup_read_u64_max() recomputes the same rounded value and uses equality as its "unlimited" sentinel. PAGE_COUNTER_MAX is LONG_MAX / PAGE_SIZE = 2251799813685247, which is odd, so round_down() really does change it and the two sides disagree. With CONFIG_DEBUG_VM=n: $ cat /sys/fs/cgroup/t/hugetlb.2MB.max 9223372036854771712 and with this patch: $ cat /sys/fs/cgroup/t/hugetlb.2MB.max max A debug option should not change cgroup output. Call the function, then assert the result, as v6.12 did. Use VM_WARN_ON_ONCE() rather than restoring VM_BUG_ON(): the two are identical under CONFIG_DEBUG_VM=n, and checkpatch asks that new code not use BUG() variants. Link: https://lore.kernel.org/20260817103433.191266-1-njilav@gmail.com Fixes: 0e2759afcaf9 ("page_counter: track failcnt only for legacy cgroups") Signed-off-by: Narek Jilavyan Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Oscar Salvador Cc: Shakeel Butt Cc: Signed-off-by: Andrew Morton --- mm/hugetlb_cgroup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index e0083de1ca82b5..ecb6e0b7819a0d 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -97,6 +97,7 @@ static void hugetlb_cgroup_init(struct hugetlb_cgroup *h_cgroup, struct page_counter *fault, *fault_parent = NULL; struct page_counter *rsvd, *rsvd_parent = NULL; unsigned long limit; + int ret; if (parent_h_cgroup) { fault_parent = hugetlb_cgroup_counter_from_cgroup( @@ -118,8 +119,10 @@ static void hugetlb_cgroup_init(struct hugetlb_cgroup *h_cgroup, limit = round_down(PAGE_COUNTER_MAX, pages_per_huge_page(&hstates[idx])); - VM_BUG_ON(page_counter_set_max(fault, limit)); - VM_BUG_ON(page_counter_set_max(rsvd, limit)); + ret = page_counter_set_max(fault, limit); + VM_WARN_ON_ONCE(ret); + ret = page_counter_set_max(rsvd, limit); + VM_WARN_ON_ONCE(ret); } } From 23ecbde06714b871c1acd32cdbb14fbea297217f Mon Sep 17 00:00:00 2001 From: Hui Su Date: Mon, 17 Aug 2026 20:08:00 +0800 Subject: [PATCH 039/250] mm/migrate_device: avoid out-of-bounds writes for compound folios migrate_device_range() and migrate_device_pfns() clear the entries following a compound folio so that the PFN arrays retain their page-granular representation. If a compound folio extends beyond the end of the caller-provided range, the loops clear all following folio entries without limiting them to the number of slots remaining in the npages-sized array, causing an out-of-bounds write. Do not proceed with a compound folio if its page-granular representation does not fit entirely in the remaining PFN array. If this happens, drop any reference and lock acquired for the folio, clear the remaining entries, and stop collecting. Observed with a KASAN x86 QEMU kernel using the HMM migrate_anon_huge_zero selftest. Closing /dev/hmm_dmirror0 after migrating an anonymous huge page to device memory exercises: dmirror_fops_release() -> dmirror_device_evict_chunk() -> migrate_device_range() Link: https://lore.kernel.org/20260817120758.669807-3-sh_def@163.com Fixes: a30b48bf1b24 ("mm/migrate_device: implement THP migration of zone device pages") Signed-off-by: Hui Su Cc: Alistair Popple Cc: Balbir Singh Cc: Byungchul Park Cc: David Hildenbrand Cc: Gregory Price Cc: "Huang, Ying" Cc: Joshua Hahn Cc: Matthew Brost Cc: Rakie Kim Cc: Zi Yan Cc: Signed-off-by: Andrew Morton --- mm/migrate_device.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 908d2d4ec43ac9..69b8d0660bab4c 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -1400,6 +1400,15 @@ int migrate_device_range(unsigned long *src_pfns, unsigned long start, src_pfns[i] = migrate_device_pfn_lock(pfn); nr = folio_nr_pages(folio); + if (nr > npages - i) { + if (src_pfns[i] & MIGRATE_PFN_MIGRATE) { + folio_unlock(folio); + folio_put(folio); + } + memset(&src_pfns[i], 0, + (npages - i) * sizeof(*src_pfns)); + break; + } if (nr > 1) { src_pfns[i] |= MIGRATE_PFN_COMPOUND; for (j = 1; j < nr; j++) @@ -1434,6 +1443,15 @@ int migrate_device_pfns(unsigned long *src_pfns, unsigned long npages) src_pfns[i] = migrate_device_pfn_lock(src_pfns[i]); nr = folio_nr_pages(folio); + if (nr > npages - i) { + if (src_pfns[i] & MIGRATE_PFN_MIGRATE) { + folio_unlock(folio); + folio_put(folio); + } + memset(&src_pfns[i], 0, + (npages - i) * sizeof(*src_pfns)); + break; + } if (nr > 1) { src_pfns[i] |= MIGRATE_PFN_COMPOUND; for (j = 1; j < nr; j++) From 060d990c79f2f5a6c57ca5ea62fbb43b9aafc433 Mon Sep 17 00:00:00 2001 From: Longlong Xia Date: Fri, 14 Aug 2026 16:30:27 +0800 Subject: [PATCH 040/250] mm/hugetlb: keep max_huge_pages when dissolving surplus folios dissolve_free_hugetlb_folio() can remove a free folio as surplus when its node has surplus pages. In that case remove_hugetlb_folio() decrements both nr_huge_pages and surplus_huge_pages, leaving the persistent pool size unchanged. Updating max_huge_pages as if a persistent folio had been removed can therefore corrupt the persistent pool target and underflow it when max_huge_pages is zero. Keep max_huge_pages unchanged for surplus folios, including the vmemmap restoration rollback path. Link: https://lore.kernel.org/20260814083027.1419487-1-xialonglong2025@163.com Fixes: cb402bbdabca ("mm/hugetlb: fix surplus pages in dissolve_free_huge_page()") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Longlong Xia Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Jinjiang Tu Cc: Longlong Xia Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e93c4d2456aa46..2239e2566a52e9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2002,7 +2002,8 @@ int dissolve_free_hugetlb_folio(struct folio *folio) if (h->surplus_huge_pages_node[folio_nid(folio)]) adjust_surplus = true; remove_hugetlb_folio(h, folio, adjust_surplus); - h->max_huge_pages--; + if (!adjust_surplus) + h->max_huge_pages--; spin_unlock_irq(&hugetlb_lock); /* @@ -2022,7 +2023,8 @@ int dissolve_free_hugetlb_folio(struct folio *folio) if (rc) { spin_lock_irq(&hugetlb_lock); add_hugetlb_folio(h, folio, adjust_surplus); - h->max_huge_pages++; + if (!adjust_surplus) + h->max_huge_pages++; goto out; } } else { From 50c608b405466aa0d2b8fc68c17675e072ed93b9 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Tue, 18 Aug 2026 10:47:26 +0800 Subject: [PATCH 041/250] mm: fix incorrect vm_flags usage when checking allowable orders for tmpfs Lance reported that when nothing else causes the mm to be considered for khugepaged collapse, an MADV_HUGEPAGE-advised tmpfs VMA alone does not trigger scanning. After commit 6beeab870e70 ("mm: shmem: move shmem_huge_global_enabled() into shmem_allowable_huge_orders()"), the shmem/tmpfs allowable order check reads vma->flags directly. However, when MADV_HUGEPAGE is handled, khugepaged_enter_vma() is called before the VMA's flags have been updated, so the check uses stale flags and incorrectly rejects the VMA for collapse. As a result, khugepaged does not collapse the tmpfs file into PMD order in time. Fix this by calling khugepaged_enter_vma() with the new VMA flags in madvise_update_vma(). Meanwhile we can remove the khugepaged_enter_vma() in hugepage_madvise(). Link: https://lore.kernel.org/7d5b5eb27be798f89d563b06254c947ff53db0b2.1787020910.git.baolin.wang@linux.alibaba.com Fixes: 6beeab870e70 ("mm: shmem: move shmem_huge_global_enabled() into shmem_allowable_huge_orders()") Signed-off-by: Baolin Wang Reported-by: Lance Yang Closes: https://lore.kernel.org/all/20260815181632.21453-1-lance.yang@linux.dev/ Suggested-by: Lorenzo Stoakes (ARM) Reviewed-by: Zi Yan Reviewed-by: Lorenzo Stoakes (ARM) Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Hugh Dickins Cc: Lance Yang Cc: Liam R. Howlett Cc: Ryan Roberts Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton --- mm/khugepaged.c | 6 ------ mm/madvise.c | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 617bca76db49b6..2d0aee0312f246 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -452,12 +452,6 @@ int hugepage_madvise(struct vm_area_struct *vma, case MADV_HUGEPAGE: *vm_flags &= ~VM_NOHUGEPAGE; *vm_flags |= VM_HUGEPAGE; - /* - * If the vma become good for khugepaged to scan, - * register it here without waiting a page fault that - * may not happen any time soon. - */ - khugepaged_enter_vma(vma, *vm_flags); break; case MADV_NOHUGEPAGE: *vm_flags &= ~VM_HUGEPAGE; diff --git a/mm/madvise.c b/mm/madvise.c index 77552b03d318d9..9083b89e441295 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -177,6 +177,14 @@ static int madvise_update_vma(vm_flags_t new_flags, /* vm_flags is protected by the mmap_lock held in write mode. */ vma_start_write(vma); vma->flags = new_vma_flags; + /* + * If the vma become good for khugepaged to scan, + * register it here without waiting a page fault that + * may not happen any time soon. + */ + if (vma_flags_test(&new_vma_flags, VMA_HUGEPAGE_BIT)) + khugepaged_enter_vma(vma, vma_flags_to_legacy(new_vma_flags)); + if (set_new_anon_name) return replace_anon_vma_name(vma, anon_name); From 66e76f8e5440e6559c30c644e6343cbfb04b3757 Mon Sep 17 00:00:00 2001 From: Bryan Lim Date: Wed, 19 Aug 2026 10:08:24 +0700 Subject: [PATCH 042/250] userfaultfd: reset err to be 0 when move_pages_ptes succeeded During move_pages() operation, when move_pages_ptes() returns EAGAIN, the error code is not cleared even after we processed it. This leads to a successful retry but then the same pages are retried again due to the stale error code. This time move fails because pages are already moved, loop is terminated and move_pages() reports a failure. Clear the error code once we processes EAGAIN. Link: https://lore.kernel.org/e1e0b5f8-c3c6-0537-670b-4397f822f980@gmail.com Fixes: 50944692052b ("userfaultfd: opportunistic TLB-flush batching for present pages in MOVE") Assisted-by: ChatGPT:GPT-5.6-Luna Signed-off-by: Bryan Lim Reviewed-by: Suren Baghdasaryan Cc: Mike Rapoport Cc: Peter Xu Cc: Signed-off-by: Andrew Morton --- mm/userfaultfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c index c3adedaaf7d547..ec5d511bd1791d 100644 --- a/mm/userfaultfd.c +++ b/mm/userfaultfd.c @@ -2085,8 +2085,10 @@ static ssize_t move_pages(struct userfaultfd_ctx *ctx, unsigned long dst_start, } if (err) { - if (err == -EAGAIN) + if (err == -EAGAIN) { + err = 0; continue; + } break; } From 90c4f67f851fd12eeb8eb1111108de90bb44cb3e Mon Sep 17 00:00:00 2001 From: Lance Yang Date: Thu, 20 Aug 2026 09:45:35 +0800 Subject: [PATCH 043/250] MAINTAINERS: add Lance Yang as a hung task detector co-maintainer I've been a hung_task reviewer for over a year now and plan to stay involved. Take on more responsibility for hung_task as a co-maintainer. Link: https://lore.kernel.org/20260820014535.79105-1-lance.yang@linux.dev Signed-off-by: Lance Yang Cc: "Masami Hiramatsu (Google)" Cc: Petr Mladek Signed-off-by: Andrew Morton --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 651d91bcb1a62f..6435791dfe6d2d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12140,7 +12140,7 @@ F: drivers/tty/hvc/ HUNG TASK DETECTOR M: Andrew Morton -R: Lance Yang +M: Lance Yang R: Masami Hiramatsu R: Petr Mladek L: linux-kernel@vger.kernel.org From f9226ddd5d433dadbec9009c11ac2cb9d57237ca Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Mon, 29 Jun 2026 12:33:37 -0400 Subject: [PATCH 044/250] mm: mempolicy: fix automatic numa balancing for shmem Neha reports that mapped shmem aren't considered for NUMA balancing, noting convergence problems and bandwidth bottlenecking for cachelib based workloads on tiered memory systems. Looking at the code and going through the git history, this doesn't actually seem intentional: Commit fc3147245d19 ("mm: numa: Limit NUMA scanning to migrate-on-fault VMAs") added a vma_policy_mof() gate to task_numa_work() so VMAs whose policy lacks MPOL_F_MOF are skipped from NUMA balancing scans. The motivation was a real usecase: Oracle was pinning shared segments with mbind(MPOL_BIND) so trapping faults was both expensive and pointless. The handling of NULL from vm_ops->get_policy, however, treated "user explicitly opted out" the same as "user never specified anything." For VMAs whose shared policy is absent - the common case for shmem - the scan was disabled too. This issue is old. It probably hurts less in conventional NUMA. But it's very noticeable on tiered systems, where entire tmpfs workingsets can get stuck on lower-bandwidth memory. Fix this by having vma_policy_mof() use __get_vma_policy() directly, and thereby handle the fallback to task policy (-> preferred_node_policy() has MPOL_F_MOF per default). Every other consumer of vm_ops->get_policy already handles it this way, the scan-eligibility check was the outlier. This preserves Mel's intended fix: don't scan stuff the user explicitly pinned. But allow default policy vmas to participate in balancing. Link: https://lore.kernel.org/20260629163337.1264881-1-hannes@cmpxchg.org Fixes: fc3147245d19 ("mm: numa: Limit NUMA scanning to migrate-on-fault VMAs") Signed-off-by: Johannes Weiner Reported-by: Neha Gholkar Tested-by: Neha Gholkar Reviewed-by: Gregory Price Acked-by: David Hildenbrand (Arm) Acked-by: Balbir Singh Cc: Alistair Popple Cc: Byungchul Park Cc: "Huang, Ying" Cc: Joshua Hahn Cc: Matthew Brost Cc: Rakie Kim Cc: Zi Yan Cc: Signed-off-by: Andrew Morton --- mm/mempolicy.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 501e0b80d7da10..5720f7f54d942f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2060,24 +2060,15 @@ struct mempolicy *get_vma_policy(struct vm_area_struct *vma, bool vma_policy_mof(struct vm_area_struct *vma) { struct mempolicy *pol; + pgoff_t ilx; + bool mof; - if (vma->vm_ops && vma->vm_ops->get_policy) { - bool ret = false; - pgoff_t ilx; /* ignored here */ - - pol = vma->vm_ops->get_policy(vma, vma->vm_start, &ilx); - if (pol && (pol->flags & MPOL_F_MOF)) - ret = true; - mpol_cond_put(pol); - - return ret; - } - - pol = vma->vm_policy; + pol = __get_vma_policy(vma, vma->vm_start, &ilx); if (!pol) pol = get_task_policy(current); - - return pol->flags & MPOL_F_MOF; + mof = pol->flags & MPOL_F_MOF; + mpol_cond_put(pol); + return mof; } bool apply_policy_zone(struct mempolicy *policy, enum zone_type zone) From 1f8f6c1cacd2d309ebb3c9f26da446f3f22da50e Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Thu, 2 Jul 2026 10:25:46 +0900 Subject: [PATCH 045/250] mm: nommu: point to the write iterator upon split_vma When a user invokes munmap(2) on a partial region allocated by mmap(), the kernel may split the original region if necessary and shrink it to the correct size. At the beginning of vmi_shrink_vma(), the unused part is cleared; however, an assertion is triggered if the shrink occurs after split_vma(). This commit fixes the issue by correctly configuring the pointer to the iterator at the end of split_vma(). This bug was detected using the Linux Test Project (LTP) test linked below, running on a nommu UML (User-Mode Linux) environment (via an out-of-tree extension to UML). Here is a minimal reproducible chunk of code for this issue: void *addr; size_t pagesize = getpagesize(); addr = mmap(NULL, pagesize * 4, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); munmap(addr + pagesize * 1, pagesize); This is the console output with CONFIG_DEBUG_MAPLE_TREE=y. nommu: WARN at __mas_set_range:791 (1) MAS: tree=0000000091c23b08 enode=0000000065057663 (ma_active) Store Type: node_store [9/9] index=70af8000 last=ffffffffffffffff min=0 max=ffffffffffffffff sheaf=0000000000000000, request 0 depth=0, flags=0 maple_tree(0000000091c23b08) flags 307, height 1 root 0000000083394c06 0-ffffffffffffffff: node 0000000010c90bd6 depth 0 type 1 parent 0000000050e1ddf8 contents: 0000000000000000 707A 7FFF 00000000eb0ac2b5 707AFFFF 0000000000000000 7093FFFF 0000000045ead616 7095FFFF 0000000000000000 7096CFFF 000 00000681c7151 7096FFFF 0000000000000000 70AF3FFF 000000006c78b9e9 70AF4FFF 000000001914ab0b 70AF7FFF 00000000000 00000 FFFFFFFFFFFFFFFF 0000000000000000 0 0000000000000000 0 0000000000000000 0 0000000000000000 0 0000000000000 000 0 00000000bca8be4f 0-707a7fff: 0000000000000000 707a8000-707affff: 00000000eb0ac2b5 707b0000-7093ffff: 0000000000000000 70940000-7095ffff: 0000000045ead616 70960000-7096cfff: 0000000000000000 7096d000-7096ffff: 00000000681c7151 70970000-70af3fff: 0000000000000000 70af4000-70af4fff: 000000006c78b9e9 70af5000-70af7fff: 000000001914ab0b 70af8000-ffffffffffffffff: 0000000000000000 nommu: Pass: 796 Run:797 Link: https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mseal/mseal02.c Link: https://lore.kernel.org/20260702012546.665383-1-thehajime@gmail.com Signed-off-by: Hajime Tazaki Cc: Jann Horn Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Pedro Falcato Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/nommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/nommu.c b/mm/nommu.c index 277f663e1c5bca..498e01ee40b056 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1393,6 +1393,10 @@ static int split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, setup_vma_to_mm(vma, mm); setup_vma_to_mm(new, mm); vma_iter_store_new(vmi, new); + + /* vmi should point lower address */ + if (new_below) + vma_next(vmi); mm->map_count++; return 0; From 197bce2d7a8035b754419293bfb54839befd39ac Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Wed, 10 Jun 2026 15:09:04 -0700 Subject: [PATCH 046/250] maple_tree: remove undocumented CONFIG_MAPLE_RCU_DISABLED macro consults the macro CONFIG_MAPLE_RCU_DISABLED to determine whether to disable the mt_in_rcu() function (by making it always return false). This macro is not reachable via Kconfig, despite its name, and is not documented anywhere. Remove it to avoid polluting the CONFIG_* namespace. Discovered while searching for CONFIG_* symbols referenced in code but not defined in any Kconfig file. Link: https://lore.kernel.org/20260610220905.99860-1-enelsonmoore@gmail.com Signed-off-by: Ethan Nelson-Moore Acked-by: SeongJae Park Reviewed-by: Liam Howlett Reviewed-by: Alice Ryhl Cc: Andrew Ballance Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 4a5631906affb5..1b3014377105cd 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -11,7 +11,6 @@ #include #include #include -/* #define CONFIG_MAPLE_RCU_DISABLED */ /* * Allocated nodes are mutable until they have been inserted into the tree, @@ -864,9 +863,6 @@ static inline void mt_init(struct maple_tree *mt) static inline bool mt_in_rcu(struct maple_tree *mt) { -#ifdef CONFIG_MAPLE_RCU_DISABLED - return false; -#endif return mt->ma_flags & MT_FLAGS_USE_RCU; } From 3538876c345cdecf24f31ca1105d80dda2eaf33a Mon Sep 17 00:00:00 2001 From: Kaitao Cheng Date: Tue, 7 Jul 2026 17:03:31 +0800 Subject: [PATCH 047/250] mm/kconfig: drop redundant memory hotplug dependencies MHP_MEMMAP_ON_MEMORY is defined inside the MEMORY_HOTPLUG block, and MEMORY_HOTPLUG already depends on SPARSEMEM_VMEMMAP. Keep the explicit MEMORY_HOTPLUG dependency for local readability, but drop the redundant SPARSEMEM_VMEMMAP dependency. ZONE_DEVICE depends on MEMORY_HOTREMOVE, which depends on MEMORY_HOTPLUG. MEMORY_HOTPLUG in turn depends on SPARSEMEM_VMEMMAP. Drop the direct MEMORY_HOTPLUG and SPARSEMEM_VMEMMAP dependencies from ZONE_DEVICE. This does not change the set of valid configurations. Link: https://lore.kernel.org/20260707090331.52971-1-kaitao.cheng@linux.dev Signed-off-by: Kaitao Cheng Acked-by: David Hildenbrand (Arm) Acked-by: Muchun Song Reviewed-by: Lorenzo Stoakes Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 3185500ce7b7fe..d28dde592de460 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -588,7 +588,7 @@ config MEMORY_HOTREMOVE config MHP_MEMMAP_ON_MEMORY def_bool y - depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP + depends on MEMORY_HOTPLUG depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE endif # MEMORY_HOTPLUG @@ -1227,9 +1227,7 @@ config ZONE_DMA32 config ZONE_DEVICE bool "Device memory (pmem, HMM, etc...) hotplug support" - depends on MEMORY_HOTPLUG depends on MEMORY_HOTREMOVE - depends on SPARSEMEM_VMEMMAP select XARRAY_MULTI help From 78868ebede2d4397b78e3af7c1a25d778aa619a9 Mon Sep 17 00:00:00 2001 From: Wupeng Ma Date: Tue, 7 Jul 2026 19:02:54 +0800 Subject: [PATCH 048/250] mm/hugetlb: fix missing migratable flag on same-node hugetlb migration Commit ba23f58de896 ("mm/migrate: don't call folio_putback_active_hugetlb() on dst hugetlb folio") moved setting of the migratable flag and active-list placement from folio_putback_active_hugetlb(dst) into move_hugetlb_state(), so that the freshly allocated destination folio is handled where allocation is known to have succeeded. Unfortunately, the new code was appended after the existing temporary-folio block in move_hugetlb_state(), which contains an early return added earlier by commit 5af1ab1d24e08 ("mm/hugetlb: optimize the surplus state transfer code in move_hugetlb_state()"): if (folio_test_hugetlb_temporary(new_folio)) { ... if (new_nid == old_nid) return; <-- skips the new code ... } /* added by ba23f58 */ folio_set_hugetlb_migratable(new_folio); list_move_tail(&new_folio->lru, ...&h->hugepage_activelist); When the destination folio is temporary (i.e. the hugetlb pool was exhausted and the migration callback fell back to alloc_migrate_hugetlb_folio()) and the migration does not cross a node -- the common case, and always true on a single-NUMA system -- move_hugetlb_state() returns before setting the migratable flag or adding the new folio to the active list. The destination folio is then installed in the page table but cannot be isolated afterwards, since folio_isolate_hugetlb() rejects folios without the migratable flag; a subsequent soft-offline, hard-offline or memory-hotplug offline of that folio fails with -EBUSY. This was reproduced on a single-NUMA arm64 VM: a second MADV_SOFT_OFFLINE on an already-migrated hugetlb page returned EBUSY and logged "hugepage isolation failed". Keep the surplus adjustment, which is the only part that depends on the node crossing, guarded by `if (new_nid != old_nid)', while making the migratable flag and active-list placement unconditional. This preserves the cleanup intent of ba23f58 and closes the early-return hole. Link: https://lore.kernel.org/20260707110254.3147686-1-mawupeng1@huawei.com Fixes: ba23f58de896 ("mm/migrate: don't call folio_putback_active_hugetlb() on dst hugetlb folio") Signed-off-by: Wupeng Ma Cc: Baolin Wang Cc: David Hildenbrand Cc: Muchun Song Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b006576d412c04..0c8c5e71911352 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7338,14 +7338,14 @@ void move_hugetlb_state(struct folio *old_folio, struct folio *new_folio, * There is no need to transfer the per-node surplus state * when we do not cross the node. */ - if (new_nid == old_nid) - return; - spin_lock_irq(&hugetlb_lock); - if (h->surplus_huge_pages_node[old_nid]) { - h->surplus_huge_pages_node[old_nid]--; - h->surplus_huge_pages_node[new_nid]++; + if (new_nid != old_nid) { + spin_lock_irq(&hugetlb_lock); + if (h->surplus_huge_pages_node[old_nid]) { + h->surplus_huge_pages_node[old_nid]--; + h->surplus_huge_pages_node[new_nid]++; + } + spin_unlock_irq(&hugetlb_lock); } - spin_unlock_irq(&hugetlb_lock); } /* From 6bebdc951e5d487fdec63141d322c0f878cd231b Mon Sep 17 00:00:00 2001 From: "David Hildenbrand (Arm)" Date: Thu, 9 Jul 2026 10:13:34 +0530 Subject: [PATCH 049/250] mm: standardize printing for pgtable entries Bad page map reporting currently stores page table entry values in an unsigned long long and prints them with fixed 64-bit-oriented format strings. This is inconsistent across call sites and does not work well for architectures where page table entry values are not naturally represented as 64-bit values, such as 32-bit or 128-bit entries. Introduce a common helper to convert raw page table entry values into a fixed-width hexadecimal string based on the actual entry size. Use it for bad page map reporting and for dumping the page table walk in __print_bad_page_map_pgtable(). Pass page table entry values to the reporting path as raw bytes together with their size, instead of forcing them through an unsigned long long. It keeps the printed output consistent and avoids truncation or misleading formatting for non-64-bit page table entries. Link: https://lore.kernel.org/20260709044334.1741263-1-anshuman.khandual@arm.com Signed-off-by: David Hildenbrand (Arm) Co-developed-by: Anshuman Khandual Signed-off-by: Anshuman Khandual Cc: Andriy Shevchenko Cc: David Hildenbrand Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Signed-off-by: Andrew Morton --- mm/memory.c | 102 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 23 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index be743a9c6606af..d2f14ba2261cd0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -519,9 +519,52 @@ static bool is_bad_page_map_ratelimited(void) return false; } +static void ptval_bytes_to_hex_str(char *buf, size_t buf_size, const void *entry, size_t entry_size) +{ + if (WARN_ON_ONCE(buf_size < entry_size * 2 + 1)) { + snprintf(buf, buf_size, "overflow"); + return; + } + + switch (entry_size) { + case sizeof(u32): + snprintf(buf, buf_size, "%08x", *(const u32 *)entry); + break; + case sizeof(u64): + snprintf(buf, buf_size, "%016llx", *(const u64 *)entry); + break; +#if defined(__SIZEOF_INT128__) + case sizeof(u128): + snprintf(buf, buf_size, "%016llx%016llx", + (unsigned long long)(*(const u128 *)entry >> 64), + (unsigned long long)*(const u128 *)entry); + break; +#endif + default: + snprintf(buf, buf_size, "unsupported"); + break; + } +} + +#define ptval_to_str(buf, val) \ + do { \ + auto __val = (val); \ + \ + ptval_bytes_to_hex_str((buf), sizeof(buf), &__val, sizeof(__val)); \ + } while (0) + +#if defined(__SIZEOF_INT128__) +#define PTVAL_STR_MAX (32 + 1) /* Max 128-bit value in hex + NUL */ +#else +#define PTVAL_STR_MAX (16 + 1) /* Max 64-bit value in hex + NUL */ +#endif + static void __print_bad_page_map_pgtable(struct mm_struct *mm, unsigned long addr) { - unsigned long long pgdv, p4dv, pudv, pmdv; + char pgd_str[PTVAL_STR_MAX]; + char p4d_str[PTVAL_STR_MAX]; + char pud_str[PTVAL_STR_MAX]; + char pmd_str[PTVAL_STR_MAX]; p4d_t p4d, *p4dp; pud_t pud, *pudp; pmd_t pmd, *pmdp; @@ -532,34 +575,34 @@ static void __print_bad_page_map_pgtable(struct mm_struct *mm, unsigned long add * see locking requirements for print_bad_page_map(). */ pgdp = pgd_offset(mm, addr); - pgdv = pgd_val(*pgdp); + ptval_to_str(pgd_str, pgd_val(*pgdp)); if (!pgd_present(*pgdp) || pgd_leaf(*pgdp)) { - pr_alert("pgd:%08llx\n", pgdv); + pr_alert("pgd:%s\n", pgd_str); return; } p4dp = p4d_offset(pgdp, addr); p4d = p4dp_get(p4dp); - p4dv = p4d_val(p4d); + ptval_to_str(p4d_str, p4d_val(p4d)); if (!p4d_present(p4d) || p4d_leaf(p4d)) { - pr_alert("pgd:%08llx p4d:%08llx\n", pgdv, p4dv); + pr_alert("pgd:%s p4d:%s\n", pgd_str, p4d_str); return; } pudp = pud_offset(p4dp, addr); pud = pudp_get(pudp); - pudv = pud_val(pud); + ptval_to_str(pud_str, pud_val(pud)); if (!pud_present(pud) || pud_leaf(pud)) { - pr_alert("pgd:%08llx p4d:%08llx pud:%08llx\n", pgdv, p4dv, pudv); + pr_alert("pgd:%s p4d:%s pud:%s\n", pgd_str, p4d_str, pud_str); return; } pmdp = pmd_offset(pudp, addr); pmd = pmdp_get(pmdp); - pmdv = pmd_val(pmd); + ptval_to_str(pmd_str, pmd_val(pmd)); /* * Dumping the PTE would be nice, but it's tricky with CONFIG_HIGHPTE, @@ -567,8 +610,7 @@ static void __print_bad_page_map_pgtable(struct mm_struct *mm, unsigned long add * doing another map would be bad. print_bad_page_map() should * already take care of printing the PTE. */ - pr_alert("pgd:%08llx p4d:%08llx pud:%08llx pmd:%08llx\n", pgdv, - p4dv, pudv, pmdv); + pr_alert("pgd:%s p4d:%s pud:%s pmd:%s\n", pgd_str, p4d_str, pud_str, pmd_str); } /* @@ -584,10 +626,11 @@ static void __print_bad_page_map_pgtable(struct mm_struct *mm, unsigned long add * page table lock. */ static void print_bad_page_map(struct vm_area_struct *vma, - unsigned long addr, unsigned long long entry, struct page *page, - enum pgtable_level level) + unsigned long addr, const void *entry, size_t entry_size, + struct page *page, enum pgtable_level level) { struct address_space *mapping; + char entry_str[PTVAL_STR_MAX]; pgoff_t index; if (is_bad_page_map_ratelimited()) @@ -596,8 +639,9 @@ static void print_bad_page_map(struct vm_area_struct *vma, mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL; index = linear_page_index(vma, addr); - pr_alert("BUG: Bad page map in process %s %s:%08llx", current->comm, - pgtable_level_to_str(level), entry); + ptval_bytes_to_hex_str(entry_str, sizeof(entry_str), entry, entry_size); + pr_alert("BUG: Bad page map in process %s %s:%s", current->comm, + pgtable_level_to_str(level), entry_str); __print_bad_page_map_pgtable(vma->vm_mm, addr); if (page) dump_page(page, "bad page map"); @@ -627,8 +671,13 @@ static inline bool pgtable_level_has_pxx_special(enum pgtable_level level) } } -#define print_bad_pte(vma, addr, pte, page) \ - print_bad_page_map(vma, addr, pte_val(pte), page, PGTABLE_LEVEL_PTE) +static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, + pte_t pte, struct page *page) +{ + auto entry = pte_val(pte); + + print_bad_page_map(vma, addr, &entry, sizeof(entry), page, PGTABLE_LEVEL_PTE); +} /** * __vm_normal_page() - Get the "struct page" associated with a page table entry. @@ -636,8 +685,9 @@ static inline bool pgtable_level_has_pxx_special(enum pgtable_level level) * @addr: The address where the page table entry is mapped. * @pfn: The PFN stored in the page table entry. * @special: Whether the page table entry is marked "special". - * @level: The page table level for error reporting purposes only. * @entry: The page table entry value for error reporting purposes only. + * @entry_size: The size of @entry. + * @level: The page table level for error reporting purposes only. * * "Special" mappings do not wish to be associated with a "struct page" (either * it doesn't exist, or it exists but they don't want to touch it). In this @@ -697,7 +747,7 @@ static inline bool pgtable_level_has_pxx_special(enum pgtable_level level) */ static inline struct page *__vm_normal_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, bool special, - unsigned long long entry, enum pgtable_level level) + const void *entry, size_t entry_size, enum pgtable_level level) { if (pgtable_level_has_pxx_special(level)) { if (unlikely(special)) { @@ -710,7 +760,7 @@ static inline struct page *__vm_normal_page(struct vm_area_struct *vma, if (is_zero_pfn(pfn) || is_huge_zero_pfn(pfn)) return NULL; - print_bad_page_map(vma, addr, entry, NULL, level); + print_bad_page_map(vma, addr, entry, entry_size, NULL, level); return NULL; } /* @@ -741,7 +791,7 @@ static inline struct page *__vm_normal_page(struct vm_area_struct *vma, if (unlikely(pfn > highest_memmap_pfn)) { /* Corrupted page table entry. */ - print_bad_page_map(vma, addr, entry, NULL, level); + print_bad_page_map(vma, addr, entry, entry_size, NULL, level); return NULL; } /* @@ -767,8 +817,10 @@ static inline struct page *__vm_normal_page(struct vm_area_struct *vma, struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_t pte) { + auto entry = pte_val(pte); + return __vm_normal_page(vma, addr, pte_pfn(pte), pte_special(pte), - pte_val(pte), PGTABLE_LEVEL_PTE); + &entry, sizeof(entry), PGTABLE_LEVEL_PTE); } /** @@ -809,8 +861,10 @@ struct folio *vm_normal_folio(struct vm_area_struct *vma, unsigned long addr, struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t pmd) { + auto entry = pmd_val(pmd); + return __vm_normal_page(vma, addr, pmd_pfn(pmd), pmd_special(pmd), - pmd_val(pmd), PGTABLE_LEVEL_PMD); + &entry, sizeof(entry), PGTABLE_LEVEL_PMD); } /** @@ -850,8 +904,10 @@ struct folio *vm_normal_folio_pmd(struct vm_area_struct *vma, struct page *vm_normal_page_pud(struct vm_area_struct *vma, unsigned long addr, pud_t pud) { + auto entry = pud_val(pud); + return __vm_normal_page(vma, addr, pud_pfn(pud), pud_special(pud), - pud_val(pud), PGTABLE_LEVEL_PUD); + &entry, sizeof(entry), PGTABLE_LEVEL_PUD); } #endif From e6cad980a06e3c63aa9ff512936b71029603ad3f Mon Sep 17 00:00:00 2001 From: Kaitao Cheng Date: Sun, 12 Jul 2026 17:33:26 +0800 Subject: [PATCH 050/250] mm/kconfig: drop redundant dependency wrappers Some mm Kconfig entries repeat dependencies that are already expressed by their surrounding blocks or menus. The zsmalloc allocator options menu already depends on ZSMALLOC, so the outer if ZSMALLOC block does not add any extra constraint. MEMORY_HOTREMOVE and MHP_MEMMAP_ON_MEMORY are both inside the if MEMORY_HOTPLUG block, so their local depends on MEMORY_HOTPLUG entries are redundant. PTE_MARKER_UFFD_WP is the only entry under if USERFAULTFD. Move the USERFAULTFD dependency into the symbol itself and combine it with the architecture support dependency. This keeps the same visibility and defaults while avoiding duplicate dependency expressions. Link: https://lore.kernel.org/20260712093326.8313-1-kaitao.cheng@linux.dev Signed-off-by: Kaitao Cheng Suggested-by: Julian Braha Reviewed-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/Kconfig | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index d28dde592de460..060190e12bced3 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -125,8 +125,6 @@ config ZSWAP_COMPRESSOR_DEFAULT config ZSMALLOC tristate -if ZSMALLOC - menu "Zsmalloc allocator options" depends on ZSMALLOC @@ -161,8 +159,6 @@ config ZSMALLOC_CHAIN_SIZE endmenu -endif - menu "Slab allocator options" config SLUB @@ -583,12 +579,10 @@ endchoice config MEMORY_HOTREMOVE bool "Allow for memory hot remove" - depends on MEMORY_HOTPLUG select MIGRATION config MHP_MEMMAP_ON_MEMORY def_bool y - depends on MEMORY_HOTPLUG depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE endif # MEMORY_HOTPLUG @@ -1393,17 +1387,15 @@ menuconfig USERFAULTFD Enable the userfaultfd() system call that allows to intercept and handle page faults in userland. -if USERFAULTFD config PTE_MARKER_UFFD_WP bool "Userfaultfd write protection support for shmem/hugetlbfs" default y - depends on HAVE_ARCH_USERFAULTFD_WP + depends on USERFAULTFD && HAVE_ARCH_USERFAULTFD_WP help Allows to create marker PTEs for userfaultfd write protection purposes. It is required to enable userfaultfd write protection on file-backed memory types like shmem and hugetlbfs. -endif # USERFAULTFD # multi-gen LRU { config LRU_GEN From 51417b3bb5b1aa937ce1ca085cf48b342fc3fea1 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:18 +0100 Subject: [PATCH 051/250] mm/vma: introduce VMA anon page offset field and add helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch series "mm/rmap: index MAP_PRIVATE file-backed folios by anonymous pgoff", v5. In memory management we've managed to manufacture a great deal of confusion around the concept of anonymous memory. We have: 1. 'Pure anon' memory - anonymous VMAs whose folios are anonymous and swap-backed (thus for reclaim purposes, treated as anonymous). These are simple enough. 2. shmem - file-backed VMAs, file-backed folios (from rmap perspective) so present in the page cache and mapped by an address_space object, but whose folios are also swap-backed (thus treated as anonymous for reclaim purposes). 3. MAP_PRIVATE-mapped /dev/zero - a strange beast whose VMAs have vma->vm_file set, but which clears vma->vm_ops to satisfy vma_is_anonymous(), resulting in VMAs that were mmap()'d referencing a file, but are in every other sense anonymous, including the folios. 4. Other MAP_PRIVATE-file backed mappings - These possess file-backed VMAs and have file-backed folios until CoW'd, at which point those CoW'd folios are anonymous. This series fixes issue 3. In order for us to traverse VMAs using the reverse mapping, we require two fields - folio->mapping and folio->index. The first tells the rmap code where to look for VMAs, and the second tells it at which offset the folio starts within the referenced object. For anonymous folios, folio->mapping points at an anon_vma object. For file-backed folios, it points at an address_space. And: * For file-backed folios folio->index is simply the page offset of the start of the folio within the file. * For anonymous folios belonging to pure anon mappings, folio->index is equal to the anonymous page offset of the folio. * For anonymous folios belonging to file-backed mappings (i.e. CoW'd folios of a MAP_PRIVATE file-backed mapping), folio->index is equal to the file page offset. This series establishes a new anonymous page offset property of VMAs to allow us to map anonymous folios at their anonymous page offset, consistent with pure anon. The purpose of doing so is to lay the foundations for the scalable CoW work. This is necessary because scalable CoW looks in the maple tree for the VMA located at folio->index << PAGE_SHIFT, before falling back to looking up tracked remaps if necessary. The MAP_PRIVATE file-backed case means that folio indices will very often conflict with one another and this remap tracking becomes substantially more contended, and of course the fast path can never be used. This also makes it possible, in future, to unshare anonymously mapped folios with deep fork hierarchies on remap, eliminating the need for remap tracking in the vast majority of cases. Similar to page offset of pure anonymous VMAs, we update the anonymous page offset of unfaulted file-backed VMAs on remap, but do not once CoW'd (i.e. vma->anon_vma is non-NULL). Overall, there is little impact on mergeability, which remains exactly the same for pure anonymous and shared file-backed mappings, with the only impact being on MAP_PRIVATE-mapped file-backed mappings, which must now match on anonymous page offset as well as file page offset to be merged. To fail to merge like this would require CoW'ing the mapping, then finding another VMA with identical file and compatible page offset to remap next to. This is therefore very much an edge case that should have very little impact (and which scalable CoW may very well address in any case). This patch (of 16): Establish fields in vm_area_struct to store the anonymous page offset of VMAs. Initially, the anonymous page offset of a VMA is vma->vm_start >> PAGE_SHIFT. When a VMA is remapped to new_address its anonymous page offset is either updated to new_address >> PAGE_SHIFT if unfaulted or, if faulted, remains equal to the anonymous page offset it had when first faulted. Currently, anonymous folios belonging to CoW'd MAP_PRIVATE-mapped file-backed VMAs are tracked by their file offsets. By adding anonymous offset as a property of VMAs, we can now track them by their anonymous page offset instead. By tracking this, we provide the means by which to eliminate this inconsistency, and more importantly lay the foundations for future work for the scalable CoW anonymous rmap rework. This patch simply adds the fields and some simple helpers. Subsequent patches will update mm code to make use of these fields correctly. The fields chosen are packed in the VMA such that, for 64-bit kernel builds, no additional space is taken up. The first field is present on cacheline 0 containing key VMA fields, and the second on cacheline 3, which contains file-backed reverse mapping fields. Given the relative time spent accessing reverse mapping fields as well as updating them, there shouldn't be any performance impact here from false sharing. Update the VMA userland tests to account for this change. No callsites are updated yet, so no functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-0-c21581c0c3c8@kernel.org Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-1-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Reviewed-by: Gregory Price (Meta) Reviewed-by: Xu Xin Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- include/linux/mm.h | 59 +++++++++++++++++++++++++++++++++ include/linux/mm_types.h | 12 +++++++ mm/vma.h | 14 ++++++++ mm/vma_init.c | 1 + tools/testing/vma/include/dup.h | 26 +++++++++++++++ 5 files changed, 112 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 87feaa5a2b780e..df78847f5f07aa 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4393,6 +4393,65 @@ static inline pgoff_t vma_last_pgoff(const struct vm_area_struct *vma) return vma_end_pgoff(vma) - 1; } +/** + * vma_start_anon_pgoff() - Get the anonymous page offset of the start of @vma + * @vma: The VMA whose anonymous page offset is required. + * + * If unfaulted, then this is vma->vm_start >> PAGE_SHIFT, if faulted then the + * anonymous page offset at the time of first fault. + * + * If the VMA is anonymous, this returns the same value as vma_start_pgoff(). + * + * This value is used for tracking MAP_PRIVATE file-backed mappings by their + * anonymous page offset. + * + * Returns: The anonymous page offset of the start of @vma. + */ +static inline pgoff_t vma_start_anon_pgoff(const struct vm_area_struct *vma) +{ + pgoff_t pgoff = 0; + +#ifdef CONFIG_64BIT + pgoff += vma->__vm_anon_pgoff_hi; + pgoff <<= 32; +#endif + pgoff += vma->__vm_anon_pgoff_lo; + return pgoff; +} + +/** + * vma_end_anon_pgoff() - Get the anonymous page offset of the exclusive end of + * @vma. + * @vma: The VMA whose end anonymous page offset is required. + * + * This returns the anonymous exclusive end page offset of @vma, which is useful + * for expressing page offset ranges. + * + * See the description of vma_start_anon_pgoff() for a description of VMA + * anonymous page offsets. + * + * Returns: The exclusive end anonymous page offset of @vma. + */ +static inline pgoff_t vma_end_anon_pgoff(const struct vm_area_struct *vma) +{ + return vma_start_anon_pgoff(vma) + vma_pages(vma); +} + +/** + * vma_last_anon_pgoff() - Get the anonymous page offset of the last page in + * @vma. + * @vma: The VMA whose last anonymous page offset is required. + * + * See the description of vma_start_anon_pgoff() for a description of VMA + * anonymous page offsets. + * + * Returns: The last anonymous page offset of @vma. + */ +static inline pgoff_t vma_last_anon_pgoff(const struct vm_area_struct *vma) +{ + return vma_end_anon_pgoff(vma) - 1; +} + static inline unsigned long vma_desc_size(const struct vm_area_desc *desc) { return desc->end - desc->start; diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 939b5ea8c9e0be..ebf0d912be7db7 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -967,6 +967,11 @@ struct vm_area_struct { */ unsigned int vm_lock_seq; #endif + /* + * Low 32-bits of anonymous page offset. + * See vma_start_anon_pgoff() comment for details. + */ + unsigned int __vm_anon_pgoff_lo; /* * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma * list, after a COW of one of the file pages. A MAP_SHARED vma @@ -1041,6 +1046,13 @@ struct vm_area_struct { #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map vmlock_dep_map; #endif +#endif +#ifdef CONFIG_64BIT + /* + * High 32-bits of anonymous page offset. + * See vma_start_anon_pgoff() comment for details. + */ + unsigned int __vm_anon_pgoff_hi; #endif /* * For areas with an address space and backing store, diff --git a/mm/vma.h b/mm/vma.h index 0bc7d521e97677..54ed7c744e3bc3 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -283,6 +283,20 @@ static inline void vma_set_pgoff(struct vm_area_struct *vma, pgoff_t pgoff) vma->vm_pgoff = pgoff; } +static inline void __vma_set_anon_pgoff(struct vm_area_struct *vma, pgoff_t pgoff) +{ +#ifdef CONFIG_64BIT + vma->__vm_anon_pgoff_hi = pgoff >> 32; +#endif + vma->__vm_anon_pgoff_lo = pgoff & GENMASK(31, 0); +} + +static inline void vma_set_anon_pgoff(struct vm_area_struct *vma, pgoff_t pgoff) +{ + vma_assert_can_modify(vma); + __vma_set_anon_pgoff(vma, pgoff); +} + static inline void vma_add_pgoff(struct vm_area_struct *vma, pgoff_t delta) { vma_assert_can_modify(vma); diff --git a/mm/vma_init.c b/mm/vma_init.c index 715feee283f0fb..baa7e82f47e3f8 100644 --- a/mm/vma_init.c +++ b/mm/vma_init.c @@ -51,6 +51,7 @@ static void vm_area_init_from(const struct vm_area_struct *src, dest->vm_end = src->vm_end; dest->anon_vma = src->anon_vma; dest->vm_pgoff = vma_start_pgoff(src); + __vma_set_anon_pgoff(dest, vma_start_anon_pgoff(src)); dest->vm_file = src->vm_file; dest->vm_private_data = src->vm_private_data; vm_flags_init(dest, src->vm_flags); diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index cdeb53bbdd1b14..17f94e5de569eb 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -577,6 +577,7 @@ struct vm_area_struct { */ unsigned int vm_lock_seq; #endif + unsigned int __vm_anon_pgoff_lo; /* * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma @@ -612,6 +613,9 @@ struct vm_area_struct { #ifdef CONFIG_PER_VMA_LOCK /* Unstable RCU readers are allowed to read this. */ refcount_t vm_refcnt; +#endif +#ifdef CONFIG_64BIT + unsigned int __vm_anon_pgoff_hi; #endif /* * For areas with an address space and backing store, @@ -1320,6 +1324,28 @@ static inline pgoff_t vma_end_pgoff(const struct vm_area_struct *vma) return vma_start_pgoff(vma) + vma_pages(vma); } +static inline pgoff_t vma_start_anon_pgoff(const struct vm_area_struct *vma) +{ + pgoff_t pgoff = 0; + +#ifdef CONFIG_64BIT + pgoff += vma->__vm_anon_pgoff_hi; + pgoff <<= 32; +#endif + pgoff += vma->__vm_anon_pgoff_lo; + return pgoff; +} + +static inline pgoff_t vma_end_anon_pgoff(const struct vm_area_struct *vma) +{ + return vma_start_anon_pgoff(vma) + vma_pages(vma); +} + +static inline pgoff_t vma_last_anon_pgoff(const struct vm_area_struct *vma) +{ + return vma_end_anon_pgoff(vma) - 1; +} + static inline int vfs_mmap_prepare(struct file *file, struct vm_area_desc *desc) { return file->f_op->mmap_prepare(desc); From 340294d234c7e17732b54058f8b72d16be28eb94 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:19 +0100 Subject: [PATCH 052/250] mm: provide vma_[flags_]is_cow_mapping() and remove is_cow_mapping() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All remaining callers of is_cow_mapping() are invoking it in the form of is_cow_mapping(vma->vm_flags) or an indirected version of this. Therefore, provide a helper - vma_is_cow_mapping() to directly test the VMA. Additionally provide a new helper vma_flags_is_cow_mapping() which performs the check using the new vma_flags_t type, and share this logic between vma_is_cow_mapping() and vma_desc_is_cow_mapping(). With these changes, no callers of is_cow_mapping() remain, so remove it. Also update the userland VMA tests to reflect the change. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-2-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- arch/s390/mm/gmap_helpers.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- drivers/gpu/drm/panthor/panthor_gem.c | 2 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 +- drivers/gpu/drm/xe/xe_device.c | 2 +- fs/proc/task_mmu.c | 2 +- include/linux/mm.h | 71 ++++++++++++++++++++++--- kernel/events/uprobes.c | 2 +- mm/gup.c | 2 +- mm/huge_memory.c | 8 +-- mm/hugetlb.c | 2 +- mm/internal.h | 2 +- mm/memory.c | 25 +++++---- mm/mempolicy.c | 2 +- tools/testing/vma/include/dup.h | 11 ++++ 16 files changed, 105 insertions(+), 36 deletions(-) diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c index 4bf7c9012feb6a..cd5fded159c04b 100644 --- a/arch/s390/mm/gmap_helpers.c +++ b/arch/s390/mm/gmap_helpers.c @@ -200,7 +200,7 @@ static int find_zeropage_pte_entry(pte_t *pte, unsigned long addr, * currently only works in COW mappings, which is also where * mm_forbids_zeropage() is checked. */ - if (!is_cow_mapping(walk->vma->vm_flags)) + if (!vma_is_cow_mapping(walk->vma)) return -EFAULT; *found_addr = addr; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 6a0699746fbcd6..0c7309080a7a73 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -377,9 +377,9 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str /* Workaround for Thunk bug creating PROT_NONE,MAP_PRIVATE mappings * for debugger access to invisible VRAM. Should have used MAP_SHARED * instead. Clearing VM_MAYWRITE prevents the mapping from ever - * becoming writable and makes is_cow_mapping(vm_flags) false. + * becoming writable and makes vma_is_cow_mapping(vma) false. */ - if (is_cow_mapping(vma->vm_flags) && + if (vma_is_cow_mapping(vma) && !(vma->vm_flags & VM_ACCESS_FLAGS)) vm_flags_clear(vma, VM_MAYWRITE); diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 06d019d51d3e6b..177d0e0b933402 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -753,7 +753,7 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct return ret; } - if (is_cow_mapping(vma->vm_flags)) + if (vma_is_cow_mapping(vma)) return -EINVAL; dma_resv_lock(shmem->base.resv, NULL); diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c index 77055635396870..d2eec46f7abe32 100644 --- a/drivers/gpu/drm/panthor/panthor_gem.c +++ b/drivers/gpu/drm/panthor/panthor_gem.c @@ -761,7 +761,7 @@ static int panthor_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *v return ret; } - if (is_cow_mapping(vma->vm_flags)) + if (vma_is_cow_mapping(vma)) return -EINVAL; if (!refcount_inc_not_zero(&bo->cmap.mmap_count)) { diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 88babf435ac238..872bf444b1f0ff 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -489,7 +489,7 @@ static const struct vm_operations_struct ttm_bo_vm_ops = { int ttm_bo_mmap_obj(struct vm_area_struct *vma, struct ttm_buffer_object *bo) { /* Enforce no COW since would have really strange behavior with it. */ - if (is_cow_mapping(vma->vm_flags)) + if (vma_is_cow_mapping(vma)) return -EINVAL; drm_gem_object_get(&bo->base); diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 9d119c95a569af..de5fdf49d729a7 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -330,7 +330,7 @@ static int xe_pci_barrier_mmap(struct file *filp, if (vma->vm_end - vma->vm_start > SZ_4K) return -EINVAL; - if (is_cow_mapping(vma->vm_flags)) + if (vma_is_cow_mapping(vma)) return -EINVAL; if (vma->vm_flags & (VM_READ | VM_EXEC)) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 817e3e0f919430..5c54aebe211824 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1693,7 +1693,7 @@ static inline bool pte_is_pinned(struct vm_area_struct *vma, unsigned long addr, if (!pte_write(pte)) return false; - if (!is_cow_mapping(vma->vm_flags)) + if (!vma_is_cow_mapping(vma)) return false; if (likely(!mm_flags_test(MMF_HAS_PINNED, vma->vm_mm))) return false; diff --git a/include/linux/mm.h b/include/linux/mm.h index df78847f5f07aa..199d0a64b14a9f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2271,17 +2271,76 @@ void unpin_user_pages(struct page **pages, unsigned long npages); void unpin_user_folio(struct folio *folio, unsigned long npages); void unpin_folios(struct folio **folios, unsigned long nfolios); -static inline bool is_cow_mapping(vm_flags_t flags) +/** + * vma_flags_is_cow_mapping() - Do these VMA flags imply a CoW mapping? + * @flags: The VMA flags to check. + * + * Mappings which could be CoW'd (subject to Copy-On-Write faults) are + * described as CoW mappings. + * + * All mappings backed by anonymous folios (all anonymous mappings and most + * MAP_PRIVATE-file backed ranges) are CoW mappings. + * + * All other mappings (including all MAP_SHARED mappings) are non-CoW. + * + * The criteria are !VMA_SHARED_BIT, VMA_MAYWRITE_BIT. + * + * VMA_MAYWRITE_BIT is checked instead of VMA_WRITE_BIT to account for both + * future mprotect() calls which can render a read-only mapping writable, and + * GUP with FOLL_FORCE (e.g. ptrace) which can CoW a read-only mapping. + * + * - No anonymous mapping can ever clear VMA_MAYWRITE_BIT. + * + * - Writes to anonymous mappings do not immediately result in CoW faults but + * may do so after the process is forked or if a read is followed by a + * write. + * + * - Writes to MAP_PRIVATE file-backed mappings result in CoW faults and may + * do so again after fork. + * + * - MAP_SHARED mappings of a file opened read-only are transformed into + * VMA_MAYSHARE_BIT, !VMA_SHARED_BIT, !VMA_MAYWRITE_BIT mappings, so remain + * non-CoW. + * + * - Drivers may clear VMA_MAYWRITE_BIT but do so at mmap() time and cannot + * mark themselves anonymous. Having cleared this flag it is not valid for + * them to leave the VMA_WRITE_BIT flag set. + * + * As a consequence, the anonymous reverse mapping only tracks CoW mappings. + * + * Returns: true if the flags indicate a CoW mapping, otherwise false. + */ +static inline bool vma_flags_is_cow_mapping(const vma_flags_t *flags) +{ + return vma_flags_test(flags, VMA_MAYWRITE_BIT) && + !vma_flags_test(flags, VMA_SHARED_BIT); +} + +/** + * vma_is_cow_mapping() - Is this VMA a CoW mapping? + * @desc: The VMA to check. + * + * See vma_flags_is_cow_mapping() for details. + * + * Returns: true if the VMA is a CoW mapping, otherwise false. + */ +static inline bool vma_is_cow_mapping(const struct vm_area_struct *vma) { - return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; + return vma_flags_is_cow_mapping(&vma->flags); } +/** + * vma_desc_is_cow_mapping() - Is this VMA descriptor a CoW mapping? + * @desc: The VMA descriptor to check. + * + * See vma_flags_is_cow_mapping() for details. + * + * Returns: true if the VMA descriptor describes a CoW mapping, otherwise + * false. + */ static inline bool vma_desc_is_cow_mapping(struct vm_area_desc *desc) { - const vma_flags_t *flags = &desc->vma_flags; - - return vma_flags_test(flags, VMA_MAYWRITE_BIT) && - !vma_flags_test(flags, VMA_SHARED_BIT); + return vma_flags_is_cow_mapping(&desc->vma_flags); } #ifndef CONFIG_MMU diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index ae2f3b9f8d503f..eb0d11092fb3a5 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -513,7 +513,7 @@ int uprobe_write(struct arch_uprobe *auprobe, struct vm_area_struct *vma, uprobe = container_of(auprobe, struct uprobe, arch); - if (WARN_ON_ONCE(!is_cow_mapping(vma->vm_flags))) + if (WARN_ON_ONCE(!vma_is_cow_mapping(vma))) return -EINVAL; /* diff --git a/mm/gup.c b/mm/gup.c index 99902c15703b01..8ea3de60e82db9 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1236,7 +1236,7 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) * Anon pages in shared mappings are surprising: now * just reject it. */ - if (!is_cow_mapping(vm_flags)) + if (!vma_is_cow_mapping(vma)) return -EFAULT; } } else if (!(vm_flags & VM_READ)) { diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 644d6905b49ccc..ff13b57d9d56f6 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1681,7 +1681,7 @@ vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, unsigned long pfn, BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))); BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) == (VM_PFNMAP|VM_MIXEDMAP)); - BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags)); + BUG_ON((vma->vm_flags & VM_PFNMAP) && vma_is_cow_mapping(vma)); pfnmap_setup_cachemode_pfn(pfn, &pgprot); @@ -1789,7 +1789,7 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, unsigned long pfn, BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))); BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) == (VM_PFNMAP|VM_MIXEDMAP)); - BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags)); + BUG_ON((vma->vm_flags & VM_PFNMAP) && vma_is_cow_mapping(vma)); pfnmap_setup_cachemode_pfn(pfn, &pgprot); @@ -1931,7 +1931,7 @@ int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, * applied special bit, or we made the PRIVATE mapping be * able to wrongly write to the backend MMIO. */ - VM_WARN_ON_ONCE(is_cow_mapping(src_vma->vm_flags) && pmd_write(pmd)); + VM_WARN_ON_ONCE(vma_is_cow_mapping(src_vma) && pmd_write(pmd)); goto set_pmd; } @@ -2052,7 +2052,7 @@ int copy_huge_pud(struct mm_struct *dst_mm, struct mm_struct *src_mm, * TODO: once we support anonymous pages, use * folio_try_dup_anon_rmap_*() and split if duplicating fails. */ - if (is_cow_mapping(vma->vm_flags) && pud_write(pud)) { + if (vma_is_cow_mapping(vma) && pud_write(pud)) { pudp_set_wrprotect(src_mm, addr, src_pud); pud = pud_wrprotect(pud); } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0c8c5e71911352..3c684890f28346 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4900,7 +4900,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, pte_t *src_pte, *dst_pte, entry; struct folio *pte_folio; unsigned long addr; - bool cow = is_cow_mapping(src_vma->vm_flags); + bool cow = vma_is_cow_mapping(src_vma); struct hstate *h = hstate_vma(src_vma); unsigned long sz = huge_page_size(h); unsigned long npages = pages_per_huge_page(h); diff --git a/mm/internal.h b/mm/internal.h index 68db5abd0a4ced..a75e7641ef49b5 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1353,7 +1353,7 @@ static inline bool gup_must_unshare(struct vm_area_struct *vma, * ... because we only care about writable private ("COW") * mappings where we have to break COW early. */ - return is_cow_mapping(vma->vm_flags); + return vma_is_cow_mapping(vma); } /* Paired with a memory barrier in folio_try_share_anon_rmap_*(). */ diff --git a/mm/memory.c b/mm/memory.c index d2f14ba2261cd0..396d7b9059e671 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -780,7 +780,7 @@ static inline struct page *__vm_normal_page(struct vm_area_struct *vma, /* Only CoW'ed anon folios are "normal". */ if (pfn == index) return NULL; - if (!is_cow_mapping(vma->vm_flags)) + if (!vma_is_cow_mapping(vma)) return NULL; } } @@ -1002,7 +1002,6 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, unsigned long addr, int *rss) { - vm_flags_t vm_flags = dst_vma->vm_flags; pte_t orig_pte = ptep_get(src_pte); softleaf_t entry = softleaf_from_pte(orig_pte); pte_t pte = orig_pte; @@ -1026,7 +1025,7 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, rss[mm_counter(folio)]++; if (!softleaf_is_migration_read(entry) && - is_cow_mapping(vm_flags)) { + vma_is_cow_mapping(dst_vma)) { /* * COW mappings require pages in both parent and child * to be set to read. A previously exclusive entry is @@ -1067,7 +1066,7 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, * save and restore device driver state). */ if (softleaf_is_device_private_write(entry) && - is_cow_mapping(vm_flags)) { + vma_is_cow_mapping(dst_vma)) { entry = make_readable_device_private_entry( swp_offset(entry)); pte = swp_entry_to_pte(entry); @@ -1082,7 +1081,7 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, * exclusive entries currently only support private writable * (ie. COW) mappings. */ - VM_BUG_ON(!is_cow_mapping(src_vma->vm_flags)); + VM_BUG_ON(!vma_is_cow_mapping(src_vma)); if (try_restore_exclusive_pte(src_vma, addr, src_pte, orig_pte)) return -EBUSY; return -ENOENT; @@ -1181,7 +1180,7 @@ static __always_inline void __copy_present_ptes(struct vm_area_struct *dst_vma, } /* If it's a COW mapping, write protect it both processes. */ - if (is_cow_mapping(src_vma->vm_flags) && writable) { + if (vma_is_cow_mapping(src_vma) && writable) { wrprotect_ptes(src_mm, addr, src_pte, nr); pte = pte_wrprotect(pte); } @@ -1602,9 +1601,9 @@ copy_page_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma) * We need to invalidate the secondary MMU mappings only when * there could be a permission downgrade on the ptes of the * parent mm. And a permission downgrade will only happen if - * is_cow_mapping() returns true. + * vma_is_cow_mapping() returns true. */ - is_cow = is_cow_mapping(src_vma->vm_flags); + is_cow = vma_is_cow_mapping(src_vma); if (is_cow) { mmu_notifier_range_init(&range, MMU_NOTIFY_PROTECTION_PAGE, @@ -2437,7 +2436,7 @@ static bool vm_mixed_zeropage_allowed(struct vm_area_struct *vma) if (mm_forbids_zeropage(vma->vm_mm)) return false; /* zeropages in COW mappings are common and unproblematic. */ - if (is_cow_mapping(vma->vm_flags)) + if (vma_is_cow_mapping(vma)) return true; /* Mappings that do not allow for writable PTEs are unproblematic. */ if (!(vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) @@ -2888,7 +2887,7 @@ vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))); BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) == (VM_PFNMAP|VM_MIXEDMAP)); - BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags)); + BUG_ON((vma->vm_flags & VM_PFNMAP) && vma_is_cow_mapping(vma)); BUG_ON((vma->vm_flags & VM_MIXEDMAP) && pfn_valid(pfn)); if (addr < vma->vm_start || addr >= vma->vm_end) @@ -3300,7 +3299,7 @@ static int remap_pfn_range_prepare_vma(struct vm_area_struct *vma, unsigned long size) { const unsigned long end = addr + PAGE_ALIGN(size); - const bool is_cow = is_cow_mapping(vma->vm_flags); + const bool is_cow = vma_is_cow_mapping(vma); int err; err = get_remap_pgoff(is_cow, addr, end, vma->vm_start, vma->vm_end, @@ -6800,7 +6799,7 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma, * FAULT_FLAG_UNSHARE only applies to COW mappings. Let's * just treat it like an ordinary read-fault otherwise. */ - if (!is_cow_mapping(vma->vm_flags)) + if (!vma_is_cow_mapping(vma)) *flags &= ~FAULT_FLAG_UNSHARE; } else if (*flags & FAULT_FLAG_WRITE) { /* Write faults on read-only mappings are impossible ... */ @@ -6808,7 +6807,7 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma, return VM_FAULT_SIGSEGV; /* ... and FOLL_FORCE only applies to COW mappings. */ if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE) && - !is_cow_mapping(vma->vm_flags))) + !vma_is_cow_mapping(vma))) return VM_FAULT_SIGSEGV; } #ifdef CONFIG_PER_VMA_LOCK diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 5720f7f54d942f..3498a5651d50ff 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -844,7 +844,7 @@ bool folio_can_map_prot_numa(struct folio *folio, struct vm_area_struct *vma, return false; /* Also skip shared copy-on-write folios */ - if (is_cow_mapping(vma->vm_flags) && folio_maybe_mapped_shared(folio)) + if (vma_is_cow_mapping(vma) && folio_maybe_mapped_shared(folio)) return false; /* Folios are pinned and can't be migrated */ diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index 17f94e5de569eb..af2fd3f607b5f5 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1162,6 +1162,17 @@ static inline bool vma_is_shared_maywrite(struct vm_area_struct *vma) return is_shared_maywrite(&vma->flags); } +static inline bool vma_flags_is_cow_mapping(const vma_flags_t *flags) +{ + return vma_flags_test(flags, VMA_MAYWRITE_BIT) && + !vma_flags_test(flags, VMA_SHARED_BIT); +} + +static inline bool vma_is_cow_mapping(const struct vm_area_struct *vma) +{ + return vma_flags_is_cow_mapping(&vma->flags); +} + static inline struct vm_area_struct *vma_next(struct vma_iterator *vmi) { /* From 011bd39835622414b73ec7363be9e2cb1fc1dbfe Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:20 +0100 Subject: [PATCH 053/250] mm: introduce linear_anon_page_index() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function provides the anonymous equivalent of linear_page_index(), instead offsetting based on the anonymous page offset of the VMA. It is valid only for anonymous or MAP_PRIVATE file-backed mappings, in other words CoW mappings. For pure anon VMAs, this will be equal to linear_page_index(). Assert that both of these invariants are true in linear_anon_page_index() and implement the algorithm in __linear_anon_page_index(). Note that MAP_PRIVATE-/dev/zero mappings will satisfy vma_is_anonymous() but not fulfill this invariant, so when asserting this we check vma->vm_file to account for this. We do not update callsites yet, so no functional change intended. Also const-ify vma_is_anonymous() to make it compatible with the const-ified linear_anon_page_index(). While we're here, update linear_page_index() to be more succinct. VMA userland tests are also updated accordingly. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-3-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Reviewed-by: Gregory Price (Meta) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- include/linux/mm.h | 2 +- include/linux/pagemap.h | 40 ++++++++++++++++++++++++++++++--- tools/testing/vma/include/dup.h | 25 ++++++++++++++++++++- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 199d0a64b14a9f..0829e0d3b2d129 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1556,7 +1556,7 @@ static inline void vma_desc_set_anonymous(struct vm_area_desc *desc) desc->vm_ops = NULL; } -static inline bool vma_is_anonymous(struct vm_area_struct *vma) +static inline bool vma_is_anonymous(const struct vm_area_struct *vma) { return !vma->vm_ops; } diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c6fc783aaee576..0adfa6605653db 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1094,10 +1094,44 @@ static inline pgoff_t linear_page_delta(const struct vm_area_struct *vma, static inline pgoff_t linear_page_index(const struct vm_area_struct *vma, const unsigned long address) { - pgoff_t pgoff; + return linear_page_delta(vma, address) + vma_start_pgoff(vma); +} + +static inline pgoff_t __linear_anon_page_index(const struct vm_area_struct *vma, + const unsigned long address) +{ + return linear_page_delta(vma, address) + vma_start_anon_pgoff(vma); +} + +/** + * linear_anon_page_index() - Determine the absolute anonymous page offset of + * @address within @vma. + * @vma: An anonymous or MAP_PRIVATE file-backed VMA in which @address resides. + * @address: The address whose absolute page offset is required. + * + * This returns the anonymous page offset of @address, which is the page offset + * the address possessed at the time the VMA was first faulted. + * + * For anonymous mappings, this returns the same value as linear_page_index(). + * + * For MAP_PRIVATE file-backed mappings, this returns the anonymous page offset + * of @address, which is the page offset the address possessed at the time the + * VMA was first faulted. + * + * It is not valid to call this function for shared file-backed mappings. + * + * Returns: The absolute anonymous page offset of @address within @vma. + */ +static inline pgoff_t linear_anon_page_index(const struct vm_area_struct *vma, + const unsigned long address) +{ + const pgoff_t pgoff = __linear_anon_page_index(vma, address); + + VM_WARN_ON_ONCE(!vma_is_cow_mapping(vma)); + /* Account for MAP_PRIVATE-/dev/zero which is only semi-anonymous. */ + if (vma_is_anonymous(vma) && !vma->vm_file) + VM_WARN_ON_ONCE(pgoff != linear_page_index(vma, address)); - pgoff = linear_page_delta(vma, address); - pgoff += vma_start_pgoff(vma); return pgoff; } diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index af2fd3f607b5f5..4655aecffaf31b 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1428,7 +1428,7 @@ static inline void vma_iter_set(struct vma_iterator *vmi, unsigned long addr) mas_set(&vmi->mas, addr); } -static inline bool vma_is_anonymous(struct vm_area_struct *vma) +static inline bool vma_is_anonymous(const struct vm_area_struct *vma) { return !vma->vm_ops; } @@ -1621,3 +1621,26 @@ static inline pgprot_t vma_get_page_prot(const struct vm_area_struct *vma) { return vma_flags_to_page_prot(vma->flags); } + +static inline pgoff_t __linear_anon_page_index(const struct vm_area_struct *vma, + const unsigned long address) +{ + pgoff_t pgoff; + + pgoff = linear_page_delta(vma, address); + pgoff += vma_start_anon_pgoff(vma); + return pgoff; +} + +static inline pgoff_t linear_anon_page_index(const struct vm_area_struct *vma, + const unsigned long address) +{ + const pgoff_t pgoff = __linear_anon_page_index(vma, address); + + VM_WARN_ON_ONCE(!vma_is_cow_mapping(vma)); + /* Account for MAP_PRIVATE-/dev/zero which is only semi-anonymous. */ + if (vma_is_anonymous(vma) && !vma->vm_file) + VM_WARN_ON_ONCE(pgoff != linear_page_index(vma, address)); + + return pgoff; +} From 697f28c628047c484a1946c3b58d2d600b12bcdf Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:21 +0100 Subject: [PATCH 054/250] mm: abstract vma_address() and introduce vma_anon_address() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce __vma_address() which abstracts the VMA start page offset field as pgoff_start, then update vma_address() to use it. Then introduce vma_anon_address() which does the equivalent of vma_address(), only using the anonymous page offset of the VMA rather than the file-backed one. Also add an assert to ensure that the function is not called for mappings which are file-backed but not MAP_PRIVATE to ensure it is only used in the correct places. This will be necessary for determining the address of a folio's index within a VMA when the folio belongs to a MAP_PRIVATE file-backed VMA but has been CoW'd, and thus is anonymous, once the anonymous VMA page offset field is used for the reverse mapping. No callers are updated, so no functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-4-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/internal.h | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index a75e7641ef49b5..761738d61fe059 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1017,19 +1017,9 @@ void mlock_drain_remote(int cpu); extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma); -/** - * vma_address - Find the virtual address a page range is mapped at - * @vma: The vma which maps this object. - * @pgoff: The page offset within its object. - * @nr_pages: The number of pages to consider. - * - * If any page in this range is mapped by this VMA, return the first address - * where any of these pages appear. Otherwise, return -EFAULT. - */ -static inline unsigned long vma_address(const struct vm_area_struct *vma, - pgoff_t pgoff, unsigned long nr_pages) +static inline unsigned long __vma_address(const struct vm_area_struct *vma, + pgoff_t pgoff, pgoff_t pgoff_start, unsigned long nr_pages) { - const pgoff_t pgoff_start = vma_start_pgoff(vma); unsigned long address; if (pgoff >= pgoff_start) { @@ -1047,6 +1037,41 @@ static inline unsigned long vma_address(const struct vm_area_struct *vma, return address; } +/** + * vma_address - Find the virtual address a page range is mapped at. + * @vma: The vma which maps this object. + * @pgoff: The page offset within its object. + * @nr_pages: The number of pages to consider. + * + * If any page in this range is mapped by this VMA, return the first address + * where any of these pages appear. Otherwise, return -EFAULT. + */ +static inline unsigned long vma_address(const struct vm_area_struct *vma, + pgoff_t pgoff, unsigned long nr_pages) +{ + return __vma_address(vma, pgoff, vma_start_pgoff(vma), nr_pages); +} + +/** + * vma_anon_address - Find the address an anonymous folio with index @pgoff_anon + * is mapped at. + * @vma: The vma which maps this object. + * @pgoff_anon: The anonymous page index belonging to the folio. + * @nr_pages: The number of pages to consider. + * + * This is only valid for anonymous or MAP_PRIVATE-mapped file-backed VMAs. + * + * Returns: If any page in this range is mapped by this VMA, return the first + * address where any of these pages appear. Otherwise, return -EFAULT. + */ +static inline unsigned long vma_anon_address(const struct vm_area_struct *vma, + pgoff_t pgoff_anon, unsigned long nr_pages) +{ + VM_WARN_ON_ONCE(!vma_is_cow_mapping(vma)); + + return __vma_address(vma, pgoff_anon, vma_start_anon_pgoff(vma), nr_pages); +} + /* * Then at what user virtual address will none of the range be found in vma? * Assumes that vma_address() already returned a good starting address. From 8d85a78dd82ae3eba9dded3489c3ae4a8b67e752 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:22 +0100 Subject: [PATCH 055/250] mm: update print_bad_page_map() to show anon index if appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the VMA is a CoW mapping page offset may differ from anon page offset, indicating different positions in the relevant rmap trees. Update print_bad_page_map() to reflect that - if the mapping is non-CoW or the indexes match, then output only one index as before, otherwise output both with (file) or (anon) suffixes to reflect which is which. It's not possible to give only one index as there is no folio available to perform folio_test_anon() upon (the page table entry is bad so this is unavailable). This is potentially useful debugging information and matches the existing page offset provided. Use the raw __linear_anon_page_index() function so as to always output this value regardless of whether the mapping is file-backed or not and to avoid asserts that shouldn't apply here. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-5-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Reviewed-by: Gregory Price (Meta) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/memory.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 396d7b9059e671..c5494330255328 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -631,13 +631,14 @@ static void print_bad_page_map(struct vm_area_struct *vma, { struct address_space *mapping; char entry_str[PTVAL_STR_MAX]; - pgoff_t index; + pgoff_t index, anon_index; if (is_bad_page_map_ratelimited()) return; mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL; index = linear_page_index(vma, addr); + anon_index = __linear_anon_page_index(vma, addr); ptval_bytes_to_hex_str(entry_str, sizeof(entry_str), entry, entry_size); pr_alert("BUG: Bad page map in process %s %s:%s", current->comm, @@ -645,8 +646,14 @@ static void print_bad_page_map(struct vm_area_struct *vma, __print_bad_page_map_pgtable(vma->vm_mm, addr); if (page) dump_page(page, "bad page map"); - pr_alert("addr:%px vm_flags:%08lx anon_vma:%px mapping:%px index:%lx\n", - (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index); + pr_alert("addr:%px vm_flags:%08lx anon_vma:%px mapping:%px", + (void *)addr, vma->vm_flags, vma->anon_vma, mapping); + if (!vma_is_cow_mapping(vma) || index == anon_index) { + pr_cont(" index:%lx\n", index); + } else { + pr_cont(" index:%lx (file) %lx (anon)\n", index, anon_index); + } + pr_alert("file:%pD fault:%ps mmap:%ps mmap_prepare: %ps read_folio:%ps\n", vma->vm_file, vma->vm_ops ? vma->vm_ops->fault : NULL, From 8461846ef37a63c9e7a5970ce63c63b36ccb79ac Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:23 +0100 Subject: [PATCH 056/250] mm: introduce and use vma_filebacked_address() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In cases where we know that the VMA is file-backed, use vma_filebacked_address() rather than vma_address(). This lays the foundation for using the anonymous page offset via vma_anon_address(). Also add an assert to ensure that the VMA whose address is required is not anonymous. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-6-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Tested-by: syzbot@syzkaller.appspotmail.com Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/internal.h | 18 ++++++++++++++++++ mm/memory-failure.c | 4 ++-- mm/page_vma_mapped.c | 6 +++++- mm/rmap.c | 10 ++++++---- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 761738d61fe059..f6475d77024de3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1037,6 +1037,24 @@ static inline unsigned long __vma_address(const struct vm_area_struct *vma, return address; } +/** + * vma_filebacked_address - Find the virtual address a file-backed page range is + * mapped at. + * @vma: The vma which maps this object. + * @pgoff: The page offset within its object. + * @nr_pages: The number of pages to consider. + * + * Returns: If any page in this range is mapped by this VMA, return the first + * address where any of these pages appear. Otherwise, return -EFAULT. + */ +static inline unsigned long vma_filebacked_address(const struct vm_area_struct *vma, + pgoff_t pgoff, unsigned long nr_pages) +{ + VM_WARN_ON_ONCE(vma_is_anonymous(vma)); + + return __vma_address(vma, pgoff, vma_start_pgoff(vma), nr_pages); +} + /** * vma_address - Find the virtual address a page range is mapped at. * @vma: The vma which maps this object. diff --git a/mm/memory-failure.c b/mm/memory-failure.c index aaf14608b30e2d..a8b03e2920ba8a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -620,7 +620,7 @@ static void add_to_kill_fsdax(struct task_struct *tsk, const struct page *p, struct vm_area_struct *vma, struct list_head *to_kill, pgoff_t pgoff) { - unsigned long addr = vma_address(vma, pgoff, 1); + unsigned long addr = vma_filebacked_address(vma, pgoff, 1); __add_to_kill(tsk, p, vma, to_kill, addr); } @@ -2265,7 +2265,7 @@ static void add_to_kill_pgoff(struct task_struct *tsk, } /* Check for pgoff not backed by struct page */ - tk->addr = vma_address(vma, pgoff, 1); + tk->addr = vma_filebacked_address(vma, pgoff, 1); tk->size_shift = PAGE_SHIFT; if (tk->addr == -EFAULT) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index d7670ba4147bff..081e483cc7bf5f 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -356,6 +356,7 @@ unsigned long page_mapped_in_vma(const struct page *page, struct vm_area_struct *vma) { const struct folio *folio = page_folio(page); + const pgoff_t pgoff = page_pgoff(folio, page); struct page_vma_mapped_walk pvmw = { .pfn = page_to_pfn(page), .nr_pages = 1, @@ -363,7 +364,10 @@ unsigned long page_mapped_in_vma(const struct page *page, .flags = PVMW_SYNC, }; - pvmw.address = vma_address(vma, page_pgoff(folio, page), 1); + if (folio_test_anon(folio)) + pvmw.address = vma_address(vma, pgoff, 1); + else + pvmw.address = vma_filebacked_address(vma, pgoff, 1); if (pvmw.address == -EFAULT) goto out; if (!page_vma_mapped_walk(&pvmw)) diff --git a/mm/rmap.c b/mm/rmap.c index 1f72d279ba68f8..bf618e4678d335 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -865,14 +865,15 @@ unsigned long page_address_in_vma(const struct folio *folio, if (!vma->anon_vma || !anon_vma || vma->anon_vma->root != anon_vma->root) return -EFAULT; + /* KSM folios don't reach here because of the !anon_vma check */ + return vma_address(vma, page_pgoff(folio, page), 1); } else if (!vma->vm_file) { return -EFAULT; } else if (vma->vm_file->f_mapping != folio->mapping) { return -EFAULT; } - /* KSM folios don't reach here because of the !anon_vma check */ - return vma_address(vma, page_pgoff(folio, page), 1); + return vma_filebacked_address(vma, page_pgoff(folio, page), 1); } /* @@ -1321,7 +1322,7 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff, if (invalid_mkclean_vma(vma, NULL)) return 0; - pvmw.address = vma_address(vma, pgoff, nr_pages); + pvmw.address = vma_filebacked_address(vma, pgoff, nr_pages); VM_BUG_ON_VMA(pvmw.address == -EFAULT, vma); return page_vma_mkclean_one(&pvmw); @@ -3098,7 +3099,8 @@ static void __rmap_walk_file(struct folio *folio, struct address_space *mapping, } lookup: mapping_rmap_tree_foreach(vma, mapping, pgoff_start, pgoff_end) { - unsigned long address = vma_address(vma, pgoff_start, nr_pages); + unsigned long address = vma_filebacked_address(vma, pgoff_start, + nr_pages); VM_BUG_ON_VMA(address == -EFAULT, vma); cond_resched(); From 618099a9b7c15ce95a3f37f1eab1770f9ea69e63 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:24 +0100 Subject: [PATCH 057/250] mm/vma: fix self-merge check in copy_vma() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing logic is very confusing so improve things. Firstly rename the confusing faulted_in_anon_vma variable to can_self_merge and update this when the page offset is updated. What is being checked for is a 'self-merge' - that is between the VMA being remapped and its prior VMA (remember that this is copy_vma() - if a non-MREMAP_DONTUNMAP remap the original VMA is only removed afterwards). This can happen if the VMA is moved immediately adjacent to itself, either before or after it: |----------------|----------------| | | | v | v |...............||---------------||...............| | new || old || new | |...............||---------------||---------------| In these cases the old VMA is simply expanded to cover the new range. It is also possible for the move to both self-merge and merge with a prior VMA if it is placed between a preceding VMA and its old self: |---------------| | | v | |---------------||...............||---------------| | prev || new || old | |---------------||...............||---------------| In this case, the old VMA is removed and 'prev' is expanded and replaces it. Since copy_vma_and_data() which calls copy_vma() intends to reference the old VMA after the merge, it must have this pointer updated. This kind of self-merge is not possible with a succeeding merge, as the merge always prefers to expand the preceding VMA if possible. copy_vma() accounts for this by explicitly checking to see if a self-merge occurred and updating the vmap pointer if so. However it incorrect did so even for a subsequent merge (this is simply a noop so it had no impact). So change this to only check for the case which matters - a backwards merge - and rearrange the parameters to make it clearer we're doing that - i.e. check new_vma->vm_start < old_vma_start (having already renamed vma_start to old_vma_start to make it clear this is the previous VMA). Also update the existing wall-of-text comment to be a lot clearer. While we're here, replace the VM_BUG_ON_VMA() with a VM_WARN_ON_ONCE_VMA() and update the VMA userland tests accordingly. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-7-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/vma.c | 35 +++++++++++++++----------------- tools/testing/vma/vma_internal.h | 1 + 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index a325376e62ea9a..ecefc9e6307095 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -1911,10 +1911,10 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, bool *need_rmap_locks) { struct vm_area_struct *vma = *vmap; - unsigned long vma_start = vma->vm_start; + unsigned long old_vma_start = vma->vm_start; struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *new_vma; - bool faulted_in_anon_vma = true; + bool can_self_merge = false; VMA_ITERATOR(vmi, mm, addr); VMG_VMA_STATE(vmg, &vmi, NULL, vma, addr, addr + len); @@ -1924,7 +1924,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, */ if (unlikely(vma_is_anonymous(vma) && !vma->anon_vma)) { pgoff = addr >> PAGE_SHIFT; - faulted_in_anon_vma = false; + can_self_merge = true; } /* @@ -1944,24 +1944,21 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, new_vma = vma_merge_copied_range(&vmg); if (new_vma) { - /* - * Source vma may have been merged into new_vma - */ - if (unlikely(vma_start >= new_vma->vm_start && - vma_start < new_vma->vm_end)) { + /* Self-merged and VMA replaced. */ + if (unlikely(new_vma->vm_start < old_vma_start && + new_vma->vm_end > old_vma_start)) { /* - * The only way we can get a vma_merge with - * self during an mremap is if the vma hasn't - * been faulted in yet and we were allowed to - * reset the dst vma->vm_pgoff to the - * destination address of the mremap to allow - * the merge to happen. mremap must change the - * vm_pgoff linearity between src and dst vmas - * (in turn preventing a vma_merge) to be - * safe. It is only safe to keep the vm_pgoff - * linear if there are no pages mapped yet. + * The only way a VMA can both self-merge and be + * replaced is if the remap places the new VMA + * immediately prior to its old self ('next') and + * immediately after another VMA ('prev') causing the + * next to be removed and prev to be expanded to cover + * the entire range. + * + * This should only be possible if the page offset was + * updated, i.e. the VMA is unfaulted. */ - VM_BUG_ON_VMA(faulted_in_anon_vma, new_vma); + VM_WARN_ON_ONCE_VMA(!can_self_merge, new_vma); *vmap = vma = new_vma; } *need_rmap_locks = diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index 4f6c5666ac07d3..8a48b231aa7abf 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -53,6 +53,7 @@ typedef __bitwise unsigned int vm_fault_t; #define VM_WARN_ON(_expr) (WARN_ON(_expr)) #define VM_WARN_ON_ONCE(_expr) (WARN_ON_ONCE(_expr)) +#define VM_WARN_ON_ONCE_VMA(_expr, _vma) (WARN_ON_ONCE(_expr)) #define VM_WARN_ON_VMG(_expr, _vmg) (WARN_ON(_expr)) #define VM_BUG_ON(_expr) (BUG_ON(_expr)) #define VM_BUG_ON_VMA(_expr, _vma) (BUG_ON(_expr)) From 724ff634e4ffa2a4511a73941d823433f28fe41e Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:25 +0100 Subject: [PATCH 058/250] tools/testing/vma: add tests for copy_vma() self-merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assert that a VMA can be moved backwards, forwards and between a preceding VMA and its old self. In the cases in which the VMA merges only with itself expect that to be achieved by expanding its old self, so assert that these function correctly. However in the case of a merge between a preceding VMA and itself the original VMA is removed, so assert that the preceding VMA replaces the one passed in as vmap and the merge is as expected. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-8-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/vma/tests/vma.c | 46 ++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/tools/testing/vma/tests/vma.c b/tools/testing/vma/tests/vma.c index 754a2da0632157..0d40d7ba21819b 100644 --- a/tools/testing/vma/tests/vma.c +++ b/tools/testing/vma/tests/vma.c @@ -33,7 +33,51 @@ static bool test_copy_vma(void) struct mm_struct mm = {}; bool need_locks = false; VMA_ITERATOR(vmi, &mm, 0); - struct vm_area_struct *vma, *vma_new, *vma_next; + struct vm_area_struct *vma, *vma_prev, *vma_new, *vma_next, *vma_orig; + + /* Move forwards, adjacent to old self - self-merge. */ + + vma = alloc_and_link_vma(&mm, 0x1000, 0x2000, 1, vma_flags); + vma_set_anonymous(vma); + vma_orig = vma; + vma_new = copy_vma(&vma, 0x2000, 0x1000, 1, &need_locks); + ASSERT_EQ(vma_new, vma_orig); + ASSERT_EQ(vma, vma_orig); + ASSERT_EQ(vma_new->vm_start, 0x1000); + ASSERT_EQ(vma_new->vm_end, 0x3000); + + cleanup_mm(&mm, &vmi); + + /* Move backwards, adjacent to old self - self-merge. */ + + vma = alloc_and_link_vma(&mm, 0x2000, 0x3000, 2, vma_flags); + vma_set_anonymous(vma); + vma_orig = vma; + vma_new = copy_vma(&vma, 0x1000, 0x1000, 2, &need_locks); + ASSERT_EQ(vma_new, vma_orig); + ASSERT_EQ(vma, vma_orig); + ASSERT_EQ(vma_new->vm_start, 0x1000); + ASSERT_EQ(vma_new->vm_end, 0x3000); + + cleanup_mm(&mm, &vmi); + + /* + * Move backwards between prior VMA and old self - self-merge and vma + * updated to a new VMA. + */ + + vma_prev = alloc_and_link_vma(&mm, 0x1000, 0x2000, 1, vma_flags); + vma_set_anonymous(vma_prev); + vma = alloc_and_link_vma(&mm, 0x3000, 0x4000, 3, vma_flags); + vma_set_anonymous(vma); + vma_orig = vma; + vma_new = copy_vma(&vma, 0x2000, 0x1000, 3, &need_locks); + ASSERT_NE(vma_new, vma_orig); + ASSERT_EQ(vma_new, vma); + ASSERT_EQ(vma_new->vm_start, 0x1000); + ASSERT_EQ(vma_new->vm_end, 0x4000); + + cleanup_mm(&mm, &vmi); /* Move backwards and do not merge. */ From 341b7b51df9dd5e0e6ff230c9ff2ca1a347bdcbb Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:26 +0100 Subject: [PATCH 059/250] mm: propagate VMA anonymous page offset on map, remap, split + merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We must correctly update VMA anonymous page offset state on all VMA operations that would result in it changing, with special attention given to remapping. We cover most cases by simply updating vma_set_range() to do so (with a new anonymous page offset parameter), but also notably must update the merging and mapping logic to propagate this parameter correctly. The remap logic remains the same - we may update the anonymous page offset if the VMA is unfaulted, but now this applies to MAP_PRIVATE file-backed mappings too, so we update the code to reflect this. Note that we use __linear_anon_page_index() upon remap as the VMA may be shared, in order that we update the field consistently regardless of VMA type. Similarly, pass through anon page offset to the merge logic, updating the vma_merge_struct struct to propagate it, and also use __linear_anon_page_index() to obtain the anonymous page index so it can be safely used for both shared and MAP_PRIVATE file-backed mappings. In copy_vma(), the anonymous page offset is updated regardless of whether the mapping is a CoW mapping or not. This is both to keep the anonymous page offset consistent even for non-CoW mappings (it is set so should at least remain correct) and makes the logic cleaner. A self-merge however remains permitted only for mappings which can have a populated vma->anon_vma and do not require alignment on a separate file offset - that is pure anonymous VMAs, so only set can_self_merge if vma_is_anonymous(). Finally, we update insert_vm_struct() to correctly set the anonymous page offset on insertion of a VMA. We simply ensure state is correctly propagated here, so no functional changes are intended. Also update VMA userland tests to reflect this change. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-9-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/mremap.c | 6 ++- mm/vma.c | 52 +++++++++++++++-------- mm/vma.h | 75 ++++++++++++++++++++------------- mm/vma_exec.c | 2 +- tools/testing/vma/shared.c | 3 +- tools/testing/vma/tests/merge.c | 4 +- tools/testing/vma/tests/vma.c | 10 ++--- 7 files changed, 95 insertions(+), 57 deletions(-) diff --git a/mm/mremap.c b/mm/mremap.c index b64aa1f6e07ede..9ea1707eafa5b6 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -1265,7 +1265,9 @@ static void unmap_source_vma(struct vma_remap_struct *vrm) static int copy_vma_and_data(struct vma_remap_struct *vrm, struct vm_area_struct **new_vma_ptr) { - const unsigned long new_pgoff = linear_page_index(vrm->vma, vrm->addr); + const pgoff_t new_pgoff = linear_page_index(vrm->vma, vrm->addr); + const pgoff_t new_anon_pgoff = + __linear_anon_page_index(vrm->vma, vrm->addr); struct vm_area_struct *vma = vrm->vma; struct vm_area_struct *new_vma; unsigned long moved_len; @@ -1273,7 +1275,7 @@ static int copy_vma_and_data(struct vma_remap_struct *vrm, PAGETABLE_MOVE(pmc, NULL, NULL, vrm->addr, vrm->new_addr, vrm->old_len); new_vma = copy_vma(&vma, vrm->new_addr, vrm->new_len, new_pgoff, - &pmc.need_rmap_locks); + new_anon_pgoff, &pmc.need_rmap_locks); if (!new_vma) { vrm_uncharge(vrm); *new_vma_ptr = NULL; diff --git a/mm/vma.c b/mm/vma.c index ecefc9e6307095..e35b04ac12cbb6 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -18,6 +18,7 @@ struct mmap_state { unsigned long addr; unsigned long end; pgoff_t pgoff; + pgoff_t anon_pgoff; unsigned long pglen; union { vm_flags_t vm_flags; @@ -46,13 +47,14 @@ struct mmap_state { bool file_doesnt_need_get :1; }; -#define MMAP_STATE(name, mm_, vmi_, addr_, len_, pgoff_, vma_flags_, file_) \ +#define MMAP_STATE(name, mm_, vmi_, addr_, len_, pgoff_, anon_pgoff_, vma_flags_, file_) \ struct mmap_state name = { \ .mm = mm_, \ .vmi = vmi_, \ .addr = addr_, \ .end = (addr_) + (len_), \ .pgoff = pgoff_, \ + .anon_pgoff = anon_pgoff_, \ .pglen = PHYS_PFN(len_), \ .vma_flags = vma_flags_, \ .file = file_, \ @@ -67,6 +69,7 @@ struct mmap_state { .end = (map_)->end, \ .vma_flags = (map_)->vma_flags, \ .pgoff = (map_)->pgoff, \ + .anon_pgoff = (map_)->anon_pgoff, \ .file = (map_)->file, \ .prev = (map_)->prev, \ .middle = vma_, \ @@ -82,10 +85,11 @@ static void __vma_set_range(struct vm_area_struct *vma, unsigned long start, } static void vma_set_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end, pgoff_t pgoff) + unsigned long end, pgoff_t pgoff, pgoff_t anon_pgoff) { __vma_set_range(vma, start, end); vma_set_pgoff(vma, pgoff); + vma_set_anon_pgoff(vma, anon_pgoff); } /* Was this VMA ever forked from a parent, i.e. maybe contains CoW mappings? */ @@ -812,7 +816,8 @@ static int commit_merge(struct vma_merge_struct *vmg) */ vma_adjust_trans_huge(vma, vmg->start, vmg->end, vmg->__adjust_middle_start ? vmg->middle : NULL); - vma_set_range(vma, vmg->start, vmg->end, vmg_start_pgoff(vmg)); + vma_set_range(vma, vmg->start, vmg->end, vmg_start_pgoff(vmg), + vmg_start_anon_pgoff(vmg)); vmg_adjust_set_range(vmg); vma_iter_store_overwrite(vmg->vmi, vmg->target); @@ -982,6 +987,7 @@ static __must_check struct vm_area_struct *vma_merge_existing_range( vmg->start = prev->vm_start; vmg->end = next->vm_end; vmg->pgoff = vma_start_pgoff(prev); + vmg->anon_pgoff = vma_start_anon_pgoff(prev); /* * We already ensured anon_vma compatibility above, so now it's @@ -1000,6 +1006,7 @@ static __must_check struct vm_area_struct *vma_merge_existing_range( */ vmg->start = prev->vm_start; vmg->pgoff = vma_start_pgoff(prev); + vmg->anon_pgoff = vma_start_anon_pgoff(prev); if (!vmg->__remove_middle) vmg->__adjust_middle_start = true; @@ -1022,12 +1029,14 @@ static __must_check struct vm_area_struct *vma_merge_existing_range( if (vmg->__remove_middle) { vmg->end = next->vm_end; vmg->pgoff = vma_start_pgoff(next) - pglen; + vmg->anon_pgoff = vma_start_anon_pgoff(next) - pglen; } else { /* We shrink middle and expand next. */ vmg->__adjust_next_start = true; vmg->start = middle->vm_start; vmg->end = start; vmg->pgoff = vma_start_pgoff(middle); + vmg->anon_pgoff = vma_start_anon_pgoff(middle); } err = dup_anon_vma(next, middle, &anon_dup); @@ -1137,6 +1146,7 @@ struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg) vmg->start = prev->vm_start; vmg->target = prev; vmg->pgoff = vma_start_pgoff(prev); + vmg->anon_pgoff = vma_start_anon_pgoff(prev); /* * If this merge would result in removal of the next VMA but we @@ -1908,7 +1918,7 @@ static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma) */ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, unsigned long addr, unsigned long len, pgoff_t pgoff, - bool *need_rmap_locks) + pgoff_t anon_pgoff, bool *need_rmap_locks) { struct vm_area_struct *vma = *vmap; unsigned long old_vma_start = vma->vm_start; @@ -1919,12 +1929,16 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, VMG_VMA_STATE(vmg, &vmi, NULL, vma, addr, addr + len); /* - * If anonymous vma has not yet been faulted, update new pgoff - * to match new location, to increase its chance of merging. + * If a vma has not yet been faulted, update its anonymous pgoff to + * match the new location to increase its chance of merging. */ - if (unlikely(vma_is_anonymous(vma) && !vma->anon_vma)) { - pgoff = addr >> PAGE_SHIFT; - can_self_merge = true; + if (!vma->anon_vma) { + anon_pgoff = addr >> PAGE_SHIFT; + + if (vma_is_anonymous(vma)) { + pgoff = anon_pgoff; + can_self_merge = true; + } } /* @@ -1940,6 +1954,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, return NULL; /* should never get here */ vmg.pgoff = pgoff; + vmg.anon_pgoff = anon_pgoff; vmg.next = vma_iter_next_rewind(&vmi, NULL); new_vma = vma_merge_copied_range(&vmg); @@ -1955,8 +1970,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, * next to be removed and prev to be expanded to cover * the entire range. * - * This should only be possible if the page offset was - * updated, i.e. the VMA is unfaulted. + * This should only be possible if the anonymous page + * offset was updated, i.e. the VMA is unfaulted. */ VM_WARN_ON_ONCE_VMA(!can_self_merge, new_vma); *vmap = vma = new_vma; @@ -1967,7 +1982,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, new_vma = vm_area_dup(vma); if (!new_vma) goto out; - vma_set_range(new_vma, addr, addr + len, pgoff); + vma_set_range(new_vma, addr, addr + len, pgoff, anon_pgoff); if (vma_dup_policy(vma, new_vma)) goto out_free_vma; if (anon_vma_clone(new_vma, vma, VMA_OP_REMAP)) @@ -2609,7 +2624,7 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap, if (is_anon) vma_set_anonymous(vma); - vma_set_range(vma, map->addr, map->end, map->pgoff); + vma_set_range(vma, map->addr, map->end, map->pgoff, map->anon_pgoff); vma->flags = map->vma_flags; vma->vm_page_prot = map->page_prot; @@ -2798,7 +2813,8 @@ static unsigned long __mmap_region(struct file *file, unsigned long addr, struct vm_area_struct *vma = NULL; bool have_mmap_prepare = file && file->f_op->mmap_prepare; VMA_ITERATOR(vmi, mm, addr); - MMAP_STATE(map, mm, &vmi, addr, len, pgoff, vma_flags, file); + const pgoff_t anon_pgoff = addr >> PAGE_SHIFT; + MMAP_STATE(map, mm, &vmi, addr, len, pgoff, anon_pgoff, vma_flags, file); struct vm_area_desc desc = { .mm = mm, .file = file, @@ -2943,6 +2959,7 @@ int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, unsigned long addr, unsigned long len, vma_flags_t vma_flags) { struct mm_struct *mm = current->mm; + const pgoff_t pgoff = addr >> PAGE_SHIFT; /* * Check against address space limits by the changed size @@ -2967,7 +2984,7 @@ int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, * occur after forking, so the expand will only happen on new VMAs. */ if (vma && vma->vm_end == addr) { - VMG_STATE(vmg, mm, vmi, addr, addr + len, vma_flags, PHYS_PFN(addr)); + VMG_STATE(vmg, mm, vmi, addr, addr + len, vma_flags, pgoff, pgoff); vmg.prev = vma; /* vmi is positioned at prev, which this mode expects. */ @@ -2987,7 +3004,7 @@ int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma, goto unacct_fail; vma_set_anonymous(vma); - vma_set_range(vma, addr, addr + len, addr >> PAGE_SHIFT); + vma_set_range(vma, addr, addr + len, pgoff, pgoff); vma->flags = vma_flags; vma->vm_page_prot = vm_get_page_prot(vma_flags_to_legacy(vma_flags)); vma_start_write(vma); @@ -3379,6 +3396,7 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) WARN_ON_ONCE(vma->anon_vma); vma_set_pgoff(vma, vma->vm_start >> PAGE_SHIFT); } + vma_set_anon_pgoff(vma, vma->vm_start >> PAGE_SHIFT); if (vma_link(mm, vma)) { if (vma_test(vma, VMA_ACCOUNT_BIT)) @@ -3434,7 +3452,7 @@ struct vm_area_struct *__install_special_mapping( vma->vm_ops = ops; vma->vm_private_data = priv; - vma_set_range(vma, addr, addr + len, 0); + vma_set_range(vma, addr, addr + len, 0, addr >> PAGE_SHIFT); ret = insert_vm_struct(mm, vma); if (ret) diff --git a/mm/vma.h b/mm/vma.h index 54ed7c744e3bc3..024fabe63560a0 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -104,6 +104,7 @@ struct vma_merge_struct { unsigned long start; unsigned long end; pgoff_t pgoff; + pgoff_t anon_pgoff; union { /* Temporary while VMA flags are being converted. */ @@ -237,11 +238,6 @@ static inline bool vmg_nomem(struct vma_merge_struct *vmg) return vmg->state == VMA_MERGE_ERROR_NOMEM; } -static inline pgoff_t vmg_start_pgoff(const struct vma_merge_struct *vmg) -{ - return vmg->pgoff; -} - static inline pgoff_t vmg_pages(const struct vma_merge_struct *vmg) { const unsigned long size = vmg->end - vmg->start; @@ -249,6 +245,11 @@ static inline pgoff_t vmg_pages(const struct vma_merge_struct *vmg) return size >> PAGE_SHIFT; } +static inline pgoff_t vmg_start_pgoff(const struct vma_merge_struct *vmg) +{ + return vmg->pgoff; +} + static inline pgoff_t vmg_end_pgoff(const struct vma_merge_struct *vmg) { return vmg_start_pgoff(vmg) + vmg_pages(vmg); @@ -283,6 +284,16 @@ static inline void vma_set_pgoff(struct vm_area_struct *vma, pgoff_t pgoff) vma->vm_pgoff = pgoff; } +static inline pgoff_t vmg_start_anon_pgoff(const struct vma_merge_struct *vmg) +{ + return vmg->anon_pgoff; +} + +static inline pgoff_t vmg_end_anon_pgoff(const struct vma_merge_struct *vmg) +{ + return vmg_start_anon_pgoff(vmg) + vmg_pages(vmg); +} + static inline void __vma_set_anon_pgoff(struct vm_area_struct *vma, pgoff_t pgoff) { #ifdef CONFIG_64BIT @@ -301,44 +312,48 @@ static inline void vma_add_pgoff(struct vm_area_struct *vma, pgoff_t delta) { vma_assert_can_modify(vma); vma_set_pgoff(vma, vma_start_pgoff(vma) + delta); + vma_set_anon_pgoff(vma, vma_start_anon_pgoff(vma) + delta); } static inline void vma_sub_pgoff(struct vm_area_struct *vma, pgoff_t delta) { vma_assert_can_modify(vma); vma_set_pgoff(vma, vma_start_pgoff(vma) - delta); -} + vma_set_anon_pgoff(vma, vma_start_anon_pgoff(vma) - delta); +} + +#define VMG_STATE(name, mm_, vmi_, start_, end_, vma_flags_, pgoff_, anon_pgoff_) \ + struct vma_merge_struct name = { \ + .mm = mm_, \ + .vmi = vmi_, \ + .start = start_, \ + .end = end_, \ + .vma_flags = vma_flags_, \ + .pgoff = pgoff_, \ + .anon_pgoff = anon_pgoff_, \ + .state = VMA_MERGE_START, \ + } -#define VMG_STATE(name, mm_, vmi_, start_, end_, vma_flags_, pgoff_) \ +#define VMG_VMA_STATE(name, vmi_, prev_, vma_, start_, end_) \ struct vma_merge_struct name = { \ - .mm = mm_, \ + .mm = vma_->vm_mm, \ .vmi = vmi_, \ + .prev = prev_, \ + .middle = vma_, \ + .next = NULL, \ .start = start_, \ .end = end_, \ - .vma_flags = vma_flags_, \ - .pgoff = pgoff_, \ + .vm_flags = vma_->vm_flags, \ + .pgoff = linear_page_index(vma_, start_), \ + .anon_pgoff = __linear_anon_page_index(vma_, start_), \ + .file = vma_->vm_file, \ + .anon_vma = vma_->anon_vma, \ + .policy = vma_policy(vma_), \ + .uffd_ctx = vma_->vm_userfaultfd_ctx, \ + .anon_name = anon_vma_name(vma_), \ .state = VMA_MERGE_START, \ } -#define VMG_VMA_STATE(name, vmi_, prev_, vma_, start_, end_) \ - struct vma_merge_struct name = { \ - .mm = vma_->vm_mm, \ - .vmi = vmi_, \ - .prev = prev_, \ - .middle = vma_, \ - .next = NULL, \ - .start = start_, \ - .end = end_, \ - .vm_flags = vma_->vm_flags, \ - .pgoff = linear_page_index(vma_, start_), \ - .file = vma_->vm_file, \ - .anon_vma = vma_->anon_vma, \ - .policy = vma_policy(vma_), \ - .uffd_ctx = vma_->vm_userfaultfd_ctx, \ - .anon_name = anon_vma_name(vma_), \ - .state = VMA_MERGE_START, \ - } - #ifdef CONFIG_DEBUG_VM_MAPLE_TREE void validate_mm(struct mm_struct *mm); #else @@ -520,7 +535,7 @@ void unlink_file_vma_batch_add(struct unlink_vma_file_batch *vb, struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, unsigned long addr, unsigned long len, pgoff_t pgoff, - bool *need_rmap_locks); + pgoff_t anon_pgoff, bool *need_rmap_locks); struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma); diff --git a/mm/vma_exec.c b/mm/vma_exec.c index 7af1260689b97e..586c5215594245 100644 --- a/mm/vma_exec.c +++ b/mm/vma_exec.c @@ -41,7 +41,7 @@ int relocate_vma_down(struct vm_area_struct *vma, unsigned long shift) unsigned long new_end = old_end - shift; VMA_ITERATOR(vmi, mm, new_start); VMG_STATE(vmg, mm, &vmi, new_start, old_end, EMPTY_VMA_FLAGS, - vma_start_pgoff(vma)); + vma_start_pgoff(vma), vma_start_anon_pgoff(vma)); struct vm_area_struct *next; struct mmu_gather tlb; PAGETABLE_MOVE(pmc, vma, vma, old_start, new_start, length); diff --git a/tools/testing/vma/shared.c b/tools/testing/vma/shared.c index bea9ea6db02a4c..4a39c9d5048964 100644 --- a/tools/testing/vma/shared.c +++ b/tools/testing/vma/shared.c @@ -23,7 +23,8 @@ struct vm_area_struct *alloc_vma(struct mm_struct *mm, vma->vm_start = start; vma->vm_end = end; - vma->vm_pgoff = pgoff; + vma_set_pgoff(vma, pgoff); + vma_set_anon_pgoff(vma, start >> PAGE_SHIFT); vma->flags = vma_flags; vma_assert_detached(vma); diff --git a/tools/testing/vma/tests/merge.c b/tools/testing/vma/tests/merge.c index e357accc849905..48418b82b01db1 100644 --- a/tools/testing/vma/tests/merge.c +++ b/tools/testing/vma/tests/merge.c @@ -45,6 +45,7 @@ void vmg_set_range(struct vma_merge_struct *vmg, unsigned long start, vmg->start = start; vmg->end = end; vmg->pgoff = pgoff; + vmg->anon_pgoff = start >> PAGE_SHIFT; vmg->vma_flags = vma_flags; vmg->just_expand = false; @@ -108,6 +109,7 @@ static bool test_simple_merge(void) .end = 0x2000, .vma_flags = vma_flags, .pgoff = 1, + .anon_pgoff = 1, }; ASSERT_FALSE(attach_vma(&mm, vma_left)); @@ -1431,7 +1433,7 @@ static bool test_expand_only_mode(void) struct mm_struct mm = {}; VMA_ITERATOR(vmi, &mm, 0); struct vm_area_struct *vma_prev, *vma; - VMG_STATE(vmg, &mm, &vmi, 0x5000, 0x9000, vma_flags, 5); + VMG_STATE(vmg, &mm, &vmi, 0x5000, 0x9000, vma_flags, 5, 5); /* * Place a VMA prior to the one we're expanding so we assert that we do diff --git a/tools/testing/vma/tests/vma.c b/tools/testing/vma/tests/vma.c index 0d40d7ba21819b..c8ef7b8cd46be7 100644 --- a/tools/testing/vma/tests/vma.c +++ b/tools/testing/vma/tests/vma.c @@ -40,7 +40,7 @@ static bool test_copy_vma(void) vma = alloc_and_link_vma(&mm, 0x1000, 0x2000, 1, vma_flags); vma_set_anonymous(vma); vma_orig = vma; - vma_new = copy_vma(&vma, 0x2000, 0x1000, 1, &need_locks); + vma_new = copy_vma(&vma, 0x2000, 0x1000, 1, 1, &need_locks); ASSERT_EQ(vma_new, vma_orig); ASSERT_EQ(vma, vma_orig); ASSERT_EQ(vma_new->vm_start, 0x1000); @@ -53,7 +53,7 @@ static bool test_copy_vma(void) vma = alloc_and_link_vma(&mm, 0x2000, 0x3000, 2, vma_flags); vma_set_anonymous(vma); vma_orig = vma; - vma_new = copy_vma(&vma, 0x1000, 0x1000, 2, &need_locks); + vma_new = copy_vma(&vma, 0x1000, 0x1000, 2, 2, &need_locks); ASSERT_EQ(vma_new, vma_orig); ASSERT_EQ(vma, vma_orig); ASSERT_EQ(vma_new->vm_start, 0x1000); @@ -71,7 +71,7 @@ static bool test_copy_vma(void) vma = alloc_and_link_vma(&mm, 0x3000, 0x4000, 3, vma_flags); vma_set_anonymous(vma); vma_orig = vma; - vma_new = copy_vma(&vma, 0x2000, 0x1000, 3, &need_locks); + vma_new = copy_vma(&vma, 0x2000, 0x1000, 3, 3, &need_locks); ASSERT_NE(vma_new, vma_orig); ASSERT_EQ(vma_new, vma); ASSERT_EQ(vma_new->vm_start, 0x1000); @@ -82,7 +82,7 @@ static bool test_copy_vma(void) /* Move backwards and do not merge. */ vma = alloc_and_link_vma(&mm, 0x3000, 0x5000, 3, vma_flags); - vma_new = copy_vma(&vma, 0, 0x2000, 0, &need_locks); + vma_new = copy_vma(&vma, 0, 0x2000, 0, 3, &need_locks); ASSERT_NE(vma_new, vma); ASSERT_EQ(vma_new->vm_start, 0); ASSERT_EQ(vma_new->vm_end, 0x2000); @@ -95,7 +95,7 @@ static bool test_copy_vma(void) vma = alloc_and_link_vma(&mm, 0, 0x2000, 0, vma_flags); vma_next = alloc_and_link_vma(&mm, 0x6000, 0x8000, 6, vma_flags); - vma_new = copy_vma(&vma, 0x4000, 0x2000, 4, &need_locks); + vma_new = copy_vma(&vma, 0x4000, 0x2000, 4, 4, &need_locks); vma_assert_attached(vma_new); ASSERT_EQ(vma_new, vma_next); From 12a0860b3a4156706a238e5be1d83a351f5daa3c Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:27 +0100 Subject: [PATCH 060/250] mm/rmap: track whether the page VMA mapped pgoff is anonymous MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the page_vma_mapped_walk structure to track whether the pgoff being tracked is an anonymous pgoff or not and update the comments to reflect this. This is necessary in order to determine the correct VMA page offset in vma_address_end() when pvmw->nr_pages > 1. Also document that pvmw->pgoff is meaningless for pvmw->nr_pages == 1 and for KSM. Do not set this field where pgoff is not specified. This is laying the groundwork for eventually using anonymous page offsets as the index for all anonymous folios. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-10-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- include/linux/rmap.h | 4 +++- mm/rmap.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 8dc0871e5f0011..0574537a355cde 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -864,13 +864,14 @@ struct page *make_device_exclusive(struct mm_struct *mm, unsigned long addr, struct page_vma_mapped_walk { unsigned long pfn; unsigned long nr_pages; - pgoff_t pgoff; + pgoff_t pgoff; /* Only meaningful if nr_pages > 1 and not a KSM walk */ struct vm_area_struct *vma; unsigned long address; pmd_t *pmd; pte_t *pte; spinlock_t *ptl; unsigned int flags; + bool pgoff_is_anon : 1; }; #define DEFINE_FOLIO_VMA_WALK(name, _folio, _vma, _address, _flags) \ @@ -881,6 +882,7 @@ struct page_vma_mapped_walk { .vma = _vma, \ .address = _address, \ .flags = _flags, \ + .pgoff_is_anon = folio_test_anon(_folio), \ } static inline void page_vma_mapped_walk_done(struct page_vma_mapped_walk *pvmw) diff --git a/mm/rmap.c b/mm/rmap.c index bf618e4678d335..1b23ac709f45c8 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1240,6 +1240,7 @@ static bool mapping_wrprotect_range_one(struct folio *folio, .vma = vma, .address = address, .flags = PVMW_SYNC, + .pgoff_is_anon = false, }; state->cleaned += page_vma_mkclean_one(&pvmw); @@ -1317,6 +1318,7 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff, .pgoff = pgoff, .vma = vma, .flags = PVMW_SYNC, + .pgoff_is_anon = false, }; if (invalid_mkclean_vma(vma, NULL)) From 19ca1c830ba657767a175bf51d6060a073999b05 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:28 +0100 Subject: [PATCH 061/250] mm: clean up vma_address_end() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vma_address_end() is a confusing function with a lot of moving parts so clean it up prior to extending it for anon page indexed mappings. Const-ify some variables and establish pgoff_vma_start and pgoff_end variables to clearly identify the page offset for the start of the VMA and the end of the page offset range specified by the page walk. This simplifies the function significantly and lays the groundwork for a future change to update this function to account for anonymously page indexed folios. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-11-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/internal.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index f6475d77024de3..a38b5f7896b20d 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1091,22 +1091,24 @@ static inline unsigned long vma_anon_address(const struct vm_area_struct *vma, } /* - * Then at what user virtual address will none of the range be found in vma? + * At what user virtual address will none of the range be found in vma? * Assumes that vma_address() already returned a good starting address. */ static inline unsigned long vma_address_end(struct page_vma_mapped_walk *pvmw) { - struct vm_area_struct *vma = pvmw->vma; - pgoff_t pgoff; + const pgoff_t pgoff_end = pvmw->pgoff + pvmw->nr_pages; + const struct vm_area_struct *vma = pvmw->vma; + pgoff_t pgoff_vma_start; unsigned long address; /* Common case, plus ->pgoff is invalid for KSM */ if (pvmw->nr_pages == 1) return pvmw->address + PAGE_SIZE; - pgoff = pvmw->pgoff + pvmw->nr_pages; + pgoff_vma_start = vma_start_pgoff(vma); + address = vma->vm_start + - ((pgoff - vma_start_pgoff(vma)) << PAGE_SHIFT); + ((pgoff_end - pgoff_vma_start) << PAGE_SHIFT); /* Check for address beyond vma (or wrapped through 0?) */ if (address < vma->vm_start || address > vma->vm_end) address = vma->vm_end; From 6f9ecd1a4c1802054477e68a356d989e83199e93 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:29 +0100 Subject: [PATCH 062/250] mm/huge_memory: update remove_migration_pmd() to accept a folio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function does not need to accept a page and requiring it to is unnecessary and misleading. make_[writable, readable]_device_private_entry() must be passed a PMD-aligned PFN as they immediately used to obtain a softleaf PMD entry and the same argument applies to folio_add_[anon, file]_rmap_pmd(). While we are here, update a VM_BUG_ON() to a VM_WARN_ON_ONCE(). No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-12-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- include/linux/swapops.h | 6 +++--- mm/huge_memory.c | 16 +++++++--------- mm/migrate.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/linux/swapops.h b/include/linux/swapops.h index c956bc445ee013..1f3ff3b93e1613 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -325,8 +325,8 @@ struct page_vma_mapped_walk; extern int set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, struct page *page); -extern void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, - struct page *new); +void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, + struct folio *folio); extern void pmd_migration_entry_wait(struct mm_struct *mm, pmd_t *pmd); @@ -346,7 +346,7 @@ static inline int set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, } static inline void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, - struct page *new) + struct folio *folio) { BUILD_BUG(); } diff --git a/mm/huge_memory.c b/mm/huge_memory.c index ff13b57d9d56f6..2822190daf2b35 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -5077,9 +5077,8 @@ int set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, return 0; } -void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new) +void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct folio *folio) { - struct folio *folio = page_folio(new); struct vm_area_struct *vma = pvmw->vma; struct mm_struct *mm = vma->vm_mm; unsigned long address = pvmw->address; @@ -5115,11 +5114,9 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new) swp_entry_t entry; if (pmd_write(pmde)) - entry = make_writable_device_private_entry( - page_to_pfn(new)); + entry = make_writable_device_private_entry(folio_pfn(folio)); else - entry = make_readable_device_private_entry( - page_to_pfn(new)); + entry = make_readable_device_private_entry(folio_pfn(folio)); pmde = softleaf_to_pmd(entry); if (pmd_swp_soft_dirty(*pvmw->pmd)) @@ -5134,11 +5131,12 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new) if (!softleaf_is_migration_read(entry)) rmap_flags |= RMAP_EXCLUSIVE; - folio_add_anon_rmap_pmd(folio, new, vma, haddr, rmap_flags); + folio_add_anon_rmap_pmd(folio, &folio->page, vma, haddr, rmap_flags); } else { - folio_add_file_rmap_pmd(folio, new, vma); + folio_add_file_rmap_pmd(folio, &folio->page, vma); } - VM_BUG_ON(pmd_write(pmde) && folio_test_anon(folio) && !PageAnonExclusive(new)); + VM_WARN_ON_ONCE(pmd_write(pmde) && folio_test_anon(folio) && + !PageAnonExclusive(&folio->page)); set_pmd_at(mm, haddr, pvmw->pmd, pmde); /* No need to invalidate - it was non-present before */ diff --git a/mm/migrate.c b/mm/migrate.c index 8aaafcea7bc13d..9e32af3fe303c1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -372,7 +372,7 @@ static bool remove_migration_pte(struct folio *folio, if (!pvmw.pte) { VM_BUG_ON_FOLIO(folio_test_hugetlb(folio) || !folio_test_pmd_mappable(folio), folio); - remove_migration_pmd(&pvmw, new); + remove_migration_pmd(&pvmw, folio); continue; } #endif From e77e5d08eae671361d596104b7dcae3b60abcfb8 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:30 +0100 Subject: [PATCH 063/250] mm/migrate: calculate large folio page index using PFN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than having to figure out the page index to use using linear_page_index(), calculate it using PFN. This is a more natural fit as the linear page index is immaterial to determining the folio page index. Derive the page index from the offset between migration entry PFN and folio PFN - pvmw.pfn (set via DEFINE_FOLIO_VMA_WALK() which uses folio_pfn() to obtain it). Additionally remove a not so useful comment and clean the code layout up. No functional change intended. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-13-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Suggested-by: David Hildenbrand (Arm) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/migrate.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 9e32af3fe303c1..15b45832bcfa7e 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -356,16 +356,11 @@ static bool remove_migration_pte(struct folio *folio, while (page_vma_mapped_walk(&pvmw)) { rmap_t rmap_flags = RMAP_NONE; - pte_t old_pte; - pte_t pte; + unsigned long idx = 0; softleaf_t entry; struct page *new; - unsigned long idx = 0; - - /* pgoff is invalid for ksm pages, but they are never large */ - if (folio_test_large(folio) && !folio_test_hugetlb(folio)) - idx = linear_page_index(vma, pvmw.address) - pvmw.pgoff; - new = folio_page(folio, idx); + pte_t old_pte; + pte_t pte; #ifdef CONFIG_ARCH_HAS_PMD_SOFTLEAVES /* PMD-mapped THP migration entry */ @@ -381,14 +376,18 @@ static bool remove_migration_pte(struct folio *folio, pvmw.pte); else old_pte = ptep_get(pvmw.pte); + + entry = softleaf_from_pte(old_pte); + if (folio_test_large(folio) && !folio_test_hugetlb(folio)) + idx = softleaf_to_pfn(entry) - pvmw.pfn; + if (rmap_walk_arg->map_unused_to_zeropage && try_to_map_unused_to_zeropage(&pvmw, folio, old_pte, idx)) continue; folio_get(folio); + new = folio_page(folio, idx); pte = mk_pte(new, READ_ONCE(vma->vm_page_prot)); - - entry = softleaf_from_pte(old_pte); if (!softleaf_is_migration_young(entry)) pte = pte_mkold(pte); if (folio_test_dirty(folio) && softleaf_is_migration_dirty(entry)) From c573267986f07dd103d122d737932f7c05d5ec49 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:31 +0100 Subject: [PATCH 064/250] mm/rmap: use anon pgoff to track MAP_PRIVATE file-backed anon folios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently anonymous folios belonging to CoW'd MAP_PRIVATE file-backed mappings are indexed by their page offset within the file in which they were originally mapped. This differs from anonymous folios belonging to pure anon mappings which are indexed by their anonymous page offset (the address at which they'd belong in the VMA when first faulted). This change fixes this inconsistency, always indexing anonymous folios by their anonymous page offset regardless of the VMA to which they belong. The foundations have been laid such that we need only switch this functionality on such by: * Using linear_anon_page_index() in __folio_set_anon() to assign the folio's index to the anonymous linear index rather than the file-backed one. * Otherwise using linear_anon_page_index() in all instances where anonymous folios are being referenced or manipulated. * Replacing vma_address() with vma_filebacked_address() or vma_anon_address() as appropriate. * Updating the merging logic to check that anonymous page offsets are aligned as well as filebacked ones for MAP_PRIVATE file-backed VMAs, introducing needs_adjacent_anon_pgoff() to figure out when this is required. * Updating linear_folio_page_index() to invoke linear_anon_page_index() if the folio is anonymous. * Updating vma_address_end() to use the VMA's anonymous page offset when pvmw->pgoff is anonymous. * Correcting folio_within_range() to use anonymous page offset for anonymous folios. This will have no impact on merging of anonymous VMAs, whose page offset and anonymous page offset are identical, nor will it impact shared file-backed VMAs, which will continue to be merged based on the file-backed page offset. However, MAP_PRIVATE file-backed mappings must now be aligned on anonymous page offset as well. In most instances this should have no impact on merging of file-backed mappings, which are usually not merged all that often, let alone MAP_PRIVATE mapped ones, and rarely remapped and faulted before being moved back in place (the case in which a merge may now fail). One subtle impact of this change is in NUMA interleaving - since commit 88c91dc58582 ("mempolicy: migration attempt to match interleave nodes"), migration heuristically tries to maintain interleaving behaviour matching the policy using folio indices. When doing migration of CoW'd MAP_PRIVATE-file backed ranges, the 'base' upon which the interleaving behaviour is performed will vary for these ranges. However the commit notes that ranges spanning multiple VMAs will already cause varying bases, and that this is an acceptable approximation. It is very unlikely real world use-cases will be impacted by this (MAP_PRIVATE file-backed mappings are already an edge case), and all that will happen is that such ranges will cause interleaving to be rotated over the CoW'd range, with little to no impact. This commit lays the foundations for future scalable CoW work which needs to track some remaps, meaning that most remap tracking can be avoided, and in nearly all cases the anonymous page offset will be able to be used to quickly find the VMA in an mm. Note that the need_rmap_locks check doesn't need to be updated, as any remapping will offset both the anonymous and file-backed page offset, so it suffices to check only one. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-14-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/huge_memory.c | 2 +- mm/internal.h | 27 ++++++++------------------- mm/interval_tree.c | 4 ++-- mm/ksm.c | 6 +++--- mm/page_vma_mapped.c | 2 +- mm/rmap.c | 12 ++++++------ mm/userfaultfd.c | 4 ++-- mm/vma.c | 32 +++++++++++++++++++++++++++++++- 8 files changed, 54 insertions(+), 35 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2822190daf2b35..a8174d1d38485d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2930,7 +2930,7 @@ int move_pages_huge_pmd(struct mm_struct *mm, pmd_t *dst_pmd, pmd_t *src_pmd, pm } folio_move_anon_rmap(src_folio, dst_vma); - src_folio->index = linear_page_index(dst_vma, dst_addr); + src_folio->index = linear_anon_page_index(dst_vma, dst_addr); _dst_pmd = folio_mk_pmd(src_folio, dst_vma->vm_page_prot); /* Follow mremap() behavior and treat the entry dirty after the move */ diff --git a/mm/internal.h b/mm/internal.h index a38b5f7896b20d..16750b130ec443 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -945,7 +945,8 @@ folio_within_range(struct folio *folio, struct vm_area_struct *vma, return false; pgoff_folio = folio_pgoff(folio); - pgoff_vma_start = vma_start_pgoff(vma); + pgoff_vma_start = folio_test_anon(folio) ? + vma_start_anon_pgoff(vma) : vma_start_pgoff(vma); if (start < vma->vm_start) start = vma->vm_start; @@ -1056,23 +1057,8 @@ static inline unsigned long vma_filebacked_address(const struct vm_area_struct * } /** - * vma_address - Find the virtual address a page range is mapped at. - * @vma: The vma which maps this object. - * @pgoff: The page offset within its object. - * @nr_pages: The number of pages to consider. - * - * If any page in this range is mapped by this VMA, return the first address - * where any of these pages appear. Otherwise, return -EFAULT. - */ -static inline unsigned long vma_address(const struct vm_area_struct *vma, - pgoff_t pgoff, unsigned long nr_pages) -{ - return __vma_address(vma, pgoff, vma_start_pgoff(vma), nr_pages); -} - -/** - * vma_anon_address - Find the address an anonymous folio with index @pgoff_anon - * is mapped at. + * vma_anon_address - Find the virtual address an anonymous page range is mapped + * at. * @vma: The vma which maps this object. * @pgoff_anon: The anonymous page index belonging to the folio. * @nr_pages: The number of pages to consider. @@ -1105,7 +1091,10 @@ static inline unsigned long vma_address_end(struct page_vma_mapped_walk *pvmw) if (pvmw->nr_pages == 1) return pvmw->address + PAGE_SIZE; - pgoff_vma_start = vma_start_pgoff(vma); + if (pvmw->pgoff_is_anon) + pgoff_vma_start = vma_start_anon_pgoff(vma); + else + pgoff_vma_start = vma_start_pgoff(vma); address = vma->vm_start + ((pgoff_end - pgoff_vma_start) << PAGE_SHIFT); diff --git a/mm/interval_tree.c b/mm/interval_tree.c index 3ae9e106d3afd8..7bbbf15cfbf0c7 100644 --- a/mm/interval_tree.c +++ b/mm/interval_tree.c @@ -83,12 +83,12 @@ mapping_rmap_tree_iter_next(struct vm_area_struct *vma, static pgoff_t avc_start_pgoff(struct anon_vma_chain *avc) { - return vma_start_pgoff(avc->vma); + return vma_start_anon_pgoff(avc->vma); } static pgoff_t avc_last_pgoff(struct anon_vma_chain *avc) { - return vma_last_pgoff(avc->vma); + return vma_last_anon_pgoff(avc->vma); } INTERVAL_TREE_DEFINE(struct anon_vma_chain, rb, pgoff_t, rb_subtree_last, diff --git a/mm/ksm.c b/mm/ksm.c index b4142746777ee3..b5854dc14a2ec1 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1625,7 +1625,7 @@ static int try_to_merge_with_ksm_page(struct ksm_rmap_item *rmap_item, * stable_tree, break_cow() will clean it up. */ rmap_item->anon_vma = vma->anon_vma; - rmap_item->linear_page_index = linear_page_index(vma, rmap_item->address); + rmap_item->linear_page_index = linear_anon_page_index(vma, rmap_item->address); get_anon_vma(vma->anon_vma); out: mmap_read_unlock(mm); @@ -3152,7 +3152,7 @@ struct folio *ksm_might_need_to_copy(struct folio *folio, return folio; /* no need to copy it */ } else if (!anon_vma) { return folio; /* no need to copy it */ - } else if (folio->index == linear_page_index(vma, addr) && + } else if (folio->index == linear_anon_page_index(vma, addr) && anon_vma->root == vma->anon_vma->root) { return folio; /* still no need to copy it */ } @@ -3222,7 +3222,7 @@ void rmap_walk_ksm(struct folio *folio, struct rmap_walk_control *rwc) /* * Currently, KSM folios are always small folios, so it's * sufficient to search for a single page. We can simply use - * the linear_page_index of the original de-duplicate + * the linear_anon_page_index of the original de-duplicate * anonymous page that we remembered in the rmap_item while * de-duplicating. Note that mremap() always de-duplicates KSM * folios: so if there was mremap() in our parent or our child, diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 081e483cc7bf5f..4e964545e5e85a 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -365,7 +365,7 @@ unsigned long page_mapped_in_vma(const struct page *page, }; if (folio_test_anon(folio)) - pvmw.address = vma_address(vma, pgoff, 1); + pvmw.address = vma_anon_address(vma, pgoff, 1); else pvmw.address = vma_filebacked_address(vma, pgoff, 1); if (pvmw.address == -EFAULT) diff --git a/mm/rmap.c b/mm/rmap.c index 1b23ac709f45c8..34ceeb600111c7 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -866,7 +866,7 @@ unsigned long page_address_in_vma(const struct folio *folio, vma->anon_vma->root != anon_vma->root) return -EFAULT; /* KSM folios don't reach here because of the !anon_vma check */ - return vma_address(vma, page_pgoff(folio, page), 1); + return vma_anon_address(vma, page_pgoff(folio, page), 1); } else if (!vma->vm_file) { return -EFAULT; } else if (vma->vm_file->f_mapping != folio->mapping) { @@ -1485,7 +1485,7 @@ static void __folio_set_anon(struct folio *folio, struct vm_area_struct *vma, */ anon_vma = (void *) anon_vma + FOLIO_MAPPING_ANON; WRITE_ONCE(folio->mapping, (struct address_space *) anon_vma); - folio->index = linear_page_index(vma, address); + folio->index = linear_anon_page_index(vma, address); } /** @@ -1512,8 +1512,8 @@ static void __page_check_anon_rmap(const struct folio *folio, */ VM_BUG_ON_FOLIO(folio_anon_vma(folio)->root != vma->anon_vma->root, folio); - VM_BUG_ON_PAGE(page_pgoff(folio, page) != linear_page_index(vma, address), - page); + VM_BUG_ON_PAGE(page_pgoff(folio, page) != + linear_anon_page_index(vma, address), page); } static __always_inline void __folio_add_anon_rmap(struct folio *folio, @@ -3038,10 +3038,10 @@ static void rmap_walk_anon(struct folio *folio, pgoff_end = pgoff_start + folio_nr_pages(folio) - 1; anon_rmap_tree_foreach(avc, anon_vma, pgoff_start, pgoff_end) { struct vm_area_struct *vma = avc->vma; - unsigned long address = vma_address(vma, pgoff_start, + const unsigned long address = vma_anon_address(vma, pgoff_start, folio_nr_pages(folio)); - VM_BUG_ON_VMA(address == -EFAULT, vma); + VM_WARN_ON_ONCE_VMA(address == -EFAULT, vma); cond_resched(); if (rwc->invalid_vma && rwc->invalid_vma(vma, rwc->arg)) diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c index 752ca2e3b5e5a2..74f04c323c50fb 100644 --- a/mm/userfaultfd.c +++ b/mm/userfaultfd.c @@ -1352,7 +1352,7 @@ static long move_present_ptes(struct mm_struct *mm, } folio_move_anon_rmap(src_folio, dst_vma); - src_folio->index = linear_page_index(dst_vma, dst_addr); + src_folio->index = linear_anon_page_index(dst_vma, dst_addr); orig_dst_pte = folio_mk_pte(src_folio, dst_vma->vm_page_prot); /* Set soft dirty bit so userspace can notice the pte was moved */ @@ -1428,7 +1428,7 @@ static int move_swap_pte(struct mm_struct *mm, struct vm_area_struct *dst_vma, */ if (src_folio) { folio_move_anon_rmap(src_folio, dst_vma); - src_folio->index = linear_page_index(dst_vma, dst_addr); + src_folio->index = linear_anon_page_index(dst_vma, dst_addr); } else { /* * Check if the swap entry is cached after acquiring the src_pte diff --git a/mm/vma.c b/mm/vma.c index e35b04ac12cbb6..35e7a64855fadc 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -204,6 +204,25 @@ static void init_multi_vma_prep(struct vma_prepare *vp, vp->skip_vma_uprobe = true; } +/* + * Does this merge require that adjacent VMAs must have adjacent anonymous page + * offsets in addition to having adjacent vma->vm_pgoff? + * + * This is only required for MAP_PRIVATE-file backed mappings as the page offset + * for pure anonymous VMAs is equal to the anonymous page offset. + * + * Read-only shared mappings (with VMA_SHARED_BIT cleared) are always unfaulted + * so automatically have correct anonymous page offset (as it is always updated + * on remap). + * + * 'Special' mappings in the sense of VDSO, VVAR etc. have !file but would in + * any case not be candidates for merge nor be mergeable. + */ +static bool needs_adjacent_anon_pgoff(const struct vma_merge_struct *vmg) +{ + return vmg->file && vma_flags_is_cow_mapping(&vmg->vma_flags); +} + /* * Return true if we can merge this (vma_flags,anon_vma,file,vm_pgoff) * in front of (at a lower virtual address and file offset than) the vma. @@ -225,6 +244,9 @@ static bool can_vma_merge_before(struct vma_merge_struct *vmg) return false; if (vmg_end_pgoff(vmg) != vma_start_pgoff(vmg->next)) return false; + if (needs_adjacent_anon_pgoff(vmg) && + vmg_end_anon_pgoff(vmg) != vma_start_anon_pgoff(vmg->next)) + return false; return true; } @@ -245,6 +267,9 @@ static bool can_vma_merge_after(struct vma_merge_struct *vmg) return false; if (vma_end_pgoff(vmg->prev) != vmg_start_pgoff(vmg)) return false; + if (needs_adjacent_anon_pgoff(vmg) && + vma_end_anon_pgoff(vmg->prev) != vmg_start_anon_pgoff(vmg)) + return false; return true; } @@ -2048,7 +2073,12 @@ static int anon_vma_compatible(struct vm_area_struct *a, struct vm_area_struct * if (!vma_flags_empty(&diff)) return false; /* Page offset must align. */ - return vma_end_pgoff(a) == vma_start_pgoff(b); + if (vma_end_pgoff(a) != vma_start_pgoff(b)) + return false; + /* Only reached from anon path, so either MAP_PRIVATE file or anon. */ + if (vma_end_anon_pgoff(a) != vma_start_anon_pgoff(b)) + return false; + return true; } /* From 52f8e8cbc3def7af54af6f890cc9f7885eddc2ed Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:32 +0100 Subject: [PATCH 065/250] tools/testing/vma: expand VMA merge tests to assert anon pgoff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we have introduced the VMA anonymous page offset attribute and update it when VMAs are manipulated, update VMA merge tests to assert that the anonymous page offset is as expected. Also update instances where we could use vma_start_pgoff() to do so. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-15-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/vma/tests/merge.c | 45 ++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/tools/testing/vma/tests/merge.c b/tools/testing/vma/tests/merge.c index 48418b82b01db1..acaab282939c0b 100644 --- a/tools/testing/vma/tests/merge.c +++ b/tools/testing/vma/tests/merge.c @@ -121,6 +121,7 @@ static bool test_simple_merge(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x3000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_FLAGS_SAME_MASK(&vma->flags, vma_flags); detach_free_vma(vma); @@ -153,6 +154,7 @@ static bool test_simple_modify(void) ASSERT_EQ(vma->vm_start, 0x1000); ASSERT_EQ(vma->vm_end, 0x2000); ASSERT_EQ(vma_start_pgoff(vma), 1); + ASSERT_EQ(vma_start_anon_pgoff(vma), 1); /* * Now walk through the three split VMAs and make sure they are as @@ -165,6 +167,7 @@ static bool test_simple_modify(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x1000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); detach_free_vma(vma); vma_iter_clear(&vmi); @@ -174,6 +177,7 @@ static bool test_simple_modify(void) ASSERT_EQ(vma->vm_start, 0x1000); ASSERT_EQ(vma->vm_end, 0x2000); ASSERT_EQ(vma_start_pgoff(vma), 1); + ASSERT_EQ(vma_start_anon_pgoff(vma), 1); detach_free_vma(vma); vma_iter_clear(&vmi); @@ -183,6 +187,7 @@ static bool test_simple_modify(void) ASSERT_EQ(vma->vm_start, 0x2000); ASSERT_EQ(vma->vm_end, 0x3000); ASSERT_EQ(vma_start_pgoff(vma), 2); + ASSERT_EQ(vma_start_anon_pgoff(vma), 2); detach_free_vma(vma); mtree_destroy(&mm.mm_mt); @@ -212,6 +217,7 @@ static bool test_simple_expand(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x3000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); detach_free_vma(vma); mtree_destroy(&mm.mm_mt); @@ -234,6 +240,7 @@ static bool test_simple_shrink(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x1000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); detach_free_vma(vma); mtree_destroy(&mm.mm_mt); @@ -346,6 +353,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x5000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 3); @@ -367,6 +375,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0x6000); ASSERT_EQ(vma->vm_end, 0x9000); ASSERT_EQ(vma_start_pgoff(vma), 6); + ASSERT_EQ(vma_start_anon_pgoff(vma), 6); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 3); @@ -387,6 +396,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x9000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 2); @@ -407,6 +417,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0xa000); ASSERT_EQ(vma->vm_end, 0xc000); ASSERT_EQ(vma_start_pgoff(vma), 0xa); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0xa); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 2); @@ -426,6 +437,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0xc000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 1); @@ -446,6 +458,7 @@ static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0xc000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_EQ(vma->anon_vma, &dummy_anon_vma); detach_free_vma(vma); @@ -642,7 +655,8 @@ static bool test_vma_merge_with_close(void) ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x5000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_EQ(cleanup_mm(&mm, &vmi), 2); @@ -753,7 +767,8 @@ static bool test_vma_merge_with_close(void) ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x5000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_EQ(cleanup_mm(&mm, &vmi), 2); @@ -808,6 +823,7 @@ static bool test_vma_merge_new_with_close(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x5000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_EQ(vma->vm_ops, &vm_ops); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 2); @@ -863,11 +879,13 @@ static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bo ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_next->vm_start, 0x3000); ASSERT_EQ(vma_next->vm_end, 0x9000); - ASSERT_EQ(vma_next->vm_pgoff, 3); + ASSERT_EQ(vma_start_pgoff(vma_next), 3); + ASSERT_EQ(vma_start_anon_pgoff(vma_next), 3); ASSERT_EQ(vma_next->anon_vma, &dummy_anon_vma); ASSERT_EQ(vma->vm_start, 0x2000); ASSERT_EQ(vma->vm_end, 0x3000); ASSERT_EQ(vma_start_pgoff(vma), 2); + ASSERT_EQ(vma_start_anon_pgoff(vma), 2); ASSERT_TRUE(vma_write_started(vma)); ASSERT_TRUE(vma_write_started(vma_next)); ASSERT_EQ(mm.map_count, 2); @@ -897,7 +915,8 @@ static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bo ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_next->vm_start, 0x2000); ASSERT_EQ(vma_next->vm_end, 0x9000); - ASSERT_EQ(vma_next->vm_pgoff, 2); + ASSERT_EQ(vma_start_pgoff(vma_next), 2); + ASSERT_EQ(vma_start_anon_pgoff(vma_next), 2); ASSERT_EQ(vma_next->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma_next)); ASSERT_EQ(mm.map_count, 1); @@ -929,11 +948,13 @@ static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bo ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x6000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_EQ(vma_prev->anon_vma, &dummy_anon_vma); ASSERT_EQ(vma->vm_start, 0x6000); ASSERT_EQ(vma->vm_end, 0x7000); ASSERT_EQ(vma_start_pgoff(vma), 6); + ASSERT_EQ(vma_start_anon_pgoff(vma), 6); ASSERT_TRUE(vma_write_started(vma_prev)); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 2); @@ -964,7 +985,8 @@ static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bo ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x7000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_EQ(vma_prev->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma_prev)); ASSERT_EQ(mm.map_count, 1); @@ -996,7 +1018,8 @@ static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bo ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x9000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_EQ(vma_prev->anon_vma, &dummy_anon_vma); ASSERT_TRUE(vma_write_started(vma_prev)); ASSERT_EQ(mm.map_count, 1); @@ -1126,7 +1149,8 @@ static bool test_anon_vma_non_mergeable(void) ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x7000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_TRUE(vma_write_started(vma_prev)); ASSERT_FALSE(vma_write_started(vma_next)); @@ -1157,7 +1181,8 @@ static bool test_anon_vma_non_mergeable(void) ASSERT_EQ(vmg.state, VMA_MERGE_SUCCESS); ASSERT_EQ(vma_prev->vm_start, 0); ASSERT_EQ(vma_prev->vm_end, 0x7000); - ASSERT_EQ(vma_prev->vm_pgoff, 0); + ASSERT_EQ(vma_start_pgoff(vma_prev), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma_prev), 0); ASSERT_TRUE(vma_write_started(vma_prev)); ASSERT_FALSE(vma_write_started(vma_next)); @@ -1419,6 +1444,7 @@ static bool test_merge_extend(void) ASSERT_EQ(vma->vm_start, 0); ASSERT_EQ(vma->vm_end, 0x4000); ASSERT_EQ(vma_start_pgoff(vma), 0); + ASSERT_EQ(vma_start_anon_pgoff(vma), 0); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(mm.map_count, 1); @@ -1459,6 +1485,7 @@ static bool test_expand_only_mode(void) ASSERT_EQ(vma->vm_start, 0x3000); ASSERT_EQ(vma->vm_end, 0x9000); ASSERT_EQ(vma_start_pgoff(vma), 3); + ASSERT_EQ(vma_start_anon_pgoff(vma), 3); ASSERT_TRUE(vma_write_started(vma)); ASSERT_EQ(vma_iter_addr(&vmi), 0x3000); vma_assert_attached(vma); From 1d08eb9849097c1d3d06351980cc79faf26eb5fd Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Thu, 13 Aug 2026 18:32:33 +0100 Subject: [PATCH 066/250] tools/testing/selftests/mm: test anonymous page offset merge behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While maintaining anonymous page offsets for VMAs has no impact for most merge cases, it does impact MAP_PRIVATE-mapped file-backed mappings which happen to have matching page offset but not matching anonymous page offset. Assert this behaviour by attempting to map an unfaulted MAP_PRIVATE-memfd region with a faulted one with compatible file page offsets but incompatible anonymous page offsets. Link: https://lore.kernel.org/20260813-b4-scalable-cow-virt-pgoff-v5-16-c21581c0c3c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Adrian Hunter Cc: Alexander Deucher Cc: Alexander Gordeev Cc: Alexander Shishkin Cc: Alistair Popple Cc: Arnaldo Carvalho de Melo Cc: Arnd Bergmann Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Boris Brezillon Cc: Byungchul Park Cc: Chengming Zhou Cc: Chris Li Cc: Christan König Cc: Christian Borntraeger Cc: Claudio Imbrenda Cc: Dave Airlie Cc: Dev Jain Cc: Gerald Schaefer Cc: Greg Kroah-Hartman Cc: Gregory Price (Meta) Cc: Harry Yoo Cc: Heiko Carstens Cc: Huang Ray Cc: "Huang, Ying" Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jan Kara Cc: Jann Horn Cc: Janosch Frank Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Joshua Hahn Cc: Kairui Song Cc: Kees Cook Cc: Kemeng Shi Cc: Lance Yang Cc: Liam R. Howlett Cc: Liviu Dudau Cc: Maarten Lankhorst Cc: Marc Rutland Cc: "Masami Hiramatsu (Google)" Cc: Matthew Auld Cc: Matthew Brost Cc: Matthew Wilcox (Oracle) Cc: Maxime Ripard Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Namhyung kim Cc: Naoya Horiguchi Cc: Nhat Pham Cc: Nico Pache Cc: Oleg Nesterov Cc: Oscar Salvador Cc: Pedro Falcato Cc: Peter Xu Cc: Peter Zijlstra Cc: Rakie Kim Cc: Rik van Riel Cc: Rodrigo Vivi Cc: Ryan Roberts Cc: Steven Price Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Thomas Hellström Cc: Thomas Zimemrmann Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: xu xin Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/merge.c | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tools/testing/selftests/mm/merge.c b/tools/testing/selftests/mm/merge.c index 519e5ac02db78c..52b8727b6628e0 100644 --- a/tools/testing/selftests/mm/merge.c +++ b/tools/testing/selftests/mm/merge.c @@ -1305,6 +1305,63 @@ TEST_F(merge, merge_vmas_with_mseal) ASSERT_EQ(procmap->query.vma_end, (unsigned long)ptr + 2 * page_size); } +TEST_F(merge, anon_and_page_offset_mismatch_memfd) +{ + struct procmap_fd *procmap = &self->procmap; + unsigned int page_size = self->page_size; + char *carveout = self->carveout; + char *ptr, *ptr2; + int fd; + + /* Create a 10 page memfd descriptor. */ + fd = memfd_create("anon_page_offset_test", MFD_CLOEXEC); + ASSERT_NE(fd, -1); + ASSERT_EQ(ftruncate(fd, 10 * page_size), 0); + + /* Map a region using the memfd at page offset 0. */ + ptr = mmap(carveout, 5 * page_size, PROT_READ | PROT_WRITE, + MAP_FIXED | MAP_PRIVATE, fd, 0); + ASSERT_NE(ptr, MAP_FAILED); + + /* + * Map another separately and trigger a CoW fault at page offset 5: + * + * |-----------| |---------| + * | unfaulted | | faulted | + * |-----------| |---------| + */ + ptr2 = mmap(&carveout[10 * page_size], 5 * page_size, + PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, + fd, 5 * page_size); + ASSERT_NE(ptr2, MAP_FAILED); + ptr2[0] = 'x'; + + /* + * Now move it in place: + * + * |----------| + * | | + * v | + * |-----------| |---------| + * | unfaulted | | faulted | + * |-----------| |---------| + * + * Because the anonymous page offset of the faulted region is now + * &carveout[10 * page_size], despite the two regions being mergeable + * due to file page offset, they are NOT mergeable due to anonymous + * page offset. + */ + ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size, + MREMAP_MAYMOVE | MREMAP_FIXED, + &carveout[5 * page_size]); + ASSERT_NE(ptr2, MAP_FAILED); + + /* Assert that they did not merge. */ + ASSERT_TRUE(find_vma_procmap(procmap, ptr)); + ASSERT_EQ(procmap->query.vma_start, (unsigned long)ptr); + ASSERT_EQ(procmap->query.vma_end, (unsigned long)ptr + 5 * page_size); +} + TEST_F(merge_with_fork, mremap_faulted_to_unfaulted_prev) { struct procmap_fd *procmap = &self->procmap; From 3f12a275e664118dac1ed94751722ab59ddf6287 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 20 Jul 2026 06:23:45 -0700 Subject: [PATCH 067/250] mm/kmemleak: report RCU-tasks quiescent states during the scan kmemleak_scan() can run for ages on large debug kernels. It was causing some soft-lockups which I got fixed with commit 3175fcfec8b16baeb ("mm/kmemleak: avoid soft lockup when scanning task stacks") with our beloved cond_resched(). I've got the fix above deployed in the Meta fleet, and now I am seeing: INFO: rcu_tasks detected stalls on tasks: task:kmemleak state:R ... nvcsw: 274/274 holdout: 1 idle_cpu: -1/3 scan_block scan_gray_list kmemleak_scan and, worse, blocks the callers waiting on that grace period. Here a BPF struct_ops map free, which waits via synchronize_rcu_mult(call_rcu, call_rcu_tasks), is stuck long enough to also trip the hung task check: INFO: task kworker/...:bpf_map_free_deferred blocked for 122 seconds __wait_rcu_gp bpf_struct_ops_map_free Then I've learned that cond_resched() is not an RCU-tasks quiescent state, so, we need to use stronger primitives. Use cond_resched_tasks_rcu_qs() at the scan reschedule points so the scan reports an RCU-tasks quiescent state as it proceeds. Inspired by commit b96285e10aad ("tracing: Have osnoise_main() add a quiescent state for task rcu"). Link: https://lore.kernel.org/20260720-kmemleak_rcu_task-v1-1-5b460ade777d@debian.org Fixes: c4b28963fd79 ("mm/kmemleak: rely on rcu for task stack scanning") Signed-off-by: Breno Leitao Reviewed-by: Paul E. McKenney Reviewed-by: SJ Park Reviewed-by: Catalin Marinas Cc: Breno Leitao Cc: Puranjay Mohan Cc: Signed-off-by: Andrew Morton --- mm/kmemleak.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index e96e9efd19b0d9..0a6045c857d661 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1571,7 +1571,7 @@ static int scan_large_block(void *start, void *end) if (scan_block(start, next, NULL)) return 1; start = next; - cond_resched(); + cond_resched_tasks_rcu_qs(); } return 0; @@ -1608,7 +1608,7 @@ static void scan_object(struct kmemleak_object *object) scan_block(start, end, object); raw_spin_unlock_irqrestore(&object->lock, flags); - cond_resched(); + cond_resched_tasks_rcu_qs(); raw_spin_lock_irqsave(&object->lock, flags); if (!(object->flags & OBJECT_ALLOCATED)) break; @@ -1630,7 +1630,7 @@ static void scan_object(struct kmemleak_object *object) break; raw_spin_unlock_irqrestore(&object->lock, flags); - cond_resched(); + cond_resched_tasks_rcu_qs(); raw_spin_lock_irqsave(&object->lock, flags); } while (object->flags & OBJECT_ALLOCATED); } else { @@ -1658,7 +1658,7 @@ static void scan_gray_list(void) */ object = list_entry(gray_list.next, typeof(*object), gray_list); while (&object->gray_list != &gray_list) { - cond_resched(); + cond_resched_tasks_rcu_qs(); /* may add new objects to the list */ if (!scan_should_stop()) @@ -1693,7 +1693,7 @@ static void kmemleak_cond_resched(struct kmemleak_object *object) raw_spin_unlock_irq(&kmemleak_lock); rcu_read_unlock(); - cond_resched(); + cond_resched_tasks_rcu_qs(); rcu_read_lock(); raw_spin_lock_irq(&kmemleak_lock); @@ -1738,7 +1738,7 @@ static void kmemleak_scan_task_stacks(void) } put_task_struct(p); } - cond_resched(); + cond_resched_tasks_rcu_qs(); } while (pid && !stop); } @@ -1915,7 +1915,7 @@ static void kmemleak_scan(void) struct page *page = pfn_to_online_page(pfn); if (!(pfn & 63)) - cond_resched(); + cond_resched_tasks_rcu_qs(); if (!page) continue; From bd3e740a82ff6a97140e803698bd9283ce1d0f8a Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Mon, 20 Jul 2026 19:12:00 +0800 Subject: [PATCH 068/250] mm: vmscan: convert folio_referenced() to use vma_flags_t Patch series "promote mapped executable folios after first usage for MGLRU", v4. Now MGLRU's protection of mapped executable file folios is less reliable. Follow the classical LRU's logic, promoting mapped executable file folios after their first usage to give executable code a better chance to stay in memory and improve workload performance (See patch 2 for more details). This patch (of 3): Replace use of the legacy vm_flags_t flags with vma_flags_t values for folio_referenced() and related logic. This is also a preparation for the following changes. No functional changes. Link: https://lore.kernel.org/cover.1784509721.git.baolin.wang@linux.alibaba.com Link: https://lore.kernel.org/2bd39e16ec19e3e3c4716aa9a1a25775c26cac57.1784509721.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: David Hildenbrand (Arm) Acked-by: Johannes Weiner Reviewed-by: Barry Song Reviewed-by: Kairui Song Reviewed-by: Axel Rasmussen Cc: Harry Yoo Cc: Jann Horn Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Rik van Riel Cc: Shakeel Butt Cc: Vlastimil Babka Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- include/linux/rmap.h | 7 +++---- mm/rmap.c | 19 +++++++++++-------- mm/vmscan.c | 14 +++++++------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 0574537a355cde..0b332770abeed5 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -843,7 +843,7 @@ static inline int folio_try_share_anon_rmap_pmd(struct folio *folio, * Called from mm/vmscan.c to handle paging out */ int folio_referenced(struct folio *, int is_locked, - struct mem_cgroup *memcg, vm_flags_t *vm_flags); + struct mem_cgroup *memcg, vma_flags_t *vma_flags); void try_to_migrate(struct folio *folio, enum ttu_flags flags); void try_to_unmap(struct folio *, enum ttu_flags flags); @@ -977,10 +977,9 @@ struct anon_vma *folio_lock_anon_vma_read(const struct folio *folio, #define anon_vma_prepare(vma) (0) static inline int folio_referenced(struct folio *folio, int is_locked, - struct mem_cgroup *memcg, - vm_flags_t *vm_flags) + struct mem_cgroup *memcg, vma_flags_t *vma_flags) { - *vm_flags = 0; + vma_flags_clear_all(vma_flags); return 0; } diff --git a/mm/rmap.c b/mm/rmap.c index 34ceeb600111c7..14f2f9b07572ab 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -908,7 +908,7 @@ pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address) struct folio_referenced_arg { int mapcount; int referenced; - vm_flags_t vm_flags; + vma_flags_t vma_flags; struct mem_cgroup *memcg; }; @@ -927,7 +927,7 @@ static bool folio_referenced_one(struct folio *folio, address = pvmw.address; nr = 1; - if (vma->vm_flags & VM_LOCKED) { + if (vma_test(vma, VMA_LOCKED_BIT)) { ptes++; pra->mapcount--; @@ -948,7 +948,7 @@ static bool folio_referenced_one(struct folio *folio, /* Restore the mlock which got missed */ mlock_vma_folio(folio, vma); page_vma_mapped_walk_done(&pvmw); - pra->vm_flags |= VM_LOCKED; + vma_flags_set(&pra->vma_flags, VMA_LOCKED_BIT); return false; /* To break the loop */ } @@ -1016,8 +1016,11 @@ static bool folio_referenced_one(struct folio *folio, referenced++; if (referenced) { + vma_flags_t vma_flags = vma->flags; + pra->referenced++; - pra->vm_flags |= vma->vm_flags & ~VM_LOCKED; + vma_flags_clear(&vma_flags, VMA_LOCKED_BIT); + vma_flags_set_mask(&pra->vma_flags, vma_flags); } if (!pra->mapcount) @@ -1055,7 +1058,7 @@ static bool invalid_folio_referenced_vma(struct vm_area_struct *vma, void *arg) * @folio: The folio to test. * @is_locked: Caller holds lock on the folio. * @memcg: target memory cgroup - * @vm_flags: A combination of all the vma->vm_flags which referenced the folio. + * @vma_flags: A combination of all the vma->flags which referenced the folio. * * Quick test_and_clear_referenced for all mappings of a folio, * @@ -1063,7 +1066,7 @@ static bool invalid_folio_referenced_vma(struct vm_area_struct *vma, void *arg) * the function bailed out due to rmap lock contention. */ int folio_referenced(struct folio *folio, int is_locked, - struct mem_cgroup *memcg, vm_flags_t *vm_flags) + struct mem_cgroup *memcg, vma_flags_t *vma_flags) { bool we_locked = false; struct folio_referenced_arg pra = { @@ -1079,7 +1082,7 @@ int folio_referenced(struct folio *folio, int is_locked, }; VM_WARN_ON_ONCE_FOLIO(folio_is_zone_device(folio), folio); - *vm_flags = 0; + vma_flags_clear_all(vma_flags); if (!pra.mapcount) return 0; @@ -1093,7 +1096,7 @@ int folio_referenced(struct folio *folio, int is_locked, } rmap_walk(folio, &rwc); - *vm_flags = pra.vm_flags; + vma_flags_set_mask(vma_flags, pra.vma_flags); if (we_locked) folio_unlock(folio); diff --git a/mm/vmscan.c b/mm/vmscan.c index 8bd0bea627677d..206213e56ec815 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -861,16 +861,16 @@ static enum folio_references folio_check_references(struct folio *folio, struct scan_control *sc) { int referenced_ptes, referenced_folio; - vm_flags_t vm_flags; + vma_flags_t vma_flags; referenced_ptes = folio_referenced(folio, 1, sc->target_mem_cgroup, - &vm_flags); + &vma_flags); /* * The supposedly reclaimable folio was found to be in a VM_LOCKED vma. * Let the folio, now marked Mlocked, be moved to the unevictable list. */ - if (vm_flags & VM_LOCKED) + if (vma_flags_test(&vma_flags, VMA_LOCKED_BIT)) return FOLIOREF_ACTIVATE; /* @@ -914,7 +914,7 @@ static enum folio_references folio_check_references(struct folio *folio, /* * Activate file-backed executable folios after first usage. */ - if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio)) + if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) return FOLIOREF_ACTIVATE; return FOLIOREF_KEEP; @@ -2065,7 +2065,7 @@ static void shrink_active_list(unsigned long nr_to_scan, { unsigned long nr_taken; unsigned long nr_scanned; - vm_flags_t vm_flags; + vma_flags_t vma_flags; LIST_HEAD(l_hold); /* The folios which were snipped off */ LIST_HEAD(l_active); LIST_HEAD(l_inactive); @@ -2109,7 +2109,7 @@ static void shrink_active_list(unsigned long nr_to_scan, /* Referenced or rmap lock contention: rotate */ if (folio_referenced(folio, 0, sc->target_mem_cgroup, - &vm_flags) != 0) { + &vma_flags) != 0) { /* * Identify referenced, file-backed active folios and * give them one more trip around the active list. So @@ -2119,7 +2119,7 @@ static void shrink_active_list(unsigned long nr_to_scan, * IO, plus JVM can create lots of anon VM_EXEC folios, * so we ignore them here. */ - if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio)) { + if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) { nr_rotated += folio_nr_pages(folio); list_add(&folio->lru, &l_active); continue; From 383b3c4057594c5778d3a81a47fa5c24276fd959 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Mon, 20 Jul 2026 19:12:01 +0800 Subject: [PATCH 069/250] mm: vmscan: add a helper to identify file-backed executable folios Add a helper to identify file-backed executable folios to avoid duplicate code. No functional changes. Link: https://lore.kernel.org/2ee74f9f98ac45a2f0db0ceb018e086bdb671d17.1784509721.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen Reviewed-by: David Hildenbrand (Arm) Reviewed-by: Kairui Song Reviewed-by: Barry Song Cc: Harry Yoo Cc: Jann Horn Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Rik van Riel Cc: Shakeel Butt Cc: Vlastimil Babka Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- mm/vmscan.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 206213e56ec815..f2628b9187f863 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -268,6 +268,12 @@ static int sc_swappiness(struct scan_control *sc, struct mem_cgroup *memcg) } #endif +static inline bool is_exec_file_folio(const struct folio *folio, + const vma_flags_t *vma_flags) +{ + return vma_flags_test(vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio); +} + static void set_task_reclaim_state(struct task_struct *task, struct reclaim_state *rs) { @@ -914,7 +920,7 @@ static enum folio_references folio_check_references(struct folio *folio, /* * Activate file-backed executable folios after first usage. */ - if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) + if (is_exec_file_folio(folio, &vma_flags)) return FOLIOREF_ACTIVATE; return FOLIOREF_KEEP; @@ -2119,7 +2125,7 @@ static void shrink_active_list(unsigned long nr_to_scan, * IO, plus JVM can create lots of anon VM_EXEC folios, * so we ignore them here. */ - if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) { + if (is_exec_file_folio(folio, &vma_flags)) { nr_rotated += folio_nr_pages(folio); list_add(&folio->lru, &l_active); continue; From f619fa7bef2b6289c7cf009aade68bc0990f55f8 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Mon, 20 Jul 2026 19:12:02 +0800 Subject: [PATCH 070/250] mm: mglru: promote mapped executable folios after first usage Classical LRU protects mapped executable file folios through commit 8cab4754d24a0 ("vmscan: make mapped executable pages the first class citizen") and commit c909e99364c8 ("vmscan: activate executable pages after first usage"), giving executable code a better chance to stay in memory, avoiding IO thrashing and improving workload performance. However, MGLRU's protection of mapped executable file folios is less reliable. Although shrink_folio_list() checks references, the access flag of mapped executable file folios may have already been checked and cleared by lru_gen_look_around() or walk_mm(). Additionally, folio_update_gen() or lru_gen_set_refs() only sets the 'PG_referenced' flag for mapped executable file folios, which causes shrink_folio_list() to ignore the first usage of these mapped executable file folios and reclaim them easily. Follow the classical LRU's logic, promoting mapped executable file folios after their first usage in folio_update_gen() and lru_gen_set_refs(), giving executable code a better chance to stay in memory. On my 32-core Arm machine, with the memcg limit set to 2G, running 'make -j32' to build kernel showed some improvement in sys time. base patched 9248.543s 7861.579s Link: https://lore.kernel.org/f57d94b1d85bb3d620d89bb739128f0d929bf9c6.1784509721.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen Cc: Barry Song Cc: David Hildenbrand Cc: Harry Yoo Cc: Jann Horn Cc: Kairui Song Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Rik van Riel Cc: Shakeel Butt Cc: Vlastimil Babka Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- mm/vmscan.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index f2628b9187f863..d65ccea927567d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -841,10 +841,16 @@ enum folio_references { * with PG_active set. In contrast, the aging (page table walk) path uses * folio_update_gen(). */ -static bool lru_gen_set_refs(struct folio *folio) +static bool lru_gen_set_refs(struct folio *folio, const vma_flags_t *vma_flags) { /* see the comment on LRU_REFS_FLAGS */ if (!folio_test_referenced(folio) && !folio_test_workingset(folio)) { + /* Activate file-backed executable folios after first usage. */ + if (is_exec_file_folio(folio, vma_flags)) { + set_mask_bits(&folio->flags.f, LRU_REFS_FLAGS, BIT(PG_workingset)); + return true; + } + set_mask_bits(&folio->flags.f, LRU_REFS_MASK, BIT(PG_referenced)); return false; } @@ -857,7 +863,7 @@ static bool lru_gen_set_refs(struct folio *folio) return true; } #else -static bool lru_gen_set_refs(struct folio *folio) +static bool lru_gen_set_refs(struct folio *folio, const vma_flags_t *vma_flags) { return false; } @@ -892,7 +898,7 @@ static enum folio_references folio_check_references(struct folio *folio, if (!referenced_ptes) return FOLIOREF_RECLAIM; - return lru_gen_set_refs(folio) ? FOLIOREF_ACTIVATE : FOLIOREF_KEEP; + return lru_gen_set_refs(folio, &vma_flags) ? FOLIOREF_ACTIVATE : FOLIOREF_KEEP; } referenced_folio = folio_test_clear_referenced(folio); @@ -3208,14 +3214,19 @@ static bool positive_ctrl_err(struct ctrl_pos *sp, struct ctrl_pos *pv) ******************************************************************************/ /* promote pages accessed through page tables */ -static int folio_update_gen(struct folio *folio, int gen) +static int folio_update_gen(struct folio *folio, int gen, const vma_flags_t *vma_flags) { unsigned long new_flags, old_flags = READ_ONCE(folio->flags.f); VM_WARN_ON_ONCE(gen >= MAX_NR_GENS); - /* see the comment on LRU_REFS_FLAGS */ - if (!folio_test_referenced(folio) && !folio_test_workingset(folio)) { + /* + * See the comment on LRU_REFS_FLAGS, and activate file-backed + * executable folios after first usage to avoid typical IO + * thrashing from reclaiming. + */ + if (!folio_test_referenced(folio) && !folio_test_workingset(folio) && + !is_exec_file_folio(folio, vma_flags)) { set_mask_bits(&folio->flags.f, LRU_REFS_MASK, BIT(PG_referenced)); return -1; } @@ -3448,8 +3459,8 @@ static bool suitable_to_scan(int total, int young) return young * n >= total; } -static void walk_update_folio(struct lru_gen_mm_walk *walk, struct folio *folio, - int new_gen, bool dirty) +static void walk_update_folio(struct lru_gen_mm_walk *walk, struct vm_area_struct *vma, + struct folio *folio, int new_gen, bool dirty) { int old_gen; @@ -3462,10 +3473,10 @@ static void walk_update_folio(struct lru_gen_mm_walk *walk, struct folio *folio, folio_mark_dirty(folio); if (walk) { - old_gen = folio_update_gen(folio, new_gen); + old_gen = folio_update_gen(folio, new_gen, &vma->flags); if (old_gen >= 0 && old_gen != new_gen) update_batch_size(walk, folio, old_gen, new_gen); - } else if (lru_gen_set_refs(folio)) { + } else if (lru_gen_set_refs(folio, &vma->flags)) { old_gen = folio_lru_gen(folio); if (old_gen >= 0 && old_gen != new_gen) folio_activate(folio); @@ -3538,7 +3549,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long start, unsigned long end, continue; if (last != folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, args->vma, last, gen, dirty); last = folio; dirty = false; @@ -3551,7 +3562,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long start, unsigned long end, walk->mm_stats[MM_LEAF_YOUNG] += nr; } - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, args->vma, last, gen, dirty); last = NULL; if (i < PTRS_PER_PTE && get_next_vma(PMD_MASK, PAGE_SIZE, args, &start, &end)) @@ -3629,7 +3640,7 @@ static void walk_pmd_range_locked(pud_t *pud, unsigned long addr, struct vm_area goto next; if (last != folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); last = folio; dirty = false; @@ -3643,7 +3654,7 @@ static void walk_pmd_range_locked(pud_t *pud, unsigned long addr, struct vm_area i = i > MIN_LRU_BATCH ? 0 : find_next_bit(bitmap, MIN_LRU_BATCH, i) + 1; } while (i <= MIN_LRU_BATCH); - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); lazy_mmu_mode_disable(); spin_unlock(ptl); @@ -4278,7 +4289,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr) continue; if (last != folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); last = folio; dirty = false; @@ -4290,7 +4301,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr) young += nr; } - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); lazy_mmu_mode_disable(); From 45af85e680e7516d54db16c6e8888f74ced1a8d6 Mon Sep 17 00:00:00 2001 From: Ridong Chen Date: Thu, 23 Jul 2026 11:24:33 +0800 Subject: [PATCH 071/250] memcg: move mem_cgroup_swappiness and vm_swappiness to mm/swap.h Patch series "mm: vmscan: fix node reclaim ignoring swappiness parameter", v4. The per-node proactive reclaim interface (/sys/devices/system/node/nodeX/reclaim) accepts a swappiness parameter, but it is silently ignored when CONFIG_MEMCG is disabled. The root cause is that sc_swappiness() has separate implementations for CONFIG_MEMCG and !CONFIG_MEMCG, and the latter never checks proactive_swappiness. Patch 1 moves mem_cgroup_swappiness() and vm_swappiness out of the public include/linux/swap.h into the mm-private mm/swap.h, and makes the helper handle both CONFIG_MEMCG and !CONFIG_MEMCG in a single inline function. This is a prerequisite for unifying sc_swappiness(). Patch 2 consolidates sc_swappiness() into a single definition that works regardless of CONFIG_MEMCG, fixing the node reclaim swappiness bug. This patch (of 2): The per-memcg swappiness knob is v1-only; v2 always uses global vm_swappiness and ignores the per-cgroup field. Both mem_cgroup_swappiness() and vm_swappiness are only used within mm/ (memcontrol.c, memcontrol-v1.c, vmscan.c), so move them out of the public include/linux/swap.h into the mm-private mm/swap.h. This keeps unrelated declarations out of include/linux/swap.h. Guard memcg->swappiness with CONFIG_MEMCG_V1 as well, so v2-only kernels drop the unused field. No functional change for v1; v2-only kernels drop the unused field. Link: https://lore.kernel.org/20260723032434.2016749-1-ridong.chen@linux.dev Link: https://lore.kernel.org/20260723032434.2016749-2-ridong.chen@linux.dev Signed-off-by: Ridong Chen Acked-by: Johannes Weiner Reviewed-by: Barry Song Reviewed-by: Song Hu Acked-by: Shakeel Butt Cc: Axel Rasmussen Cc: Baoquan He Cc: Chris Li Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: Kairui Song Cc: Kemeng Shi Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Muchun Song Cc: Nhat Pham Cc: Roman Gushchin Cc: Wei Xu Cc: Yuanchu Xie Cc: Qi Zheng Signed-off-by: Andrew Morton --- include/linux/memcontrol.h | 4 ++-- include/linux/swap.h | 19 ------------------- mm/memcontrol.c | 4 ++-- mm/swap.h | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 8170bb8066a22f..f619e24fc3bb2f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -239,8 +239,6 @@ struct mem_cgroup { */ bool oom_group; - int swappiness; - /* memory.events and memory.events.local */ struct cgroup_file events_file; struct cgroup_file events_local_file; @@ -318,6 +316,8 @@ struct mem_cgroup { /* List of events which userspace want to receive */ struct list_head event_list; spinlock_t event_list_lock; + + int swappiness; #endif /* CONFIG_MEMCG_V1 */ struct mem_cgroup_per_node *nodeinfo[]; diff --git a/include/linux/swap.h b/include/linux/swap.h index 696ed01709c2ba..330a420fd6de34 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -309,7 +309,6 @@ static inline bool lru_cache_disabled(void) } extern unsigned long shrink_all_memory(unsigned long nr_pages); -extern int vm_swappiness; long remove_mapping(struct address_space *mapping, struct folio *folio); #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) @@ -468,25 +467,7 @@ static inline int add_swap_extent(struct swap_info_struct *sis, } #endif /* CONFIG_SWAP */ #ifdef CONFIG_MEMCG -static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) -{ - /* Cgroup2 doesn't have per-cgroup swappiness */ - if (cgroup_subsys_on_dfl(memory_cgrp_subsys)) - return READ_ONCE(vm_swappiness); - - /* root ? */ - if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg)) - return READ_ONCE(vm_swappiness); - - return READ_ONCE(memcg->swappiness); -} - void lru_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, int nid); -#else -static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) -{ - return READ_ONCE(vm_swappiness); -} #endif #if defined(CONFIG_SWAP) && defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 69b37f63a307f3..ec92cb40156d44 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -63,6 +63,7 @@ #include #include #include "internal.h" +#include "swap.h" #include "swap_table.h" #include #include @@ -4176,11 +4177,10 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) #endif page_counter_set_high(&memcg->swap, PAGE_COUNTER_MAX); if (parent) { - WRITE_ONCE(memcg->swappiness, mem_cgroup_swappiness(parent)); - page_counter_init(&memcg->memory, &parent->memory, memcg_on_dfl); page_counter_init(&memcg->swap, &parent->swap, false); #ifdef CONFIG_MEMCG_V1 + WRITE_ONCE(memcg->swappiness, mem_cgroup_swappiness(parent)); memcg->memory.track_failcnt = !memcg_on_dfl; memcg->memsw.track_failcnt = !memcg_on_dfl; WRITE_ONCE(memcg->oom_kill_disable, READ_ONCE(parent->oom_kill_disable)); diff --git a/mm/swap.h b/mm/swap.h index b51ad3071a7308..2ccf8cf7f6c1c4 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -4,6 +4,8 @@ #include /* for atomic_long_t */ #include /* for PAGE_SHIFT */ +#include /* for mem_cgroup_swappiness() */ + struct mempolicy; struct swap_iocb; struct swap_memcg_table; @@ -76,6 +78,18 @@ enum swap_cluster_flags { CLUSTER_FLAG_MAX, }; +extern int vm_swappiness; + +static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) +{ +#ifdef CONFIG_MEMCG_V1 + if (!cgroup_subsys_on_dfl(memory_cgrp_subsys) && + !mem_cgroup_disabled() && !mem_cgroup_is_root(memcg)) + return READ_ONCE(memcg->swappiness); +#endif + return READ_ONCE(vm_swappiness); +} + #ifdef CONFIG_SWAP #include /* for swp_offset */ #include /* for bio_end_io_t */ From f48d210a5dffc45e6f71a056d0e6cfb92b5248ed Mon Sep 17 00:00:00 2001 From: Ridong Chen Date: Thu, 23 Jul 2026 11:24:34 +0800 Subject: [PATCH 072/250] mm: vmscan: fix node reclaim ignoring swappiness parameter sc_swappiness() had two separate definitions depending on CONFIG_MEMCG. The !CONFIG_MEMCG variant simply returned vm_swappiness, ignoring the proactive_swappiness value passed through scan_control. This caused the swappiness parameter written to /sys/devices/system/node/nodeX/reclaim to have no effect when CONFIG_MEMCG is disabled. Fix this by consolidating sc_swappiness() into a single definition that checks sc->proactive_swappiness first, then falls back to mem_cgroup_swappiness() which already handles both CONFIG_MEMCG and !CONFIG_MEMCG. Before fix (swappiness=max ignored, mostly file pages reclaimed): # cat /proc/sys/vm/swappiness 60 # cat /proc/vmstat | grep pgsteal pgsteal_kswapd 0 pgsteal_direct 0 pgsteal_khugepaged 0 pgsteal_proactive 1840 pgsteal_anon 25 pgsteal_file 1815 # echo "64M swappiness=max" > /sys/devices/system/node/node0/reclaim # cat /proc/vmstat | grep pgsteal pgsteal_kswapd 0 pgsteal_direct 0 pgsteal_khugepaged 0 pgsteal_proactive 18013 pgsteal_anon 337 pgsteal_file 17676 After fix (swappiness=max honored, anon pages reclaimed as expected): # cat /proc/vmstat | grep pgsteal pgsteal_kswapd 0 pgsteal_direct 0 pgsteal_khugepaged 0 pgsteal_proactive 0 pgsteal_anon 0 pgsteal_file 0 # echo "64M swappiness=max" > /sys/devices/system/node/node0/reclaim # cat /proc/vmstat | grep pgsteal pgsteal_kswapd 0 pgsteal_direct 0 pgsteal_khugepaged 0 pgsteal_proactive 16283 pgsteal_anon 16283 pgsteal_file 0 Link: https://lore.kernel.org/20260723032434.2016749-3-ridong.chen@linux.dev Fixes: b980077899ea ("mm: introduce per-node proactive reclaim interface") Signed-off-by: Ridong Chen Acked-by: Johannes Weiner Reviewed-by: Barry Song Acked-by: Qi Zheng Tested-by: Song Hu Reviewed-by: Song Hu Acked-by: Shakeel Butt Cc: Axel Rasmussen Cc: Baoquan He Cc: Chris Li Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: Kairui Song Cc: Kemeng Shi Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Muchun Song Cc: Nhat Pham Cc: Roman Gushchin Cc: Wei Xu Cc: Yuanchu Xie Cc: [6.17+] Signed-off-by: Andrew Morton --- mm/vmscan.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index d65ccea927567d..5bad065a38f1ae 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -199,6 +199,13 @@ struct scan_control { */ int vm_swappiness = 60; +static int sc_swappiness(struct scan_control *sc, struct mem_cgroup *memcg) +{ + if (sc->proactive && sc->proactive_swappiness) + return *sc->proactive_swappiness; + return mem_cgroup_swappiness(memcg); +} + #ifdef CONFIG_MEMCG /* Returns true for reclaim through cgroup limits or cgroup interfaces. */ @@ -239,13 +246,6 @@ static bool writeback_throttling_sane(struct scan_control *sc) #endif return false; } - -static int sc_swappiness(struct scan_control *sc, struct mem_cgroup *memcg) -{ - if (sc->proactive && sc->proactive_swappiness) - return *sc->proactive_swappiness; - return mem_cgroup_swappiness(memcg); -} #else static bool cgroup_reclaim(struct scan_control *sc) { @@ -261,11 +261,6 @@ static bool writeback_throttling_sane(struct scan_control *sc) { return true; } - -static int sc_swappiness(struct scan_control *sc, struct mem_cgroup *memcg) -{ - return READ_ONCE(vm_swappiness); -} #endif static inline bool is_exec_file_folio(const struct folio *folio, From 051be0d7c210e997bac55bb5d003e34dc02fc1b1 Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Mon, 27 Jul 2026 09:23:23 -0700 Subject: [PATCH 073/250] mm/vmstat, mm/memcontrol: add _monotonic vmstat readers Patch series "mm/vmscan: reduce lru_lock contention via vmstat-derived scan-balance cost", v5. The anon/file scan balance heuristic in get_scan_count() is fed by two scalars in struct lruvec (anon_cost, file_cost) that every reclaim producer updates under lruvec->lru_lock. The cost-recording work itself is trivial, but it both contends for and contributes to contention on lru_lock - which is often a contention point on memory-pressured workloads. Specifically: - shrink_inactive_list() re-acquires lru_lock at function exit just to call lru_note_cost_unlock_irq(). - shrink_active_list() does the same after rotation accounting. - workingset_refault() takes folio_lruvec_lock_irq() purely to record the refault cost. - prepare_scan_control() snapshots anon_cost/file_cost under lru_lock. - lru_note_cost_unlock_irq() itself walks parent_lruvec() and re-acquires lru_lock on every ancestor, multiplying the cost of every update by memcg-hierarchy depth. This series removes those producer-side acquisitions entirely. The rotation inputs become per-LRU PGROTATE_{ANON,FILE} vmstat counters. NR_VMSCAN_WRITE already captures reclaim-driven pageout at writeout(); charge it through lruvec_stat_mod_folio() so it is available per lruvec and aggregated through the memcg hierarchy. Reclaim does not submit filesystem folios for writeback from this path, so pageout contributes only to anon cost. WORKINGSET_RESTORE_* already captures the refault input. PGROTATE_* are also useful independently of scan balancing. They are cumulative base-page events, not unique-page counts. Classic inactive reclaim records scan work that does not produce immediate reclaim or demotion, while active reclaim records referenced executable file folios retained on the active list. MGLRU records initially isolated pages that remain unreclaimed after its retry passes. Read alongside pgscan_* and pgsteal_*, their deltas identify which LRU type is consuming reclaim CPU without producing immediate yield. Unlike the existing pgrotated event, they do not imply a move to the inactive-list tail. prepare_scan_control() reads the raw cost signals without lru_lock: anon = PGROTATE_ANON + (NR_VMSCAN_WRITE + WORKINGSET_RESTORE_ANON) * SWAP_CLUSTER_MAX file = PGROTATE_FILE + WORKINGSET_RESTORE_FILE * SWAP_CLUSTER_MAX It folds the deltas into a per-lruvec accumulator. A dedicated per-lruvec cost_lock, not touched by isolate_lru_folios(), move_folios_to_lru(), or folio_add_lru(), serialises the accumulator RMW and the lrusize/4 halving check. Hierarchy aggregation is implicit in rstat propagation, so the parent_lruvec() walk and the lru_reparent_memcg() cost-splice both disappear. Moving accumulation and decay to the reclaim side also improves the cost model across reclaim gaps. With producer-side decay, events that happen while reclaim is idle still age each other before reclaim ever samples the costs. If a workload refaults a large anon set and then a smaller file set before reclaim runs again, the later file activity can age the earlier anon activity out of the cost model. The new scheme observes the whole between-reclaim delta and decays anon and file proportionally, so the scan-balance history better represents what happened since the last reclaim pass. Trade-offs: - Cost reads see rstat-aggregated values that can lag until periodic / reader-triggered flushing. - Per-lruvec footprint grows by 4 unsigned longs + a spinlock (a struct lru_cost { count, last_rotated, last_io } per side), which is a small cost. - NR_VMSCAN_WRITE now also updates the folio's lruvec/memcg stat, adding memcg stat accounting to the reclaim writeout path while preserving the existing node-level total. == Numbers == Tested on a 176-core, 256 GB host. The benchmark drives sustained swap-out/refault inside a tight memcg using vm-scalability/usemem: usemem -n 16 --prealloc --prefault --random $((256*1024*1024)) run inside a two-level memcg with memory.max=512M on the leaf (4 GB anon working set has to fit in 512 MB -> continuous shrink_inactive_list + workingset_refault). A 16 GB swap file is used. Measurement is a 30 s `perf lock record -a` window over otherwise-idle hardware. Workload rates are identical on both kernels (the bench drives the same memory pressure): baseline patched delta pgscan_direct / s 172,662 171,817 ~0% pgsteal_direct / s 67,162 66,306 ~0% workingset_refault_anon / s 40,696 39,830 ~0% perf lock contention (total wait per 30 s window): Lock Name Before After % change shrink_lruvec+0x770 722.84 ms 0 -100% (eliminated) (= lru_note_cost_unlock_irq) workingset_refault+0x167 385.26 ms 0 -100% (eliminated) (= lru_note_cost_refault) shrink_node+0x4ad 689.43 ms 26.95 ms -96% shrink_active_list 208.34 ms 15.97 ms -92% lru_add_drain_cpu+0x34 1.96 s 917.71 ms -53% Total LRU lock wait ~4.23 s ~1.66 s -61% The two specific contention sites the patch removes (shrink_lruvec+0x770 = lru_note_cost_unlock_irq; workingset_refault+0x167 = lru_note_cost_refault) are completely absent from the patched perf-lock-contention output. Secondary reductions in shrink_node, shrink_active_list, lru_add_drain_cpu and pgrefill/pgactivate look like knock-on effects from removing the cost-recording overhead and the parent_lruvec walk. The remaining ~1.66 s of LRU lock wait on the patched kernel is dominated by the per-CPU pagevec drain (lru_add_drain_cpu) and the main reclaim path in shrink_lruvec. The numbers above can be reproduced using the script in [1]. This patch (of 3): lruvec_page_state(), node_page_state(), and global_node_page_state() all clamp negative reads to zero on CONFIG_SMP so that a transient per-CPU delta skew presents as zero pages rather than as a garbage unsigned value. This is the right behaviour for non-monotonic page-count readers. It is however incorrect for callers that snapshot a monotonically- incremented event counter and compute a delta from two samples. Once the underlying signed long wraps past LONG_MAX, the clamped read drops to zero while the previously-recorded snapshot still holds the pre-wrap value; the unsigned subtraction then underflows into a ~2^31 spurious delta for 32-bit architecture and corrupts the caller's accumulator. Add non-clamping siblings that return the underlying state value cast to unsigned long: global_node_page_state_monotonic() node_page_state_monotonic() lruvec_page_state_monotonic() With both samples read via the _monotonic variant, unsigned modular subtraction stays correct across a signed-long wraparound as long as the true growth between two samples fits in unsigned long (< 2^32 on 32-bit, < 2^64 on 64-bit); the 32-bit bound is the practically-reachable one that motivates this helper. The variants are only safe for monotonically-incremented counters. Non-monotonic page-count readers must keep using the existing clamped helpers so transient negative reads still present as zero. This is a prerequisite for a later patch which replaces the producer-side anon_cost/file_cost accumulators with a read-side accumulator in prepare_scan_control() that samples monotonic per-LRU vmstat counters (PGROTATE_*, NR_VMSCAN_WRITE, WORKINGSET_RESTORE_*) via lruvec_page_state_monotonic() and folds their unsigned modular deltas into lruvec->cost[].count. Link: https://lore.kernel.org/20260727162550.2032-1-usama.arif@linux.dev Link: https://lore.kernel.org/20260727162550.2032-2-usama.arif@linux.dev Link: https://gist.github.com/uarif1/a4eb33a86c5b2d7bbc55b42f0956e884 [1] Signed-off-by: Usama Arif Acked-by: Johannes Weiner Acked-by: Shakeel Butt Acked-by: Vlastimil Babka (SUSE) Cc: Axel Rasmussen Cc: Baoquan He Cc: Chris Li Cc: David Hildenbrand Cc: David Rientjes Cc: Kairui Song Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Nhat Pham Cc: Roman Gushchin Cc: Suren Baghdasaryan Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- include/linux/memcontrol.h | 8 ++++++++ include/linux/vmstat.h | 16 ++++++++++++++++ mm/memcontrol.c | 36 ++++++++++++++++++++++++++++++++++++ mm/vmstat.c | 11 +++++++++++ 4 files changed, 71 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index f619e24fc3bb2f..e78bc98ab229b2 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -947,6 +947,8 @@ unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item); bool memcg_stat_item_valid(int idx); bool memcg_vm_event_item_valid(enum vm_event_item idx); unsigned long lruvec_page_state(struct lruvec *lruvec, enum node_stat_item idx); +unsigned long lruvec_page_state_monotonic(struct lruvec *lruvec, + enum node_stat_item idx); unsigned long lruvec_page_state_local(struct lruvec *lruvec, enum node_stat_item idx); @@ -1399,6 +1401,12 @@ static inline unsigned long lruvec_page_state(struct lruvec *lruvec, return node_page_state(lruvec_pgdat(lruvec), idx); } +static inline unsigned long lruvec_page_state_monotonic(struct lruvec *lruvec, + enum node_stat_item idx) +{ + return node_page_state_monotonic(lruvec_pgdat(lruvec), idx); +} + static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, enum node_stat_item idx) { diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 3c9c266cf782ad..fb8c76289e024e 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -194,6 +194,19 @@ unsigned long global_node_page_state_pages(enum node_stat_item item) return x; } +/* + * Non-clamping variant of global_node_page_state() intended for callers that + * snapshot a monotonically-incremented counter and subtract two samples. + * Returns the raw wrapping value so that unsigned modular subtraction stays + * correct across a signed-long overflow (a real hazard on 32-bit) that the + * clamp in global_node_page_state() would otherwise turn into a huge spurious + * delta. Do NOT use for non-monotonic page-count reads. + */ +static inline unsigned long global_node_page_state_monotonic(enum node_stat_item item) +{ + return (unsigned long)atomic_long_read(&vm_node_stat[item]); +} + static inline unsigned long global_node_page_state(enum node_stat_item item) { VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); @@ -259,11 +272,14 @@ extern unsigned long node_page_state(struct pglist_data *pgdat, enum node_stat_item item); extern unsigned long node_page_state_pages(struct pglist_data *pgdat, enum node_stat_item item); +extern unsigned long node_page_state_monotonic(struct pglist_data *pgdat, + enum node_stat_item item); extern void fold_vm_numa_events(void); #else #define sum_zone_node_page_state(node, item) global_zone_page_state(item) #define node_page_state(node, item) global_node_page_state(item) #define node_page_state_pages(node, item) global_node_page_state_pages(item) +#define node_page_state_monotonic(node, item) global_node_page_state_monotonic(item) static inline void fold_vm_numa_events(void) { } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ec92cb40156d44..d804f8d0758120 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -508,6 +508,42 @@ unsigned long lruvec_page_state(struct lruvec *lruvec, enum node_stat_item idx) return x; } +/** + * lruvec_page_state_monotonic - non-clamping lruvec stat read for delta sampling + * @lruvec: the LRU vector to read from + * @idx: the node_stat_item to read + * + * Returns the raw state[idx] value cast to unsigned long, skipping the + * clamp-negative-to-zero step in lruvec_page_state(). Intended for callers + * that snapshot a monotonically-incremented counter and subtract two + * samples: unsigned modular arithmetic then yields the correct delta across + * a signed-long wraparound (a real hazard on 32-bit) that the clamp would + * otherwise turn into a huge spurious delta. + * + * Do NOT use for non-monotonic page-count reads where a transient negative + * reading from per-CPU delta skew must present as zero. + * + * XXX: This helper (and its node/global peers) exists because some + * monotonically-incremented event counters are stored in + * enum node_stat_item. + */ +unsigned long lruvec_page_state_monotonic(struct lruvec *lruvec, + enum node_stat_item idx) +{ + struct mem_cgroup_per_node *pn; + int i; + + if (mem_cgroup_disabled()) + return node_page_state_monotonic(lruvec_pgdat(lruvec), idx); + + i = memcg_stats_index(idx); + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) + return 0; + + pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); + return (unsigned long)READ_ONCE(pn->lruvec_stats->state[i]); +} + unsigned long lruvec_page_state_local(struct lruvec *lruvec, enum node_stat_item idx) { diff --git a/mm/vmstat.c b/mm/vmstat.c index 3b5cb1031f7209..507118474c03e6 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1025,6 +1025,17 @@ unsigned long node_page_state(struct pglist_data *pgdat, return node_page_state_pages(pgdat, item); } + +/* + * Non-clamping variant of node_page_state() intended for callers that + * snapshot a monotonically-incremented counter and subtract two samples. + * See global_node_page_state_monotonic() for the rationale. + */ +unsigned long node_page_state_monotonic(struct pglist_data *pgdat, + enum node_stat_item item) +{ + return (unsigned long)atomic_long_read(&pgdat->vm_stat[item]); +} #endif /* From dd6a5ea1adc5e20c02bc5bd3047e9f867c591403 Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Mon, 27 Jul 2026 09:23:24 -0700 Subject: [PATCH 074/250] mm/vmscan: add pgrotate_anon and pgrotate_file vmstat counters Reclaim can spend substantial work on an LRU type without immediately reclaiming or demoting a corresponding amount of memory. Record this work in PGROTATE_ANON and PGROTATE_FILE. For classic LRU reclaim: - Inactive-list reclaim adds nr_scanned - nr_reclaimed to the corresponding anon/file counter when isolation succeeds. - Active-list reclaim adds referenced executable file folios that are retained on the active list to PGROTATE_FILE. Active anon reclaim does not contribute this component. For MGLRU, add the number of initially isolated pages that remain unreclaimed after both the initial and retry passes to the counter for the selected anon/file type. These counters are distinct from the existing pgrotated vm event. pgrotated records an actual move to the inactive-list tail, primarily after reclaim-marked writeback completes or failed invalidation leaves a folio for accelerated reclaim. PGROTATE_ANON and PGROTATE_FILE measure reclaim cost and do not imply that a folio moved to an LRU tail. A subsequent patch will consume these counters for anon/file scan balancing. Link: https://lore.kernel.org/20260727162550.2032-3-usama.arif@linux.dev Signed-off-by: Usama Arif Acked-by: Shakeel Butt Acked-by: Johannes Weiner Reviewed-by: Vlastimil Babka (SUSE) Cc: Axel Rasmussen Cc: Baoquan He Cc: Chris Li Cc: David Hildenbrand Cc: David Rientjes Cc: Kairui Song Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Nhat Pham Cc: Roman Gushchin Cc: Suren Baghdasaryan Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 2 ++ mm/memcontrol.c | 2 ++ mm/vmscan.c | 14 +++++++++++++- mm/vmstat.c | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 0507193b3ae346..1cc5ea506b7c12 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -323,6 +323,8 @@ enum node_stat_item { PGSCAN_PROACTIVE, PGSCAN_ANON, PGSCAN_FILE, + PGROTATE_ANON, + PGROTATE_FILE, PGREFILL, #ifdef CONFIG_HUGETLB_PAGE NR_HUGETLB, diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d804f8d0758120..011bb3b0346be1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -425,6 +425,8 @@ static const unsigned int memcg_node_stat_items[] = { PGSCAN_PROACTIVE, PGSCAN_ANON, PGSCAN_FILE, + PGROTATE_ANON, + PGROTATE_FILE, PGREFILL, #ifdef CONFIG_HUGETLB_PAGE NR_HUGETLB, diff --git a/mm/vmscan.c b/mm/vmscan.c index 5bad065a38f1ae..fa2c5cf577afd4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2038,6 +2038,9 @@ static unsigned long shrink_inactive_list(unsigned long nr_to_scan, item = PGSTEAL_KSWAPD + reclaimer_offset(sc); mod_lruvec_state(lruvec, item, nr_reclaimed); mod_lruvec_state(lruvec, PGSTEAL_ANON + file, nr_reclaimed); + if (nr_scanned > nr_reclaimed) + mod_lruvec_state(lruvec, PGROTATE_ANON + file, + nr_scanned - nr_reclaimed); lruvec_lock_irq(lruvec); lru_note_cost_unlock_irq(lruvec, file, stat.nr_pageout, @@ -2147,6 +2150,8 @@ static void shrink_active_list(unsigned long nr_to_scan, count_vm_events(PGDEACTIVATE, nr_deactivate); count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate); mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); + if (nr_rotated) + mod_lruvec_state(lruvec, PGROTATE_ANON + file, nr_rotated); lruvec_lock_irq(lruvec); lru_note_cost_unlock_irq(lruvec, file, 0, nr_rotated); @@ -4828,7 +4833,8 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec, struct reclaim_stat stat; struct lru_gen_mm_walk *walk; int scanned, reclaimed; - int isolated = 0, type, type_scanned; + int isolated = 0, nr_isolated = 0, type, type_scanned; + unsigned long total_reclaimed = 0; bool skip_retry = false; struct mem_cgroup *memcg = lruvec_memcg(lruvec); struct pglist_data *pgdat = lruvec_pgdat(lruvec); @@ -4840,6 +4846,7 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec, scanned = isolate_folios(nr_to_scan, lruvec, sc, swappiness, &list, &isolated, &type, &type_scanned); + nr_isolated = isolated; /* Scanning may have emptied the oldest gen, flush it */ if (scanned) @@ -4852,6 +4859,7 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec, retry: reclaimed = shrink_folio_list(&list, pgdat, sc, &stat, false, memcg); sc->nr_reclaimed += reclaimed; + total_reclaimed += reclaimed; /* Retry pass is only meant for clean folios without new isolation */ if (isolated) handle_reclaim_writeback(isolated, pgdat, sc, &stat); @@ -4903,6 +4911,10 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec, goto retry; } + if (nr_isolated > total_reclaimed) + mod_lruvec_state(lruvec, PGROTATE_ANON + type, + nr_isolated - total_reclaimed); + return scanned; } diff --git a/mm/vmstat.c b/mm/vmstat.c index 507118474c03e6..7d6e61a01f519b 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1301,6 +1301,8 @@ const char * const vmstat_text[] = { [I(PGSCAN_PROACTIVE)] = "pgscan_proactive", [I(PGSCAN_ANON)] = "pgscan_anon", [I(PGSCAN_FILE)] = "pgscan_file", + [I(PGROTATE_ANON)] = "pgrotate_anon", + [I(PGROTATE_FILE)] = "pgrotate_file", [I(PGREFILL)] = "pgrefill", #ifdef CONFIG_HUGETLB_PAGE [I(NR_HUGETLB)] = "nr_hugetlb", From 1ca75d8e9458d42df3e04b82f3830e6d6db0915d Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Mon, 27 Jul 2026 09:23:25 -0700 Subject: [PATCH 075/250] mm/vmscan: reduce lru_lock contention via vmstat-derived scan-balance cost The anon/file scan balance in get_scan_count() is driven by two scalars in struct lruvec, anon_cost and file_cost, accumulated by every reclaim producer under lruvec->lru_lock. The acquisition sites for cost work specifically are: - shrink_inactive_list() re-takes lru_lock at function exit purely to call lru_note_cost_unlock_irq() with (nr_pageout, nr_scanned - nr_reclaimed). One acquisition per inactive shrink. - shrink_active_list() does the same with (0, nr_rotated). One acquisition per active shrink. - workingset_refault() takes the lock via folio_lruvec_lock_irq() purely to record the refault cost. One acquisition per refault. - prepare_scan_control() takes lru_lock just to snapshot the two scalars into sc->{anon,file}_cost. - lru_note_cost_unlock_irq() itself walks parent_lruvec and re-acquires lru_lock on each ancestor to propagate the update, adding O(memcg-depth) acquisitions per producer call. This hurts because lru_lock is already a heavy contention point on memory-heavy workloads: every isolate_lru_folios(), move_folios_to_lru() and folio_add_lru() takes it. The cost work itself is trivial (two scalar bumps and one comparison), but it contends with and causes contention for actual LRU manipulation. The parent_lruvec() walk also multiplies cost-update overhead by memcg hierarchy depth. The balance formula for anon and file, respectively, is this: cost = nr_io * SWAP_CLUSTER_MAX + nr_rotated Instead of recording cost and running averaging logic directly when these events occur, snapshot running vmstat counters once per reclaim cycle and derive the balance from event deltas since the last run. Use PGROTATE_* from the preceding patch for the rotation input. WORKINGSET_RESTORE_* and NR_VMSCAN_WRITE provide the remaining event counters. Charge NR_VMSCAN_WRITE through lruvec stats so all inputs can be sampled per lruvec and aggregated through the memcg hierarchy. This is overall cheaper and has fewer lock acquisition sites. Moving accumulation and decay to the reclaim side also improves the cost model across reclaim gaps. With producer-side decay, events that happen while reclaim is idle still age each other before reclaim ever samples the costs. If a workload refaults a large anon set and then a smaller file set before reclaim runs again, the later file activity can age the earlier anon activity out of the cost model. The new scheme observes the whole between-reclaim delta and decays anon and file proportionally, so the scan-balance history better represents what happened since the last reclaim pass. A dedicated per-lruvec spinlock, cost_lock, serialises the delta extraction, the cost->count update and the halving loop against concurrent reclaimers in the same memcg+node. NR_VMSCAN_WRITE is accounted at writeout(), so reclaim_stat.nr_pageout is no longer needed and is removed. memcg-v1's memory.stat anon_cost/file_cost is now sourced from cost[].count instead of the removed lruvec anon_cost/file_cost fields. The reported values only refresh when prepare_scan_control() runs and are bounded at ~lrusize/4 by the halving loop; the scan-balance signal they express is unchanged. Under pure MGLRU the scan-balance signal itself is not consumed (both prepare_scan_control() and get_scan_count() are short-circuited on the MGLRU paths, and MGLRU's own type/tier selection comes from read_ctrl_pos() on lrugen->{avg_refaulted,avg_total,refaulted,evicted}, not from anon_cost/file_cost). NR_VMSCAN_WRITE naturally covers writeout from either reclaim implementation. The preceding patch also bumps PGROTATE_{ANON,FILE} from evict_folios(), so rotation-driven reclaim work is accounted consistently across both implementations. Link: https://lore.kernel.org/20260727162550.2032-4-usama.arif@linux.dev Signed-off-by: Usama Arif Acked-by: Shakeel Butt Acked-by: Johannes Weiner Acked-by: Vlastimil Babka (SUSE) Cc: Axel Rasmussen Cc: Baoquan He Cc: Chris Li Cc: David Hildenbrand Cc: David Rientjes Cc: Kairui Song Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Nhat Pham Cc: Roman Gushchin Cc: Suren Baghdasaryan Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 13 +++++-- include/linux/vmstat.h | 1 - mm/folio.c | 69 ------------------------------------ mm/internal.h | 3 -- mm/memcontrol-v1.c | 4 +-- mm/memcontrol.c | 1 + mm/mmzone.c | 1 + mm/vmscan.c | 79 +++++++++++++++++++++++++++++++++++------- mm/workingset.c | 5 --- 9 files changed, 81 insertions(+), 95 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 1cc5ea506b7c12..158c1fba239340 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -757,6 +757,12 @@ void lru_gen_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, #endif /* CONFIG_LRU_GEN */ +struct lru_cost { + unsigned long count; + unsigned long last_rotated; + unsigned long last_io; +}; + struct lruvec { struct list_head lists[NR_LRU_LISTS]; /* per lruvec lru_lock for memcg */ @@ -765,9 +771,12 @@ struct lruvec { * These track the cost of reclaiming one LRU - file or anon - * over the other. As the observed cost of reclaiming one LRU * increases, the reclaim scan balance tips toward the other. + * Updated and decayed at prepare_scan_control() time; cost_lock + * serialises that update. */ - unsigned long anon_cost; - unsigned long file_cost; + struct lru_cost cost[ANON_AND_FILE]; + /* Protects cost[]. */ + spinlock_t cost_lock; /* Non-resident age, driven by LRU movement */ atomic_long_t nonresident_age; /* Refaults at the time of last reclaim cycle */ diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index fb8c76289e024e..5b31d8e7ae4058 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -20,7 +20,6 @@ struct reclaim_stat { unsigned nr_congested; unsigned nr_writeback; unsigned nr_immediate; - unsigned nr_pageout; unsigned nr_activate[ANON_AND_FILE]; unsigned nr_ref_keep; unsigned nr_unmap_fail; diff --git a/mm/folio.c b/mm/folio.c index d2937600cf7260..a9e328c3f21bbe 100644 --- a/mm/folio.c +++ b/mm/folio.c @@ -265,73 +265,6 @@ void folio_rotate_reclaimable(struct folio *folio) folio_batch_add_and_move(folio, lru_move_tail); } -void lru_note_cost_unlock_irq(struct lruvec *lruvec, bool file, - unsigned int nr_io, unsigned int nr_rotated) - __releases(lruvec->lru_lock) - __releases(rcu) -{ - unsigned long cost; - - /* - * Reflect the relative cost of incurring IO and spending CPU - * time on rotations. This doesn't attempt to make a precise - * comparison, it just says: if reloads are about comparable - * between the LRU lists, or rotations are overwhelmingly - * different between them, adjust scan balance for CPU work. - */ - cost = nr_io * SWAP_CLUSTER_MAX + nr_rotated; - if (!cost) { - spin_unlock_irq(&lruvec->lru_lock); - rcu_read_unlock(); - return; - } - - for (;;) { - unsigned long lrusize; - - /* Record cost event */ - if (file) - lruvec->file_cost += cost; - else - lruvec->anon_cost += cost; - - /* - * Decay previous events - * - * Because workloads change over time (and to avoid - * overflow) we keep these statistics as a floating - * average, which ends up weighing recent refaults - * more than old ones. - */ - lrusize = lruvec_page_state(lruvec, NR_INACTIVE_ANON) + - lruvec_page_state(lruvec, NR_ACTIVE_ANON) + - lruvec_page_state(lruvec, NR_INACTIVE_FILE) + - lruvec_page_state(lruvec, NR_ACTIVE_FILE); - - if (lruvec->file_cost + lruvec->anon_cost > lrusize / 4) { - lruvec->file_cost /= 2; - lruvec->anon_cost /= 2; - } - - spin_unlock_irq(&lruvec->lru_lock); - lruvec = parent_lruvec(lruvec); - if (!lruvec) { - rcu_read_unlock(); - break; - } - spin_lock_irq(&lruvec->lru_lock); - } -} - -void lru_note_cost_refault(struct folio *folio) -{ - struct lruvec *lruvec; - - lruvec = folio_lruvec_lock_irq(folio); - lru_note_cost_unlock_irq(lruvec, folio_is_file_lru(folio), - folio_nr_pages(folio), 0); -} - static void lru_activate(struct lruvec *lruvec, struct folio *folio) { long nr_pages = folio_nr_pages(folio); @@ -1162,8 +1095,6 @@ void lru_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, int child_lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(nid)); parent_lruvec = mem_cgroup_lruvec(parent, NODE_DATA(nid)); - parent_lruvec->anon_cost += child_lruvec->anon_cost; - parent_lruvec->file_cost += child_lruvec->file_cost; for_each_lru(lru) lruvec_reparent_lru(child_lruvec, parent_lruvec, lru, nid); diff --git a/mm/internal.h b/mm/internal.h index 16750b130ec443..07f60ca0b201b6 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -41,9 +41,6 @@ void workingset_refault(struct folio *folio, void *shadow); void workingset_activation(struct folio *folio); /* mm/folio.c */ -void lru_note_cost_unlock_irq(struct lruvec *lruvec, bool file, - unsigned int nr_io, unsigned int nr_rotated); -void lru_note_cost_refault(struct folio *folio); void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma); static inline bool folio_may_be_lru_cached(struct folio *folio) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index d7394dace38dfd..05ef55cae4dc61 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -2297,8 +2297,8 @@ void memcg1_stat_format(struct mem_cgroup *memcg, struct seq_buf *s) for_each_online_pgdat(pgdat) { mz = memcg->nodeinfo[pgdat->node_id]; - anon_cost += mz->lruvec.anon_cost; - file_cost += mz->lruvec.file_cost; + anon_cost += mz->lruvec.cost[WORKINGSET_ANON].count; + file_cost += mz->lruvec.cost[WORKINGSET_FILE].count; } seq_buf_printf(s, "anon_cost %lu\n", anon_cost); seq_buf_printf(s, "file_cost %lu\n", file_cost); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 011bb3b0346be1..65057b59b09761 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -399,6 +399,7 @@ static const unsigned int memcg_node_stat_items[] = { NR_SHMEM_THPS, NR_FILE_THPS, NR_ANON_THPS, + NR_VMSCAN_WRITE, NR_VMALLOC, NR_KERNEL_STACK_KB, NR_PAGETABLE, diff --git a/mm/mmzone.c b/mm/mmzone.c index 59dc3f2076a6dd..9cc9ef588580d2 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -79,6 +79,7 @@ void lruvec_init(struct lruvec *lruvec) memset(lruvec, 0, sizeof(struct lruvec)); spin_lock_init(&lruvec->lru_lock); + spin_lock_init(&lruvec->cost_lock); zswap_lruvec_state_init(lruvec); for_each_lru(lru) diff --git a/mm/vmscan.c b/mm/vmscan.c index fa2c5cf577afd4..3a670114362033 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -670,7 +670,7 @@ static pageout_t pageout(struct folio *folio, struct address_space *mapping, folio_clear_reclaim(folio); trace_mm_vmscan_write_folio(folio); - node_stat_add_folio(folio, NR_VMSCAN_WRITE); + lruvec_stat_mod_folio(folio, NR_VMSCAN_WRITE, folio_nr_pages(folio)); return PAGE_SUCCESS; } @@ -1413,8 +1413,6 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, sc->nr_scanned -= (nr_pages - 1); nr_pages = 1; } - stat->nr_pageout += nr_pages; - if (folio_test_writeback(folio)) goto keep; if (folio_test_dirty(folio)) @@ -2042,9 +2040,6 @@ static unsigned long shrink_inactive_list(unsigned long nr_to_scan, mod_lruvec_state(lruvec, PGROTATE_ANON + file, nr_scanned - nr_reclaimed); - lruvec_lock_irq(lruvec); - lru_note_cost_unlock_irq(lruvec, file, stat.nr_pageout, - nr_scanned - nr_reclaimed); handle_reclaim_writeback(nr_taken, pgdat, sc, &stat); trace_mm_vmscan_lru_shrink_inactive(pgdat->node_id, nr_scanned, nr_reclaimed, &stat, sc->priority, file); @@ -2153,8 +2148,6 @@ static void shrink_active_list(unsigned long nr_to_scan, if (nr_rotated) mod_lruvec_state(lruvec, PGROTATE_ANON + file, nr_rotated); - lruvec_lock_irq(lruvec); - lru_note_cost_unlock_irq(lruvec, file, 0, nr_rotated); trace_mm_vmscan_lru_shrink_active(pgdat->node_id, nr_taken, nr_activate, nr_deactivate, nr_rotated, sc->priority, file); } @@ -2287,8 +2280,10 @@ enum scan_balance { static void prepare_scan_control(pg_data_t *pgdat, struct scan_control *sc) { - unsigned long file; + struct lru_cost *anon_cost, *file_cost; struct lruvec *target_lruvec; + unsigned long lrusize; + unsigned long file; if (lru_gen_enabled() && !lru_gen_switching()) return; @@ -2304,11 +2299,69 @@ static void prepare_scan_control(pg_data_t *pgdat, struct scan_control *sc) /* * Determine the scan balance between anon and file LRUs. + * + * The cost model is based on rotations, refaults and + * reclaim-driven writes (anon only) on each side. + * + * These event counters are monotonic, so each reclaim cycle + * the delta since the last scan is extracted and incorporated + * into a decaying average. This ensures currency, as workloads + * change over time, and avoids overflow in the calculations. + * + * Use lruvec_page_state_monotonic() so unsigned subtraction + * yields the correct delta across a signed-long wraparound of + * the underlying counter (a real hazard on 32-bit that the + * clamp in lruvec_page_state() would otherwise turn into a huge + * spurious delta). */ - spin_lock_irq(&target_lruvec->lru_lock); - sc->anon_cost = target_lruvec->anon_cost; - sc->file_cost = target_lruvec->file_cost; - spin_unlock_irq(&target_lruvec->lru_lock); + spin_lock(&target_lruvec->cost_lock); + + for (int f = 0; f <= 1; f++) { + struct lru_cost *cost = &target_lruvec->cost[f]; + unsigned long rotated, io, nr_rotated, nr_io; + + rotated = lruvec_page_state_monotonic(target_lruvec, + PGROTATE_ANON + f); + io = lruvec_page_state_monotonic(target_lruvec, + WORKINGSET_RESTORE_BASE + f); + if (f == WORKINGSET_ANON) + io += lruvec_page_state_monotonic(target_lruvec, + NR_VMSCAN_WRITE); + + nr_rotated = rotated - cost->last_rotated; + nr_io = io - cost->last_io; + + /* + * Reflect the relative cost of incurring IO and spending + * CPU time on rotations. This doesn't attempt to make a + * precise comparison, it just says: if reloads are about + * comparable between the LRU lists, or rotations are + * overwhelmingly different between them, adjust scan + * balance for CPU work. + */ + cost->count += nr_io * SWAP_CLUSTER_MAX + nr_rotated; + + cost->last_rotated = rotated; + cost->last_io = io; + } + + anon_cost = &target_lruvec->cost[WORKINGSET_ANON]; + file_cost = &target_lruvec->cost[WORKINGSET_FILE]; + + lrusize = lruvec_page_state(target_lruvec, NR_INACTIVE_ANON) + + lruvec_page_state(target_lruvec, NR_ACTIVE_ANON) + + lruvec_page_state(target_lruvec, NR_INACTIVE_FILE) + + lruvec_page_state(target_lruvec, NR_ACTIVE_FILE); + + while (anon_cost->count + file_cost->count > lrusize / 4) { + anon_cost->count /= 2; + file_cost->count /= 2; + } + + sc->anon_cost = anon_cost->count; + sc->file_cost = file_cost->count; + + spin_unlock(&target_lruvec->cost_lock); /* * Target desirable inactive:active list ratios for the anon diff --git a/mm/workingset.c b/mm/workingset.c index f351798e723acd..7ac2b88c80ae56 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -584,11 +584,6 @@ void workingset_refault(struct folio *folio, void *shadow) /* Folio was active prior to eviction */ if (workingset) { folio_set_workingset(folio); - /* - * XXX: Move to folio_add_lru() when it supports new vs - * putback - */ - lru_note_cost_refault(folio); mod_lruvec_state(lruvec, WORKINGSET_RESTORE_BASE + file, nr); } out: From c5d3e8d16ac7137f8d40fd37491e74f097e3f03f Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Wed, 29 Jul 2026 13:57:35 +0900 Subject: [PATCH 076/250] zram: set default primary compressor in zram_destroy_comps() Patch series "zram: fix zram issues reported by sashiko". Sashiko drove by and reported [1] a couple of zram issues: a possible BUG_ON() in zlib code due to missing winbits range validation and one possible NULL-ptr dereference in zcomp. Both are low risk yet still worth fixing. This patch (of 2): zram_destroy_comps() resets all compressors and leaves them set to NULL, including the primary one, which is invalid device state, as now comp_algorithm_show()->strcmp() can be called on a NULL compressor. Set default primary compressor in zram_destroy_comps(). Link: https://lore.kernel.org/20260729045745.775973-2-senozhatsky@chromium.org Fixes: 486fd58af7ac ("zram: don't free statically defined names") Link: https://sashiko.dev/#/patchset/20260728092935.31139-1-haoqinhuang7@gmail.com [1] Signed-off-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Haoqin Huang Cc: Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 4bfe63a5225d80..cfa98846ac484b 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -2828,6 +2828,7 @@ static void zram_destroy_comps(struct zram *zram) zram->comp_algs[prio] = NULL; zram_comp_params_reset(zram); + comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor); } static void zram_reset_device(struct zram *zram) @@ -2845,8 +2846,6 @@ static void zram_reset_device(struct zram *zram) zram_destroy_comps(zram); memset(&zram->stats, 0, sizeof(zram->stats)); reset_bdev(zram); - - comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor); } static ssize_t disksize_store(struct device *dev, struct device_attribute *attr, From 971cf48e68bb33d5971e9e60b1b44d8b0e083a43 Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Wed, 29 Jul 2026 13:57:36 +0900 Subject: [PATCH 077/250] zram: validate deflate params We must validate user-supplied deflate winbits before we pass it to zlib_deflate_workspacesize(), which triggers BUG_ON() if winbits value is outside of valid ranges. Link: https://lore.kernel.org/20260729045745.775973-3-senozhatsky@chromium.org Fixes: dc75a0d93bd5 ("zram: support deflate-specific params") Link: https://sashiko.dev/#/patchset/20260728092935.31139-1-haoqinhuang7@gmail.com Signed-off-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Haoqin Huang Cc: Signed-off-by: Andrew Morton --- drivers/block/zram/backend_deflate.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index f92a52a720d1e2..b3f7d08b49d934 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -24,8 +24,16 @@ static int deflate_setup_params(struct zcomp_params *params) { if (params->level == ZCOMP_PARAM_NOT_SET) params->level = Z_DEFAULT_COMPRESSION; - if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET) + if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET) { params->deflate.winbits = DEFLATE_DEF_WINBITS; + } else { + s32 wb = params->deflate.winbits; + + if ((wb < -15 || wb > -9) && (wb < 9 || wb > 15)) { + pr_err("invalid deflate winbits: %d\n", wb); + return -EINVAL; + } + } return 0; } From 1f884e55f4362d8ec95ca2247fbe887e3d3e7f8a Mon Sep 17 00:00:00 2001 From: Guopeng Zhang Date: Fri, 24 Jul 2026 10:18:05 +0800 Subject: [PATCH 078/250] mm: memcg: stop reclaim when a limit update is superseded kernfs serializes file operations only per open file, so separate open files can update the same memory.high or memory.max file concurrently. Both handlers store the new limit before synchronous reclaim, but continue to use the writer's local target in the reclaim loop. If another writer raises or removes the limit, the first writer can continue reclaiming toward a stale target. For memory.max, this can leave the writer looping indefinitely once reclaim retries are exhausted. The OOM path sees sufficient margin under the current limit and returns true without killing, while the writer still compares usage against its stale target and records another OOM event. Check the current limit at the start of each reclaim iteration and stop if it no longer matches the writer's target. Reproducer: Populate a cgroup with anonymous memory and disable swapping. Lower memory.max from one open file, then restore it to "max" through another open file after the new limit becomes visible. Without the patch, the first writer remains blocked and repeatedly increments the OOM event counter. With the patch, it returns normally. This was not motivated by a reported production workload. We found it through automated randomized testing for our cgroup observability work and reduced it to the reproducer above. Link: https://lore.kernel.org/20260724021805.1234583-1-guopeng.zhang@linux.dev Fixes: 8c8c383c04f6 ("mm: memcontrol: try harder to set a new memory.high") Fixes: b6e6edcfa405 ("mm: memcontrol: reclaim and OOM kill when shrinking memory.max below usage") Signed-off-by: Guopeng Zhang Acked-by: Tao Cui Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Signed-off-by: Andrew Morton --- mm/memcontrol.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 65057b59b09761..0dd847af69a202 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4839,6 +4839,9 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, unsigned long nr_pages = page_counter_read(&memcg->memory); unsigned long reclaimed; + if (high != READ_ONCE(memcg->memory.high)) + break; + if (nr_pages <= high) break; @@ -4894,6 +4897,9 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, for (;;) { unsigned long nr_pages = page_counter_read(&memcg->memory); + if (max != READ_ONCE(memcg->memory.max)) + break; + if (nr_pages <= max) break; From 9fd1cb6c479509842ed44352eb5a43b05747693e Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Thu, 30 Jul 2026 16:51:46 +0900 Subject: [PATCH 079/250] Documentation: zram: correct algo parameters configuration documentation zram has always reset all previously set parameters for the given algorithm in comp_params_store(). Make documentation more clear and explicitly state that all relevant/necessary parameters should be set in one configuration write. Link: https://lore.kernel.org/20260730075158.1339787-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Cc: Jonathan Corbet Cc: Minchan Kim Signed-off-by: Andrew Morton --- Documentation/admin-guide/blockdev/zram.rst | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/admin-guide/blockdev/zram.rst index 2f6bbfd991fe02..148b7cf3b924de 100644 --- a/Documentation/admin-guide/blockdev/zram.rst +++ b/Documentation/admin-guide/blockdev/zram.rst @@ -109,14 +109,41 @@ path to the `dict` along with other parameters:: #pass path to pre-trained zstd dictionary echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/algorithm_params + #pass path to pre-trained zstd dictionary and compression level + echo "algo=zstd level=8 dict=/etc/dictionary" > \ + /sys/block/zram0/algorithm_params + #same, but using algorithm priority + echo "algo=zstd priority=1" > /sys/block/zram0/recomp_algorithm echo "priority=1 dict=/etc/dictionary" > \ /sys/block/zram0/algorithm_params - #pass path to pre-trained zstd dictionary and compression level +Each write to `algorithm_params` replaces the entire set of parameters of +the corresponding algorithm, parameters that are not listed in the write +are reset to their default values. Configure all of the parameters of an +algorithm in one write:: + + #WRONG: the second write resets level back to its default value + echo "algo=zstd level=8" > /sys/block/zram0/algorithm_params + echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/algorithm_params + + #RIGHT echo "algo=zstd level=8 dict=/etc/dictionary" > \ /sys/block/zram0/algorithm_params +Select the compression algorithm before configuring its parameters. The +parameters of one algorithm are not necessarily valid for another one, so +changing the algorithm of a particular priority resets that priority's +parameters:: + + #WRONG: comp_algorithm write resets the previously configured level + echo "level=8" > /sys/block/zram0/algorithm_params + echo zstd > /sys/block/zram0/comp_algorithm + + #RIGHT + echo zstd > /sys/block/zram0/comp_algorithm + echo "algo=zstd level=8" > /sys/block/zram0/algorithm_params + Parameters are algorithm specific: not all algorithms support pre-trained dictionaries, not all algorithms support `level`. Furthermore, for certain algorithms `level` controls the compression level (the higher the value the @@ -124,6 +151,11 @@ better the compression ratio, it even can take negatives values for some algorithms), for other algorithms `level` is acceleration level (the higher the value the lower the compression ratio). +Parameters are handed over to the compression algorithm when the device is +initialised, hence invalid parameters (or parameters that the selected +algorithm does not support) are reported by the `disksize` write, and not +by the `algorithm_params` write that has configured them. + Set Disksize ============ From 9bc1899a1f30713d01b5decd6dea456e747f676e Mon Sep 17 00:00:00 2001 From: Shakeel Butt Date: Tue, 28 Jul 2026 19:46:12 -0700 Subject: [PATCH 080/250] memcg: bypass the reclaim and oom killer for dying tasks once oom_reaper is done At Meta, we are seeing instances where an OOM killed job is stuck in the exit path for several hours. In one particular case, the job was stuck for more than 8 hours and I had to manually remove the memory.max limits to allow the process to exit. The job was a single process job and had ~55 GiB memory.max and zswap enabled. It had almost 0 anon in memory and ~111 GiB in zswap compressed to ~51 GiB zswap pool (i.e. almost all of memory.current was zswap). Nothing was left on the LRUs to reclaim. On further inspection, I observed ~20k threads of that process stuck with the following stack: [<0>] mem_cgroup_out_of_memory+0x4e/0xa0 [<0>] charge_memcg+0x8bf/0x990 [<0>] mem_cgroup_swapin_charge_folio+0x4e/0x80 [<0>] __read_swap_cache_async+0x10c/0x260 [<0>] swapin_readahead+0x116/0x3f0 [<0>] do_swap_page+0x13c/0x1ce0 [<0>] handle_mm_fault+0x61d/0x11f0 [<0>] do_user_addr_fault+0x3e7/0x6d0 [<0>] exc_page_fault+0x8f/0x110 [<0>] asm_exc_page_fault+0x22/0x30 [<0>] __get_user_8+0x14/0x20 [<0>] futex_cleanup+0x27/0x1c0 [<0>] futex_exit_release+0x47/0x60 [<0>] do_exit+0x107/0x940 [<0>] do_group_exit+0x81/0xa0 [<0>] get_signal+0x2b1/0x6e0 [<0>] arch_do_signal_or_restart+0x1a/0x1c0 [<0>] exit_to_user_mode_loop+0xa8/0x1c0 [<0>] do_syscall_64+0x152/0x250 [<0>] entry_SYSCALL_64_after_hwframe+0x4b/0x53 In addition the dmesg was filled with "Out of memory and no killable processes..." messages. I have no idea why oom reaper was not able to reap/unmap the process. My guess is that since oom reaper tries to acquire mmap_lock in read mode limited number of times and then gives up, there might be a thread of that process which had mmap_lock in write mode at that time. My initial suspicion was the futex_cleanup and kernel page fault causing infinite fault and charge retries but that was put to rest in previous discussions happened on similar problem [1]. My current theory is that it is just a simple slow serialization behind the oom_lock. Unlike page allocator, memcg charge code takes the oom_lock without the "try". Though memcg oom code uses mutex_lock_killable(), note that in the call stack get_signal() consumes SIGKILL (or sigdelset(SIGKILL)) before calling do_group_exit(). So this mutex_lock_killable() is just a mutex_lock() here. Therefore 10s of thousands of threads are waiting on oom_lock and one by one they get -EFAULT from get_user() in the futex cleanup code and bails out. Discussion from [1] led to commit a75ffa26122b ("memcg, oom: do not bypass oom killer for dying tasks") which routes dying tasks into the OOM path precisely so the oom_reaper can reap their mm and free the memory asynchronously. But the reaper is best-effort and one-shot: if it cannot take mmap_lock for read (e.g. a sibling thread holds it for write) it sets MMF_OOM_SKIP and never retries, leaving only the glacial oom_lock-serialized synchronous drain. Once MMF_OOM_SKIP is set there is no more asynchronous reclaim coming for the mm, so a dying task charging against it has nothing left to wait for: it frees its memory only once it finishes exiting. Running reclaim and the (no-victim) OOM killer for it is then pointless, and doing it for 10s of thousands of exiting threads is what serializes them behind oom_lock. So before reclaim, if current is an OOM victim whose reaper is done, fail the charge. Reproduced with 20k threads, each parking a robust futex head on its own zswapped page, OOM-group-killed while a sibling holds mmap_lock for write so the reaper gives up and sets MMF_OOM_SKIP. Tested on next-20260728 and baseline show ~90 seconds exit time while with the patch the exit time reduced to ~3 seconds. Link: https://lore.kernel.org/20260729024612.3369005-1-shakeel.butt@linux.dev Link: https://lore.kernel.org/7a4e5591f45df455e6a485fc5400989569d3d22d.camel@surriel.com/ [1] Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: David Rientjes Cc: Muchun Song Cc: Nhat Pham Cc: Rik van Riel Cc: Roman Gushchin Cc: Suren Baghdasaryan Cc: Signed-off-by: Andrew Morton --- mm/memcontrol.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0dd847af69a202..1d3339520809f2 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2693,6 +2693,19 @@ static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask, if (!gfpflags_allow_blocking(gfp_mask)) goto nomem; + /* + * OOM victim still needs to charge memory to exit. OOM reaper should + * help but it might fail on mmap_lock contention. If the victim is a + * large thread group then all exiting threads might compete on oom_lock + * just to learn that there is nothing really killable anymore. Bail + * out early and fail the charge to expedite their exit. They are + * considered fully reclaimed by the oom reaper and they shouldn't + * contribute further charges. + */ + if (tsk_is_oom_victim(current) && + mm_flags_test(MMF_OOM_SKIP, current->signal->oom_mm)) + goto nomem; + __memcg_memory_event(mem_over_limit, MEMCG_MAX, allow_spinning); raised_max_event = true; From 79b2f8506659b3847f1ac05a2923cc24f22f9181 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Mon, 20 Jul 2026 16:16:33 +0200 Subject: [PATCH 081/250] mm: use proper PTE accessor in move_ptes() Follow the pattern established by commit c33c794828f2 ("mm: ptep_get() conversion") and use the proper PTE accessor instead of a direct pointer dereference. Link: https://lore.kernel.org/20260720141633.501799-1-agordeev@linux.ibm.com Fixes: b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes") Signed-off-by: Alexander Gordeev Acked-by: David Hildenbrand (Arm) Cc: Ryan Roberts Signed-off-by: Andrew Morton --- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mremap.c b/mm/mremap.c index 9ea1707eafa5b6..e8df5cdb0ac9f1 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc, for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes * PAGE_SIZE, new_ptep += nr_ptes, new_addr += nr_ptes * PAGE_SIZE) { - VM_WARN_ON_ONCE(!pte_none(*new_ptep)); + VM_WARN_ON_ONCE(!pte_none(ptep_get(new_ptep))); nr_ptes = 1; max_nr_ptes = (old_end - old_addr) >> PAGE_SHIFT; From 9c79e86fb449d2099fb9eaae723b018d643a113d Mon Sep 17 00:00:00 2001 From: Guillaume Morin Date: Tue, 28 Jul 2026 21:29:03 +0200 Subject: [PATCH 082/250] hugetlb: only adjust reservation during unmapping if mapcount is 0 Since df7a6d1f6405, __unmap_hugepage_range can adjust reservations. In the case of folio mapped in both a parent and a child, if the parent unmaps the range first, the reservation adjustment will result in an underflow of the reserved count. Once the child unmaps the range, the count is restored. Change __unmap_hugepage_range() to check the mapcount before adjusting the reservation. Link: https://lore.kernel.org/all/alEJkwn5VlTTH_ZX@bender.morinfr.org/ Link: https://lore.kernel.org/amkC_1Ya6OiUoiLZ@bender.morinfr.org Fixes: df7a6d1f6405 ("mm/hugetlb: restore the reservation if needed") Signed-off-by: Guillaume Morin Reviewed-by: Breno Leitao Reviewed-by: Rik van Riel Cc: Muchun Song Cc: David Hildenbrand Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3c684890f28346..d8849196ad9b1c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5220,6 +5220,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, bool adjust_reservation; unsigned long last_addr_mask; + i_mmap_assert_write_locked(vma->vm_file->f_mapping); WARN_ON(!is_vm_hugetlb_page(vma)); BUG_ON(start & ~huge_page_mask(h)); BUG_ON(end & ~huge_page_mask(h)); @@ -5311,7 +5312,10 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, /* * Restore the reservation for anonymous page, otherwise the - * backing page could be stolen by someone. + * backing page could be stolen by someone. Restore only on the + * last unmap, otherwise the owner could empty its resv map + * while the folio is still mapped by a child. Note that holding + * i_mmap_lock_write is needed to check the number of mappings. * If there we are freeing a surplus, do not set the restore * reservation bit. */ @@ -5319,7 +5323,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, spin_lock_irq(&hugetlb_lock); if (!h->surplus_huge_pages && __vma_private_lock(vma) && - folio_test_anon(folio)) { + !folio_mapped(folio) && folio_test_anon(folio)) { folio_set_hugetlb_restore_reserve(folio); /* Reservation to be adjusted after the spin lock */ adjust_reservation = true; From 680f3fd1258d19e4a287b227f71629040eae8ecb Mon Sep 17 00:00:00 2001 From: Pratyush Mallick Date: Fri, 31 Jul 2026 19:37:05 +0000 Subject: [PATCH 083/250] mm/page_reporting: add page_reporting_delay_ms module parameter Free page reporting currently hardcodes a 2-second interval between reports. This rigid delay cannot accommodate diverse guest workloads. This patch introduces a module parameter, page_reporting_delay_ms (default: 2000), allowing users to tune the reporting rate: - Lower values enable aggressive memory reclamation by returning unused pages to the host immediately. - Higher values help batch pages during spiky allocation/free churn, reducing hypercalls and nested page fault overheads. Setting the delay to 0 is safe and execution is strictly gated by: - reporting is only triggered by high-order page frees. - expensive hypercalls are bounded by a slot capacity watermark check before proceeding. Link: https://lore.kernel.org/20260731193705.2902728-1-pratmal@google.com Signed-off-by: Pratyush Mallick Reviewed-by: SJ Park Acked-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Cc: Anshuman Khandual Cc: Brendan Jackman Cc: Greg Thelen Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: SeongJae Park Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- .../admin-guide/kernel-parameters.txt | 6 ++++ mm/page_reporting.c | 28 ++++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index b5493a7f8f2281..364c2dce8e70fe 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4810,6 +4810,12 @@ Kernel parameters Adjust the minimal page reporting order. The page reporting is disabled when it exceeds MAX_PAGE_ORDER. + page_reporting.page_reporting_delay_ms= + [KNL] Free page reporting delay in milliseconds + Format: + Adjust the delay in milliseconds between free page + reporting intervals. Default is 2000 (2 seconds). + panic= [KNL] Kernel behaviour on panic: delay timeout > 0: seconds before rebooting timeout = 0: wait forever diff --git a/mm/page_reporting.c b/mm/page_reporting.c index 1cce8729696ee6..de587be178010a 100644 --- a/mm/page_reporting.c +++ b/mm/page_reporting.c @@ -48,7 +48,11 @@ MODULE_PARM_DESC(page_reporting_order, "Set page reporting order"); */ EXPORT_SYMBOL_GPL(page_reporting_order); -#define PAGE_REPORTING_DELAY (2 * HZ) +static unsigned int page_reporting_delay_ms = 2 * MSEC_PER_SEC; +module_param(page_reporting_delay_ms, uint, 0644); +MODULE_PARM_DESC(page_reporting_delay_ms, + "Set page reporting delay in milliseconds"); + static struct page_reporting_dev_info __rcu *pr_dev_info __read_mostly; enum { @@ -57,6 +61,13 @@ enum { PAGE_REPORTING_ACTIVE }; +/* schedule work for page reporting */ +static void page_reporting_schedule_work(struct page_reporting_dev_info *prdev) +{ + queue_delayed_work(system_freezable_wq, &prdev->work, + msecs_to_jiffies(page_reporting_delay_ms)); +} + /* request page reporting */ static void __page_reporting_request(struct page_reporting_dev_info *prdev) @@ -77,12 +88,10 @@ __page_reporting_request(struct page_reporting_dev_info *prdev) return; /* - * Delay the start of work to allow a sizable queue to build. For - * now we are limiting this to running no more than once every - * couple of seconds. + * Delay the start of work to allow a sizable queue to build. + * We limit this based on page_reporting_delay_ms. */ - queue_delayed_work(system_freezable_wq, &prdev->work, - PAGE_REPORTING_DELAY); + page_reporting_schedule_work(prdev); } /* notify prdev of free page reporting request */ @@ -337,13 +346,12 @@ static void page_reporting_process(struct work_struct *work) err_out: /* * If the state has reverted back to requested then there may be - * additional pages to be processed. We will defer for 2s to allow - * more pages to accumulate. + * additional pages to be processed. We will defer by + * page_reporting_delay_ms to allow more pages to accumulate. */ state = atomic_cmpxchg(&prdev->state, state, PAGE_REPORTING_IDLE); if (state == PAGE_REPORTING_REQUESTED) - queue_delayed_work(system_freezable_wq, &prdev->work, - PAGE_REPORTING_DELAY); + page_reporting_schedule_work(prdev); } static DEFINE_MUTEX(page_reporting_mutex); From 370e24c74d10b0fcd98581d37152432a1de07952 Mon Sep 17 00:00:00 2001 From: Sang-Heon Jeon Date: Sat, 1 Aug 2026 01:47:55 +0900 Subject: [PATCH 084/250] mm/sparse: correct init section annotations The !SPARSEMEM_EXTREME stub of sparse_index_init() has no annotation but the SPARSEMEM_EXTREME variant is __meminit. So mark the stub __meminit too. mminit_validate_memmodel_limits() is only called by memory_present(), which is __init. So mark it __init. sparse_usagebuf and sparse_usagebuf_end are only used by sparse_init_early_section(), sparse_usage_init() and sparse_usage_fini(), which are all __init. So mark them __initdata. Link: https://lore.kernel.org/20260731164758.1210668-1-ekffu200098@gmail.com Signed-off-by: Sang-Heon Jeon Reviewed-by: Andrew Morton Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Reviewed-by: Anshuman Khandual Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/sparse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 704a9dec2b9af8..67fa192d428999 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -104,7 +104,7 @@ int __meminit sparse_index_init(unsigned long section_nr, int nid) return 0; } #else /* !SPARSEMEM_EXTREME */ -int sparse_index_init(unsigned long section_nr, int nid) +int __meminit sparse_index_init(unsigned long section_nr, int nid) { return 0; } @@ -127,7 +127,7 @@ static inline int sparse_early_nid(struct mem_section *section) } /* Validate the physical addressing limitations of the model */ -static void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn, +static void __init mminit_validate_memmodel_limits(unsigned long *start_pfn, unsigned long *end_pfn) { unsigned long max_sparsemem_pfn = (DIRECT_MAP_PHYSMEM_END + 1) >> PAGE_SHIFT; @@ -249,8 +249,8 @@ void __weak __meminit vmemmap_populate_print_last(void) { } -static void *sparse_usagebuf __meminitdata; -static void *sparse_usagebuf_end __meminitdata; +static void *sparse_usagebuf __initdata; +static void *sparse_usagebuf_end __initdata; /* * Helper function that is used for generic section initialization, and From 0cac2da97f5efb056696a15d6848304c3e90932f Mon Sep 17 00:00:00 2001 From: Wilson Felipe Pereira Date: Fri, 31 Jul 2026 05:37:06 +0000 Subject: [PATCH 085/250] mm: zswap: drop list_lru param from zswap_lru_add() and _del() Since zswap_lru_add() and zswap_lru_del() are only called with the global zswap_list_lru, remove the redundant list_lru argument and use zswap_list_lru directly. Link: https://lore.kernel.org/20260731053721.1412304-1-wfelipe@google.com Signed-off-by: Wilson Felipe Pereira Acked-by: Johannes Weiner Acked-by: Yosry Ahmed Reviewed-by: SJ Park Acked-by: Nhat Pham Cc: Chengming Zhou Signed-off-by: Andrew Morton --- mm/zswap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index 761cd699e0a3e6..a810524c762176 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -665,7 +665,7 @@ static inline int entry_to_nid(struct zswap_entry *entry) return page_to_nid(virt_to_page(entry)); } -static void zswap_lru_add(struct list_lru *list_lru, struct zswap_entry *entry) +static void zswap_lru_add(struct zswap_entry *entry) { int nid = entry_to_nid(entry); struct mem_cgroup *memcg; @@ -684,11 +684,11 @@ static void zswap_lru_add(struct list_lru *list_lru, struct zswap_entry *entry) rcu_read_lock(); memcg = mem_cgroup_from_entry(entry); /* will always succeed */ - list_lru_add(list_lru, &entry->lru, nid, memcg); + list_lru_add(&zswap_list_lru, &entry->lru, nid, memcg); rcu_read_unlock(); } -static void zswap_lru_del(struct list_lru *list_lru, struct zswap_entry *entry) +static void zswap_lru_del(struct zswap_entry *entry) { int nid = entry_to_nid(entry); struct mem_cgroup *memcg; @@ -696,7 +696,7 @@ static void zswap_lru_del(struct list_lru *list_lru, struct zswap_entry *entry) rcu_read_lock(); memcg = mem_cgroup_from_entry(entry); /* will always succeed */ - list_lru_del(list_lru, &entry->lru, nid, memcg); + list_lru_del(&zswap_list_lru, &entry->lru, nid, memcg); rcu_read_unlock(); } @@ -764,7 +764,7 @@ static void zswap_entry_cache_free(struct zswap_entry *entry) */ static void zswap_entry_free(struct zswap_entry *entry) { - zswap_lru_del(&zswap_list_lru, entry); + zswap_lru_del(entry); zs_free(entry->pool->zs_pool, entry->handle); zswap_pool_put(entry->pool); if (entry->objcg) { @@ -1461,7 +1461,7 @@ static bool zswap_store_page(struct page *page, entry->referenced = true; if (entry->length) { INIT_LIST_HEAD(&entry->lru); - zswap_lru_add(&zswap_list_lru, entry); + zswap_lru_add(entry); } return true; From 8fc2e2b83ac388f88dc456b81b808be44721c675 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Tue, 28 Jul 2026 11:58:32 +0530 Subject: [PATCH 086/250] mm/migrate_device: clear stale mapping after freeing swapcache __migrate_device_pages() reads the folio mapping before calling folio_free_swap(). When folio_free_swap() succeeds, the folio is removed from the swap cache, but the saved mapping still points to swap_space. Passing the stale mapping to folio_migrate_mapping() makes it use the mapped-folio path for a folio that is no longer in swapcache. It can then operate on swap_space.i_pages with invalid reference accounting, eventually triggering a folio reference count BUG. After a successful split, nr still contains the number of pages in the original large folio, although each resulting page is now a separate order-0 folio. Reset nr to 1 so each split folio is processed separately, including its own swapcache removal and mapping lookup. Refresh the saved mapping after folio_free_swap() so the current folio state is used during migration. Link: https://lore.kernel.org/20260728062832.1107127-1-arvind.yadav@intel.com Fixes: df263d9a7dff ("mm/migrate_device: try to handle swapcache pages") Signed-off-by: Arvind Yadav Reviewed-by: Zi Yan Reviewed-by: Balbir Singh Cc: David Hildenbrand Cc: Matthew Brost Cc: Joshua Hahn Cc: Rakie Kim Cc: Byungchul Park Cc: Gregory Price Cc: Ying Huang Cc: Alistair Popple Cc: Signed-off-by: Andrew Morton --- mm/migrate_device.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 004dafa3703862..ab3281b7fb6e9e 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -1193,6 +1193,13 @@ static void __migrate_device_pages(unsigned long *src_pfns, MIGRATE_PFN_COMPOUND); goto next; } + + /* + * reset nr so that only first after-split folio + * is processed below + */ + VM_WARN_ON_ONCE(folio_test_large(folio)); + nr = 1; } else if ((src_pfns[i] & MIGRATE_PFN_MIGRATE) && (dst_pfns[i] & MIGRATE_PFN_COMPOUND) && !(src_pfns[i] & MIGRATE_PFN_COMPOUND)) { @@ -1232,6 +1239,12 @@ static void __migrate_device_pages(unsigned long *src_pfns, folio = page_folio(migrate_pfn_to_page(src_pfns[i+j])); newfolio = page_folio(migrate_pfn_to_page(dst_pfns[i+j])); + /* + * folio_free_swap() removed the folio from the swap + * cache. Refresh the saved mapping before migration. + */ + mapping = folio_mapping(folio); + r = folio_migrate_mapping(mapping, newfolio, folio, extra_cnt); if (r) src_pfns[i+j] &= ~MIGRATE_PFN_MIGRATE; From a706c03244e3836831186aab9280aadfd12d3396 Mon Sep 17 00:00:00 2001 From: Zi Yan Date: Tue, 4 Aug 2026 17:04:27 -0400 Subject: [PATCH 087/250] mm/huge_memory: use folio's memcg inside __folio_split() Patch series "Honor XA_FLAGS_ACCOUNT in xas_split_alloc() and charge to folio's memcg", v3. __GFP_ACCOUNT is needed for xarray node allocation accounting when XA_FLAGS_ACCOUNT is set. Commit 7b785645e8f13 ("mm: fix page cache convergence regression") fixed a workingset regression with it. xas_split_alloc() does not have it and needs to be fixed. In addition, based on Sashiko's review[1] and Johannes' confirmation[2], to charge the right memcg, folio's memcg needs to be active during folio split. Add that before adding __GFP_ACCOUNT. There is no workingset convergence regression related to missing __GFP_ACCOUNT in xas_split_alloc() and the impact to userspace should be minor. This patch (of 2): During a pagecache folio split, an xarray node allocation can happen and needs to charge at folio's memcg instead of folio split invoker's memcg, because for example folio split can happen during reclaim and reclaim's active memcg might not be folio's memcg. Switch to folio's memcg at the beginning and switch back afterwards. Link: https://lore.kernel.org/20260804-add-gfp_account-to-xas_split_alloc-v3-0-38cb3ff325c5@nvidia.com Link: https://lore.kernel.org/20260804-add-gfp_account-to-xas_split_alloc-v3-1-38cb3ff325c5@nvidia.com Link: https://sashiko.dev/#/patchset/20260727-add-gfp_account-to-xas_split_alloc-v1-1-9fae6bf64838%40nvidia.com?part=1 [1] Link: https://lore.kernel.org/all/amtcBZ-_QVRgCd6b@cmpxchg.org/ [2] Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Signed-off-by: Zi Yan Suggested-by: Johannes Weiner Reviewed-by: Baolin Wang Acked-by: Lorenzo Stoakes (ARM) Acked-by: Johannes Weiner Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: William Kucharski Cc: Signed-off-by: Andrew Morton --- mm/huge_memory.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index a8174d1d38485d..ced400f72d43ac 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4105,34 +4105,42 @@ static int __folio_split(struct folio *folio, unsigned int new_order, XA_STATE(xas, &folio->mapping->i_pages, folio->index); struct folio *end_folio = folio_next(folio); bool is_anon = folio_test_anon(folio); + struct mem_cgroup *memcg, *old_memcg; struct address_space *mapping = NULL; struct anon_vma *anon_vma = NULL; int old_order = folio_order(folio); struct folio *new_folio, *next; int nr_shmem_dropped = 0; enum ttu_flags ttu_flags = 0; - int ret; pgoff_t end = 0; + int ret; VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio); VM_WARN_ON_ONCE_FOLIO(!folio_test_large(folio), folio); if (folio != page_folio(split_at) || folio != page_folio(lock_at)) { ret = -EINVAL; - goto out; + goto out_no_memcg; } if (new_order >= old_order) { ret = -EINVAL; - goto out; + goto out_no_memcg; } ret = folio_check_splittable(folio, new_order, split_type); if (ret) { VM_WARN_ONCE(ret == -EINVAL, "Tried to split an unsplittable folio"); - goto out; + goto out_no_memcg; } + /* + * switch to folio's memcg as xarray node allocation can happen and + * needs to charge to it. + */ + memcg = get_mem_cgroup_from_folio(folio); + old_memcg = set_active_memcg(memcg); + if (is_anon) { /* * The caller does not necessarily hold an mmap_lock that would @@ -4275,6 +4283,10 @@ static int __folio_split(struct folio *folio, unsigned int new_order, if (mapping) i_mmap_unlock_read(mapping); out: + /* restore to caller's old_memcg */ + set_active_memcg(old_memcg); + mem_cgroup_put(memcg); +out_no_memcg: xas_destroy(&xas); if (is_pmd_order(old_order)) count_vm_event(!ret ? THP_SPLIT_PAGE : THP_SPLIT_PAGE_FAILED); From 3a31545aef9ac788fdda43bc448b377fb2da7e2b Mon Sep 17 00:00:00 2001 From: Zi Yan Date: Tue, 4 Aug 2026 17:04:28 -0400 Subject: [PATCH 088/250] xarray: honor XA_FLAGS_ACCOUNT in xas_split_alloc() XArray operations that allocate xa_nodes, such as xas_nomem() and xas_alloc(), add __GFP_ACCOUNT when the array has XA_FLAGS_ACCOUNT set. This charges the allocated memory and avoids the workingset convergence issue described by commit 7b785645e8f13 ("mm: fix page cache convergence regression"). xas_split_alloc() does not add _GFP_ACCOUNT when XA_FLAGS_ACCOUNT is present. Fix it. Link: https://lore.kernel.org/20260804-add-gfp_account-to-xas_split_alloc-v3-2-38cb3ff325c5@nvidia.com Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Signed-off-by: Zi Yan Reviewed-by: Lorenzo Stoakes (ARM) Acked-by: Johannes Weiner Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: William Kucharski Cc: Signed-off-by: Andrew Morton --- lib/xarray.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/xarray.c b/lib/xarray.c index 9a8b4916540cf1..bfe7bef80f34eb 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1053,6 +1053,9 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, if (xas->xa_shift + XA_CHUNK_SHIFT > order) return; + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) + gfp |= __GFP_ACCOUNT; + do { struct xa_node *node; From 785e9110e1c664ee6897ae7adef0f20bd704e5e4 Mon Sep 17 00:00:00 2001 From: "David Hildenbrand (Arm)" Date: Fri, 31 Jul 2026 22:27:53 +0200 Subject: [PATCH 089/250] mm/gup: fix always draining LRU caches in collect_longterm_unpinnable_folios() folio_may_be_lru_cached() is currently only true for small folios, and for small folios FOLL_PIN adds GUP_PIN_COUNTING_BIAS references instead of 1 in try_grab_folio()/try_grab_folio_fast(). Consequently, our folio_ref_count(folio) != folio_expected_ref_count(folio) + 1 check in collect_longterm_unpinnable_folios() will currently always identify "reference mismatch" and first drain the local LRU cache to then drain the LRU cache on all CPUs, as collect_longterm_unpinnable_folios() is really called after pinning the folios with FOLL_PIN. Add a comment because the current code is not quite intuitive: we used to drain only to make sure the folio_isolate_lru() would succeed. But then we also started draining to make later migration more reliable. We'll refactor that code soon a bit, to also make it usable in other context where we really want to remove any references from LRU caches. Let's add CC stable, because having an easy way for excessive LRU cache draining on all CPUs does not sound right. In common scenarios we don't expect to ever have to drain. Link: https://lore.kernel.org/20260731-check_and_migrate_movable_folios-v1-1-e0002d7b791e@kernel.org Fixes: 98c6d259319e ("mm/gup: check ref_count instead of lru before migration") Fixes: a09a8a1fbb37 ("mm/gup: local lru_add_drain() to avoid lru_add_drain_all()") Signed-off-by: David Hildenbrand (Arm) Acked-by: Hugh Dickins Cc: Ackerley Tng Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kiryl Shutsemau Cc: Peter Xu Cc: Signed-off-by: Andrew Morton --- mm/gup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 8ea3de60e82db9..bce275c7dbb6d6 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2273,6 +2273,7 @@ static unsigned long collect_longterm_unpinnable_folios( for (folio = pofs_get_folio(pofs, i); folio; folio = pofs_next_folio(folio, pofs, &i)) { + const int pin_refs = folio_has_pincount(folio) ? 1 : GUP_PIN_COUNTING_BIAS; if (folio_is_longterm_pinnable(folio)) continue; @@ -2287,15 +2288,20 @@ static unsigned long collect_longterm_unpinnable_folios( continue; } + /* + * We drain not only to make the folio_isolate_lru() succeed, + * but also to remove any other folio references from LRU + * caches. + */ if (drained == 0 && folio_may_be_lru_cached(folio) && folio_ref_count(folio) != - folio_expected_ref_count(folio) + 1) { + folio_expected_ref_count(folio) + pin_refs) { lru_add_drain(); drained = 1; } if (drained == 1 && folio_may_be_lru_cached(folio) && folio_ref_count(folio) != - folio_expected_ref_count(folio) + 1) { + folio_expected_ref_count(folio) + pin_refs) { lru_add_drain_all(); drained = 2; } From 0d9aade829d691baf8279a8136ff58314d73aebb Mon Sep 17 00:00:00 2001 From: "David Hildenbrand (Arm)" Date: Thu, 6 Aug 2026 20:09:06 +0200 Subject: [PATCH 090/250] mm/gup: factor out LRU cache draining for folio into lru_cache_drain_for_folio() KVM with guest_memfd wants to remove any folio references due to LRU caches, as it really must only allow to convert folios from shared to private when there are no unexpected folio references (e.g., from GUP references). So, to drive the refcount down, it needs a way to flush the LRU caches. Let's factor out what we have in lru_cache_drain_for_folio(). Document it, and also mention that concurrent folio (un)mapping might, in theory, miss detecting LRU cache references. Keep obtaining the expected refcount twice to minimize the possibility. For the current and future user that should work, and we don't really have a better alternative: we could detect if the mapcount changed, but it would still be racy and add more complexity with questionable benefit. Maybe there is a chance to avoid the draining entirely in the future, by avoiding extra references from the LRU cache: Hugh thinks there might be a way. But for the time being, this handling is unfortunately required. Make folio_may_be_lru_cached() accept a const pointer so lru_cache_drain_for_folio() can accept a const pointer as well. Link: https://lore.kernel.org/20260806-lru_cache_drain_for_folio-v1-1-c6287d295e99@kernel.org Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Fuad Tabba Cc: Ackerley Tng Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kairui Song Cc: Kemeng Shi Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Nhat Pham Cc: Peter Xu Cc: Sean Christopherson Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- include/linux/swap.h | 8 ++++++++ mm/folio.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ mm/gup.c | 15 ++------------- mm/internal.h | 2 +- 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 330a420fd6de34..b4b1c0a84c8b1c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -298,6 +298,14 @@ void folio_add_lru(struct folio *folio); void folio_mark_accessed(struct folio *folio); void lru_add_drain_all(void); +enum lru_cache_drained { + LRU_CACHE_NOT_DRAINED, + LRU_CACHE_DRAINED, + LRU_CACHE_DRAINED_ALL, +}; +void lru_cache_drain_for_folio(const struct folio *folio, + unsigned int extra_refs, enum lru_cache_drained *drained); + /* linux/mm/folio-compat.c */ void mark_page_accessed(struct page *page); diff --git a/mm/folio.c b/mm/folio.c index a9e328c3f21bbe..59c477120b9a8c 100644 --- a/mm/folio.c +++ b/mm/folio.c @@ -881,6 +881,52 @@ void lru_add_drain_all(void) } #endif /* CONFIG_SMP */ +/** + * lru_cache_drain_for_folio() - drain LRU caches if the caches might hold + * folio references + * @folio: The folio. + * @extra_refs: Extra folio references held by the caller. + * @drained: Drain status for batch folio processing. + * + * Drain LRU caches if the caches might hold folio references. Start + * with a local LRU cache drain, to then drain LRU caches on all CPUs if + * local draining was insufficient. + * + * This function detects LRU cache references by comparing the folio refcount + * with the sum of the expected folio refcount + extra references held by the + * caller. Note that we cannot rely on PG_lru to reliably detect all LRU + * cache references, and there are rare scenarios (concurrent folio (un)mapping) + * where this function might miss detecting LRU cache references. + * + * If @drained is not NULL, the function will avoid re-draining LRU caches + * when processing multiple folios in a row. In that case, the variable + * @drained points at must be initialized to LRU_CACHE_NOT_DRAINED before + * the first invocation by the caller. + */ +void lru_cache_drain_for_folio(const struct folio *folio, + unsigned int extra_refs, enum lru_cache_drained *drained) +{ + if (!folio_may_be_lru_cached(folio)) + return; + + if (!drained || *drained == LRU_CACHE_NOT_DRAINED) { + if (folio_ref_count(folio) == + folio_expected_ref_count(folio) + extra_refs) + return; + lru_add_drain(); + if (drained) + *drained = LRU_CACHE_DRAINED; + } + if (!drained || *drained == LRU_CACHE_DRAINED) { + if (folio_ref_count(folio) == + folio_expected_ref_count(folio) + extra_refs) + return; + lru_add_drain_all(); + if (drained) + *drained = LRU_CACHE_DRAINED_ALL; + } +} + atomic_t lru_disable_count = ATOMIC_INIT(0); /* diff --git a/mm/gup.c b/mm/gup.c index bce275c7dbb6d6..eb898ea1ee22e5 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2266,9 +2266,9 @@ static unsigned long collect_longterm_unpinnable_folios( struct list_head *movable_folio_list, struct pages_or_folios *pofs) { + enum lru_cache_drained drained = LRU_CACHE_NOT_DRAINED; unsigned long collected = 0; struct folio *folio; - int drained = 0; long i = 0; for (folio = pofs_get_folio(pofs, i); folio; @@ -2293,18 +2293,7 @@ static unsigned long collect_longterm_unpinnable_folios( * but also to remove any other folio references from LRU * caches. */ - if (drained == 0 && folio_may_be_lru_cached(folio) && - folio_ref_count(folio) != - folio_expected_ref_count(folio) + pin_refs) { - lru_add_drain(); - drained = 1; - } - if (drained == 1 && folio_may_be_lru_cached(folio) && - folio_ref_count(folio) != - folio_expected_ref_count(folio) + pin_refs) { - lru_add_drain_all(); - drained = 2; - } + lru_cache_drain_for_folio(folio, pin_refs, &drained); if (!folio_isolate_lru(folio)) continue; diff --git a/mm/internal.h b/mm/internal.h index 07f60ca0b201b6..38b1165212c941 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -43,7 +43,7 @@ void workingset_activation(struct folio *folio); /* mm/folio.c */ void folio_add_lru_vma(struct folio *folio, struct vm_area_struct *vma); -static inline bool folio_may_be_lru_cached(struct folio *folio) +static inline bool folio_may_be_lru_cached(const struct folio *folio) { /* * Holding PMD-sized folios in per-CPU LRU cache unbalances accounting. From 9a980234ca5e3382805654f72e66321becc1840b Mon Sep 17 00:00:00 2001 From: Artem Lytkin Date: Sat, 1 Aug 2026 14:49:15 +0300 Subject: [PATCH 091/250] mm/vmalloc: make vm_struct.nr_pages an unsigned long vm_struct::nr_pages is an unsigned int, and the file keeps deriving byte counts from it as nr_pages << PAGE_SHIFT. A shift is evaluated in the type of its promoted left operand, so those are 32-bit arithmetic and wrap at 4 GiB of bytes, which is 2^20 pages. Every site depends on a cast being remembered; vmap() has one, two recent commits did not. vread_iter() then computes a size of zero for a 4 GiB VM_ALLOC area and /proc/kcore returns it as zeros while reporting a successful read, which drgn, crash or gdb cannot tell from real memory, and the vrealloc() grow-in-place check declines a request that would have fit. Widen the field so the class of bug goes away instead of one site at a time. Everything feeding or consuming it widens too: vm_area_alloc_pages() and its accumulators, nr_small_pages, new_nr_pages and old_nr_pages, the index range of vm_area_free_pages(), and three page indexes that were plain int. Five casts go. Two prints needed fixing as well, %u in vmalloc_dump_obj() and %d for the unsigned field in vmalloc_info_show(). No bug report behind this, I found it reading the code. The 4 GiB wrap needs only a machine with over 4 GiB of memory. Neither larger threshold is a practical concern: 2^32 pages, where the field itself truncates, is 16 TiB and beyond what hardware can populate, and 2^31, where the plain int indexes break, is 8 TiB and larger than anything in the tree asks for. The int *nr cursor in the mapping path is unchanged and is separate work. Users outside mm/vmalloc.c need no change either. Those handing the count to a narrower parameter cannot drive it near 2^31, and kho_preserve_vmalloc() stores it into a 32-bit ABI field that still receives the same low bits; above 2^32 pages the truncation just moves out of vm_struct into that store. sizeof(struct vm_struct) on x86-64 stays 72 bytes with CONFIG_HAVE_ARCH_HUGE_VMALLOC=n and goes from 72 to 80 with it enabled, both inside the kmalloc-96 bucket it already comes from. Link: https://lore.kernel.org/20260801114915.115224-1-iprintercanon@gmail.com Fixes: 0bca23804632 ("mm/vmalloc: use physical page count in vread_iter() for VM_ALLOC areas") Fixes: d57ac904ffdc ("mm/vmalloc: use physical page count for vrealloc() grow-in-place check") Signed-off-by: Artem Lytkin Suggested-by: Andrew Morton Reviewed-by: Uladzislau Rezki (Sony) Assisted-by: Claude:claude-fable-5 Cc: Matthew Wilcox (Oracle) Cc: Cc: Signed-off-by: Andrew Morton --- include/linux/vmalloc.h | 2 +- mm/vmalloc.c | 58 ++++++++++++++++++++--------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index e4d8d0a9f30f9f..aed121d729b013 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -62,7 +62,7 @@ struct vm_struct { #ifdef CONFIG_HAVE_ARCH_HUGE_VMALLOC unsigned int page_order; #endif - unsigned int nr_pages; + unsigned long nr_pages; phys_addr_t phys_addr; const void *caller; unsigned long requested_size; diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 5c0c2d0d6ae74e..72d7f0d81c053e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3361,7 +3361,7 @@ struct vm_struct *remove_vm_area(const void *addr) static inline void set_area_direct_map(const struct vm_struct *area, int (*set_direct_map)(struct page *page)) { - int i; + unsigned long i; /* HUGE_VMALLOC passes small pages to set_direct_map */ for (i = 0; i < area->nr_pages; i++) @@ -3377,7 +3377,7 @@ static void vm_reset_perms(struct vm_struct *area) unsigned long start = ULONG_MAX, end = 0; unsigned int page_order = vm_area_page_order(area); int flush_dmap = 0; - int i; + unsigned long i; /* * Find the start and end range of the direct mappings to make sure that @@ -3450,10 +3450,10 @@ void vfree_atomic(const void *addr) * Caller is responsible for unmapping (vunmap_range) and KASAN * poisoning before calling this. */ -static void vm_area_free_pages(struct vm_struct *vm, unsigned int start_idx, - unsigned int end_idx) +static void vm_area_free_pages(struct vm_struct *vm, unsigned long start_idx, + unsigned long end_idx) { - unsigned int i; + unsigned long i; if (!(vm->flags & VM_MAP_PUT_PAGES)) { for (i = start_idx; i < end_idx; i++) @@ -3665,12 +3665,12 @@ static inline gfp_t vmalloc_gfp_adjust(gfp_t flags, const bool large) return flags; } -static inline unsigned int +static inline unsigned long vm_area_alloc_pages(gfp_t gfp, int nid, - unsigned int order, unsigned int nr_pages, struct page **pages) + unsigned int order, unsigned long nr_pages, struct page **pages) { - unsigned int nr_allocated = 0; - unsigned int nr_remaining = nr_pages; + unsigned long nr_allocated = 0; + unsigned long nr_remaining = nr_pages; unsigned int max_attempt_order = MAX_PAGE_ORDER; struct page *page; int i; @@ -3718,7 +3718,7 @@ vm_area_alloc_pages(gfp_t gfp, int nid, if (!order) { while (nr_allocated < nr_pages) { unsigned int nr, nr_pages_request; - int i; + unsigned long i; /* * A maximum allowed request is hard-coded and is 100 @@ -3726,7 +3726,7 @@ vm_area_alloc_pages(gfp_t gfp, int nid, * long preemption off scenario in the bulk-allocator * so the range is [1:100]. */ - nr_pages_request = min(100U, nr_pages - nr_allocated); + nr_pages_request = min(100UL, nr_pages - nr_allocated); /* memory allocation should consider mempolicy, we can't * wrongly use nearest node when nid == NUMA_NO_NODE, @@ -3872,12 +3872,12 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, unsigned long addr = (unsigned long)area->addr; unsigned long size = get_vm_area_size(area); unsigned long array_size; - unsigned int nr_small_pages = size >> PAGE_SHIFT; + unsigned long nr_small_pages = size >> PAGE_SHIFT; unsigned int page_order; unsigned int flags; int ret; - array_size = (unsigned long)nr_small_pages * sizeof(struct page *); + array_size = nr_small_pages * sizeof(struct page *); /* __GFP_NOFAIL and "noblock" flags are mutually exclusive. */ if (!gfpflags_allow_blocking(gfp_mask)) @@ -4375,7 +4375,7 @@ void *vrealloc_node_align_noprof(const void *p, size_t size, unsigned long align } if (size <= old_size) { - unsigned int new_nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; + unsigned long new_nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; /* Zero out "freed" memory, potentially for future realloc. */ if (want_init_on_free() || want_init_on_alloc(flags)) @@ -4404,7 +4404,7 @@ void *vrealloc_node_align_noprof(const void *p, size_t size, unsigned long align !(vm->flags & (VM_FLUSH_RESET_PERMS | VM_USERMAP)) && gfp_has_io_fs(flags)) { unsigned long addr = (unsigned long)kasan_reset_tag(p); - unsigned int old_nr_pages = vm->nr_pages; + unsigned long old_nr_pages = vm->nr_pages; /* * Use the node lock to synchronize with concurrent @@ -4417,16 +4417,13 @@ void *vrealloc_node_align_noprof(const void *p, size_t size, unsigned long align spin_unlock(&vn->busy.lock); /* Notify kmemleak of the reduced allocation size before unmapping. */ - kmemleak_free_part( - (void *)addr + ((unsigned long)new_nr_pages - << PAGE_SHIFT), - (unsigned long)(old_nr_pages - new_nr_pages) - << PAGE_SHIFT); + kmemleak_free_part((void *)addr + + (new_nr_pages << PAGE_SHIFT), + (old_nr_pages - new_nr_pages) + << PAGE_SHIFT); - vunmap_range(addr + ((unsigned long)new_nr_pages - << PAGE_SHIFT), - addr + ((unsigned long)old_nr_pages - << PAGE_SHIFT)); + vunmap_range(addr + (new_nr_pages << PAGE_SHIFT), + addr + (old_nr_pages << PAGE_SHIFT)); vm_area_free_pages(vm, new_nr_pages, old_nr_pages); } @@ -5250,7 +5247,7 @@ bool vmalloc_dump_obj(void *object) struct vmap_area *va; struct vmap_node *vn; unsigned long addr; - unsigned int nr_pages; + unsigned long nr_pages; addr = PAGE_ALIGN((unsigned long) object); vn = addr_to_node(addr); @@ -5270,7 +5267,7 @@ bool vmalloc_dump_obj(void *object) nr_pages = vm->nr_pages; spin_unlock(&vn->busy.lock); - pr_cont(" %u-page vmalloc region starting at %#lx allocated at %pS\n", + pr_cont(" %lu-page vmalloc region starting at %#lx allocated at %pS\n", nr_pages, addr, caller); return true; @@ -5288,16 +5285,17 @@ bool vmalloc_dump_obj(void *object) static void show_numa_info(struct seq_file *m, struct vm_struct *v, unsigned int *counters) { - unsigned int nr; unsigned int step = 1U << vm_area_page_order(v); + unsigned long i; + unsigned int nr; if (!counters) return; memset(counters, 0, nr_node_ids * sizeof(unsigned int)); - for (nr = 0; nr < v->nr_pages; nr += step) - counters[page_to_nid(v->pages[nr])] += step; + for (i = 0; i < v->nr_pages; i += step) + counters[page_to_nid(v->pages[i])] += step; for_each_node_state(nr, N_HIGH_MEMORY) if (counters[nr]) seq_printf(m, " N%u=%u", nr, counters[nr]); @@ -5355,7 +5353,7 @@ static int vmalloc_info_show(struct seq_file *m, void *p) seq_printf(m, " %pS", v->caller); if (v->nr_pages) - seq_printf(m, " pages=%d", v->nr_pages); + seq_printf(m, " pages=%lu", v->nr_pages); if (v->phys_addr) seq_printf(m, " phys=%pa", &v->phys_addr); From 70c3891675318b3308a2ef55cf4e7c120c0b5fbd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 3 Aug 2026 11:04:26 -0700 Subject: [PATCH 092/250] mm/swap: reject swapon() on filesystem-level encrypted files ext4 and f2fs don't prevent filesystem-level encrypted files from being set up directly as swap files. In this case, encryption is bypassed. No one should be doing this, vs. the methods of encrypted swap that actually do work (such as swapping to a dm-crypt device, or swapping to a loopback device on top of a filesystem-level encrypted file). Nevertheless, to prevent user error, make swapon() explicitly reject this case. Document this behavior in fscrypt.rst as well. Link: https://lore.kernel.org/20260803180426.3123-1-ebiggers@kernel.org Fixes: 9bd8212f981e ("ext4 crypto: add encryption policy and password salt support") Fixes: f424f664f0e8 ("f2fs crypto: add encryption policy and password salt support") Signed-off-by: Eric Biggers Reviewed-by: Baoquan He Reviewed-by: Muhammad Usama Anjum Reviewed-by: "Darrick J. Wong" Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Signed-off-by: Andrew Morton --- Documentation/filesystems/fscrypt.rst | 4 ++++ mm/swapfile.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems/fscrypt.rst index c0dd35f1af12b2..e4882b73120e32 100644 --- a/Documentation/filesystems/fscrypt.rst +++ b/Documentation/filesystems/fscrypt.rst @@ -1238,6 +1238,10 @@ astute users may notice some differences in behavior: - DAX (Direct Access) is not supported on encrypted files. +- Encrypted files cannot be used directly as swap files. To swap to + an encrypted file, set up a loopback device on top of it. + Alternatively, encrypted swap can use a dm-crypt device. + - The maximum length of an encrypted symlink is 2 bytes shorter than the maximum length of an unencrypted symlink. For example, on an EXT4 filesystem with a 4K block size, unencrypted symlinks can be up diff --git a/mm/swapfile.c b/mm/swapfile.c index 4e07d457e26158..d7f749ad60c2f8 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3668,6 +3668,13 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) error = -EBUSY; goto bad_swap_unlock_inode; } + if (IS_ENCRYPTED(inode)) { + pr_warn_once( + "Filesystem-level encrypted swapfile '%s' is unsupported. Create a loop device over it, or use dm-crypt\n", + name->name); + error = -EINVAL; + goto bad_swap_unlock_inode; + } /* * The swap subsystem needs a major overhaul to support this. From 9b74c1c9b2b6f5d04af9745db55d6de2b3c2ece7 Mon Sep 17 00:00:00 2001 From: Jianlin Shi Date: Thu, 6 Aug 2026 16:27:34 +0800 Subject: [PATCH 093/250] mm/page_alloc: only update lowmem_reserve_ratio on sysctl write lowmem_reserve_ratio_sysctl_handler() ignores the return value of proc_dointvec_minmax() and always calls setup_per_zone_lowmem_reserve(), even for read operations. Fix three issues: 1. Propagate errors from proc_dointvec_minmax() instead of always returning success. For example, writing non-integer garbage to the sysctl now returns an error instead of silently succeeding with unchanged values. 2. Only call setup_per_zone_lowmem_reserve() when the sysctl is actually written, matching the write-only refresh pattern of min_free_kbytes and watermark_scale_factor handlers. 3. On write, parse into a temporary ratio[] array and only copy into sysctl_lowmem_reserve_ratio[] and refresh derived state after the full vector is validated. This avoids leaving the ratio array partially updated while skipping setup when proc_dointvec_minmax() returns an error on a later element (suggested by Andrew Morton). Drop the manual "< 1 -> 0" sanitization loop and set .extra1 = SYSCTL_ZERO on the ctl_table entry so proc_dointvec_minmax() enforces the minimum on write; negative values now return -EINVAL instead of being silently coerced to 0 (suggested by Vlastimil Babka). [akpm@linux-foundation.org: add comment, per hannes] Link: https://lore.kernel.org/anSRGASe5FIrqwlg@cmpxchg.org Link: https://lore.kernel.org/linux-mm/tencent_FFD4F4D728AAE8A8AE0AF277A59854A29A06@qq.com/ Link: https://lore.kernel.org/tencent_A860C873956A52E26AD8D309A308A241BA08@qq.com Signed-off-by: Jianlin Shi Acked-by: Vlastimil Babka (SUSE) Cc: Brendan Jackman Cc: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Zi Yan Cc: Joel Granados Signed-off-by: Andrew Morton --- mm/page_alloc.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 083cbcb5bddec3..12fac9084c483d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6853,8 +6853,8 @@ static int sysctl_min_slab_ratio_sysctl_handler(const struct ctl_table *table, i /* * lowmem_reserve_ratio_sysctl_handler - just a wrapper around - * proc_dointvec() so that we can call setup_per_zone_lowmem_reserve() - * whenever sysctl_lowmem_reserve_ratio changes. + * proc_dointvec_minmax() so that we can call + * setup_per_zone_lowmem_reserve() when the sysctl is written. * * The reserve ratio obviously has absolutely no relation with the * minimum watermarks. The lowmem reserve ratio can only make sense @@ -6863,16 +6863,27 @@ static int sysctl_min_slab_ratio_sysctl_handler(const struct ctl_table *table, i static int lowmem_reserve_ratio_sysctl_handler(const struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { - int i; + struct ctl_table tmp = *table; + int ratio[ARRAY_SIZE(sysctl_lowmem_reserve_ratio)]; + int rc; - proc_dointvec_minmax(table, write, buffer, length, ppos); + if (!write) + return proc_dointvec_minmax(table, write, buffer, length, ppos); - for (i = 0; i < MAX_NR_ZONES; i++) { - if (sysctl_lowmem_reserve_ratio[i] < 1) - sysctl_lowmem_reserve_ratio[i] = 0; - } + /* + * proc_dointvec_max() works incrementally. Use a buffer and only set + * the values if all of them parse cleanly. + */ + memcpy(ratio, sysctl_lowmem_reserve_ratio, sizeof(ratio)); + tmp.data = ratio; + + rc = proc_dointvec_minmax(&tmp, write, buffer, length, ppos); + if (rc) + return rc; + memcpy(sysctl_lowmem_reserve_ratio, ratio, sizeof(ratio)); setup_per_zone_lowmem_reserve(); + return 0; } @@ -6971,6 +6982,7 @@ static const struct ctl_table page_alloc_sysctl_table[] = { .maxlen = sizeof(sysctl_lowmem_reserve_ratio), .mode = 0644, .proc_handler = lowmem_reserve_ratio_sysctl_handler, + .extra1 = SYSCTL_ZERO, }, #ifdef CONFIG_NUMA { From 4c24b69db573e5a012fb15dbcae2dfc5f659db09 Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Sat, 23 May 2026 22:04:45 +0900 Subject: [PATCH 094/250] tmpfs/ramfs: let memfd_create() work on nommu Currently trying to use memfd_create() on nommu returns an error with errno set to EFBIG. The manpage memfd_create() doesn't have EFBIG as a possible error value. Doing some digging this is coming from 0 getting passed as newsize to ramfs_nommu_expand_for_mapping() and that getting into get_order() and there "The result is undefined if the size is 0". Whatever comes out of get_order() is then used in the following logic and that results in the EFBIG that causes the syscall to fail and the errno in userspace. If newsize is 0 there is nothing to do so just return. Roughly tested on m68k nommu by creating a process, creating an memfd, forking another process, mmap()ing the memfd in the child, writing into the mapping, then mmap()ing in the parent and checking that the right data is there. Link: https://lore.kernel.org/20260523130445.1101818-1-daniel@thingy.jp Signed-off-by: Daniel Palmer Acked-by: Lorenzo Stoakes Cc: "Liam R. Howlett" Cc: Al Viro Cc: Christian Brauner Signed-off-by: Andrew Morton --- fs/ramfs/file-nommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 2f79bcb89d2e57..fb471bf88ab7a6 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -69,6 +69,9 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) gfp_t gfp = mapping_gfp_mask(inode->i_mapping); /* make various checks */ + if (!newsize) + return 0; + order = get_order(newsize); if (unlikely(order > MAX_PAGE_ORDER)) return -EFBIG; From 48a390ff447e67ff153fd2eb1856a35e9a0871c0 Mon Sep 17 00:00:00 2001 From: Pratyush Mallick Date: Mon, 3 Aug 2026 22:17:31 +0000 Subject: [PATCH 095/250] selftests/mm: rename local_config.h to local_config.h_gen Patch series "selftests/mm: use pattern matching in .gitignore", v4. The current selftests/mm/.gitignore hardcodes each generated test binary by name, which requires manual updates every time a new test is added. This series switches to a pattern-matching approach (similar to KVM selftests), ignoring everything by default and allowing specific source extensions. To accommodate this without tracking generated headers, local_config.h is renamed to local_config.h_gen. This patch (of 2): Because local_config.h is a generated build artifact, un-ignoring all .h files in .gitignore causes it to incorrectly show up as an untracked file in git status. Rename it to local_config.h_gen so it no longer matches the !*.h inclusion rule, preparing for a subsequent patch that switches .gitignore to a pattern-matching approach. Update Makefile, check_config.sh, and affected test sources (cow.c, gup_longterm.c) accordingly. Link: https://lore.kernel.org/20260803221732.3651981-1-pratmal@google.com Link: https://lore.kernel.org/20260803221732.3651981-2-pratmal@google.com Signed-off-by: Pratyush Mallick Reviewed-by: Lorenzo Stoakes Acked-by: Mike Rapoport (Microsoft) Suggested-by: David Hildenbrand Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Liam R. Howlett" Cc: Michal Hocko Cc: Peter Xu Cc: SeongJae Park Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yosry Ahmed Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/Makefile | 6 +++--- tools/testing/selftests/mm/check_config.sh | 2 +- tools/testing/selftests/mm/cow.c | 2 +- tools/testing/selftests/mm/gup_longterm.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 277a141d662e16..0f31d850707d05 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -5,7 +5,7 @@ # script so kunit knows to run it, and add it to the list below. # If you do not YOUR TESTS WILL NOT RUN IN THE CI. -LOCAL_HDRS += $(selfdir)/mm/local_config.h $(top_srcdir)/mm/gup_test.h +LOCAL_HDRS += $(selfdir)/mm/local_config.h_gen $(top_srcdir)/mm/gup_test.h LOCAL_HDRS += $(selfdir)/mm/mseal_helpers.h include local_config.mk @@ -261,11 +261,11 @@ $(OUTPUT)/migration: LDLIBS += -lnuma $(OUTPUT)/rmap: LDLIBS += -lnuma -local_config.mk local_config.h: check_config.sh +local_config.mk local_config.h_gen: check_config.sh $(call msg,CHK,config,$@) $(Q)CC="$(CC)" CFLAGS="$(CFLAGS)" ./check_config.sh -EXTRA_CLEAN += local_config.mk local_config.h +EXTRA_CLEAN += local_config.mk local_config.h_gen ifeq ($(IOURING_EXTRA_LIBS),) all: warn_missing_liburing diff --git a/tools/testing/selftests/mm/check_config.sh b/tools/testing/selftests/mm/check_config.sh index 32beaefe279e5c..1c603261e93d18 100755 --- a/tools/testing/selftests/mm/check_config.sh +++ b/tools/testing/selftests/mm/check_config.sh @@ -4,7 +4,7 @@ # Probe for libraries and create header files to record the results. Both C # header files and Makefile include fragments are created. -OUTPUT_H_FILE=local_config.h +OUTPUT_H_FILE=local_config.h_gen OUTPUT_MKFILE=local_config.mk tmpname=$(mktemp) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 0c627ea89ff7b2..7fa2d97ca9b2dd 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -21,7 +21,7 @@ #include #include -#include "local_config.h" +#include "local_config.h_gen" #ifdef LOCAL_CONFIG_HAVE_LIBURING #include #endif /* LOCAL_CONFIG_HAVE_LIBURING */ diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index c03b4f8910c0e7..510de93be6814f 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -21,7 +21,7 @@ #include #include -#include "local_config.h" +#include "local_config.h_gen" #ifdef LOCAL_CONFIG_HAVE_LIBURING #include #endif /* LOCAL_CONFIG_HAVE_LIBURING */ From f6d9132b90b69f96e696359234e80d65b2156731 Mon Sep 17 00:00:00 2001 From: Warren Xiong Date: Tue, 4 Aug 2026 20:16:58 +0800 Subject: [PATCH 096/250] selftests/mm: read memory information without popen read_memory_info() invokes two shell pipelines to obtain MemFree and Hugepagesize from /proc/meminfo. It does not check whether popen() returns NULL before passing the result to fgets(), and it does not call pclose() when fgets() fails. Open /proc/meminfo directly and obtain both values in a single pass. This removes the unchecked NULL path, closes the file on all paths, and avoids dependencies on external commands. The compaction test continues to pass after this change. Link: https://lore.kernel.org/1785845818-3131-1-git-send-email-warren.xiong@ugreen.com Signed-off-by: Warren Xiong Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/compaction_test.c | 38 +++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 5b582588e015d4..30d4ace7155ae9 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -29,30 +29,34 @@ struct map_list { int read_memory_info(unsigned long *memfree, unsigned long *hugepagesize) { - char buffer[256] = {0}; - char *cmd = "cat /proc/meminfo | grep -i memfree | grep -o '[0-9]*'"; - FILE *cmdfile = popen(cmd, "r"); + char buffer[256]; + int found = 0; + FILE *file; + int ret = -1; - if (!(fgets(buffer, sizeof(buffer), cmdfile))) { - ksft_print_msg("Failed to read meminfo: %s\n", strerror(errno)); + file = fopen("/proc/meminfo", "r"); + if (!file) { + ksft_print_msg("Failed to open /proc/meminfo: %s\n", + strerror(errno)); return -1; } - pclose(cmdfile); - - *memfree = atoll(buffer); - cmd = "cat /proc/meminfo | grep -i hugepagesize | grep -o '[0-9]*'"; - cmdfile = popen(cmd, "r"); - - if (!(fgets(buffer, sizeof(buffer), cmdfile))) { - ksft_print_msg("Failed to read meminfo: %s\n", strerror(errno)); - return -1; + while (fgets(buffer, sizeof(buffer), file) && found != 2) { + if (sscanf(buffer, "MemFree: %lu kB", memfree) == 1 || + sscanf(buffer, "Hugepagesize: %lu kB", hugepagesize) == 1) + found++; } - pclose(cmdfile); - *hugepagesize = atoll(buffer); + if (ferror(file)) + ksft_print_msg("Failed to read /proc/meminfo: %s\n", + strerror(errno)); + else if (found != 2) + ksft_print_msg("Failed to parse /proc/meminfo\n"); + else + ret = 0; - return 0; + fclose(file); + return ret; } int prereq(void) From 174e1f6ed4bf134ce80100d55675d2291a585462 Mon Sep 17 00:00:00 2001 From: Pratyush Mallick Date: Mon, 3 Aug 2026 22:17:32 +0000 Subject: [PATCH 097/250] selftests/mm: use pattern matching in .gitignore The current .gitignore hardcodes each generated test binary by name, requiring updates every time a new test is added. Switch to the pattern-matching approach similar to KVM:selftests. Ignore everything by default and then allow source extensions (.c, .h, .sh) and tracked non-source files. Note that local_config.h was renamed to local_config.h_gen in a previous patch so that un-ignoring *.h files does not cause generated build artifacts to become untracked. [akpm@linux-foundation.org: fix botched merge resolution] Link: https://lore.kernel.org/20260803221732.3651981-3-pratmal@google.com Signed-off-by: Pratyush Mallick Reviewed-by: Lorenzo Stoakes Acked-by: Mike Rapoport (Microsoft) Suggested-by: Yosry Ahmed Reviewed-by: SJ Park Acked-by: David Hildenbrand (Arm) Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Liam R. Howlett" Cc: Michal Hocko Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/.gitignore | 76 ++++----------------------- 1 file changed, 9 insertions(+), 67 deletions(-) diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index 9ccd9e1447e66b..fcd892ed21e32c 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -1,68 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only -cow -hugepage-mmap -hugepage-mremap -hugepage-shm -hugepage-vmemmap -hugetlb-mmap -hugetlb-mremap -hugetlb-shm -hugetlb-vmemmap -hugetlb-madvise -hugetlb-read-hwpoison -hugetlb-soft-offline -khugepaged -map_hugetlb -map_populate -thuge-gen -compaction_test -memory-failure -migration -mlock2-tests -mrelease_test -mremap_dontunmap -mremap_test -on-fault-limit -transhuge-stress -pagemap_ioctl -pfnmap -process_madv -*.tmp* -protection_keys -protection_keys_32 -protection_keys_64 -madv_populate -uffd-stress -uffd-unit-tests -uffd-wp-mremap -mlock-intersect-test -mlock-random-test -virtual_address_range -gup_test -va_128TBswitch -map_fixed_noreplace -write_to_hugetlbfs -hmm-tests -memfd_secret -soft-dirty -split_huge_page_test -ksm_tests -local_config.h -local_config.mk -ksm_functional_tests -mdwe_test -gup_longterm -mkdirty -va_high_addr_switch -hugetlb_fault_after_madv -hugetlb_madv_vs_map -mseal_test -droppable -hugetlb_dio -pkey_sighandler_tests_32 -pkey_sighandler_tests_64 -guard-regions -merge -prctl_thp_disable -rmap -folio_split_race_test +* +!/**/ +!*.c +!*.h +!*.sh +!.gitignore +!Makefile +!config +!settings From 4c52da8764d1361ea86f1daf69f2e80a1dfb2efa Mon Sep 17 00:00:00 2001 From: Longlong Xia Date: Wed, 5 Aug 2026 21:27:34 +0800 Subject: [PATCH 098/250] mm/ksm: avoid missing ksmd wakeups in ksm_enter __ksm_enter() decides whether ksmd needs a wakeup by checking if the mm slot list is empty before inserting the new slot. The empty check is currently outside ksm_mmlist_lock. Another CPU can remove the last slot and let ksmd go back to sleep after the unlocked check, while this CPU inserts a new slot and skips the wakeup based on the stale result. Take ksm_mmlist_lock before checking the list so the empty-to-nonempty transition and the insertion are observed as one critical section. Link: https://lore.kernel.org/20260805132736.1063408-1-xialonglong2025@163.com Fixes: 6e15838425ac ("ksm: keep quiet while list empty") Signed-off-by: Longlong Xia Acked-by: David Hildenbrand (Arm) Reviewed-by: Andrew Morton Cc: Chengming Zhou Cc: Izik Eidus Cc: xu xin Signed-off-by: Andrew Morton --- mm/ksm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index b5854dc14a2ec1..14dd6a6e8e6d0f 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -3060,10 +3060,9 @@ int __ksm_enter(struct mm_struct *mm) slot = &mm_slot->slot; + spin_lock(&ksm_mmlist_lock); /* Check ksm_run too? Would need tighter locking */ needs_wakeup = list_empty(&ksm_mm_head.slot.mm_node); - - spin_lock(&ksm_mmlist_lock); mm_slot_insert(mm_slots_hash, mm, slot); /* * When KSM_RUN_MERGE (or KSM_RUN_STOP), From 34129be7237858abe0e46eb35f2da6692d7b1602 Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Wed, 5 Aug 2026 18:59:07 +0800 Subject: [PATCH 099/250] ksm: update comments and docs to reference folio->mapping The KSM code already stores and checks the stable node key via folio->mapping, but the comment in ksm_get_folio() and the reverse mapping documentation in ksm.rst still refer to page->mapping. This is a pure wording update to match the folio-based implementation. No functional change is intended. Link: https://lore.kernel.org/20260805105927.41987-1-hongfu.li@linux.dev Signed-off-by: Hongfu Li Acked-by: David Hildenbrand (Arm) Reviewed-by: Xu Xin Reviewed-by: Dongliang Mu Cc: Alex Shi Cc: Chengming Zhou Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yanteng Si Signed-off-by: Andrew Morton --- Documentation/mm/ksm.rst | 4 ++-- Documentation/translations/zh_CN/mm/ksm.rst | 4 ++-- mm/ksm.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Documentation/mm/ksm.rst b/Documentation/mm/ksm.rst index 2806e3e4a10e56..2b4f72f1f95343 100644 --- a/Documentation/mm/ksm.rst +++ b/Documentation/mm/ksm.rst @@ -24,13 +24,13 @@ tree. If a KSM page is shared between less than ``max_page_sharing`` VMAs, the node of the stable tree that represents such KSM page points to a -list of struct ksm_rmap_item and the ``page->mapping`` of the +list of struct ksm_rmap_item and the ``folio->mapping`` of the KSM page points to the stable tree node. When the sharing passes this threshold, KSM adds a second dimension to the stable tree. The tree node becomes a "chain" that links one or more "dups". Each "dup" keeps reverse mapping information for a KSM -page with ``page->mapping`` pointing to that "dup". +page with ``folio->mapping`` pointing to that "dup". Every "chain" and all "dups" linked into a "chain" enforce the invariant that they represent the same write protected memory content, diff --git a/Documentation/translations/zh_CN/mm/ksm.rst b/Documentation/translations/zh_CN/mm/ksm.rst index f0f458753d0cdb..822c7a2896716b 100644 --- a/Documentation/translations/zh_CN/mm/ksm.rst +++ b/Documentation/translations/zh_CN/mm/ksm.rst @@ -31,10 +31,10 @@ KSM维护着稳定树中的KSM页的逆映射信息。 当KSM页面的共享数小于 ``max_page_sharing`` 的虚拟内存区域(VMAs)时,则代表了 KSM页的稳定树其中的节点指向了一个ksm_rmap_item结构体类型的列表。同时,这个KSM页 -的 ``page->mapping`` 指向了该稳定树节点。 +的 ``folio->mapping`` 指向了该稳定树节点。 如果共享数超过了阈值,KSM将给稳定树添加第二个维度。稳定树就变成链接一个或多 -个稳定树"副本"的"链"。每个副本都保留KSM页的逆映射信息,其中 ``page->mapping`` +个稳定树"副本"的"链"。每个副本都保留KSM页的逆映射信息,其中 ``folio->mapping`` 指向该"副本"。 每个链以及链接到该链中的所有"副本"强制不变的是,它们代表了相同的写保护内存 diff --git a/mm/ksm.c b/mm/ksm.c index 14dd6a6e8e6d0f..49d48d1e099801 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -959,10 +959,9 @@ enum ksm_get_folio_flags { * seconds or even minutes: much too unresponsive. So instead we use a * "keyhole reference": access to the ksm page from the stable node peeps * out through its keyhole to see if that page still holds the right key, - * pointing back to this stable node. This relies on freeing a PageAnon - * page to reset its page->mapping to NULL, and relies on no other use of - * a page to put something that might look like our key in page->mapping. - * is on its way to being freed; but it is an anomaly to bear in mind. + * pointing back to this stable node. This relies on freeing an anon + * folio to reset its mapping to NULL, and relies on no other use of a + * folio to put something that might look like our key in its mapping. */ static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node, enum ksm_get_folio_flags flags) From bcb2c12a955f678e69d7968f7fb9946e0687c5ad Mon Sep 17 00:00:00 2001 From: "Uladzislau Rezki (Sony)" Date: Sun, 2 Aug 2026 12:46:27 +0200 Subject: [PATCH 100/250] mm/vmalloc: do not warn on -ENOMEM from va_alloc() Since vmalloc() accepts non-blocking GFP flags, allocation requests may fail when callers pass restrictive GFP masks. va_clip() may return -ENOMEM when its GFP_NOWAIT fallback allocation fails during NE_FIT_TYPE splitting. This is an expected failure, so va_alloc() should return the error without triggering a kernel splat. Link: https://lore.kernel.org/20260802104627.63892-1-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Reported-by: syzbot+61c997e6be1d9bb300ba@syzkaller.appspotmail.com Closes: https://lore.kernel.org/6a6d3cbd.6ce73036.24301b.000e.GAE@google.com Reviewed-by: Anshuman Khandual Reviewed-by: Baoquan He Signed-off-by: Andrew Morton --- mm/vmalloc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 72d7f0d81c053e..bea9f76ed7e742 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1840,8 +1840,10 @@ va_alloc(struct vmap_area *va, /* Update the free vmap_area. */ ret = va_clip(root, head, va, nva_start_addr, size); - if (WARN_ON_ONCE(ret)) + if (ret) { + WARN_ON_ONCE(ret != -ENOMEM); return ret; + } return nva_start_addr; } @@ -1914,12 +1916,9 @@ preload_this_cpu_lock(spinlock_t *lock, gfp_t gfp_mask, int node) /* * Preload this CPU with one extra vmap_area object. It is used - * when fit type of free area is NE_FIT_TYPE. It guarantees that - * a CPU that does an allocation is preloaded. - * - * We do it in non-atomic context, thus it allows us to use more - * permissive allocation masks to be more stable under low memory - * condition and high memory pressure. + * when fit type of free area is NE_FIT_TYPE. It is best effort + * pre-loading. If it fails va_clip() may return -ENOMEM from its + * GFP_NOWAIT fallback. */ if (!this_cpu_read(ne_fit_preload_node)) va = kmem_cache_alloc_node(vmap_area_cachep, gfp_mask, node); From f2559f188bb7ed5b1e8c08277d49388f75c8e5f0 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Tue, 4 Aug 2026 11:08:59 +0100 Subject: [PATCH 101/250] mm: add some missing includes to mm-local headers There are a number of internal headers local to mm/ which reference functions and data types without including the relevant headers. mm/vma.h is a special case that intentionally does not include additional headers, but the others are not. This breaks tooling like clangd (which is where I noticed this), though the build is OK due to the C files including the headers happening to include required dependencies. It's better to be explicit about dependencies anyway, so add the missing includes and fix clangd as a bonus. Link: https://lore.kernel.org/20260804-fix-some-local-headers-v1-1-a7beb173c116@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: Vlastimil Babka (SUSE) Acked-by: David Hildenbrand (Arm) Acked-by: Zi Yan Reviewed-by: Barry Song Reviewed-by: Baoquan He Cc: Chris Li Cc: Johannes Weiner Cc: Kairui Song Cc: Kemeng Shi Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Nhat Pham Cc: Oscar Salvador Cc: Roman Gushchin Cc: Shakeel Butt Cc: Suren Baghdasaryan Cc: "Uladzislau Rezki (Sony)" Signed-off-by: Andrew Morton --- mm/cma.h | 1 + mm/hugetlb_cma.h | 2 ++ mm/memcontrol-v1.h | 1 + mm/pgalloc-track.h | 3 +++ mm/shuffle.h | 2 ++ mm/swap.h | 1 + mm/vmalloc.h | 2 ++ 7 files changed, 12 insertions(+) diff --git a/mm/cma.h b/mm/cma.h index c70180c36559c2..ab6d39898ea52e 100644 --- a/mm/cma.h +++ b/mm/cma.h @@ -2,6 +2,7 @@ #ifndef __MM_CMA_H__ #define __MM_CMA_H__ +#include #include #include diff --git a/mm/hugetlb_cma.h b/mm/hugetlb_cma.h index 3aa483573d170a..730b2b4965b649 100644 --- a/mm/hugetlb_cma.h +++ b/mm/hugetlb_cma.h @@ -2,6 +2,8 @@ #ifndef _LINUX_HUGETLB_CMA_H #define _LINUX_HUGETLB_CMA_H +#include + #ifdef CONFIG_CMA void hugetlb_cma_free_frozen_folio(struct folio *folio); struct folio *hugetlb_cma_alloc_frozen_folio(int order, gfp_t gfp_mask, diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 0f703f239c80f7..1e394269c613d8 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -4,6 +4,7 @@ #define __MM_MEMCONTROL_V1_H #include +#include /* Cgroup v1 and v2 common declarations */ diff --git a/mm/pgalloc-track.h b/mm/pgalloc-track.h index e9e879de8649bb..1a6de1358a21fa 100644 --- a/mm/pgalloc-track.h +++ b/mm/pgalloc-track.h @@ -2,6 +2,9 @@ #ifndef _LINUX_PGALLOC_TRACK_H #define _LINUX_PGALLOC_TRACK_H +#include +#include + #if defined(CONFIG_MMU) static inline p4d_t *p4d_alloc_track(struct mm_struct *mm, pgd_t *pgd, unsigned long address, diff --git a/mm/shuffle.h b/mm/shuffle.h index 61bbcddeeee673..11bec7521ab897 100644 --- a/mm/shuffle.h +++ b/mm/shuffle.h @@ -2,7 +2,9 @@ // Copyright(c) 2018 Intel Corporation. All rights reserved. #ifndef _MM_SHUFFLE_H #define _MM_SHUFFLE_H + #include +#include #define SHUFFLE_ORDER MAX_PAGE_ORDER diff --git a/mm/swap.h b/mm/swap.h index 2ccf8cf7f6c1c4..4e4c291bbfdecd 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -5,6 +5,7 @@ #include /* for atomic_long_t */ #include /* for PAGE_SHIFT */ #include /* for mem_cgroup_swappiness() */ +#include /* for MAX_SWAPFILES_SHIFT, struct swap_info_struct */ struct mempolicy; struct swap_iocb; diff --git a/mm/vmalloc.h b/mm/vmalloc.h index dcfe30eaa80c1a..8866ddcff6681b 100644 --- a/mm/vmalloc.h +++ b/mm/vmalloc.h @@ -5,6 +5,8 @@ #ifndef __MM_VMALLOC_H #define __MM_VMALLOC_H +#include + #ifdef CONFIG_MMU void __init vmalloc_init(void); int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end, From a603c34cb1113fc6fcffd6cdb496b978f2b4c9e9 Mon Sep 17 00:00:00 2001 From: Sang-Heon Jeon Date: Wed, 5 Aug 2026 00:11:41 +0900 Subject: [PATCH 102/250] mm/Kconfig: make FLATMEM depend on !NUMA Patch series "mm/page_ext: remove pgdat_page_ext_init()", v2. pgdat_page_ext_init() has no effect on FLATMEM. The pgdat is always the zero-initialized contig_page_data, because no architecture supports FLATMEM + NUMA. That constraint is only implicit in the arch Kconfig files. So patch 1 makes it explicit in mm/Kconfig, and patch 2 removes pgdat_page_ext_init(). No functional change. This patch (of 2): FLATMEM + NUMA is not supported by any architecture and fails to build. The constraint is only implicit in the arch Kconfig files. So make it explicit in mm/Kconfig. No functional change. Link: https://lore.kernel.org/20260804151145.3419768-1-ekffu200098@gmail.com Link: https://lore.kernel.org/20260804151145.3419768-2-ekffu200098@gmail.com Signed-off-by: Sang-Heon Jeon Suggested-by: Zi Yan Acked-by: Zi Yan Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Cc: Johannes Weiner Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 060190e12bced3..331daf7fcfab5a 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -390,6 +390,7 @@ choice config FLATMEM_MANUAL bool "Flat Memory" + depends on !NUMA depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE help This option is best suited for non-NUMA systems with @@ -424,6 +425,7 @@ config SPARSEMEM config FLATMEM def_bool y + depends on !NUMA depends on !SPARSEMEM || FLATMEM_MANUAL # From 31aabe68e371b8d48cc8cf7b52c2ffd7306e4008 Mon Sep 17 00:00:00 2001 From: Sang-Heon Jeon Date: Wed, 5 Aug 2026 00:11:42 +0900 Subject: [PATCH 103/250] mm/page_ext: remove pgdat_page_ext_init() pgdat_page_ext_init() sets pgdat->node_page_ext to NULL only on FLATMEM. FLATMEM depends on !NUMA, so the pgdat is always the zero-initialized contig_page_data and the store has no effect. So remove the call site, the unused function and its declaration. No functional change. Link: https://lore.kernel.org/20260804151145.3419768-3-ekffu200098@gmail.com Signed-off-by: Sang-Heon Jeon Acked-by: Zi Yan Acked-by: David Hildenbrand (Arm) Cc: Johannes Weiner Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- include/linux/page_ext.h | 5 ----- mm/mm_init.c | 1 - mm/page_ext.c | 9 --------- 3 files changed, 15 deletions(-) diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index f23d4b218da079..79c53ec45dfa76 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h @@ -55,7 +55,6 @@ struct page_ext { extern bool early_page_ext; extern unsigned long page_ext_size; -extern void pgdat_page_ext_init(struct pglist_data *pgdat); static inline bool early_page_ext_enabled(void) { @@ -202,10 +201,6 @@ static inline bool early_page_ext_enabled(void) return false; } -static inline void pgdat_page_ext_init(struct pglist_data *pgdat) -{ -} - static inline void page_ext_init(void) { } diff --git a/mm/mm_init.c b/mm/mm_init.c index 711f821f7b3c72..e9c4204b73adbe 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1394,7 +1394,6 @@ static void __meminit pgdat_init_internals(struct pglist_data *pgdat) for (i = 0; i < NR_VMSCAN_THROTTLE; i++) init_waitqueue_head(&pgdat->reclaim_wait[i]); - pgdat_page_ext_init(pgdat); lruvec_init(&pgdat->__lruvec); } diff --git a/mm/page_ext.c b/mm/page_ext.c index e2e92bd27ebdd0..b679a8c1f7d7e7 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -164,11 +164,6 @@ void __init page_ext_init_flatmem_late(void) invoke_init_callbacks(); } -void __meminit pgdat_page_ext_init(struct pglist_data *pgdat) -{ - pgdat->node_page_ext = NULL; -} - static struct page_ext *lookup_page_ext(const struct page *page) { unsigned long pfn = page_to_pfn(page); @@ -494,10 +489,6 @@ void __init page_ext_init(void) panic("Out of memory"); } -void __meminit pgdat_page_ext_init(struct pglist_data *pgdat) -{ -} - #endif /** From 7a897263eb831403fdbc3fdedcb7a8b6177d1796 Mon Sep 17 00:00:00 2001 From: Haoqin Huang Date: Tue, 4 Aug 2026 17:38:37 +0800 Subject: [PATCH 104/250] zram: do not release zstd global params from error paths Patch series "zram: fix zstd error paths and add parameter validation", v6, Patch 1 removes zstd_release_params() from both zstd_create() and zstd_setup_params() error paths -- the former is a layering violation in a per-CPU callback, the latter is redundant as zcomp_init() already calls release_params() on setup failure. Patch 2 rejects zero-size dictionaries and prints distinct error messages for sz < 0 (returns the original error code) and sz == 0 ("empty file"). Currently errors are silently swallowed. Patch 3 adds pr_fmt to each backend file so that pr_err() messages are auto-prefixed with the algorithm name. Patch 4 validates dict and level parameters in each backend's .setup_params(), rejecting unsupported combinations and out-of-range levels. Patch 5 resets per-priority params on algorithm change before init. This patch (of 5): zstd_setup_params() creates global cdict and ddict stored in params->drv_data, shared across all per-CPU contexts. The per-CPU zstd_create() error path called zstd_release_params(), which freed those globally-shared objects. This is a layering violation: a per-CPU callback should only clean up its own context, not release resources owned by the compression lifecycle. zstd_setup_params() called zstd_release_params() on its own error path as well, but zcomp_init() already calls release_params() when setup fails, so this is redundant. Remove zstd_release_params() from both error paths. Link: https://lore.kernel.org/20260804093841.67920-1-haoqinhuang7@gmail.com Link: https://lore.kernel.org/20260804093841.67920-2-haoqinhuang7@gmail.com Signed-off-by: Haoqin Huang Signed-off-by: Rongwei Wang Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: David Sterba Cc: Jens Axboe Cc: Minchan Kim Cc: Nick Terrell Signed-off-by: Andrew Morton --- drivers/block/zram/backend_zstd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index d00b548056dc2e..5fabc3e7e97506 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -85,7 +85,6 @@ static int zstd_setup_params(struct zcomp_params *params) return 0; error: - zstd_release_params(params); return -EINVAL; } @@ -161,7 +160,6 @@ static int zstd_create(struct zcomp_params *params, struct zcomp_ctx *ctx) return 0; error: - zstd_release_params(params); zstd_destroy(ctx); return -EINVAL; } From 0d9ec3df208e0d81887bb7d977a67b76aceb4796 Mon Sep 17 00:00:00 2001 From: Haoqin Huang Date: Tue, 4 Aug 2026 17:38:38 +0800 Subject: [PATCH 105/250] zram: reject zero-size dictionary kernel_read_file_from_path() already rejects empty files (i_size <= 0) and returns -EINVAL, but the current implementation only checks for sz < 0 without logging any information. Use sz == 0 to reject the zero-size case and print distinct error messages for each failure type. Link: https://lore.kernel.org/20260804093841.67920-3-haoqinhuang7@gmail.com Signed-off-by: Haoqin Huang Signed-off-by: Rongwei Wang Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: David Sterba Cc: Jens Axboe Cc: Minchan Kim Cc: Nick Terrell Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index cfa98846ac484b..f73e30b6106739 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1700,8 +1700,16 @@ static int comp_params_store(struct zram *zram, u32 prio, s32 level, INT_MAX, NULL, READING_POLICY); - if (sz < 0) + if (sz < 0) { + pr_err("failed to load dictionary %s (err=%zd)\n", + dict_path, sz); + return sz; + } + if (sz == 0) { + pr_err("failed to load dictionary %s (empty file)\n", + dict_path); return -EINVAL; + } } zram->params[prio].dict_sz = sz; From 19048ab5bba6a389f6fef9d33ea68fa97ff4e293 Mon Sep 17 00:00:00 2001 From: Haoqin Huang Date: Tue, 4 Aug 2026 17:38:39 +0800 Subject: [PATCH 106/250] zram: add pr_fmt to backend files Add pr_fmt to each backend so that pr_err() messages are auto-prefixed with the algorithm name. While at it, tweak the deflate winbits pr_err to avoid a duplicated "deflate" prefix. Link: https://lore.kernel.org/20260804093841.67920-4-haoqinhuang7@gmail.com Signed-off-by: Haoqin Huang Signed-off-by: Rongwei Wang Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: David Sterba Cc: Jens Axboe Cc: Minchan Kim Cc: Nick Terrell Signed-off-by: Andrew Morton --- drivers/block/zram/backend_842.c | 2 ++ drivers/block/zram/backend_deflate.c | 4 +++- drivers/block/zram/backend_lz4.c | 4 ++++ drivers/block/zram/backend_lz4hc.c | 4 ++++ drivers/block/zram/backend_lzo.c | 2 ++ drivers/block/zram/backend_lzorle.c | 2 ++ drivers/block/zram/backend_zstd.c | 2 ++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/backend_842.c b/drivers/block/zram/backend_842.c index 10d9d5c60f5313..d9b8a6bba2cb86 100644 --- a/drivers/block/zram/backend_842.c +++ b/drivers/block/zram/backend_842.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#define pr_fmt(fmt) "842: " fmt + #include #include #include diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index b3f7d08b49d934..ee26e6c9282f78 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#define pr_fmt(fmt) "deflate: " fmt + #include #include #include @@ -30,7 +32,7 @@ static int deflate_setup_params(struct zcomp_params *params) s32 wb = params->deflate.winbits; if ((wb < -15 || wb > -9) && (wb < 9 || wb > 15)) { - pr_err("invalid deflate winbits: %d\n", wb); + pr_err("invalid winbits %d\n", wb); return -EINVAL; } } diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c index c449d511ba86fe..6d58956ed5b206 100644 --- a/drivers/block/zram/backend_lz4.c +++ b/drivers/block/zram/backend_lz4.c @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#define pr_fmt(fmt) "lz4: " fmt + #include #include #include diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c index f6a336acfe202e..c0c3715087c826 100644 --- a/drivers/block/zram/backend_lz4hc.c +++ b/drivers/block/zram/backend_lz4hc.c @@ -1,3 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#define pr_fmt(fmt) "lz4hc: " fmt + #include #include #include diff --git a/drivers/block/zram/backend_lzo.c b/drivers/block/zram/backend_lzo.c index 4c906beaae6b33..84330dea6af591 100644 --- a/drivers/block/zram/backend_lzo.c +++ b/drivers/block/zram/backend_lzo.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#define pr_fmt(fmt) "lzo: " fmt + #include #include #include diff --git a/drivers/block/zram/backend_lzorle.c b/drivers/block/zram/backend_lzorle.c index 10640c96cbfcaa..b3b03a008b64f4 100644 --- a/drivers/block/zram/backend_lzorle.c +++ b/drivers/block/zram/backend_lzorle.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#define pr_fmt(fmt) "lzo-rle: " fmt + #include #include #include diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index 5fabc3e7e97506..fb61acdaef67e2 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later +#define pr_fmt(fmt) "zstd: " fmt + #include #include #include From ede71b04692fc28a0a44768061f31f6f23c4e787 Mon Sep 17 00:00:00 2001 From: Haoqin Huang Date: Tue, 4 Aug 2026 17:38:40 +0800 Subject: [PATCH 107/250] zram: validate parameters in each backend's setup_params Dict and level parameters are silently accepted even for backends that do not support them. Validate these parameters in each backend's .setup_params() to reject unsupported combinations and out-of-range levels with a specific error message. Link: https://lore.kernel.org/20260804093841.67920-5-haoqinhuang7@gmail.com Signed-off-by: Haoqin Huang Signed-off-by: Rongwei Wang Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: David Sterba Cc: Jens Axboe Cc: Minchan Kim Cc: Nick Terrell Signed-off-by: Andrew Morton --- drivers/block/zram/backend_842.c | 8 ++++++++ drivers/block/zram/backend_deflate.c | 13 ++++++++++++- drivers/block/zram/backend_lz4.c | 6 +++++- drivers/block/zram/backend_lz4hc.c | 12 +++++++++++- drivers/block/zram/backend_lzo.c | 8 ++++++++ drivers/block/zram/backend_lzorle.c | 8 ++++++++ drivers/block/zram/backend_zstd.c | 7 ++++++- 7 files changed, 58 insertions(+), 4 deletions(-) diff --git a/drivers/block/zram/backend_842.c b/drivers/block/zram/backend_842.c index d9b8a6bba2cb86..3846a04c69d71b 100644 --- a/drivers/block/zram/backend_842.c +++ b/drivers/block/zram/backend_842.c @@ -15,6 +15,14 @@ static void release_params_842(struct zcomp_params *params) static int setup_params_842(struct zcomp_params *params) { + if (params->dict_sz) { + pr_err("dictionary is not supported\n"); + return -EOPNOTSUPP; + } + if (params->level != ZCOMP_PARAM_NOT_SET) { + pr_err("compression level is not supported\n"); + return -EOPNOTSUPP; + } return 0; } diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index ee26e6c9282f78..f71b11bcac788c 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -24,8 +24,19 @@ static void deflate_release_params(struct zcomp_params *params) static int deflate_setup_params(struct zcomp_params *params) { - if (params->level == ZCOMP_PARAM_NOT_SET) + if (params->dict_sz) { + pr_err("dictionary is not supported\n"); + return -EOPNOTSUPP; + } + + if (params->level == ZCOMP_PARAM_NOT_SET) { params->level = Z_DEFAULT_COMPRESSION; + } else if (params->level < Z_DEFAULT_COMPRESSION || + params->level > Z_BEST_COMPRESSION) { + pr_err("invalid compression level %d\n", params->level); + return -EINVAL; + } + if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET) { params->deflate.winbits = DEFLATE_DEF_WINBITS; } else { diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c index 6d58956ed5b206..1e28104ad9641a 100644 --- a/drivers/block/zram/backend_lz4.c +++ b/drivers/block/zram/backend_lz4.c @@ -32,8 +32,12 @@ static int lz4_setup_params(struct zcomp_params *params) LZ4_stream_t *dict_stream; int ret; - if (params->level == ZCOMP_PARAM_NOT_SET) + if (params->level == ZCOMP_PARAM_NOT_SET) { params->level = LZ4_ACCELERATION_DEFAULT; + } else if (params->level < LZ4_ACCELERATION_DEFAULT) { + pr_err("invalid compression level %d\n", params->level); + return -EINVAL; + } if (!params->dict || !params->dict_sz) return 0; diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c index c0c3715087c826..d8aa01bb258fec 100644 --- a/drivers/block/zram/backend_lz4hc.c +++ b/drivers/block/zram/backend_lz4hc.c @@ -22,8 +22,18 @@ static void lz4hc_release_params(struct zcomp_params *params) static int lz4hc_setup_params(struct zcomp_params *params) { - if (params->level == ZCOMP_PARAM_NOT_SET) + if (params->level == ZCOMP_PARAM_NOT_SET) { params->level = LZ4HC_DEFAULT_CLEVEL; + } else if (params->level < 1 || params->level > LZ4HC_MAX_CLEVEL) { + /* + * Use < 1 rather than < LZ4HC_MIN_CLEVEL here because + * LZ4HC_compress_generic() only clamps levels below 1 + * (levels 1 and 2 are valid). LZ4HC_MIN_CLEVEL (3) is + * advisory and not enforced by the library. + */ + pr_err("invalid compression level %d\n", params->level); + return -EINVAL; + } return 0; } diff --git a/drivers/block/zram/backend_lzo.c b/drivers/block/zram/backend_lzo.c index 84330dea6af591..d83f92cf757cf9 100644 --- a/drivers/block/zram/backend_lzo.c +++ b/drivers/block/zram/backend_lzo.c @@ -14,6 +14,14 @@ static void lzo_release_params(struct zcomp_params *params) static int lzo_setup_params(struct zcomp_params *params) { + if (params->dict_sz) { + pr_err("dictionary is not supported\n"); + return -EOPNOTSUPP; + } + if (params->level != ZCOMP_PARAM_NOT_SET) { + pr_err("compression level is not supported\n"); + return -EOPNOTSUPP; + } return 0; } diff --git a/drivers/block/zram/backend_lzorle.c b/drivers/block/zram/backend_lzorle.c index b3b03a008b64f4..1b120d062c9284 100644 --- a/drivers/block/zram/backend_lzorle.c +++ b/drivers/block/zram/backend_lzorle.c @@ -14,6 +14,14 @@ static void lzorle_release_params(struct zcomp_params *params) static int lzorle_setup_params(struct zcomp_params *params) { + if (params->dict_sz) { + pr_err("dictionary is not supported\n"); + return -EOPNOTSUPP; + } + if (params->level != ZCOMP_PARAM_NOT_SET) { + pr_err("compression level is not supported\n"); + return -EOPNOTSUPP; + } return 0; } diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index fb61acdaef67e2..08da3810cffd82 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -60,8 +60,13 @@ static int zstd_setup_params(struct zcomp_params *params) return -ENOMEM; params->drv_data = zp; - if (params->level == ZCOMP_PARAM_NOT_SET) + if (params->level == ZCOMP_PARAM_NOT_SET) { params->level = zstd_default_clevel(); + } else if (params->level < zstd_min_clevel() || + params->level > zstd_max_clevel()) { + pr_err("invalid compression level %d\n", params->level); + goto error; + } zp->cprm = zstd_get_params(params->level, PAGE_SIZE); From de8ee79c5aace8b56709b7242e857c7b9520de1b Mon Sep 17 00:00:00 2001 From: Haoqin Huang Date: Tue, 4 Aug 2026 17:38:41 +0800 Subject: [PATCH 108/250] zram: reset per-priority params when changing algorithm before init Parameters validated against one algorithm may be invalid for another (e.g. lz4 accepts level=65535 but zstd does not). Although algorithm changes are blocked after disksize is set, they are allowed before device initialization. Reset per-priority params on algorithm change so that stale parameters do not silently carry over. Link: https://lore.kernel.org/20260804093841.67920-6-haoqinhuang7@gmail.com Signed-off-by: Haoqin Huang Signed-off-by: Rongwei Wang Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: David Sterba Cc: Jens Axboe Cc: Minchan Kim Cc: Nick Terrell Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index f73e30b6106739..56183c827e1b33 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1652,6 +1652,17 @@ static void comp_algorithm_set(struct zram *zram, u32 prio, const char *alg) zram->comp_algs[prio] = alg; } +static void comp_params_reset(struct zram *zram, u32 prio) +{ + struct zcomp_params *params = &zram->params[prio]; + + vfree(params->dict); + params->level = ZCOMP_PARAM_NOT_SET; + params->deflate.winbits = ZCOMP_PARAM_NOT_SET; + params->dict_sz = 0; + params->dict = NULL; +} + static int __comp_algorithm_store(struct zram *zram, u32 prio, const char *buf) { const char *alg; @@ -1672,20 +1683,10 @@ static int __comp_algorithm_store(struct zram *zram, u32 prio, const char *buf) } comp_algorithm_set(zram, prio, alg); + comp_params_reset(zram, prio); return 0; } -static void comp_params_reset(struct zram *zram, u32 prio) -{ - struct zcomp_params *params = &zram->params[prio]; - - vfree(params->dict); - params->level = ZCOMP_PARAM_NOT_SET; - params->deflate.winbits = ZCOMP_PARAM_NOT_SET; - params->dict_sz = 0; - params->dict = NULL; -} - static int comp_params_store(struct zram *zram, u32 prio, s32 level, const char *dict_path, struct deflate_params *deflate_params) From 8846c6475004056a7bd8c8c209b944ac1e7d5960 Mon Sep 17 00:00:00 2001 From: Longlong Xia Date: Tue, 4 Aug 2026 14:59:18 +0800 Subject: [PATCH 109/250] zram: fix out-of-bounds access in writeback_store() Patch series "zram: fix stale scan bounds after reinitialization". Both writeback_store() and read_block_state() derive their table scan bounds from zram->disksize before acquiring dev_lock. If the device is reset and reinitialized with a smaller disksize between that read and lock acquisition, the bound can describe the old table while the scan operates on the new one. This can lead to out-of-bounds slot accesses. Move both bound calculations under dev_lock so each bound remains consistent with the table throughout its scan. Keep the fixes separate because the affected interfaces originate from different commits and can be backported independently. This patch (of 2): writeback_store() calculates the table scan bounds before taking dev_lock. A reset followed by reconfiguration with a smaller disksize can therefore replace zram->table while writeback_store() is waiting for the lock. Once it acquires the lock, it sees an initialized device but scans the new table using the old upper bound, resulting in an out-of-bounds access. Calculate the number of pages while holding dev_lock so the scan bound matches the table protected by the lock. Link: https://lore.kernel.org/20260804065919.3970386-1-xialonglong2025@163.com Link: https://lore.kernel.org/20260804065919.3970386-2-xialonglong2025@163.com Fixes: a939888ec38b ("zram: support idle/huge page writeback") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Longlong Xia Reviewed-by: Sergey Senozhatsky Cc: Jens Axboe Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 56183c827e1b33..2be5c20e3f14e6 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1235,8 +1235,8 @@ static ssize_t writeback_store(struct device *dev, const char *buf, size_t len) { struct zram *zram = dev_to_zram(dev); - u64 nr_pages = zram->disksize >> PAGE_SHIFT; - unsigned long lo = 0, hi = nr_pages; + u64 nr_pages; + unsigned long lo = 0, hi; struct zram_pp_ctl *pp_ctl = NULL; struct zram_wb_ctl *wb_ctl = NULL; char *args, *param, *val; @@ -1250,6 +1250,9 @@ static ssize_t writeback_store(struct device *dev, if (!zram->backing_dev) return -ENODEV; + nr_pages = zram->disksize >> PAGE_SHIFT; + hi = nr_pages; + pp_ctl = init_pp_ctl(); if (!pp_ctl) return -ENOMEM; From 538e387edc4885bb978333cd9ce5c17b3ca68b39 Mon Sep 17 00:00:00 2001 From: Longlong Xia Date: Tue, 4 Aug 2026 14:59:19 +0800 Subject: [PATCH 110/250] zram: fix out-of-bounds access in read_block_state() read_block_state() calculates nr_pages before taking dev_lock. If the device is reset and reinitialized with a smaller disksize before lock acquisition, nr_pages still describes the old table. The subsequent loop can then call slot_lock() past the end of the newly allocated table. Read disksize after acquiring dev_lock and checking that the device is initialized. The read lock then keeps the table and its bound stable for the duration of the scan. Link: https://lore.kernel.org/20260804065919.3970386-3-xialonglong2025@163.com Fixes: c0265342bff4 ("zram: introduce zram memory tracking") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Longlong Xia Reviewed-by: Sergey Senozhatsky Cc: Jens Axboe Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 2be5c20e3f14e6..82b78e6e55b24f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1543,7 +1543,7 @@ static ssize_t read_block_state(struct file *file, char __user *buf, char *kbuf; ssize_t index, written = 0; struct zram *zram = file->private_data; - unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; + unsigned long nr_pages; kbuf = kvmalloc(count, GFP_KERNEL); if (!kbuf) @@ -1555,6 +1555,8 @@ static ssize_t read_block_state(struct file *file, char __user *buf, return -EINVAL; } + nr_pages = zram->disksize >> PAGE_SHIFT; + for (index = *ppos; index < nr_pages; index++) { int copied; From 3b501a274533a1ef1195ac9b1a1cfb6903a78da3 Mon Sep 17 00:00:00 2001 From: Ye Liu Date: Wed, 5 Aug 2026 17:31:07 +0800 Subject: [PATCH 111/250] mm: debug_page_alloc: fix type mismatch for debug_guardpage_minorder The debug_guardpage_minorder local variable is declared as unsigned int, but debug_guardpage_minorder_setup() uses unsigned long and kstrtoul() to parse the value. Use kstrtouint() with unsigned int local variable to match the actual type of _debug_guardpage_minorder. Also fix the format specifier from %lu to %u accordingly. Link: https://lore.kernel.org/20260805093108.2352900-1-ye.liu@linux.dev Signed-off-by: Ye Liu Reviewed-by: Andrew Morton Cc: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/debug_page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/debug_page_alloc.c b/mm/debug_page_alloc.c index 6a26eca546c337..41e3d1f1ad9684 100644 --- a/mm/debug_page_alloc.c +++ b/mm/debug_page_alloc.c @@ -20,14 +20,14 @@ early_param("debug_pagealloc", early_debug_pagealloc); static int __init debug_guardpage_minorder_setup(char *buf) { - unsigned long res; + unsigned int res; - if (kstrtoul(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) { + if (kstrtouint(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) { pr_err("Bad debug_guardpage_minorder value: %s\n", buf); return 0; } _debug_guardpage_minorder = res; - pr_info("Setting debug_guardpage_minorder to %lu\n", res); + pr_info("Setting debug_guardpage_minorder to %u\n", res); return 0; } early_param("debug_guardpage_minorder", debug_guardpage_minorder_setup); From b862d14b309aa068fcba3c0162dd84a13849e4b2 Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 5 Aug 2026 17:29:52 +0000 Subject: [PATCH 112/250] alloc_tag: expose boot-time compression configuration Currently, userspace has limited visibility into the exact active runtime state of memory allocation profiling and its page extension compression ('sysctl.vm.mem_profiling={0|1|never}[,compressed]'). While reading the sysctl provides basic on/off status, it is currently impossible for userspace to natively determine whether page-tag compression was successfully enabled without scraping dmesg boot logs. Add a new read-only sysctl representing how compression was configured at boot time. Link: https://lore.kernel.org/c795f8089f82841e8a6e00d7ca286da2b23aeb7b.1785950530.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Acked-by: Suren Baghdasaryan Cc: Hao Ge Signed-off-by: Andrew Morton --- Documentation/mm/allocation-profiling.rst | 11 +++++++++++ mm/alloc_tag.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/Documentation/mm/allocation-profiling.rst b/Documentation/mm/allocation-profiling.rst index 5389d241176a8a..e928aa3e4e1eb7 100644 --- a/Documentation/mm/allocation-profiling.rst +++ b/Documentation/mm/allocation-profiling.rst @@ -43,6 +43,17 @@ sysctl: warnings produced by allocations made while profiling is disabled and freed when it's enabled. + /proc/sys/vm/mem_profiling_compressed + + 1: Page alloc tag compression is enabled. + + 0: Page alloc tag compression is disabled. + + This reflects a static boot-time configuration of how page allocation tags are + stored (in page flags when compression is enabled and in page_ext when disabled). + Toggling ``mem_profiling`` at runtime does not change the state of + ``mem_profiling_compressed``. + Runtime info: /proc/allocinfo diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c index e93e7fec1f066a..b60ee89704cce0 100644 --- a/mm/alloc_tag.c +++ b/mm/alloc_tag.c @@ -961,6 +961,12 @@ static const struct ctl_table memory_allocation_profiling_sysctls[] = { .mode = 0644, .proc_handler = proc_mem_profiling_handler, }, + { + .procname = "mem_profiling_compressed", + .data = &mem_profiling_compressed, + .mode = 0444, + .proc_handler = proc_do_static_key, + }, }; static void __init sysctl_init(void) From a2fcd759f470e530df5f128fd1b7465d26bf8198 Mon Sep 17 00:00:00 2001 From: Muchun Song Date: Wed, 5 Aug 2026 10:25:36 +0800 Subject: [PATCH 113/250] mm/sparse: keep mem_section_usage_size() internal mem_section_usage_size() is only needed by sparsemem implementation code after commit ae751d567baa ("mm/bootmem_info: stop marking mem_section_usage as MIX_SECTION_INFO"), so keeping the declaration in mmzone.h now exposes the helper to all mmzone.h users for no reason. Move the helper to sparse.h so sparse.c and sparse-vmemmap.c can share it through the internal header. While doing so, calculate the allocation size with struct_size_t(), which ties the expression to the pageblock_flags trailing array instead of open-coding the struct header plus bitmap size. Link: https://lore.kernel.org/20260805022536.1206575-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Mike Rapoport (Microsoft) Acked-by: David Hildenbrand (Arm) Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 1 - mm/sparse.c | 10 ---------- mm/sparse.h | 6 ++++++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 158c1fba239340..94f9c3ff541604 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -2069,7 +2069,6 @@ static inline struct mem_section *__nr_to_section(unsigned long nr) #endif return &mem_section[root][nr & SECTION_ROOT_MASK]; } -extern size_t mem_section_usage_size(void); /* * We use the lower bits of the mem_map pointer to store a little bit of diff --git a/mm/sparse.c b/mm/sparse.c index 67fa192d428999..7c15406e77f5d2 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -213,16 +213,6 @@ static void __init memblocks_present(void) memory_present(nid, start, end); } -static unsigned long usemap_size(void) -{ - return BITS_TO_LONGS(SECTION_BLOCKFLAGS_BITS) * sizeof(unsigned long); -} - -size_t mem_section_usage_size(void) -{ - return sizeof(struct mem_section_usage) + usemap_size(); -} - #ifdef CONFIG_SPARSEMEM_VMEMMAP unsigned long __init section_map_size(void) { diff --git a/mm/sparse.h b/mm/sparse.h index 95aa031213f226..3b744667a7e624 100644 --- a/mm/sparse.h +++ b/mm/sparse.h @@ -47,6 +47,12 @@ static inline void __section_mark_present(struct mem_section *ms, ms->section_mem_map |= SECTION_MARKED_PRESENT; } + +static inline size_t mem_section_usage_size(void) +{ + return struct_size_t(struct mem_section_usage, pageblock_flags, + BITS_TO_LONGS(SECTION_BLOCKFLAGS_BITS)); +} #else static inline void sparse_init(void) {} #endif /* CONFIG_SPARSEMEM */ From 53517ac8c94317e5ac898ed20014a1fd53d7aae4 Mon Sep 17 00:00:00 2001 From: Ye Liu Date: Wed, 5 Aug 2026 10:15:55 +0800 Subject: [PATCH 114/250] mm/show_mem: fix format string inconsistencies and type mismatches Fix five format string issues in show_free_areas() and __show_mem(): 1-2. reserved_highatomic and free_highatomic: %luKB -> %lukB The uppercase "KB" is inconsistent with all other fields in the same output block and with /proc/meminfo convention. 3. local_pcp: %ukB -> %lukB with explicit (unsigned long) cast per_cpu_pages.count is int, so K(count) yields int. Using %u was a signed/unsigned mismatch. Cast to unsigned long and use %lu for consistency with all other K() usages in the file. 4. total pagecache pages: %ld -> %lu global_node_page_state() returns unsigned long. Using %ld is a signedness mismatch caught by gcc -Wformat-signedness. 5. hwpoisoned pages: %lu -> %ld atomic_long_read() returns long (signed). Using %lu is a signedness mismatch caught by gcc -Wformat-signedness. Verified with: make KCFLAGS="-Wformat -Wformat-signedness" mm/show_mem.o Link: https://lore.kernel.org/20260805021556.1908807-1-ye.liu@linux.dev Signed-off-by: Ye Liu Acked-by: Vlastimil Babka (SUSE) Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/show_mem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/show_mem.c b/mm/show_mem.c index d1288b4c2b6401..b938cbcd774a1e 100644 --- a/mm/show_mem.c +++ b/mm/show_mem.c @@ -309,8 +309,8 @@ static void show_free_areas(unsigned int filter, const nodemask_t *nodemask, " min:%lukB" " low:%lukB" " high:%lukB" - " reserved_highatomic:%luKB" - " free_highatomic:%luKB" + " reserved_highatomic:%lukB" + " free_highatomic:%lukB" " active_anon:%lukB" " inactive_anon:%lukB" " active_file:%lukB" @@ -323,7 +323,7 @@ static void show_free_areas(unsigned int filter, const nodemask_t *nodemask, " mlocked:%lukB" " bounce:%lukB" " free_pcp:%lukB" - " local_pcp:%ukB" + " local_pcp:%lukB" " free_cma:%lukB" "\n", zone->name, @@ -350,7 +350,7 @@ static void show_free_areas(unsigned int filter, const nodemask_t *nodemask, K(zone_page_state(zone, NR_MLOCK)), 0UL, K(free_pcp), - K(this_cpu_read(zone->per_cpu_pageset->count)), + K((unsigned long)this_cpu_read(zone->per_cpu_pageset->count)), K(zone_page_state(zone, NR_FREE_CMA_PAGES))); printk("lowmem_reserve[]:"); for (i = 0; i < MAX_NR_ZONES; i++) @@ -400,7 +400,7 @@ static void show_free_areas(unsigned int filter, const nodemask_t *nodemask, hugetlb_show_meminfo_node(nid); } - printk("%ld total pagecache pages\n", global_node_page_state(NR_FILE_PAGES)); + printk("%lu total pagecache pages\n", global_node_page_state(NR_FILE_PAGES)); show_swap_cache_info(); } @@ -430,7 +430,7 @@ void __show_mem(unsigned int filter, const nodemask_t *nodemask, printk("%lu pages cma reserved\n", totalcma_pages); #endif #ifdef CONFIG_MEMORY_FAILURE - printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages)); + printk("%ld pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages)); #endif #ifdef CONFIG_MEM_ALLOC_PROFILING static DEFINE_SPINLOCK(mem_alloc_profiling_spinlock); From 124d84a94d62d1bc7e1314a685f4d6386d2d456a Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Thu, 6 Aug 2026 12:16:32 +0900 Subject: [PATCH 115/250] zram: switch to unsigned long indexing zram has always used "unsigned int" for (page) index calculations, which unnecessarily limited max zram disksize. Switch to "unsigned long" and permit much larger zram devices. Link: https://lore.kernel.org/20260806031640.536615-1-senozhatsky@chromium.org Suggested-by: Andrew Morton Co-developed-by: Longlong Xia Signed-off-by: Sergey Senozhatsky Cc: Minchan Kim Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 137 +++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 60 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 82b78e6e55b24f..d09fdca49cbda8 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -56,7 +56,7 @@ static size_t huge_class_size; static const struct block_device_operations zram_devops; -static void slot_free(struct zram *zram, u32 index); +static void slot_free(struct zram *zram, unsigned long index); /* * entry locking rules: @@ -70,7 +70,7 @@ static void slot_free(struct zram *zram, u32 index); * 4) Use TRY lock variant when in atomic context * - must check return value and handle locking failers */ -static __must_check bool slot_trylock(struct zram *zram, u32 index) +static __must_check bool slot_trylock(struct zram *zram, unsigned long index) { unsigned long *lock = &zram->table[index].__lock; @@ -83,7 +83,7 @@ static __must_check bool slot_trylock(struct zram *zram, u32 index) return false; } -static void slot_lock(struct zram *zram, u32 index) +static void slot_lock(struct zram *zram, unsigned long index) { unsigned long *lock = &zram->table[index].__lock; @@ -92,7 +92,7 @@ static void slot_lock(struct zram *zram, u32 index) lock_acquired(&zram->table_lock_map, _RET_IP_); } -static void slot_unlock(struct zram *zram, u32 index) +static void slot_unlock(struct zram *zram, unsigned long index) { unsigned long *lock = &zram->table[index].__lock; @@ -110,55 +110,56 @@ static inline struct zram *dev_to_zram(struct device *dev) return (struct zram *)dev_to_disk(dev)->private_data; } -static unsigned long get_slot_handle(struct zram *zram, u32 index) +static unsigned long get_slot_handle(struct zram *zram, unsigned long index) { return zram->table[index].handle; } -static void set_slot_handle(struct zram *zram, u32 index, unsigned long handle) +static void set_slot_handle(struct zram *zram, unsigned long index, + unsigned long handle) { zram->table[index].handle = handle; } -static bool test_slot_flag(struct zram *zram, u32 index, +static bool test_slot_flag(struct zram *zram, unsigned long index, enum zram_pageflags flag) { return zram->table[index].attr.flags & BIT(flag); } -static void set_slot_flag(struct zram *zram, u32 index, +static void set_slot_flag(struct zram *zram, unsigned long index, enum zram_pageflags flag) { zram->table[index].attr.flags |= BIT(flag); } -static void clear_slot_flag(struct zram *zram, u32 index, +static void clear_slot_flag(struct zram *zram, unsigned long index, enum zram_pageflags flag) { zram->table[index].attr.flags &= ~BIT(flag); } -static size_t get_slot_size(struct zram *zram, u32 index) +static size_t get_slot_size(struct zram *zram, unsigned long index) { return zram->table[index].attr.flags & (BIT(ZRAM_FLAG_SHIFT) - 1); } -static void set_slot_size(struct zram *zram, u32 index, size_t size) +static void set_slot_size(struct zram *zram, unsigned long index, size_t size) { unsigned long flags = zram->table[index].attr.flags >> ZRAM_FLAG_SHIFT; zram->table[index].attr.flags = (flags << ZRAM_FLAG_SHIFT) | size; } -static inline bool slot_allocated(struct zram *zram, u32 index) +static inline bool slot_allocated(struct zram *zram, unsigned long index) { return get_slot_size(zram, index) || test_slot_flag(zram, index, ZRAM_SAME) || test_slot_flag(zram, index, ZRAM_WB); } -static inline void set_slot_comp_priority(struct zram *zram, u32 index, - u32 prio) +static inline void set_slot_comp_priority(struct zram *zram, + unsigned long index, u32 prio) { prio &= ZRAM_COMP_PRIORITY_MASK; /* @@ -170,14 +171,14 @@ static inline void set_slot_comp_priority(struct zram *zram, u32 index, zram->table[index].attr.flags |= (prio << ZRAM_COMP_PRIORITY_BIT1); } -static inline u32 get_slot_comp_priority(struct zram *zram, u32 index) +static inline u32 get_slot_comp_priority(struct zram *zram, unsigned long index) { u32 prio = zram->table[index].attr.flags >> ZRAM_COMP_PRIORITY_BIT1; return prio & ZRAM_COMP_PRIORITY_MASK; } -static void mark_slot_accessed(struct zram *zram, u32 index) +static void mark_slot_accessed(struct zram *zram, unsigned long index) { clear_slot_flag(zram, index, ZRAM_IDLE); clear_slot_flag(zram, index, ZRAM_PP_SLOT); @@ -284,7 +285,7 @@ static void release_pp_ctl(struct zram *zram, struct zram_pp_ctl *ctl) } static bool place_pp_slot(struct zram *zram, struct zram_pp_ctl *ctl, - u32 index) + unsigned long index) { struct zram_pp_slot *pps; u32 bid; @@ -418,7 +419,7 @@ static void mark_idle(struct zram *zram, ktime_t cutoff) { int is_idle = 1; unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; - int index; + unsigned long index; for (index = 0; index < nr_pages; index++) { /* @@ -485,8 +486,9 @@ static ssize_t idle_store(struct device *dev, struct device_attribute *attr, #define INVALID_BDEV_BLOCK (~0UL) static int read_from_zspool_raw(struct zram *zram, struct page *page, - u32 index); -static int read_from_zspool(struct zram *zram, struct page *page, u32 index); + unsigned long index); +static int read_from_zspool(struct zram *zram, struct page *page, + unsigned long index); struct zram_wb_ctl { /* idle list is accessed only by the writeback task, no concurency */ @@ -522,7 +524,7 @@ struct zram_rb_req { /* error status (sync read) */ int error; }; - u32 index; + unsigned long index; }; #define FOUR_K(x) ((x) * (1 << (PAGE_SHIFT - 12))) @@ -910,7 +912,7 @@ static void zram_account_writeback_submit(struct zram *zram) static int zram_writeback_complete(struct zram *zram, struct zram_wb_req *req) { - u32 index = req->pps->index; + unsigned long index = req->pps->index; int err; err = blk_status_to_errno(req->bio.bi_status); @@ -1032,7 +1034,7 @@ static int zram_writeback_slots(struct zram *zram, struct zram_wb_req *req = NULL; struct zram_pp_slot *pps; int ret = 0, err = 0; - u32 index = 0; + unsigned long index = 0; while ((pps = select_pp_slot(ctl))) { if (zram->wb_limit_enable && !zram->bd_wb_limit) { @@ -1198,7 +1200,7 @@ static void scan_slots_for_writeback(struct zram *zram, u32 mode, unsigned long lo, unsigned long hi, struct zram_pp_ctl *ctl) { - u32 index = lo; + unsigned long index = lo; while (index < hi) { bool ok = true; @@ -1235,7 +1237,7 @@ static ssize_t writeback_store(struct device *dev, const char *buf, size_t len) { struct zram *zram = dev_to_zram(dev); - u64 nr_pages; + unsigned long nr_pages; unsigned long lo = 0, hi; struct zram_pp_ctl *pp_ctl = NULL; struct zram_wb_ctl *wb_ctl = NULL; @@ -1336,7 +1338,8 @@ static ssize_t writeback_store(struct device *dev, return ret; } -static int decompress_bdev_page(struct zram *zram, struct page *page, u32 index) +static int decompress_bdev_page(struct zram *zram, struct page *page, + unsigned long index) { struct zcomp_strm *zstrm; unsigned int size; @@ -1378,7 +1381,7 @@ static void zram_deferred_decompress(struct work_struct *w) struct zram_rb_req *req = container_of(w, struct zram_rb_req, work); struct page *page = bio_first_page_all(req->bio); struct zram *zram = req->zram; - u32 index = req->index; + unsigned long index = req->index; int ret; ret = decompress_bdev_page(zram, page, index); @@ -1429,7 +1432,7 @@ static void zram_async_read_endio(struct bio *bio) } static int read_from_bdev_async(struct zram *zram, struct page *page, - u32 index, unsigned long blk_idx, + unsigned long index, unsigned long blk_idx, struct bio *parent) { struct zram_rb_req *req; @@ -1479,8 +1482,8 @@ static void zram_sync_read(struct work_struct *w) * chained IO with parent IO in same context, it's a deadlock. To avoid that, * use a worker thread context. */ -static int read_from_bdev_sync(struct zram *zram, struct page *page, u32 index, - unsigned long blk_idx) +static int read_from_bdev_sync(struct zram *zram, struct page *page, + unsigned long index, unsigned long blk_idx) { struct zram_rb_req req; @@ -1499,8 +1502,9 @@ static int read_from_bdev_sync(struct zram *zram, struct page *page, u32 index, return decompress_bdev_page(zram, page, index); } -static int read_from_bdev(struct zram *zram, struct page *page, u32 index, - unsigned long blk_idx, struct bio *parent) +static int read_from_bdev(struct zram *zram, struct page *page, + unsigned long index, unsigned long blk_idx, + struct bio *parent) { atomic64_inc(&zram->stats.bd_reads); if (!parent) { @@ -1512,8 +1516,9 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, } #else static inline void reset_bdev(struct zram *zram) {}; -static int read_from_bdev(struct zram *zram, struct page *page, u32 index, - unsigned long blk_idx, struct bio *parent) +static int read_from_bdev(struct zram *zram, struct page *page, + unsigned long index, unsigned long blk_idx, + struct bio *parent) { return -EIO; } @@ -1541,7 +1546,8 @@ static ssize_t read_block_state(struct file *file, char __user *buf, size_t count, loff_t *ppos) { char *kbuf; - ssize_t index, written = 0; + unsigned long index; + ssize_t written = 0; struct zram *zram = file->private_data; unsigned long nr_pages; @@ -1565,7 +1571,7 @@ static ssize_t read_block_state(struct file *file, char __user *buf, goto next; copied = snprintf(kbuf + written, count, - "%12zd %12u.%06d %c%c%c%c%c%c\n", + "%12lu %12u.%06d %c%c%c%c%c%c\n", index, zram->table[index].attr.ac_time, 0, test_slot_flag(zram, index, ZRAM_SAME) ? 's' : '.', test_slot_flag(zram, index, ZRAM_WB) ? 'w' : '.', @@ -1972,8 +1978,8 @@ static ssize_t debug_stat_show(struct device *dev, static void zram_meta_free(struct zram *zram, u64 disksize) { - size_t num_pages = disksize >> PAGE_SHIFT; - size_t index; + unsigned long num_pages = disksize >> PAGE_SHIFT; + unsigned long index; if (!zram->table) return; @@ -1990,7 +1996,7 @@ static void zram_meta_free(struct zram *zram, u64 disksize) static bool zram_meta_alloc(struct zram *zram, u64 disksize) { - size_t num_pages; + unsigned long num_pages; num_pages = disksize >> PAGE_SHIFT; zram->table = vzalloc(array_size(num_pages, sizeof(*zram->table))); @@ -2013,7 +2019,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) return true; } -static void slot_free(struct zram *zram, u32 index) +static void slot_free(struct zram *zram, unsigned long index) { unsigned long handle; @@ -2067,7 +2073,7 @@ static void slot_free(struct zram *zram, u32 index) } static int read_same_filled_page(struct zram *zram, struct page *page, - u32 index) + unsigned long index) { void *mem; @@ -2078,7 +2084,7 @@ static int read_same_filled_page(struct zram *zram, struct page *page, } static int read_incompressible_page(struct zram *zram, struct page *page, - u32 index) + unsigned long index) { unsigned long handle; void *src, *dst; @@ -2093,7 +2099,8 @@ static int read_incompressible_page(struct zram *zram, struct page *page, return 0; } -static int read_compressed_page(struct zram *zram, struct page *page, u32 index) +static int read_compressed_page(struct zram *zram, struct page *page, + unsigned long index) { struct zcomp_strm *zstrm; unsigned long handle; @@ -2118,7 +2125,8 @@ static int read_compressed_page(struct zram *zram, struct page *page, u32 index) } #if defined CONFIG_ZRAM_WRITEBACK -static int read_from_zspool_raw(struct zram *zram, struct page *page, u32 index) +static int read_from_zspool_raw(struct zram *zram, struct page *page, + unsigned long index) { struct zcomp_strm *zstrm; unsigned long handle; @@ -2150,7 +2158,8 @@ static int read_from_zspool_raw(struct zram *zram, struct page *page, u32 index) * Reads (decompresses if needed) a page from zspool (zsmalloc). * Corresponding ZRAM slot should be locked. */ -static int read_from_zspool(struct zram *zram, struct page *page, u32 index) +static int read_from_zspool(struct zram *zram, struct page *page, + unsigned long index) { if (test_slot_flag(zram, index, ZRAM_SAME) || !get_slot_handle(zram, index)) @@ -2162,8 +2171,8 @@ static int read_from_zspool(struct zram *zram, struct page *page, u32 index) return read_incompressible_page(zram, page, index); } -static int zram_read_page(struct zram *zram, struct page *page, u32 index, - struct bio *parent) +static int zram_read_page(struct zram *zram, struct page *page, + unsigned long index, struct bio *parent) { int ret; @@ -2185,7 +2194,7 @@ static int zram_read_page(struct zram *zram, struct page *page, u32 index, /* Should NEVER happen. Return bio error if it does. */ if (WARN_ON(ret < 0)) - pr_err("Decompression failed! err=%d, page=%u\n", ret, index); + pr_err("Decompression failed! err=%d, page=%lu\n", ret, index); return ret; } @@ -2195,7 +2204,7 @@ static int zram_read_page(struct zram *zram, struct page *page, u32 index, * always expects a full page for the output. */ static int zram_bvec_read_partial(struct zram *zram, struct bio_vec *bvec, - u32 index, int offset) + unsigned long index, int offset) { struct page *page = alloc_page(GFP_NOIO); int ret; @@ -2210,7 +2219,7 @@ static int zram_bvec_read_partial(struct zram *zram, struct bio_vec *bvec, } static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, - u32 index, int offset, struct bio *bio) + unsigned long index, int offset, struct bio *bio) { if (is_partial_io(bvec)) return zram_bvec_read_partial(zram, bvec, index, offset); @@ -2218,7 +2227,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, } static int write_same_filled_page(struct zram *zram, unsigned long fill, - u32 index) + unsigned long index) { slot_lock(zram, index); slot_free(zram, index); @@ -2233,7 +2242,7 @@ static int write_same_filled_page(struct zram *zram, unsigned long fill, } static int write_incompressible_page(struct zram *zram, struct page *page, - u32 index) + unsigned long index) { unsigned long handle; void *src; @@ -2273,7 +2282,8 @@ static int write_incompressible_page(struct zram *zram, struct page *page, return 0; } -static int zram_write_page(struct zram *zram, struct page *page, u32 index) +static int zram_write_page(struct zram *zram, struct page *page, + unsigned long index) { int ret = 0; unsigned long handle; @@ -2340,7 +2350,7 @@ static int zram_write_page(struct zram *zram, struct page *page, u32 index) * This is a partial IO. Read the full page before writing the changes. */ static int zram_bvec_write_partial(struct zram *zram, struct bio_vec *bvec, - u32 index, int offset) + unsigned long index, int offset) { struct page *page = alloc_page(GFP_NOIO); int ret; @@ -2358,7 +2368,7 @@ static int zram_bvec_write_partial(struct zram *zram, struct bio_vec *bvec, } static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, - u32 index, int offset) + unsigned long index, int offset) { if (is_partial_io(bvec)) return zram_bvec_write_partial(zram, bvec, index, offset); @@ -2426,8 +2436,9 @@ static void scan_slots_for_recompress(struct zram *zram, u32 mode, u32 prio, * * Corresponding ZRAM slot should be locked. */ -static int recompress_slot(struct zram *zram, u32 index, struct page *page, - u64 *num_recomp_pages, u32 threshold, u32 prio) +static int recompress_slot(struct zram *zram, unsigned long index, + struct page *page, u64 *num_recomp_pages, + u32 threshold, u32 prio) { struct zcomp_strm *zstrm = NULL; unsigned long handle_old; @@ -2679,7 +2690,7 @@ static ssize_t recompress_store(struct device *dev, static void zram_bio_discard(struct zram *zram, struct bio *bio) { size_t n = bio->bi_iter.bi_size; - u32 index = bio->bi_iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; + unsigned long index = bio->bi_iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; u32 offset = (bio->bi_iter.bi_sector & (SECTORS_PER_PAGE - 1)) << SECTOR_SHIFT; @@ -2720,7 +2731,7 @@ static void zram_bio_read(struct zram *zram, struct bio *bio) struct bvec_iter iter = bio->bi_iter; do { - u32 index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; + unsigned long index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; u32 offset = (iter.bi_sector & (SECTORS_PER_PAGE - 1)) << SECTOR_SHIFT; struct bio_vec bv = bio_iter_iovec(bio, iter); @@ -2751,7 +2762,7 @@ static void zram_bio_write(struct zram *zram, struct bio *bio) struct bvec_iter iter = bio->bi_iter; do { - u32 index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; + unsigned long index = iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; u32 offset = (iter.bi_sector & (SECTORS_PER_PAGE - 1)) << SECTOR_SHIFT; struct bio_vec bv = bio_iter_iovec(bio, iter); @@ -2865,6 +2876,7 @@ static void zram_reset_device(struct zram *zram) static ssize_t disksize_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { + unsigned long num_pages; u64 disksize; struct zcomp *comp; struct zram *zram = dev_to_zram(dev); @@ -2882,6 +2894,11 @@ static ssize_t disksize_store(struct device *dev, struct device_attribute *attr, } disksize = PAGE_ALIGN(disksize); + num_pages = disksize >> PAGE_SHIFT; + /* Slots are addressed by an unsigned long index */ + if (!num_pages || ((u64)num_pages << PAGE_SHIFT) != disksize) + return -EINVAL; + if (!zram_meta_alloc(zram, disksize)) return -ENOMEM; From 8093faf6dab80d6f9d779a5066b73715ab09a13d Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Thu, 6 Aug 2026 11:34:12 +0800 Subject: [PATCH 116/250] selftests: mm: extend the check_huge() to support mTHP check Patch series "add anon mTHP collapse test cases", v3. This patch (of 4): To support checking for various sized mTHPs during mTHP collapse, extend the check_huge() function prototype to accept two new parameters specifying the address range and mTHP size, in preparation for the following patches. No functional changes. Link: https://lore.kernel.org/cover.1785985999.git.baolin.wang@linux.alibaba.com Link: https://lore.kernel.org/e5039cbc70f8de853e6c21048d65803a5fe41042.1785985999.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Nico Pache (Red Hat) Tested-by: Nico Pache (Red Hat) Acked-by: Zi Yan Acked-by: Kiryl Shutsemau (Meta) Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Ryan Roberts Signed-off-by: Andrew Morton --- .../selftests/mm/folio_split_race_test.c | 2 +- tools/testing/selftests/mm/khugepaged.c | 66 ++++++++++--------- tools/testing/selftests/mm/pagemap_ioctl.c | 2 +- .../testing/selftests/mm/prctl_thp_disable.c | 2 +- tools/testing/selftests/mm/soft-dirty.c | 2 +- .../selftests/mm/split_huge_page_test.c | 14 ++-- tools/testing/selftests/mm/uffd-common.c | 4 +- tools/testing/selftests/mm/vm_util.c | 6 +- tools/testing/selftests/mm/vm_util.h | 6 +- 9 files changed, 56 insertions(+), 48 deletions(-) diff --git a/tools/testing/selftests/mm/folio_split_race_test.c b/tools/testing/selftests/mm/folio_split_race_test.c index 6329e37fff4c94..45b84f7b364e0a 100644 --- a/tools/testing/selftests/mm/folio_split_race_test.c +++ b/tools/testing/selftests/mm/folio_split_race_test.c @@ -182,7 +182,7 @@ static uint64_t run_iteration(void) for (i = 0; i < TOTAL_PAGES; i++) fill_page(mmap_base, i); - if (!check_huge_shmem(mmap_base, NR_PMD_PAGE, pmd_pagesize)) + if (!check_huge_shmem(mmap_base, FILE_SIZE, NR_PMD_PAGE, pmd_pagesize)) ksft_exit_fail_msg("No shmem THP is allocated\n"); if (pthread_barrier_init(&ctl.barrier, NULL, NUM_READER_THREADS + 1) != 0) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 10e8dedcb087dc..c02d00846a790c 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -51,7 +51,7 @@ struct mem_ops { void *(*setup_area)(int nr_hpages); void (*cleanup_area)(void *p, unsigned long size); void (*fault)(void *p, unsigned long start, unsigned long end); - bool (*check_huge)(void *addr, int nr_hpages); + bool (*check_huge)(void *addr, size_t len, int nr_hpages, unsigned long hpage_size); const char *name; }; @@ -276,7 +276,7 @@ static void *alloc_hpage(struct mem_ops *ops) ksft_print_msg("Allocate huge page..."); if (madvise_collapse_retry(p, hpage_pmd_size)) ksft_exit_fail_perror("madvise(MADV_COLLAPSE)"); - if (!ops->check_huge(p, 1)) + if (!ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) ksft_exit_fail_perror("madvise(MADV_COLLAPSE)"); if (madvise(p, hpage_pmd_size, MADV_HUGEPAGE)) ksft_exit_fail_perror("madvise(MADV_HUGEPAGE)"); @@ -310,9 +310,10 @@ static void anon_fault(void *p, unsigned long start, unsigned long end) fill_memory(p, start, end); } -static bool anon_check_huge(void *addr, int nr_hpages) +static bool anon_check_huge(void *addr, size_t len, int nr_hpages, + unsigned long hpage_size) { - return check_huge_anon(addr, nr_hpages, hpage_pmd_size); + return check_huge_anon(addr, len, nr_hpages, hpage_size); } static void *file_setup_area_common(int nr_hpages, enum file_setup_ops setup) @@ -412,13 +413,14 @@ static void file_fault_write(void *p, unsigned long start, unsigned long end) ksft_exit_fail_perror("madvise(MADV_POPULATE_WRITE)"); } -static bool file_check_huge(void *addr, int nr_hpages) +static bool file_check_huge(void *addr, size_t len, int nr_hpages, + unsigned long hpage_size) { switch (finfo.type) { case VMA_FILE: - return check_huge_file(addr, nr_hpages, hpage_pmd_size); + return check_huge_file(addr, len, nr_hpages, hpage_size); case VMA_SHMEM: - return check_huge_shmem(addr, nr_hpages, hpage_pmd_size); + return check_huge_shmem(addr, len, nr_hpages, hpage_size); default: exit(EXIT_FAILURE); return false; @@ -448,9 +450,10 @@ static void shmem_cleanup_area(void *p, unsigned long size) close(finfo.fd); } -static bool shmem_check_huge(void *addr, int nr_hpages) +static bool shmem_check_huge(void *addr, size_t len, int nr_hpages, + unsigned long hpage_size) { - return check_huge_shmem(addr, nr_hpages, hpage_pmd_size); + return check_huge_shmem(addr, len, nr_hpages, hpage_size); } static struct mem_ops __anon_ops = { @@ -533,7 +536,7 @@ static void __madvise_collapse(const char *msg, char *p, int nr_hpages, ret = madvise_collapse_retry(p, nr_hpages * hpage_pmd_size); if (((bool)ret) == expect) fail("Fail: Bad return value"); - else if (!ops->check_huge(p, expect ? nr_hpages : 0)) + else if (!ops->check_huge(p, nr_hpages * hpage_pmd_size, expect ? nr_hpages : 0, hpage_pmd_size)) fail("Fail: check_huge()"); else success("OK"); @@ -545,7 +548,7 @@ static void madvise_collapse(const char *msg, char *p, int nr_hpages, struct mem_ops *ops, bool expect) { /* Sanity check */ - if (!ops->check_huge(p, 0)) + if (!ops->check_huge(p, nr_hpages * hpage_pmd_size, 0, hpage_pmd_size)) ksft_exit_fail_msg("Unexpected huge page\n"); __madvise_collapse(msg, p, nr_hpages, ops, expect); } @@ -554,11 +557,12 @@ static void madvise_collapse(const char *msg, char *p, int nr_hpages, static bool wait_for_scan(const char *msg, char *p, int nr_hpages, struct mem_ops *ops) { + size_t len = nr_hpages * hpage_pmd_size; int full_scans; int timeout = 6; /* 3 seconds */ /* Sanity check */ - if (!ops->check_huge(p, 0)) + if (!ops->check_huge(p, len, 0, hpage_pmd_size)) ksft_exit_fail_msg("Unexpected huge page\n"); madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); @@ -568,7 +572,7 @@ static bool wait_for_scan(const char *msg, char *p, int nr_hpages, ksft_print_msg("%s...", msg); while (timeout--) { - if (ops->check_huge(p, nr_hpages)) + if (ops->check_huge(p, len, nr_hpages, hpage_pmd_size)) break; if (thp_read_num("khugepaged/full_scans") >= full_scans) break; @@ -582,6 +586,8 @@ static bool wait_for_scan(const char *msg, char *p, int nr_hpages, static void khugepaged_collapse(const char *msg, char *p, int nr_hpages, struct mem_ops *ops, bool expect) { + size_t len = nr_hpages * hpage_pmd_size; + /* * read&write file collapse fails since khugepaged does not flush * the target dirty folios @@ -605,7 +611,7 @@ static void khugepaged_collapse(const char *msg, char *p, int nr_hpages, if (ops != &__anon_ops) ops->fault(p, 0, nr_hpages * hpage_pmd_size); - if (ops->check_huge(p, expect ? nr_hpages : 0)) + if (ops->check_huge(p, len, expect ? nr_hpages : 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -634,7 +640,7 @@ static void alloc_at_fault(void) p = alloc_mapping(1); *p = 1; ksft_print_msg("Allocate huge page on fault..."); - if (check_huge_anon(p, 1, hpage_pmd_size)) + if (check_huge_anon(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -643,7 +649,7 @@ static void alloc_at_fault(void) madvise(p, page_size, MADV_DONTNEED); ksft_print_msg("Split huge PMD on MADV_DONTNEED..."); - if (check_huge_anon(p, 0, hpage_pmd_size)) + if (check_huge_anon(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -815,7 +821,7 @@ static void collapse_single_pte_entry_compound(struct collapse_context *c, struc madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE); ksft_print_msg("Split huge page leaving single PTE mapping compound page..."); madvise(p + page_size, hpage_pmd_size - page_size, MADV_DONTNEED); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -836,7 +842,7 @@ static void collapse_full_of_compound(struct collapse_context *c, struct mem_ops ksft_print_msg("Split huge page leaving single PTE page table full of compound pages..."); madvise(p, page_size, MADV_NOHUGEPAGE); madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -858,7 +864,7 @@ static void collapse_compound_extreme(struct collapse_context *c, struct mem_ops for (i = 0; i < hpage_pmd_nr; i++) { madvise(BASE_ADDR, hpage_pmd_size, MADV_HUGEPAGE); ops->fault(BASE_ADDR, 0, hpage_pmd_size); - if (!ops->check_huge(BASE_ADDR, 1)) + if (!ops->check_huge(BASE_ADDR, hpage_pmd_size, 1, hpage_pmd_size)) ksft_exit_fail_msg("Failed to allocate huge page\n"); madvise(BASE_ADDR, hpage_pmd_size, MADV_NOHUGEPAGE); @@ -881,7 +887,7 @@ static void collapse_compound_extreme(struct collapse_context *c, struct mem_ops ops->cleanup_area(BASE_ADDR, hpage_pmd_size); ops->fault(p, 0, hpage_pmd_size); - if (!ops->check_huge(p, 1)) + if (!ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -903,7 +909,7 @@ static void collapse_fork(struct collapse_context *c, struct mem_ops *ops) ksft_print_msg("Allocate small page..."); ops->fault(p, 0, page_size); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -911,7 +917,7 @@ static void collapse_fork(struct collapse_context *c, struct mem_ops *ops) ksft_print_msg("Share small page over fork()..."); if (!fork()) { /* Do not touch settings on child exit */ - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -929,7 +935,7 @@ static void collapse_fork(struct collapse_context *c, struct mem_ops *ops) exit_status = WEXITSTATUS(wstatus); ksft_print_msg("Check if parent still has small page..."); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -947,7 +953,7 @@ static void collapse_fork_compound(struct collapse_context *c, struct mem_ops *o ksft_print_msg("Share huge page over fork()..."); if (!fork()) { /* Do not touch settings on child exit */ - if (ops->check_huge(p, 1)) + if (ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -955,7 +961,7 @@ static void collapse_fork_compound(struct collapse_context *c, struct mem_ops *o ksft_print_msg("Split huge page PMD in child process..."); madvise(p, page_size, MADV_NOHUGEPAGE); madvise(p, hpage_pmd_size, MADV_NOHUGEPAGE); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -976,7 +982,7 @@ static void collapse_fork_compound(struct collapse_context *c, struct mem_ops *o exit_status = WEXITSTATUS(wstatus); ksft_print_msg("Check if parent still has huge page..."); - if (ops->check_huge(p, 1)) + if (ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -995,7 +1001,7 @@ static void collapse_max_ptes_shared(struct collapse_context *c, struct mem_ops ksft_print_msg("Share huge page over fork()..."); if (!fork()) { /* Do not touch settings on child exit */ - if (ops->check_huge(p, 1)) + if (ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -1003,7 +1009,7 @@ static void collapse_max_ptes_shared(struct collapse_context *c, struct mem_ops ksft_print_msg("Trigger CoW on page %d of %d...", hpage_pmd_nr - max_ptes_shared - 1, hpage_pmd_nr); ops->fault(p, 0, (hpage_pmd_nr - max_ptes_shared - 1) * page_size); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -1016,7 +1022,7 @@ static void collapse_max_ptes_shared(struct collapse_context *c, struct mem_ops hpage_pmd_nr - max_ptes_shared, hpage_pmd_nr); ops->fault(p, 0, (hpage_pmd_nr - max_ptes_shared) * page_size); - if (ops->check_huge(p, 0)) + if (ops->check_huge(p, hpage_pmd_size, 0, hpage_pmd_size)) success("OK"); else fail("Fail"); @@ -1034,7 +1040,7 @@ static void collapse_max_ptes_shared(struct collapse_context *c, struct mem_ops exit_status = WEXITSTATUS(wstatus); ksft_print_msg("Check if parent still has huge page..."); - if (ops->check_huge(p, 1)) + if (ops->check_huge(p, hpage_pmd_size, 1, hpage_pmd_size)) success("OK"); else fail("Fail"); diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 1b2dffcc999b0f..cfd1987339c132 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1085,7 +1085,7 @@ static void unpopulated_written_test(const char *name, char *mem, long size, memset(mem, 1, size); if (use_thp && (madvise(mem, size, MADV_COLLAPSE) || - !check_huge_anon(mem, size / hpage_size, hpage_size))) { + !check_huge_anon(mem, size, size / hpage_size, hpage_size))) { ksft_test_result_skip("%s could not form a THP\n", name); goto out; } diff --git a/tools/testing/selftests/mm/prctl_thp_disable.c b/tools/testing/selftests/mm/prctl_thp_disable.c index d8d9d1de57b8b0..82c6e96ea6eb37 100644 --- a/tools/testing/selftests/mm/prctl_thp_disable.c +++ b/tools/testing/selftests/mm/prctl_thp_disable.c @@ -67,7 +67,7 @@ static int test_mmap_thp(enum thp_collapse_type madvise_buf, size_t pmdsize) /* HACK: make sure we have a separate VMA that we can check reliably. */ mprotect(mem, pmdsize, PROT_READ); - ret = check_huge_anon(mem, 1, pmdsize); + ret = check_huge_anon(mem, pmdsize, 1, pmdsize); munmap(mmap_mem, mmap_size); return ret; } diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index fb1864a68e1c6b..e198facf78bb5b 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -103,7 +103,7 @@ static void test_hugepage(int pagemap_fd, int pagesize) for (i = 0; i < hpage_len; i++) map[i] = (char)i; - if (check_huge_anon(map, 1, hpage_len)) { + if (check_huge_anon(map, hpage_len, 1, hpage_len)) { ksft_test_result_pass("Test %s huge page allocation\n", __func__); clear_softdirty(); diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 32b991472f744f..4cc70873a6744c 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -296,7 +296,7 @@ static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hp unsigned long rss_anon_before, rss_anon_after; size_t i; - if (!check_huge_anon(one_page, nr_hpages, pmd_pagesize)) + if (!check_huge_anon(one_page, nr_hpages * pmd_pagesize, nr_hpages, pmd_pagesize)) ksft_exit_fail_msg("No THP is allocated\n"); rss_anon_before = rss_anon(); @@ -311,7 +311,7 @@ static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hp if (one_page[i] != (char)0) ksft_exit_fail_msg("%ld byte corrupted\n", i); - if (!check_huge_anon(one_page, 0, pmd_pagesize)) + if (!check_huge_anon(one_page, nr_hpages * pmd_pagesize, 0, pmd_pagesize)) ksft_exit_fail_msg("Still AnonHugePages not split\n"); rss_anon_after = rss_anon(); @@ -347,7 +347,7 @@ static void split_pmd_thp_to_order(int order) for (i = 0; i < len; i++) one_page[i] = (char)i; - if (!check_huge_anon(one_page, 4, pmd_pagesize)) + if (!check_huge_anon(one_page, 4 * pmd_pagesize, 4, pmd_pagesize)) ksft_exit_fail_msg("No THP is allocated\n"); /* split all THPs */ @@ -366,7 +366,7 @@ static void split_pmd_thp_to_order(int order) (pmd_order + 1))) ksft_exit_fail_msg("Unexpected THP split\n"); - if (!check_huge_anon(one_page, 0, pmd_pagesize)) + if (!check_huge_anon(one_page, 4 * pmd_pagesize, 0, pmd_pagesize)) ksft_exit_fail_msg("Still AnonHugePages not split\n"); ksft_test_result_pass("Split huge pages to order %d successful\n", order); @@ -393,7 +393,7 @@ static void split_pte_mapped_thp(void) for (i = 0; i < thp_area_size; i++) thp_area[i] = (char)i; - if (!check_huge_anon(thp_area, nr_thps, pmd_pagesize)) { + if (!check_huge_anon(thp_area, nr_thps * pmd_pagesize, nr_thps, pmd_pagesize)) { ksft_test_result_skip("Not all THPs allocated\n"); goto out; } @@ -657,7 +657,7 @@ static int create_pagecache_thp_and_fd(const char *testfile, size_t fd_size, force_read_pages(*addr, fd_size / pmd_pagesize, pmd_pagesize); - if (!check_huge_file(*addr, fd_size / pmd_pagesize, pmd_pagesize)) { + if (!check_huge_file(*addr, fd_size, fd_size / pmd_pagesize, pmd_pagesize)) { ksft_print_msg("No large pagecache folio generated, please provide a filesystem supporting large folio\n"); munmap(*addr, fd_size); close(*fd); @@ -735,7 +735,7 @@ static void split_thp_in_pagecache_to_order_at(size_t fd_size, goto out; } - if (!check_huge_file(addr, 0, pmd_pagesize)) { + if (!check_huge_file(addr, fd_size, 0, pmd_pagesize)) { ksft_print_msg("Still FilePmdMapped not split\n"); err = EXIT_FAILURE; goto out; diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index f48f5d4594ab00..1fb967ef498540 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -194,7 +194,9 @@ static void shmem_alias_mapping(uffd_global_test_opts_t *gopts, __u64 *start, static void shmem_check_pmd_mapping(uffd_global_test_opts_t *gopts, void *p, int expect_nr_hpages) { - if (!check_huge_shmem(gopts->area_dst_alias, expect_nr_hpages, + size_t len = expect_nr_hpages * read_pmd_pagesize(); + + if (!check_huge_shmem(gopts->area_dst_alias, len, expect_nr_hpages, read_pmd_pagesize())) err("Did not find expected %d number of hugepages", expect_nr_hpages); diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index ef1ea11981a740..ed7b4eae3f3cce 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -247,17 +247,17 @@ bool __check_huge(void *addr, char *pattern, int nr_hpages, return thp == (nr_hpages * (hpage_size >> 10)); } -bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size) +bool check_huge_anon(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { return __check_huge(addr, "AnonHugePages: ", nr_hpages, hpage_size); } -bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size) +bool check_huge_file(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { return __check_huge(addr, "FilePmdMapped:", nr_hpages, hpage_size); } -bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size) +bool check_huge_shmem(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { return __check_huge(addr, "ShmemPmdMapped:", nr_hpages, hpage_size); } diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 7799154b67eed0..565570b2cf8b3f 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -90,9 +90,9 @@ void clear_softdirty(void); bool check_for_pattern(FILE *fp, const char *pattern, char *buf, size_t len); uint64_t read_pmd_pagesize(void); unsigned long rss_anon(void); -bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size); -bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size); -bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size); +bool check_huge_anon(void *addr, size_t len, int nr_hpages, uint64_t hpage_size); +bool check_huge_file(void *addr, size_t len, int nr_hpages, uint64_t hpage_size); +bool check_huge_shmem(void *addr, size_t len, int nr_hpages, uint64_t hpage_size); int64_t allocate_transhuge(void *ptr, int pagemap_fd); int pageflags_get(unsigned long pfn, int kpageflags_fd, uint64_t *flags); From 19daac808f026e599399b1d8043bf5fd4d1f4eef Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Thu, 6 Aug 2026 11:34:13 +0800 Subject: [PATCH 117/250] selftests: mm: move gather_after_split_folio_orders() into vm_util.c file Move gather_after_split_folio_orders() to vm_util.c as a helper function in preparation for implementing checks for mTHP collapse. While we are at it, rename this function to indicate that it is not only used for large folio splits. No functional changes. Link: https://lore.kernel.org/30a0a99556adf11c2bf97aa08d6da4830bb43f6f.1785985999.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Nico Pache (Red Hat) Tested-by: Nico Pache (Red Hat) Reviewed-by: Zi Yan Acked-by: Kiryl Shutsemau (Meta) Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Ryan Roberts Signed-off-by: Andrew Morton --- .../selftests/mm/split_huge_page_test.c | 125 +----------------- tools/testing/selftests/mm/vm_util.c | 119 +++++++++++++++++ tools/testing/selftests/mm/vm_util.h | 2 + 3 files changed, 122 insertions(+), 124 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 4cc70873a6744c..86a6036928261d 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -104,129 +104,6 @@ static bool is_backed_by_folio(char *vaddr, int order, int pagemap_fd, return false; } -static int vaddr_pageflags_get(char *vaddr, int pagemap_fd, int kpageflags_fd, - uint64_t *flags) -{ - unsigned long pfn; - - pfn = pagemap_get_pfn(pagemap_fd, vaddr); - - /* non-present PFN */ - if (pfn == -1UL) - return 1; - - if (pageflags_get(pfn, kpageflags_fd, flags)) - return -1; - - return 0; -} - -/* - * gather_after_split_folio_orders - scan through [vaddr_start, len) and record - * folio orders - * - * @vaddr_start: start vaddr - * @len: range length - * @pagemap_fd: file descriptor to /proc//pagemap - * @kpageflags_fd: file descriptor to /proc/kpageflags - * @orders: output folio order array - * @nr_orders: folio order array size - * - * gather_after_split_folio_orders() scan through [vaddr_start, len) and check - * all folios within the range and record their orders. All order-0 pages will - * be recorded. Non-present vaddr is skipped. - * - * NOTE: the function is used to check folio orders after a split is performed, - * so it assumes [vaddr_start, len) fully maps to after-split folios within that - * range. - * - * Return: 0 - no error, -1 - unhandled cases - */ -static int gather_after_split_folio_orders(char *vaddr_start, size_t len, - int pagemap_fd, int kpageflags_fd, int orders[], int nr_orders) -{ - uint64_t page_flags = 0; - int cur_order = -1; - char *vaddr; - - if (pagemap_fd == -1 || kpageflags_fd == -1) - return -1; - if (!orders) - return -1; - if (nr_orders <= 0) - return -1; - - for (vaddr = vaddr_start; vaddr < vaddr_start + len;) { - char *next_folio_vaddr; - int status; - - status = vaddr_pageflags_get(vaddr, pagemap_fd, kpageflags_fd, - &page_flags); - if (status < 0) - return -1; - - /* skip non present vaddr */ - if (status == 1) { - vaddr += psize(); - continue; - } - - /* all order-0 pages with possible false postive (non folio) */ - if (!(page_flags & (KPF_COMPOUND_HEAD | KPF_COMPOUND_TAIL))) { - orders[0]++; - vaddr += psize(); - continue; - } - - /* skip non thp compound pages */ - if (!(page_flags & KPF_THP)) { - vaddr += psize(); - continue; - } - - /* vpn points to part of a THP at this point */ - if (page_flags & KPF_COMPOUND_HEAD) - cur_order = 1; - else { - vaddr += psize(); - continue; - } - - next_folio_vaddr = vaddr + (1UL << (cur_order + pshift())); - - if (next_folio_vaddr >= vaddr_start + len) - break; - - while ((status = vaddr_pageflags_get(next_folio_vaddr, - pagemap_fd, kpageflags_fd, - &page_flags)) >= 0) { - /* - * non present vaddr, next compound head page, or - * order-0 page - */ - if (status == 1 || - (page_flags & KPF_COMPOUND_HEAD) || - !(page_flags & (KPF_COMPOUND_HEAD | KPF_COMPOUND_TAIL))) { - if (cur_order < nr_orders) { - orders[cur_order]++; - cur_order = -1; - vaddr = next_folio_vaddr; - } - break; - } - - cur_order++; - next_folio_vaddr = vaddr + (1UL << (cur_order + pshift())); - } - - if (status < 0) - return status; - } - if (cur_order > 0 && cur_order < nr_orders) - orders[cur_order]++; - return 0; -} - static int check_after_split_folio_orders(char *vaddr_start, size_t len, int pagemap_fd, int kpageflags_fd, int orders[], int nr_orders) { @@ -240,7 +117,7 @@ static int check_after_split_folio_orders(char *vaddr_start, size_t len, ksft_exit_fail_msg("Cannot allocate memory for vaddr_orders"); memset(vaddr_orders, 0, sizeof(int) * nr_orders); - status = gather_after_split_folio_orders(vaddr_start, len, pagemap_fd, + status = gather_folio_orders(vaddr_start, len, pagemap_fd, kpageflags_fd, vaddr_orders, nr_orders); if (status) ksft_exit_fail_msg("gather folio info failed\n"); diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index ed7b4eae3f3cce..5a427f494cd823 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -194,6 +194,125 @@ unsigned long rss_anon(void) return rss_anon; } +static int vaddr_pageflags_get(char *vaddr, int pagemap_fd, int kpageflags_fd, + uint64_t *flags) +{ + unsigned long pfn; + + pfn = pagemap_get_pfn(pagemap_fd, vaddr); + + /* non-present PFN */ + if (pfn == -1UL) + return 1; + + if (pageflags_get(pfn, kpageflags_fd, flags)) + return -1; + + return 0; +} + +/* + * gather_folio_orders - scan through [vaddr_start, len) and record + * folio orders + * + * @vaddr_start: start vaddr + * @len: range length + * @pagemap_fd: file descriptor to /proc//pagemap + * @kpageflags_fd: file descriptor to /proc/kpageflags + * @orders: output folio order array + * @nr_orders: folio order array size + * + * gather_folio_orders() scan through [vaddr_start, len) and check + * all folios within the range and record their orders. All order-0 pages will + * be recorded. Non-present vaddr is skipped. + * + * Return: 0 - no error, -1 - unhandled cases + */ +int gather_folio_orders(char *vaddr_start, size_t len, + int pagemap_fd, int kpageflags_fd, int orders[], int nr_orders) +{ + uint64_t page_flags = 0; + int cur_order = -1; + char *vaddr; + + if (pagemap_fd == -1 || kpageflags_fd == -1) + return -1; + if (!orders) + return -1; + if (nr_orders <= 0) + return -1; + + for (vaddr = vaddr_start; vaddr < vaddr_start + len;) { + char *next_folio_vaddr; + int status; + + status = vaddr_pageflags_get(vaddr, pagemap_fd, kpageflags_fd, + &page_flags); + if (status < 0) + return -1; + + /* skip non present vaddr */ + if (status == 1) { + vaddr += psize(); + continue; + } + + /* all order-0 pages with possible false postive (non folio) */ + if (!(page_flags & (KPF_COMPOUND_HEAD | KPF_COMPOUND_TAIL))) { + orders[0]++; + vaddr += psize(); + continue; + } + + /* skip non thp compound pages */ + if (!(page_flags & KPF_THP)) { + vaddr += psize(); + continue; + } + + /* vpn points to part of a THP at this point */ + if (page_flags & KPF_COMPOUND_HEAD) + cur_order = 1; + else { + vaddr += psize(); + continue; + } + + next_folio_vaddr = vaddr + (1UL << (cur_order + pshift())); + + if (next_folio_vaddr >= vaddr_start + len) + break; + + while ((status = vaddr_pageflags_get(next_folio_vaddr, + pagemap_fd, kpageflags_fd, + &page_flags)) >= 0) { + /* + * non present vaddr, next compound head page, or + * order-0 page + */ + if (status == 1 || + (page_flags & KPF_COMPOUND_HEAD) || + !(page_flags & (KPF_COMPOUND_HEAD | KPF_COMPOUND_TAIL))) { + if (cur_order < nr_orders) { + orders[cur_order]++; + cur_order = -1; + vaddr = next_folio_vaddr; + } + break; + } + + cur_order++; + next_folio_vaddr = vaddr + (1UL << (cur_order + pshift())); + } + + if (status < 0) + return status; + } + if (cur_order > 0 && cur_order < nr_orders) + orders[cur_order]++; + return 0; +} + char *__get_smap_entry(void *addr, const char *pattern, char *buf, size_t len) { int ret; diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 565570b2cf8b3f..9a49af88702e4c 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -95,6 +95,8 @@ bool check_huge_file(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) bool check_huge_shmem(void *addr, size_t len, int nr_hpages, uint64_t hpage_size); int64_t allocate_transhuge(void *ptr, int pagemap_fd); int pageflags_get(unsigned long pfn, int kpageflags_fd, uint64_t *flags); +int gather_folio_orders(char *vaddr_start, size_t len, + int pagemap_fd, int kpageflags_fd, int orders[], int nr_orders); int uffd_register(int uffd, void *addr, uint64_t len, bool miss, bool wp, bool minor); From 16280cd5c330ec59492fd1eb81b65f9b87759896 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Thu, 6 Aug 2026 11:34:14 +0800 Subject: [PATCH 118/250] selftests: mm: implement the mTHP-sized hugepage check helpers Implement mTHP-sized hugepage checking helpers using gather_folio_orders(). Also rename the existing PMD-sized huge page check function to __check_pmd_huge() for clarity. Link: https://lore.kernel.org/56b16691f605426b33b5cf47319233de6127a6b3.1785985999.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Nico Pache (Red Hat) Tested-by: Nico Pache (Red Hat) Acked-by: Kiryl Shutsemau (Meta) Reviewed-by: Zi Yan Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Ryan Roberts Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/vm_util.c | 76 ++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 5a427f494cd823..13b5cff7dfe319 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -15,6 +15,9 @@ #define SMAP_FILE_PATH "/proc/self/smaps" #define STATUS_FILE_PATH "/proc/self/status" #define MAX_LINE_LENGTH 500 +#define PAGEMAP_PATH "/proc/self/pagemap" +#define KPAGEFLAGS_PATH "/proc/kpageflags" +#define MAX_NR_ORDERS 20 unsigned int __page_size; unsigned int __page_shift; @@ -348,7 +351,7 @@ char *__get_smap_entry(void *addr, const char *pattern, char *buf, size_t len) return entry; } -bool __check_huge(void *addr, char *pattern, int nr_hpages, +static bool __check_pmd_huge(void *addr, char *pattern, int nr_hpages, uint64_t hpage_size) { char buffer[MAX_LINE_LENGTH]; @@ -366,19 +369,84 @@ bool __check_huge(void *addr, char *pattern, int nr_hpages, return thp == (nr_hpages * (hpage_size >> 10)); } +static bool check_large_folios(void *addr, size_t len, int nr_hpages, + uint64_t hpage_size) +{ + int order = 0, pagesize = getpagesize(); + unsigned int nr_pages = hpage_size / pagesize; + int orders[MAX_NR_ORDERS], status; + int pagemap_fd, kpageflags_fd; + bool ret = false; + + if (!nr_pages) + ksft_exit_fail_msg("invalid hugepage size\n"); + + order = 31 - __builtin_clz(nr_pages); + if (!order || order >= MAX_NR_ORDERS) + ksft_exit_fail_msg("invalid order\n"); + + memset(orders, 0, sizeof(int) * MAX_NR_ORDERS); + pagemap_fd = open(PAGEMAP_PATH, O_RDONLY); + if (pagemap_fd == -1) + ksft_exit_fail_msg("read pagemap fail\n"); + + kpageflags_fd = open(KPAGEFLAGS_PATH, O_RDONLY); + if (kpageflags_fd == -1) { + close(pagemap_fd); + ksft_exit_fail_msg("read kpageflags fail\n"); + } + + status = gather_folio_orders(addr, len, pagemap_fd, + kpageflags_fd, orders, MAX_NR_ORDERS); + if (status) + goto out; + + if (orders[order] == nr_hpages) + ret = true; + +out: + close(pagemap_fd); + close(kpageflags_fd); + return ret; +} + bool check_huge_anon(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { - return __check_huge(addr, "AnonHugePages: ", nr_hpages, hpage_size); + uint64_t pmd_pagesize = read_pmd_pagesize(); + + if (!pmd_pagesize) + ksft_exit_fail_msg("reading PMD pagesize failed\n"); + + if (hpage_size == pmd_pagesize) + return __check_pmd_huge(addr, "AnonHugePages: ", nr_hpages, hpage_size); + + return check_large_folios(addr, len, nr_hpages, hpage_size); } bool check_huge_file(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { - return __check_huge(addr, "FilePmdMapped:", nr_hpages, hpage_size); + uint64_t pmd_pagesize = read_pmd_pagesize(); + + if (!pmd_pagesize) + ksft_exit_fail_msg("reading PMD pagesize failed\n"); + + if (hpage_size == pmd_pagesize) + return __check_pmd_huge(addr, "FilePmdMapped:", nr_hpages, hpage_size); + + return check_large_folios(addr, len, nr_hpages, hpage_size); } bool check_huge_shmem(void *addr, size_t len, int nr_hpages, uint64_t hpage_size) { - return __check_huge(addr, "ShmemPmdMapped:", nr_hpages, hpage_size); + uint64_t pmd_pagesize = read_pmd_pagesize(); + + if (!pmd_pagesize) + ksft_exit_fail_msg("reading PMD pagesize failed\n"); + + if (hpage_size == pmd_pagesize) + return __check_pmd_huge(addr, "ShmemPmdMapped:", nr_hpages, hpage_size); + + return check_large_folios(addr, len, nr_hpages, hpage_size); } int64_t allocate_transhuge(void *ptr, int pagemap_fd) From 02f0e5325368ce91006b0b82f9f0d790260d2db2 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Thu, 6 Aug 2026 11:34:15 +0800 Subject: [PATCH 119/250] selftests: mm: add mTHP collapse test cases Added a new command 'mthp_khugepaged' for mTHP collapse, along with the '-c' parameter to specify the collapse order. Additionally, added mTHP collapse test cases for 'collapse_full', 'collapse_empty', and 'collapse_single_mthp' for anonymous folios. All khugepaged test cases passed. Link: https://lore.kernel.org/f260058520214a9611922a96326bc54ba282fb73.1785985999.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Nico Pache (Red Hat) Tested-by: Nico Pache (Red Hat) Acked-by: Kiryl Shutsemau (Meta) Acked-by: Zi Yan Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Ryan Roberts Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/khugepaged.c | 137 +++++++++++++++++++--- tools/testing/selftests/mm/run_vmtests.sh | 2 + 2 files changed, 120 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index c02d00846a790c..8f221c792a28b0 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -26,9 +26,11 @@ #define BASE_ADDR ((void *)(1UL << 30)) static unsigned long hpage_pmd_size; +static int hpage_pmd_order; static unsigned long page_size; static int hpage_pmd_nr; static int anon_order; +static int collapse_order; #define PID_SMAPS "/proc/self/smaps" #define TEST_FILE "collapse_test_file" @@ -69,6 +71,7 @@ struct collapse_context { }; static struct collapse_context *khugepaged_context; +static struct collapse_context *mthp_khugepaged_context; static struct collapse_context *madvise_context; struct file_info { @@ -554,25 +557,25 @@ static void madvise_collapse(const char *msg, char *p, int nr_hpages, } #define TICK 500000 -static bool wait_for_scan(const char *msg, char *p, int nr_hpages, - struct mem_ops *ops) +static bool wait_for_scan(const char *msg, char *p, size_t len, + int nr_hpages, int collap_order, struct mem_ops *ops) { - size_t len = nr_hpages * hpage_pmd_size; + unsigned long hpage_size = page_size << collap_order; int full_scans; int timeout = 6; /* 3 seconds */ /* Sanity check */ - if (!ops->check_huge(p, len, 0, hpage_pmd_size)) + if (!ops->check_huge(p, len, 0, hpage_size)) ksft_exit_fail_msg("Unexpected huge page\n"); - madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); + madvise(p, len, MADV_HUGEPAGE); /* Wait until the second full_scan completed */ full_scans = thp_read_num("khugepaged/full_scans") + 2; ksft_print_msg("%s...", msg); while (timeout--) { - if (ops->check_huge(p, len, nr_hpages, hpage_pmd_size)) + if (ops->check_huge(p, len, nr_hpages, hpage_size)) break; if (thp_read_num("khugepaged/full_scans") >= full_scans) break; @@ -595,7 +598,7 @@ static void khugepaged_collapse(const char *msg, char *p, int nr_hpages, if (!is_tmpfs(ops) && ops == &__read_write_file_write_ops) expect = false; - if (wait_for_scan(msg, p, nr_hpages, ops)) { + if (wait_for_scan(msg, p, len, nr_hpages, hpage_pmd_order, ops)) { if (expect) fail("Timeout"); else @@ -617,12 +620,62 @@ static void khugepaged_collapse(const char *msg, char *p, int nr_hpages, fail("Fail"); } +static void mthp_khugepaged_collapse(const char *msg, char *p, int nr_hpages, + struct mem_ops *ops, bool expect) +{ + unsigned long hpage_size = page_size << collapse_order; + struct thp_settings settings = *thp_current_settings(); + /* mTHP collpase only allocates PMD sized memory */ + size_t len = hpage_pmd_size; + + /* Set mTHP setting for mTHP collapse */ + if (ops == &__anon_ops) { + settings.thp_enabled = THP_NEVER; + settings.hugepages[collapse_order].enabled = THP_MADVISE; + } + + thp_push_settings(&settings); + + if (wait_for_scan(msg, p, len, nr_hpages, collapse_order, ops)) { + if (expect) + fail("Timeout"); + else + success("OK"); + + /* Restore THP settings for mTHP collapse. */ + thp_pop_settings(); + return; + } + + /* + * For file and shmem memory, khugepaged only retracts pte entries after + * putting the new hugepage in the page cache. The hugepage must be + * subsequently refaulted to install the pmd mapping for the mm. + */ + if (ops != &__anon_ops) + ops->fault(p, 0, nr_hpages * hpage_size); + + if (ops->check_huge(p, len, expect ? nr_hpages : 0, hpage_size)) + success("OK"); + else + fail("Fail"); + + /* Restore THP settings for mTHP collapse. */ + thp_pop_settings(); +} + static struct collapse_context __khugepaged_context = { .collapse = &khugepaged_collapse, .enforce_pte_scan_limits = true, .name = "khugepaged", }; +static struct collapse_context __mthp_khugepaged_context = { + .collapse = &mthp_khugepaged_collapse, + .enforce_pte_scan_limits = true, + .name = "mthp_khugepaged", +}; + static struct collapse_context __madvise_context = { .collapse = &madvise_collapse, .enforce_pte_scan_limits = false, @@ -661,10 +714,17 @@ static void alloc_at_fault(void) static void collapse_full(struct collapse_context *c, struct mem_ops *ops) { void *p; - int nr_hpages = 4; + int nr_pmds = 4, nr_hpages = 4; unsigned long size = nr_hpages * hpage_pmd_size; - p = ops->setup_area(nr_hpages); + /* Only try 1 PMD sized range for mTHP collapse. */ + if (c == &__mthp_khugepaged_context) { + nr_pmds = 1; + nr_hpages = 1 << (hpage_pmd_order - collapse_order); + size = hpage_pmd_size; + } + + p = ops->setup_area(nr_pmds); ops->fault(p, 0, size); c->collapse("Collapse multiple fully populated PTE table", p, nr_hpages, ops, true); @@ -676,10 +736,31 @@ static void collapse_full(struct collapse_context *c, struct mem_ops *ops) static void collapse_empty(struct collapse_context *c, struct mem_ops *ops) { + int nr_hpages = 1; + void *p; + + if (c == &__mthp_khugepaged_context) + nr_hpages = 1 << (hpage_pmd_order - collapse_order); + + p = ops->setup_area(1); + c->collapse("Do not collapse empty PTE table", p, nr_hpages, ops, false); + ops->cleanup_area(p, hpage_pmd_size); + ksft_test_result_report(exit_status, "%s\n", __func__); +} + +static void collapse_single_mthp(struct collapse_context *c, struct mem_ops *ops) +{ + unsigned long hpage_size = page_size << collapse_order; void *p; p = ops->setup_area(1); - c->collapse("Do not collapse empty PTE table", p, 1, ops, false); + /* + * Only fault collapse_order sized ranges, and only check 1 + * collapse_order sized huge page. + */ + ops->fault(p, 0, hpage_size); + c->collapse("Collapse PTE table with half PTE entries present", + p, 1, ops, true); ops->cleanup_area(p, hpage_pmd_size); ksft_test_result_report(exit_status, "%s\n", __func__); } @@ -1081,8 +1162,8 @@ static void madvise_retracted_page_tables(struct collapse_context *c, ops->fault(p, 0, size); /* Let khugepaged collapse and leave pmd cleared */ - if (wait_for_scan("Collapse and leave PMD cleared", p, nr_hpages, - ops)) { + if (wait_for_scan("Collapse and leave PMD cleared", p, size, nr_hpages, + hpage_pmd_order, ops)) { fail("Timeout"); return; } @@ -1098,17 +1179,19 @@ static void usage(void) { fprintf(stderr, "\nUsage: ./khugepaged [OPTIONS] [dir]\n\n"); fprintf(stderr, "\t\t: :\n"); - fprintf(stderr, "\t\t: [all|khugepaged|madvise]\n"); + fprintf(stderr, "\t\t: [all|khugepaged|mthp_khugepaged|madvise]\n"); fprintf(stderr, "\t\t: [all|anon|file|shmem]\n"); fprintf(stderr, "\n\t\"file,all\" mem_type requires [dir] argument\n"); fprintf(stderr, "\n\t\"file,all\" mem_type requires a file system\n"); fprintf(stderr, "\twith PMD-sized large folio support\n"); fprintf(stderr, "\n\tif [dir] is a (sub)directory of a tmpfs mount, tmpfs must be\n"); fprintf(stderr, "\tmounted with huge=advise option for khugepaged tests to work\n"); + fprintf(stderr, "\n\tmthp_khugepaged only supports anon mem_type now.\n"); fprintf(stderr, "\n\tSupported Options:\n"); fprintf(stderr, "\t\t-h: This help message.\n"); fprintf(stderr, "\t\t-s: mTHP size, expressed as page order.\n"); fprintf(stderr, "\t\t Defaults to 0. Use this size for anon or shmem allocations.\n"); + fprintf(stderr, "\t\t-c: collapse order for mTHP collapse, expressed as page order.\n"); exit(1); } @@ -1118,11 +1201,14 @@ static void parse_test_type(int argc, char **argv) char *buf; const char *token; - while ((opt = getopt(argc, argv, "s:h")) != -1) { + while ((opt = getopt(argc, argv, "s:c:h")) != -1) { switch (opt) { case 's': anon_order = atoi(optarg); break; + case 'c': + collapse_order = atoi(optarg); + break; case 'h': default: usage(); @@ -1148,6 +1234,10 @@ static void parse_test_type(int argc, char **argv) madvise_context = &__madvise_context; } else if (!strcmp(token, "khugepaged")) { khugepaged_context = &__khugepaged_context; + } else if (!strcmp(token, "mthp_khugepaged")) { + mthp_khugepaged_context = &__mthp_khugepaged_context; + if (collapse_order <= 0 || collapse_order >= hpage_pmd_order) + usage(); } else if (!strcmp(token, "madvise")) { madvise_context = &__madvise_context; } else { @@ -1163,14 +1253,20 @@ static void parse_test_type(int argc, char **argv) read_write_file_write_ops = &__read_write_file_write_ops; anon_ops = &__anon_ops; shmem_ops = &__shmem_ops; + if (mthp_khugepaged_context) + usage(); } else if (!strcmp(buf, "anon")) { anon_ops = &__anon_ops; } else if (!strcmp(buf, "file")) { read_only_file_ops = &__read_only_file_ops; read_write_file_read_ops = &__read_write_file_read_ops; read_write_file_write_ops = &__read_write_file_write_ops; + if (mthp_khugepaged_context) + usage(); } else if (!strcmp(buf, "shmem")) { shmem_ops = &__shmem_ops; + if (mthp_khugepaged_context) + usage(); } else { usage(); } @@ -1213,7 +1309,6 @@ static int nr_test_cases; int main(int argc, char **argv) { - int hpage_pmd_order; struct thp_settings default_settings = { .thp_enabled = THP_MADVISE, .thp_defrag = THP_DEFRAG_ALWAYS, @@ -1239,10 +1334,6 @@ int main(int argc, char **argv) if (!thp_is_enabled()) ksft_exit_skip("Transparent Hugepages not available\n"); - parse_test_type(argc, argv); - - setbuf(stdout, NULL); - page_size = getpagesize(); hpage_pmd_size = read_pmd_pagesize(); if (!hpage_pmd_size) @@ -1250,6 +1341,10 @@ int main(int argc, char **argv) hpage_pmd_nr = hpage_pmd_size / page_size; hpage_pmd_order = __builtin_ctz(hpage_pmd_nr); + parse_test_type(argc, argv); + + setbuf(stdout, NULL); + default_settings.khugepaged.max_ptes_none = hpage_pmd_nr - 1; default_settings.khugepaged.max_ptes_swap = hpage_pmd_nr / 8; default_settings.khugepaged.max_ptes_shared = hpage_pmd_nr / 2; @@ -1267,6 +1362,7 @@ int main(int argc, char **argv) TEST(collapse_full, khugepaged_context, read_write_file_read_ops); TEST(collapse_full, khugepaged_context, read_write_file_write_ops); TEST(collapse_full, khugepaged_context, shmem_ops); + TEST(collapse_full, mthp_khugepaged_context, anon_ops); TEST(collapse_full, madvise_context, anon_ops); TEST(collapse_full, madvise_context, read_only_file_ops); TEST(collapse_full, madvise_context, read_write_file_read_ops); @@ -1274,8 +1370,11 @@ int main(int argc, char **argv) TEST(collapse_full, madvise_context, shmem_ops); TEST(collapse_empty, khugepaged_context, anon_ops); + TEST(collapse_empty, mthp_khugepaged_context, anon_ops); TEST(collapse_empty, madvise_context, anon_ops); + TEST(collapse_single_mthp, mthp_khugepaged_context, anon_ops); + TEST(collapse_single_pte_entry, khugepaged_context, anon_ops); TEST(collapse_single_pte_entry, khugepaged_context, read_only_file_ops); TEST(collapse_single_pte_entry, khugepaged_context, read_write_file_read_ops); diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 687d115e3bd807..d09f9f6a384ee7 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -410,6 +410,8 @@ CATEGORY="thp" run_test ./khugepaged all:shmem CATEGORY="thp" run_test ./khugepaged -s 4 all:shmem +CATEGORY="thp" run_test ./khugepaged -c 4 mthp_khugepaged:anon + # Try to create XFS if not provided if [ -z "${SPLIT_HUGE_PAGE_TEST_XFS_PATH}" ]; then if test_selected "thp"; then From 7f9ee3b8a386d4e0f25a551daaf0fa66e9a250eb Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Thu, 6 Aug 2026 11:08:50 +0800 Subject: [PATCH 120/250] selftests/mm: drop duplicate test_seal_mprotect_two_vma_with_gap() call mseal_test main() invokes test_seal_mprotect_two_vma_with_gap() twice. The second run repeats all assertions with no benefit. Drop the duplicate call. Link: https://lore.kernel.org/20260806030850.76077-1-hongfu.li@linux.dev Signed-off-by: Hongfu Li Reviewed-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Reviewed-by: SJ Park Reviewed-by: Anshuman Khandual Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/mseal_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index 93c2e13094d4f0..1a05e6921fed76 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -1876,7 +1876,7 @@ int main(void) if (!pkey_supported()) ksft_print_msg("PKEY not supported\n"); - ksft_set_plan(88); + ksft_set_plan(87); test_seal_addseal(); test_seal_unmapped_start(); @@ -1913,7 +1913,6 @@ int main(void) test_seal_mprotect_partial_mprotect(false); test_seal_mprotect_partial_mprotect(true); - test_seal_mprotect_two_vma_with_gap(); test_seal_mprotect_two_vma_with_gap(); test_seal_mprotect_merge(false); From 8ab03be274d4bcdf55976c9dacfddc9c0daa08f3 Mon Sep 17 00:00:00 2001 From: Ye Liu Date: Thu, 6 Aug 2026 08:45:55 +0800 Subject: [PATCH 121/250] mm: debug_page_alloc: fix NULL buf in debug_guardpage_minorder_setup If the kernel command line includes "debug_guardpage_minorder" without an equals sign (i.e., no value is provided), the early parameter parser passes a NULL buf pointer to the setup function. kstrtouint() does not perform a NULL check on its input and calls directly into kstrtoull() which dereferences s[0] unconditionally, leading to a NULL pointer dereference and early boot crash. Additionally, the error path's pr_err("%s", buf) would also crash with a NULL format argument. Link: https://lore.kernel.org/20260806004556.2633049-1-ye.liu@linux.dev Fixes: c0a32fc5a2e4 ("mm: more intensive memory corruption debugging") Signed-off-by: Ye Liu Acked-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Andrew Morton Cc: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/debug_page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/debug_page_alloc.c b/mm/debug_page_alloc.c index 41e3d1f1ad9684..fd2664c3c86a0b 100644 --- a/mm/debug_page_alloc.c +++ b/mm/debug_page_alloc.c @@ -22,8 +22,8 @@ static int __init debug_guardpage_minorder_setup(char *buf) { unsigned int res; - if (kstrtouint(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) { - pr_err("Bad debug_guardpage_minorder value: %s\n", buf); + if (!buf || kstrtouint(buf, 10, &res) < 0 || res > MAX_PAGE_ORDER / 2) { + pr_err("Bad debug_guardpage_minorder value: %s\n", buf ?: "(missing)"); return 0; } _debug_guardpage_minorder = res; From d2849215fb1a3c0f9d059b2e65f2eaeaf4e2371f Mon Sep 17 00:00:00 2001 From: Audra Mitchell Date: Thu, 6 Aug 2026 11:00:34 -0400 Subject: [PATCH 122/250] selftests/mm/vm_util.c: correct __pagemap_scan_get_categories return value Currently __pagemap_scan_get_categories returns the result from the ioctl call which should be an int, not uint64_t. The ioctl may return -1 on error, which will be interpreted as UINT64_MAX. Adjust the return type to use the correct value. Link: https://lore.kernel.org/20260806150339.1824251-2-audra@redhat.com Signed-off-by: Audra Mitchell Reviewed-by: Liam R. Howlett (Oracle) Acked-by: David Hildenbrand (Arm) Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/vm_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 13b5cff7dfe319..4fe4a5a610d191 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -34,7 +34,7 @@ uint64_t pagemap_get_entry(int fd, char *start) return entry; } -static uint64_t __pagemap_scan_get_categories(int fd, char *start, struct page_region *r) +static int __pagemap_scan_get_categories(int fd, char *start, struct page_region *r) { struct pm_scan_arg arg; @@ -58,7 +58,7 @@ static uint64_t __pagemap_scan_get_categories(int fd, char *start, struct page_r static uint64_t pagemap_scan_get_categories(int fd, char *start) { struct page_region r; - long ret; + int ret; ret = __pagemap_scan_get_categories(fd, start, &r); if (ret < 0) From fface4afd3e3cdad8305403a8bd9ce0f686053fe Mon Sep 17 00:00:00 2001 From: Zhan Xusheng Date: Wed, 5 Aug 2026 15:05:29 +0800 Subject: [PATCH 123/250] maple_tree: remove unused mas_is_root_limits() The last callers of mas_is_root_limits() were removed by commit b8852ef30c67 ("maple_tree: remove maple big node and subtree structs"), together with the maple subtree state (mast_*) code that used it. As a static inline it does not trigger -Wunused-function, so it went unnoticed. Remove it. No functional change. Link: https://lore.kernel.org/20260805070529.4118794-1-zhanxusheng@xiaomi.com Signed-off-by: Zhan Xusheng Reviewed-by: Liam R. Howlett (Oracle) Cc: Alice Ryhl Cc: Andrew Ballance Signed-off-by: Andrew Morton --- lib/maple_tree.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 529acc056e550f..b48bc4064ad206 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -356,11 +356,6 @@ static __always_inline bool mte_is_root(const struct maple_enode *node) return ma_is_root(mte_to_node(node)); } -static inline bool mas_is_root_limits(const struct ma_state *mas) -{ - return !mas->min && mas->max == ULONG_MAX; -} - static __always_inline bool mt_is_alloc(struct maple_tree *mt) { return (mt->ma_flags & MT_FLAGS_ALLOC_RANGE); From 143591121fb81cb379b7af90c592673a9d1d69b6 Mon Sep 17 00:00:00 2001 From: Henry Elderman Date: Fri, 7 Aug 2026 11:19:58 +0200 Subject: [PATCH 124/250] mm/execmem: fix fallback_end description in kernel-doc The kernel-doc for struct execmem_range incorrectly describes @fallback_end as "start". Correct it to "end". Link: https://lore.kernel.org/20260807091958.4735-1-henry.elderman.edu+linux@gmail.com Signed-off-by: Henry Elderman Reviewed-by: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton --- include/linux/execmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/execmem.h b/include/linux/execmem.h index 7de229134e3071..1bd34925d1aa91 100644 --- a/include/linux/execmem.h +++ b/include/linux/execmem.h @@ -89,7 +89,7 @@ static inline int execmem_restore_rox(void *ptr, size_t size) { return 0; } * @end: address space end (inclusive) * @fallback_start: start of the secondary address space range for fallback * allocations on architectures that require it - * @fallback_end: start of the secondary address space (inclusive) + * @fallback_end: end of the secondary address space (inclusive) * @pgprot: permissions for memory in this address space * @alignment: alignment required for text allocations * @flags: options for memory allocations for this range From 76912c036a29b6ba6fb6284f9f429d99c6923221 Mon Sep 17 00:00:00 2001 From: Muhammad Usama Anjum Date: Mon, 27 Jul 2026 10:52:17 +0100 Subject: [PATCH 125/250] selftests/mm: skip COW tmpfile cases when fallocate() is unsupported Patch series "selftests/mm: Handle unsupported and transient test conditions", v3. Several MM selftests report failures when the test environment lacks an underlying prerequisite, such as fallocate() support, MADV_REMOVE, local page-cache semantics, or swap. This series converts those unsupported cases to SKIP while preserving failures for unexpected errors. It also allows migration tests to retry transient move_pages() failures. This patch (of 4): The tmpfile-backed COW cases allocate a one-page file with fallocate() before exercising private and shared mappings. When the filesystem backing tmpfile() does not implement fallocate(), setup fails with EOPNOTSUPP and no COW behavior is exercised. This occurs when the temporary directory resides on a filesystem with limited allocation support, such as NFSv3. Reporting a failure adds noise because the test prerequisite is absent rather than the COW implementation being broken. Report EOPNOTSUPP as a skip. Continue treating every other fallocate() error as a failure so unexpected setup regressions remain visible. Link: https://lore.kernel.org/20260727095225.372655-1-usama.anjum@arm.com Link: https://lore.kernel.org/20260727095225.372655-2-usama.anjum@arm.com Fixes: f8664f3c4a08 ("selftests/vm: cow: basic COW tests for non-anonymous pages") Signed-off-by: Muhammad Usama Anjum Tested-by: Sarthak Sharma Acked-by: Usama Arif Acked-by: David Hildenbrand (Arm) Cc: Baolin Wang Cc: Barry Song Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Naoya Horiguchi Cc: Nico Pache Cc: Ryan Roberts Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/cow.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 7fa2d97ca9b2dd..8aa5249d9bef63 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -1718,8 +1718,13 @@ static void run_with_tmpfile(non_anon_test_fn fn, const char *desc) /* File consists of a single page filled with zeroes. */ if (fallocate(fd, 0, 0, pagesize)) { - ksft_perror("fallocate() failed"); - log_test_result(KSFT_FAIL); + if (errno == EOPNOTSUPP) { + ksft_print_msg("fallocate() not supported by filesystem\n"); + log_test_result(KSFT_SKIP); + } else { + ksft_perror("fallocate() failed"); + log_test_result(KSFT_FAIL); + } goto close; } From 99f411b7a5cebc8d62f93556a8e59f475385aa9c Mon Sep 17 00:00:00 2001 From: Muhammad Usama Anjum Date: Mon, 27 Jul 2026 10:52:18 +0100 Subject: [PATCH 126/250] selftests/mm: skip guard hole-punch test if MADV_REMOVE is unsupported The hole_punch case verifies that guard regions survive MADV_REMOVE and that the backing range is punched out. MADV_REMOVE delegates the hole punch to the backing filesystem, which may reject the operation with EOPNOTSUPP. That result means the test cannot establish the state whose guard semantics it intends to validate. Treating the missing filesystem capability as a guard-region failure creates a false regression. Unmap the range and skip only when MADV_REMOVE fails with EOPNOTSUPP. Preserve the assertion for all other errors so failures on supported configurations remain visible. Link: https://lore.kernel.org/20260727095225.372655-3-usama.anjum@arm.com Signed-off-by: Muhammad Usama Anjum Tested-by: Sarthak Sharma Acked-by: Usama Arif Acked-by: David Hildenbrand (Arm) Cc: Baolin Wang Cc: Barry Song Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Naoya Horiguchi Cc: Nico Pache Cc: Ryan Roberts Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/guard-regions.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/guard-regions.c b/tools/testing/selftests/mm/guard-regions.c index b21df3040b1c7c..5c8ec3ca75d7d2 100644 --- a/tools/testing/selftests/mm/guard-regions.c +++ b/tools/testing/selftests/mm/guard-regions.c @@ -1912,7 +1912,7 @@ TEST_F(guard_regions, hole_punch) { const unsigned long page_size = self->page_size; char *ptr; - int i; + int i, ret; if (variant->backing == ANON_BACKED) SKIP(return, "Truncation test specific to file-backed"); @@ -1944,8 +1944,12 @@ TEST_F(guard_regions, hole_punch) } /* Now hole punch the guarded region. */ - ASSERT_EQ(madvise(&ptr[3 * page_size], 4 * page_size, - MADV_REMOVE), 0); + ret = madvise(&ptr[3 * page_size], 4 * page_size, MADV_REMOVE); + if (ret == -1 && errno == EOPNOTSUPP) { + ASSERT_EQ(munmap(ptr, 10 * page_size), 0); + SKIP(return, "MADV_REMOVE not supported by filesystem"); + } + ASSERT_EQ(ret, 0); /* Ensure guard regions remain. */ for (i = 0; i < 10; i++) { From 71a407a307c487e507cad4c51faec9aeb73fe9f4 Mon Sep 17 00:00:00 2001 From: Muhammad Usama Anjum Date: Mon, 27 Jul 2026 10:52:20 +0100 Subject: [PATCH 127/250] selftests/mm: skip hard dirty page-cache test on NFS The hard dirty_pagecache variant uses MADV_HWPOISON to exercise recovery of a dirty file-backed page. The recovery path records -EIO in the address_space mapping, which NFS later reports when the test closes the file. This makes the test fail after the hwpoison checks have completed. Skip this variant when the test file is on NFS. Keep the hard clean-page and both soft-offline variants enabled because they use folio removal, invalidation, or migration rather than recording a delayed writeback error. The unsupported-filesystem path in clean_pagecache() also returns without closing the opened test file. Close the descriptor before skipping there and in dirty_pagecache(). Link: https://lore.kernel.org/20260727095225.372655-5-usama.anjum@arm.com Signed-off-by: Muhammad Usama Anjum Reviewed-by: Miaohe Lin Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Naoya Horiguchi Cc: Nico Pache Cc: Ryan Roberts Cc: Sarthak Sharma Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Usama Arif Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/memory-failure.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/memory-failure.c b/tools/testing/selftests/mm/memory-failure.c index 1a5a32e22cce29..f3cb578b160962 100644 --- a/tools/testing/selftests/mm/memory-failure.c +++ b/tools/testing/selftests/mm/memory-failure.c @@ -287,8 +287,10 @@ TEST_F(memory_failure, clean_pagecache) if (fd < 0) SKIP(return, "failed to open test file.\n"); fs_type = get_fs_type(fd); - if (!fs_type || fs_type == TMPFS_MAGIC) + if (!fs_type || fs_type == TMPFS_MAGIC) { + close(fd); SKIP(return, "unsupported filesystem :%x\n", fs_type); + } addr = mmap(0, self->page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); @@ -327,8 +329,16 @@ TEST_F(memory_failure, dirty_pagecache) if (fd < 0) SKIP(return, "failed to open test file.\n"); fs_type = get_fs_type(fd); - if (!fs_type || fs_type == TMPFS_MAGIC) + /* + * MADV_HARD poisoning of dirty page-cache data records an expected + * -EIO in the file mapping. NFS reports this error on close(), so + * skip this variant. + */ + if (!fs_type || fs_type == TMPFS_MAGIC || + (fs_type == NFS_SUPER_MAGIC && variant->type == MADV_HARD)) { + close(fd); SKIP(return, "unsupported filesystem :%x\n", fs_type); + } addr = mmap(0, self->page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); From dce09e683fb0c169a7d6fae41ee4022ce9029220 Mon Sep 17 00:00:00 2001 From: Muhammad Usama Anjum Date: Mon, 27 Jul 2026 10:52:21 +0100 Subject: [PATCH 128/250] selftests/mm: retry migration failures for the full runtime move_pages() is best effort and can temporarily fail when concurrent faults race with page unmapping. A busy shared-anon workload can exhaust the current 100 retries long before the intended 20-second runtime and produce a false failure. Use the full runtime as the retry window. Since the initial page location is unknown, require it to reach both alternating NUMA targets to confirm that cross-node migration made progress despite transient contention. Link: https://lore.kernel.org/20260727095225.372655-6-usama.anjum@arm.com Signed-off-by: Muhammad Usama Anjum Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Naoya Horiguchi Cc: Nico Pache Cc: Ryan Roberts Cc: Sarthak Sharma Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Usama Arif Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/migration.c | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/mm/migration.c b/tools/testing/selftests/mm/migration.c index 29f7492453d439..f19d53c6957644 100644 --- a/tools/testing/selftests/mm/migration.c +++ b/tools/testing/selftests/mm/migration.c @@ -7,7 +7,7 @@ #include "kselftest_harness.h" #include "hugepage_settings.h" -#include +#include #include #include #include @@ -20,7 +20,6 @@ #define TWOMEG (2<<20) #define RUNTIME (20) -#define MAX_RETRIES 100 #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) HUGETLB_SETUP_DEFAULT_PAGES(1) @@ -110,7 +109,7 @@ int migrate(uint64_t *ptr, int n1, int n2) int ret, tmp; int status = 0; struct timespec ts1, ts2; - int failures = 0; + int success = 0; if (clock_gettime(CLOCK_MONOTONIC, &ts1)) return -1; @@ -119,29 +118,33 @@ int migrate(uint64_t *ptr, int n1, int n2) if (clock_gettime(CLOCK_MONOTONIC, &ts2)) return -1; - if (ts2.tv_sec - ts1.tv_sec >= RUNTIME) - return 0; + if (ts2.tv_sec - ts1.tv_sec >= RUNTIME) { + /* Reaching both targets verifies a cross-node move. */ + if (success >= 2) + return 0; + else + return -2; + } ret = move_pages(0, 1, (void **) &ptr, &n2, &status, MPOL_MF_MOVE_ALL); - if (ret) { - if (ret > 0) { - /* Migration is best effort; try again */ - if (++failures < MAX_RETRIES) - continue; - printf("Didn't migrate %d pages\n", ret); - } - else - perror("Couldn't migrate pages"); + if (ret < 0) { + perror("Couldn't migrate pages"); + return ret; + } + /* Migration is best effort. Try again */ + if (ret > 0 || status < 0) + continue; + if (status != n2) { + printf("Page is on node %d instead of target node %d\n", + status, n2); return -2; } - failures = 0; + success++; tmp = n2; n2 = n1; n1 = tmp; } - - return 0; } void *access_mem(void *ptr) From 7b2839e7038d6e24cd85971ac01dca5d39a53727 Mon Sep 17 00:00:00 2001 From: Hao Jia Date: Thu, 6 Aug 2026 15:09:42 +0800 Subject: [PATCH 129/250] mm/zswap: fix global shrinker when memory cgroup is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch series "mm/zswap: Fixes and improves the zswap shrink", v4. This series fixes and improves the zswap global shrinker (shrink_worker()): Patch 1: Fix missing global shrinker when memory cgroup is disabled. Patch 2: Extend shrink_memcg() to support batch writeback and thereby improving the writeback efficiency in the shrink_worker() and zswap_store() paths. This patch (of 2): Zswap writeback when the global pool limit is hit fails when memory cgroup is disabled. The pool remains full until it is organically drained by swapins or memory freeing, leading to zswap store failures and pages bypassing getting written directly to the backing swap device, causing LRU inversion (hotter pages with higher fault latency). This happens because mem_cgroup_iter() always returns NULL when memory cgroups are disabled. As a result, the global shrinker shrink_worker() repeatedly takes empty walks. After MAX_RECLAIM_RETRIES failed attempts, the worker gives up without writing back any pages. Therefore, when memory cgroup is disabled, fall through with the !memcg branch and shrink the root memcg directly. With memcg disabled, shrink_memcg() only returns -ENOENT when the root LRU is empty, which means the total pages are already below thr. In the absence of heavy concurrent zswap stores, the loop then safely bails out via the zswap_total_pages() <= thr check; otherwise, it will resume shrinking the memcg after processing the reschedule check. For any other return value from shrink_memcg(), the loop is guaranteed to terminate, either after MAX_RECLAIM_RETRIES failures or once the threshold is met. This is a potential performance regression for people using zswap without memcg that was introduced by the commit in "Fixes". Link: https://lore.kernel.org/20260806070943.95542-1-jiahao.kernel@gmail.com Link: https://lore.kernel.org/20260806070943.95542-2-jiahao.kernel@gmail.com Fixes: a65b0e7607cc ("zswap: make shrinking memcg-aware") Signed-off-by: Hao Jia Suggested-by: Nhat Pham Acked-by: Nhat Pham Acked-by: Yosry Ahmed Reported-by: Yosry Ahmed Cc: Chengming Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tejun Heo Cc: Signed-off-by: Andrew Morton --- mm/zswap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index a810524c762176..cf824e2a6b38fe 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1356,11 +1356,12 @@ static void shrink_worker(struct work_struct *w) } while (memcg && !mem_cgroup_tryget_online(memcg)); spin_unlock(&zswap_shrink_lock); - if (!memcg) { - /* - * Continue shrinking without incrementing failures if - * we found candidate memcgs in the last tree walk. - */ + /* + * A NULL memcg ends a full hierarchy pass (except when memcg is + * disabled, where it is always NULL: fall through to the root LRU). + * Count a failure only if the last pass found no candidates. + */ + if (!memcg && !mem_cgroup_disabled()) { if (!attempts && ++failures == MAX_RECLAIM_RETRIES) break; @@ -1379,7 +1380,7 @@ static void shrink_worker(struct work_struct *w) * and failures. */ if (ret == -ENOENT) - continue; + goto resched; ++attempts; if (ret && ++failures == MAX_RECLAIM_RETRIES) From df1e25ae82f6f7f8af1ac2cc5004ad9a62174906 Mon Sep 17 00:00:00 2001 From: Hao Jia Date: Thu, 6 Aug 2026 15:09:43 +0800 Subject: [PATCH 130/250] mm/zswap: support batch writeback in shrink_memcg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, shrink_memcg() writes back at most one entry per-node during its traversal. This makes shrink_worker() inefficient, as it must repeatedly re-enter shrink_memcg() to make any substantial progress. Under high memory pressure, this can cause the writeback speed to be too slow to keep up with refaults, leading to zswap store failures and forcing pages to skip zswap and go directly to disk, which results in an LRU inversion. To address this, extend the per-node scan budget in shrink_memcg() from a single entry to up to SWAP_CLUSTER_MAX pages, enabling batch writeback for both the shrink_worker() and zswap_store() paths. Test Setup: - Total memory: 32 GB, 1 NUMA node. - zswap settings: accept_threshold_percent=50, shrinker_enabled=N. Test Case 1: Set max_pool_percent=1, allocate 512MB of anonymous pages, and fill them with random data (to avoid compression). Then, use cgroup memory.reclaim to force a large amount of anonymous pages into zswap. At an interval of 2ms, allocate a 4K anonymous page where the first 4 bytes are random numbers and the rest are zeros, and then trigger reclamation of this 4K page through cgroup memory.reclaim. When the pool threshold is reached, shrink_memcg() will be triggered. The test data after running for 120s is as follows: Baseline Patched shrink_worker wakeups 5,363 169 shrink_memcg calls 11,373,201 350,703 written_back pages 40,212 40,241 zswap_store calls 161,190 163,753 store succeeded (ret=1) 102,743 117,183 store rejected (ret=0) 58,447 46,570 store reject rate ~36% ~28% pool_limit_hit delta 55,826 33,760 pswpout 98,659 86,811 pswpin 2 0 Test Case 2: We evaluated the following two sub-configurations using stress-ng inside a cgroup capped at memory.max=1G for 120 seconds: Test Case 2a (max_pool_percent=1): Continuously triggers the global zswap pool limit, thereby waking up shrink_worker() to perform asynchronous shrinking. Test Case 2b (zswap.max=320M, max_pool_percent=50): Continuously triggers the cgroup's zswap.max limit, thereby invoking synchronous shrinking. Command executed for both setups: bash -c 'echo $$ > /sys/fs/cgroup/zswaptest/cgroup.procs ; \ exec stress-ng --vm 4 --vm-bytes 4G --vm-keep --vm-method rand-set -t \ 120s -q' Test Case 2a (max_pool_percent=1): Baseline Patched shrink_worker wakeups 5,640 1,308 shrink_memcg calls 8,481,500 3,140,972 written_back pages 260 468,216 zswap_store calls 2,742,756 2,011,269 store succeeded (ret=1) 934,640 947,988 store rejected (ret=0) 1,808,116 1,063,281 store reject rate ~66% ~52% pool_limit_hit delta 1,181,310 196,882 pswpout 1,808,376 1,531,497 pswpin 4,288,497 3,635,365 Test Case 2b (zswap.max=320M, max_pool_percent=50): Baseline Patched shrink_worker wakeups 0 0 shrink_memcg calls 687,608 54,002 written_back pages 639,176 846,663 zswap_store calls 1,224,222 1,228,548 store succeeded (ret=1) 992,816 1,208,123 store rejected (ret=0) 231,431 20,425 store reject rate ~19% ~2% pool_limit_hit delta 0 0 pswpout 870,745 867,360 pswpin 1,707,823 1,216,814 Under identical workloads and runtimes, batched zswap shrinking exhibits a significant reduction in both shrink_worker() wakeups and shrink_memcg() calls. Furthermore, the sharp drop in both pswpin and zswap_store() rejections demonstrates that batching zswap shrink operations effectively mitigates zswap_store() failures caused by hitting the pool limit. This significantly prevents pages from bypassing zswap and falling back directly to disk, thereby reducing LRU inversion. Link: https://lore.kernel.org/20260806070943.95542-3-jiahao.kernel@gmail.com Signed-off-by: Hao Jia Suggested-by: Yosry Ahmed Suggested-by: Johannes Weiner Acked-by: Yosry Ahmed Acked-by: Nhat Pham Cc: Chengming Zhou Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tejun Heo Signed-off-by: Andrew Morton --- mm/zswap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index cf824e2a6b38fe..0b9435b4f57cb2 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1275,6 +1275,14 @@ static struct shrinker *zswap_alloc_shrinker(void) return shrinker; } +/* + * Scan up to SWAP_CLUSTER_MAX pages on each per-node zswap LRU of @memcg + * and write back the reclaimable ones. + * + * Return: 0 if at least one entry was written back, -EAGAIN if entries + * were scanned but none could be written back, or -ENOENT if @memcg has + * writeback disabled, is a zombie cgroup, or has empty zswap LRUs. + */ static int shrink_memcg(struct mem_cgroup *memcg) { int nid, shrunk = 0, scanned = 0; @@ -1290,13 +1298,14 @@ static int shrink_memcg(struct mem_cgroup *memcg) return -ENOENT; for_each_node_state(nid, N_NORMAL_MEMORY) { - unsigned long nr_to_walk = 1; + unsigned long nr_to_walk = SWAP_CLUSTER_MAX; shrunk += list_lru_walk_one(&zswap_list_lru, nid, memcg, &shrink_memcg_cb, NULL, &nr_to_walk); - scanned += 1 - nr_to_walk; + scanned += SWAP_CLUSTER_MAX - nr_to_walk; } + /* Nothing was scanned: every LRU under @memcg was empty. */ if (!scanned) return -ENOENT; From b6dcc375bf2843a5d61fb340e9ebf414aedd9ac5 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Thu, 6 Aug 2026 09:58:38 +0300 Subject: [PATCH 131/250] drivers/base, mm: move arch_numa.c to mm/ arch_numa.c implements boot time discovery and initialization of NUMA topology on architectures that select GENERIC_ARCH_NUMA (currently arm64 and riscv). Since this is step in the initialization of the memory management subsystem, it's logical to have arch_numa.c in mm/ alongside numa.c, numa_memblks.c and numa_emulation.c. Move arch_numa.c to mm/ and add its F: entry to "MEMBLOCK AND MEMORY MANAGEMENT INITIALIZATION" in MAINTAINERS. Link: https://lore.kernel.org/20260806-arch-numa-v1-1-968ec128121e@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Acked-by: Greg Kroah-Hartman Acked-by: Lorenzo Stoakes (ARM) Acked-by: Vlastimil Babka (SUSE) Acked-by: David Hildenbrand (Arm) Acked-by: Danilo Krummrich Cc: Albert Ou Cc: Alexandre Ghiti Cc: Catalin Marinas Cc: Liam R. Howlett Cc: Michal Hocko Cc: Palmer Dabbelt Cc: "Rafael J. Wysocki" Cc: Suren Baghdasaryan Cc: Will Deacon Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + drivers/base/Kconfig | 7 ------- drivers/base/Makefile | 1 - mm/Kconfig | 7 +++++++ mm/Makefile | 1 + {drivers/base => mm}/arch_numa.c | 0 6 files changed, 9 insertions(+), 8 deletions(-) rename {drivers/base => mm}/arch_numa.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 8cda0afedf52a1..449e89dd519421 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16880,6 +16880,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git fixes F: Documentation/core-api/boot-time-mm.rst F: include/linux/kho/abi/memblock.h F: include/linux/memblock.h +F: mm/arch_numa.c F: mm/memblock.c F: mm/memtest.c F: mm/mm_init.c diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index f7d385cbd3ba4b..1d93bfc34490fb 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -239,13 +239,6 @@ config GENERIC_ARCH_TOPOLOGY appropriate scaling, sysfs interface for reading capacity values at runtime. -config GENERIC_ARCH_NUMA - bool - select NUMA_MEMBLKS - help - Enable support for generic NUMA implementation. Currently, RISC-V - and ARM64 use it. - config FW_DEVLINK_SYNC_STATE_TIMEOUT bool "sync_state() behavior defaults to timeout instead of strict" help diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 8074a10183dcb7..435710f643a5c6 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -25,7 +25,6 @@ obj-$(CONFIG_PINCTRL) += pinctrl.o obj-$(CONFIG_DEV_COREDUMP) += devcoredump.o obj-$(CONFIG_GENERIC_MSI_IRQ) += platform-msi.o obj-$(CONFIG_GENERIC_ARCH_TOPOLOGY) += arch_topology.o -obj-$(CONFIG_GENERIC_ARCH_NUMA) += arch_numa.o obj-$(CONFIG_ACPI) += physical_location.o obj-y += test/ diff --git a/mm/Kconfig b/mm/Kconfig index 331daf7fcfab5a..8a24c130d008a8 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1463,6 +1463,13 @@ config NUMA_EMU into virtual nodes when booted with "numa=fake=N", where N is the number of nodes. This is only useful for debugging. +config GENERIC_ARCH_NUMA + bool + select NUMA_MEMBLKS + help + Enable support for generic NUMA implementation. Currently, RISC-V + and ARM64 use it. + config ARCH_HAS_USER_SHADOW_STACK bool help diff --git a/mm/Makefile b/mm/Makefile index ab37ef428d98dc..e7245cb88c6651 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -122,6 +122,7 @@ obj-$(CONFIG_CMA) += cma.o obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_NUMA_MEMBLKS) += numa_memblks.o obj-$(CONFIG_NUMA_EMU) += numa_emulation.o +obj-$(CONFIG_GENERIC_ARCH_NUMA) += arch_numa.o obj-$(CONFIG_BALLOON) += balloon.o obj-$(CONFIG_PAGE_EXTENSION) += page_ext.o obj-$(CONFIG_PAGE_TABLE_CHECK) += page_table_check.o diff --git a/drivers/base/arch_numa.c b/mm/arch_numa.c similarity index 100% rename from drivers/base/arch_numa.c rename to mm/arch_numa.c From efc2452807e3939c7d4d622f5d85f5947a908ca9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 7 Aug 2026 10:13:10 -0700 Subject: [PATCH 132/250] mm: make VM_FAULT_RESULT_TRACE compatible with sparse Fix the following sparse warnings that appear while building f2fs: ./include/trace/events/f2fs.h:1469:1: warning: incorrect type in initializer (different base types) ./include/trace/events/f2fs.h:1469:1: expected unsigned long mask ./include/trace/events/f2fs.h:1469:1: got restricted vm_fault_t Link: https://lore.kernel.org/e56c9e2aead04f79192c3110de80d846e41e3791.1786122711.git.bvanassche@acm.org Signed-off-by: Bart Van Assche Acked-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton --- include/linux/mm_types.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index ebf0d912be7db7..6d815f6440c94e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -1718,20 +1718,20 @@ enum vm_fault_reason { VM_FAULT_SIGSEGV | VM_FAULT_HWPOISON | \ VM_FAULT_HWPOISON_LARGE | VM_FAULT_FALLBACK) -#define VM_FAULT_RESULT_TRACE \ - { VM_FAULT_OOM, "OOM" }, \ - { VM_FAULT_SIGBUS, "SIGBUS" }, \ - { VM_FAULT_MAJOR, "MAJOR" }, \ - { VM_FAULT_HWPOISON, "HWPOISON" }, \ - { VM_FAULT_HWPOISON_LARGE, "HWPOISON_LARGE" }, \ - { VM_FAULT_SIGSEGV, "SIGSEGV" }, \ - { VM_FAULT_NOPAGE, "NOPAGE" }, \ - { VM_FAULT_LOCKED, "LOCKED" }, \ - { VM_FAULT_RETRY, "RETRY" }, \ - { VM_FAULT_FALLBACK, "FALLBACK" }, \ - { VM_FAULT_DONE_COW, "DONE_COW" }, \ - { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }, \ - { VM_FAULT_COMPLETED, "COMPLETED" } +#define VM_FAULT_RESULT_TRACE \ + { (__force u32)VM_FAULT_OOM, "OOM" }, \ + { (__force u32)VM_FAULT_SIGBUS, "SIGBUS" }, \ + { (__force u32)VM_FAULT_MAJOR, "MAJOR" }, \ + { (__force u32)VM_FAULT_HWPOISON, "HWPOISON" }, \ + { (__force u32)VM_FAULT_HWPOISON_LARGE, "HWPOISON_LARGE" }, \ + { (__force u32)VM_FAULT_SIGSEGV, "SIGSEGV" }, \ + { (__force u32)VM_FAULT_NOPAGE, "NOPAGE" }, \ + { (__force u32)VM_FAULT_LOCKED, "LOCKED" }, \ + { (__force u32)VM_FAULT_RETRY, "RETRY" }, \ + { (__force u32)VM_FAULT_FALLBACK, "FALLBACK" }, \ + { (__force u32)VM_FAULT_DONE_COW, "DONE_COW" }, \ + { (__force u32)VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }, \ + { (__force u32)VM_FAULT_COMPLETED, "COMPLETED" } struct vm_special_mapping { const char *name; /* The name, e.g. "[vdso]". */ From af345f06f402c01d574bcc31f66b0815fb7190cb Mon Sep 17 00:00:00 2001 From: Sourav Panda Date: Fri, 7 Aug 2026 04:00:03 +0000 Subject: [PATCH 133/250] mm/hugetlb_cma: support percentage-based hugetlb_cma reservation Currently, hugetlb_cma reservation only supports absolute sizes (e.g., hugetlb_cma=2G or hugetlb_cma=0:1G,1:1G). This can be restrictive in heterogeneous environments or when deploying common kernel command lines across machines with different memory capacities. Add support for percentage-based hugetlb_cma reservation (e.g., hugetlb_cma=20% or hugetlb_cma=0:20%,1:10%). The percentage is calculated against the total memory (for global settings) or against the node-specific memory (for node-specific settings) using memblock APIs during early boot. Link: https://lore.kernel.org/20260807040003.2156630-1-souravpanda@google.com Signed-off-by: Sourav Panda Acked-by: Usama Arif Cc: David Hildenbrand Cc: David Rientjes Cc: Frank van der Linden Cc: Greg Thelen Cc: Muchun Song Cc: Oscar Salvador Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton --- .../admin-guide/kernel-parameters.txt | 10 +- mm/hugetlb_cma.c | 142 +++++++++++++++++- 2 files changed, 142 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 364c2dce8e70fe..1af62cd16c9de7 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2064,8 +2064,14 @@ Kernel parameters hugetlb_cma= [HW,CMA,EARLY] The size of a CMA area used for allocation of gigantic hugepages. Or using node format, the size of a CMA area per node can be specified. - Format: nn[KMGTPE] or (node format) - :nn[KMGTPE][,:nn[KMGTPE]] + The size can be an absolute value (e.g., 2G) or a + percentage of the total memory or node memory (e.g., 20%). + Percentage-derived sizes are rounded down to a multiple of + the architecture's gigantic hugepage size and may become + zero. + Format: nn[KMGTPE] or nn% or (node format) + :nn[KMGTPE][,:nn[KMGTPE]] or + :nn%[,:nn%] The size must be a multiple of the gigantic page size. When using node format, this applies to each per-node size. diff --git a/mm/hugetlb_cma.c b/mm/hugetlb_cma.c index ed4e4ae8c01a77..95fd2d190f0d2e 100644 --- a/mm/hugetlb_cma.c +++ b/mm/hugetlb_cma.c @@ -10,6 +10,9 @@ #include #include +#include +#include +#include #include "internal.h" #include "hugetlb_cma.h" @@ -19,6 +22,28 @@ static unsigned long hugetlb_cma_size_in_node[MAX_NUMNODES] __initdata; static bool hugetlb_cma_only __ro_after_init; static unsigned long hugetlb_cma_size __ro_after_init; +static unsigned int hugetlb_cma_percent __initdata; +static unsigned int hugetlb_cma_percent_in_node[MAX_NUMNODES] __initdata; + +#ifdef CONFIG_NUMA +static phys_addr_t __init memblock_node_memory_size(int nid) +{ + struct memblock_region *reg; + phys_addr_t size = 0; + + for_each_mem_region(reg) { + if (reg->nid == nid) + size += reg->size; + } + return size; +} +#else +static phys_addr_t __init memblock_node_memory_size(int nid) +{ + return memblock_phys_mem_size(); +} +#endif + void hugetlb_cma_free_frozen_folio(struct folio *folio) { WARN_ON_ONCE(!cma_release_frozen(hugetlb_cma[folio_nid(folio)], @@ -105,14 +130,31 @@ static int __init cmdline_parse_hugetlb_cma(char *p) break; if (s[count] == ':') { + char *next; + if (tmp >= MAX_NUMNODES) break; nid = array_index_nospec(tmp, MAX_NUMNODES); + hugetlb_cma_size = 0; + hugetlb_cma_percent = 0; + s += count + 1; - tmp = memparse(s, &s); - hugetlb_cma_size_in_node[nid] = tmp; - hugetlb_cma_size += tmp; + tmp = memparse(s, &next); + if (*next == '%') { + if (tmp > 100) { + pr_warn("hugetlb_cma: invalid percentage %lu for node %d\n", + tmp, nid); + break; + } + hugetlb_cma_percent_in_node[nid] = tmp; + hugetlb_cma_size_in_node[nid] = 0; + s = next + 1; + } else { + hugetlb_cma_size_in_node[nid] = tmp; + hugetlb_cma_percent_in_node[nid] = 0; + s = next; + } /* * Skip the separator if have one, otherwise @@ -123,7 +165,28 @@ static int __init cmdline_parse_hugetlb_cma(char *p) else break; } else { - hugetlb_cma_size = memparse(p, &p); + char *next; + + tmp = memparse(p, &next); + if (*next == '%') { + if (tmp > 100) { + pr_warn("hugetlb_cma: invalid percentage %lu\n", tmp); + } else { + hugetlb_cma_percent = tmp; + hugetlb_cma_size = 0; + for (nid = 0; nid < MAX_NUMNODES; nid++) { + hugetlb_cma_size_in_node[nid] = 0; + hugetlb_cma_percent_in_node[nid] = 0; + } + } + } else { + hugetlb_cma_size = tmp; + hugetlb_cma_percent = 0; + for (nid = 0; nid < MAX_NUMNODES; nid++) { + hugetlb_cma_size_in_node[nid] = 0; + hugetlb_cma_percent_in_node[nid] = 0; + } + } break; } } @@ -149,8 +212,36 @@ void __init hugetlb_cma_reserve(void) { unsigned long size, reserved, per_node, order, gigantic_page_size; bool node_specific_cma_alloc = false; + bool has_node_specific_param = false; int nid; + for (nid = 0; nid < MAX_NUMNODES; nid++) { + if (hugetlb_cma_size_in_node[nid] || hugetlb_cma_percent_in_node[nid]) { + has_node_specific_param = true; + break; + } + } + + if (has_node_specific_param) { + hugetlb_cma_size = 0; + for (nid = 0; nid < MAX_NUMNODES; nid++) { + if (hugetlb_cma_percent_in_node[nid]) { + phys_addr_t node_gfp_mem = memblock_node_memory_size(nid); + u64 s; + + s = mul_u64_u32_div((u64)node_gfp_mem, + hugetlb_cma_percent_in_node[nid], + 100); + + hugetlb_cma_size_in_node[nid] = s; + } + hugetlb_cma_size += hugetlb_cma_size_in_node[nid]; + } + } else if (hugetlb_cma_percent) { + hugetlb_cma_size = mul_u64_u32_div((u64)memblock_phys_mem_size(), + hugetlb_cma_percent, 100); + } + if (!hugetlb_cma_size) return; @@ -169,6 +260,32 @@ void __init hugetlb_cma_reserve(void) VM_WARN_ON(order <= MAX_PAGE_ORDER); gigantic_page_size = PAGE_SIZE << order; + if (hugetlb_cma_percent) { + unsigned long orig_size = hugetlb_cma_size; + + hugetlb_cma_size = ALIGN_DOWN(hugetlb_cma_size, PAGE_SIZE << order); + if (orig_size && !hugetlb_cma_size) + pr_warn("hugetlb_cma: reservation size rounded down to 0 from %lu MiB (%u%%)\n", + orig_size / SZ_1M, hugetlb_cma_percent); + } else if (has_node_specific_param) { + hugetlb_cma_size = 0; + for (nid = 0; nid < MAX_NUMNODES; nid++) { + if (hugetlb_cma_percent_in_node[nid]) { + unsigned long orig_size = hugetlb_cma_size_in_node[nid]; + + hugetlb_cma_size_in_node[nid] = + ALIGN_DOWN(hugetlb_cma_size_in_node[nid], + PAGE_SIZE << order); + if (orig_size && !hugetlb_cma_size_in_node[nid]) + pr_warn("hugetlb_cma: reservation size rounded down to 0 from %lu MiB (%u%%) on node %d\n", + orig_size / SZ_1M, + hugetlb_cma_percent_in_node[nid], + nid); + } + hugetlb_cma_size += hugetlb_cma_size_in_node[nid]; + } + } + hugetlb_bootmem_set_nodes(); for (nid = 0; nid < MAX_NUMNODES; nid++) { @@ -209,8 +326,13 @@ void __init hugetlb_cma_reserve(void) per_node = DIV_ROUND_UP(hugetlb_cma_size, nodes_weight(hugetlb_bootmem_nodes)); per_node = round_up(per_node, gigantic_page_size); - pr_info("hugetlb_cma: reserve %lu MiB, up to %lu MiB per node\n", - hugetlb_cma_size / SZ_1M, per_node / SZ_1M); + if (hugetlb_cma_percent) + pr_info("hugetlb_cma: reserve %lu MiB (%u%%), up to %lu MiB per node\n", + hugetlb_cma_size / SZ_1M, hugetlb_cma_percent, + per_node / SZ_1M); + else + pr_info("hugetlb_cma: reserve %lu MiB, up to %lu MiB per node\n", + hugetlb_cma_size / SZ_1M, per_node / SZ_1M); } reserved = 0; @@ -245,8 +367,12 @@ void __init hugetlb_cma_reserve(void) } reserved += size; - pr_info("hugetlb_cma: reserved %lu MiB on node %d\n", - size / SZ_1M, nid); + if (hugetlb_cma_percent_in_node[nid]) + pr_info("hugetlb_cma: reserved %lu MiB (%u%%) on node %d\n", + size / SZ_1M, hugetlb_cma_percent_in_node[nid], nid); + else + pr_info("hugetlb_cma: reserved %lu MiB on node %d\n", + size / SZ_1M, nid); if (reserved >= hugetlb_cma_size) break; From 8bad9d589ed76b29f6c3c18d53d8c5eb47876e02 Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Fri, 7 Aug 2026 09:35:55 +0800 Subject: [PATCH 134/250] selftests/mm: fix read_file() return value check read_file() returns 0 on open/read failures and never returns negative values. Existing < 0 error checks never trigger, so read failures are silently ignored. Check for zero return to detect read_file() failures. Also fix misleading error message in get_finfo(). The error string incorrectly references read_num when reading uevent files. Link: https://lore.kernel.org/20260807013555.36525-1-hongfu.li@linux.dev Fixes: e0c13f9761df ("khugepaged: add self test") Signed-off-by: Hongfu Li Acked-by: David Hildenbrand (Arm) Cc: Baolin Wang Cc: Barry Song Cc: Dev Jain Cc: Lance Yang Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/khugepaged.c | 4 ++-- tools/testing/selftests/mm/vm_util.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 8f221c792a28b0..d3a53673e1f9ae 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -141,8 +141,8 @@ static void get_finfo(const char *dir) major(path_stat.st_dev), minor(path_stat.st_dev)) >= sizeof(path)) ksft_exit_fail_msg("%s: Pathname is too long\n", __func__); - if (read_file(path, buf, sizeof(buf)) < 0) - ksft_exit_fail_perror("read_file(read_num)"); + if (!read_file(path, buf, sizeof(buf))) + ksft_exit_fail_perror("read_file(uevent)"); if (strstr(buf, "DEVTYPE=disk")) { /* Found it */ if (snprintf(finfo.dev_queue_read_ahead_path, diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 4fe4a5a610d191..4821a356303631 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -942,7 +942,7 @@ unsigned long read_num(const char *path) { char buf[21]; - if (read_file(path, buf, sizeof(buf)) < 0) + if (!read_file(path, buf, sizeof(buf))) ksft_exit_fail_perror("read_file()"); return strtoul(buf, NULL, 10); From c8cb6d9a9bf22b7cbda5ddff1c7c01c93e88f0ad Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Wed, 10 Jun 2026 18:22:44 -0700 Subject: [PATCH 135/250] mm: fix CONFIG_STACK_GROWSUP typo in tools/testing/vma/include/dup.h Commit 2b6a3f061f11 ("mm: declare VMA flags by bit") significantly refactored the header file include/linux/mm.h. In that step, it introduced a typo in an ifdef, referring to a non-existing config option STACK_GROWS_UP, whereas the actual config option is called STACK_GROWSUP. Commit 40a4af52e047 ("mm: fix CONFIG_STACK_GROWSUP typo in mm.h") fixed this typo in the mm.h header file, but did not update the copy of the code in tools/testing/vma/include/dup.h. Update this copy as well. Commit message adapted from the above-referenced fix to mm.h. Link: https://lore.kernel.org/20260611012258.432043-1-enelsonmoore@gmail.com Signed-off-by: Ethan Nelson-Moore Reviewed-by: Lorenzo Stoakes Cc: Alice Ryhl Cc: Jann Horn Cc: Liam R. Howlett Cc: Pedro Falcato Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/vma/include/dup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index 4655aecffaf31b..4c58487b764e9d 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -243,7 +243,7 @@ enum { #define VM_NOHUGEPAGE INIT_VM_FLAG(NOHUGEPAGE) #define VM_MERGEABLE INIT_VM_FLAG(MERGEABLE) #define VM_STACK INIT_VM_FLAG(STACK) -#ifdef CONFIG_STACK_GROWS_UP +#ifdef CONFIG_STACK_GROWSUP #define VM_STACK_EARLY INIT_VM_FLAG(STACK_EARLY) #define VMA_STACK_EARLY mk_vma_flags(VMA_STACK_EARLY_BIT) #else From c41f08ed6f823077821fa460beb23e69911a9a28 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Wed, 8 Jul 2026 18:01:23 +0000 Subject: [PATCH 136/250] alloc_tag: add ioctl to /proc/allocinfo Patch series "alloc_tag: introduce IOCTL-based filtering for MAP", v8. Currently, memory allocation profiling data is primarily exposed through /proc/allocinfo. While useful for manual inspection, this text-based interface poses challenges for production monitoring and large-scale analysis: 1. Userspace must parse large amounts of text to extract specific fields. 2. To find specific tags, userspace must read the entire dataset, requiring many context switches and high data copying. 3. The kernel currently aggregates per-CPU counters for every allocation size, even those the user intends to filter out immediately. This series introduces a new IOCTL-based binary interface for allocinfo that supports kernel-side filtering. By allowing the user to specify a filter mask, we significantly reduce the work performed in-kernel and the amount of data transferred to userspace. The IOCTL mechanism was chosen for allocinfo to address the per-CPU counter aggregation bottleneck. A traditional read() operation must report the total allocation count and sizes for every code tag in the system. Doing so requires iterating across all CPUs to sum their per-CPU counters for thousands of tags, which introduces substantial runtime overhead. The IOCTL interface allows userspace to push selective filtering criteria directly into the kernel before the per-CPU counter aggregation. The kernel aggregates per-CPU counters only for a small subset of tags that match the filter. This results in significant performance improvement. Beyond fast filtered retrieval, the IOCTL foundation allows introducing a context capture mechanism in the future to capture the context for specific allocations. Performance measurements were conducted on an Intel Xeon Platinum 8481C (224 CPUs) with caches dropped before each run. The IOCTL mechanism shows a ~20x performance improvement for filtered queries. The kernel avoids the expensive per-CPU counter aggregation (alloc_tag_read) for any tags that fail the initial string or location filters. Scenario 1: Specific File Filtering (arch/x86/events/rapl.c) 1. Traditional (cat /proc/allocinfo | grep): 22ms (sys) 2. IOCTL Interface: 1ms (sys) Scenario 2: Compound Filtering (Filename + Size) 1. Traditional: (cat ... | grep | awk): 21ms (sys) 2. IOCTL Interface: 1ms (sys) Scenario 3: Size-Based Filtering (min_size = 1MB) 1. Traditional: (cat ... | awk): 21ms (sys) 2. IOCTL Interface: 14ms (sys) This patch (of 6): Add the following ioctl commands for /proc/allocinfo file: ALLOCINFO_IOC_CONTENT_ID - gets content identifier which can be used to check whether the file content has changed specifically due to module load/unload. Every time a module is loaded / unloaded, the returned value will be different. By comparing the identifier value at the beginning and at the end of the content retrieval operation, users can validate retrieved information for consistency. ALLOCINFO_IOC_GET_AT - gets the record at the specified position. This is the position of a record in /proc/allocinfo. ALLOCINFO_IOC_GET_NEXT - gets the record next to the last retrieved one. If no records were previously retrieved, returns the first record. Note, function file and module names often have the same prefixes, therefore when filtering for them, we compare the last 64 characters to minimize the chances of name collisions. [akpm@linux-foundation.org: include compat.h, per Suren] Closes: https://lore.kernel.org/oe-kbuild-all/202607091820.qbjlGhKK-lkp@intel.com/ Link: https://lore.kernel.org/cover.1783532853.git.abhishekbapat@google.com Link: https://lore.kernel.org/15596de2607ef13e7c77c6d74763f4ae992ec475.1783532853.git.abhishekbapat@google.com Signed-off-by: Suren Baghdasaryan Signed-off-by: Abhishek Bapat Acked-by: Hao Ge Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Signed-off-by: Andrew Morton --- Documentation/mm/allocation-profiling.rst | 5 + .../userspace-api/ioctl/ioctl-number.rst | 2 + MAINTAINERS | 1 + include/linux/codetag.h | 2 + include/uapi/linux/alloc_tag.h | 65 +++++ lib/codetag.c | 18 ++ mm/alloc_tag.c | 239 +++++++++++++++++- 7 files changed, 330 insertions(+), 2 deletions(-) create mode 100644 include/uapi/linux/alloc_tag.h diff --git a/Documentation/mm/allocation-profiling.rst b/Documentation/mm/allocation-profiling.rst index e928aa3e4e1eb7..b2ebcef8af6f27 100644 --- a/Documentation/mm/allocation-profiling.rst +++ b/Documentation/mm/allocation-profiling.rst @@ -57,6 +57,11 @@ sysctl: Runtime info: /proc/allocinfo + Profiling data can be retrieved either by reading `/proc/allocinfo` directly as + text or programmatically via `ioctl()` calls defined in ``. + The ioctl interface supports structured binary data extraction as well as filtering + by module name, function, file, line number, accuracy, or allocation size limits. + Example output:: root@moria-kvm:~# sort -g /proc/allocinfo|tail|numfmt --to=iec diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index 3f0ef1e27eb07d..2fc53093752d13 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -346,6 +346,8 @@ Code Seq# Include File Comments 0xA5 20-2F linux/surface_aggregator/dtx.h Microsoft Surface DTX driver +0xA6 00-0F uapi/linux/alloc_tag.h Memory allocation profiling + 0xAA 00-3F linux/uapi/linux/userfaultfd.h 0xAB 00-1F linux/nbd.h 0xAC 00-1F linux/raw.h diff --git a/MAINTAINERS b/MAINTAINERS index 449e89dd519421..bf429cd01d3080 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16940,6 +16940,7 @@ S: Maintained F: Documentation/mm/allocation-profiling.rst F: include/linux/alloc_tag.h F: include/linux/pgalloc_tag.h +F: include/uapi/linux/alloc_tag.h F: mm/alloc_tag.c MEMORY MANAGEMENT - BALLOON diff --git a/include/linux/codetag.h b/include/linux/codetag.h index ddae7484ca456c..a25a085c2df199 100644 --- a/include/linux/codetag.h +++ b/include/linux/codetag.h @@ -77,6 +77,8 @@ struct codetag_iterator { void codetag_lock_module_list(struct codetag_type *cttype); bool codetag_trylock_module_list(struct codetag_type *cttype); void codetag_unlock_module_list(struct codetag_type *cttype); +unsigned long codetag_get_content_id(struct codetag_type *cttype); +unsigned int codetag_get_count(struct codetag_type *cttype); struct codetag_iterator codetag_get_ct_iter(struct codetag_type *cttype); struct codetag *codetag_next_ct(struct codetag_iterator *iter); diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h new file mode 100644 index 00000000000000..ee6a023cbaf423 --- /dev/null +++ b/include/uapi/linux/alloc_tag.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * alloc_tag IOCTL API definition + * + * Copyright (C) 2026 Google, LLC. All rights reserved. + * + * 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. + */ + +#ifndef _UAPI_ALLOC_TAG_H +#define _UAPI_ALLOC_TAG_H + +#include + +/* + * Function, file and module names often have the same prefixes, therefore + * when filtering by these criteria, we compare the last 64 characters to + * minimize the chances of name collisions + */ +#define ALLOCINFO_STR_SIZE 64 + +struct allocinfo_content_id { + __u64 id; +}; + +struct allocinfo_tag { + /* Longer names are trimmed */ + char modname[ALLOCINFO_STR_SIZE]; + char function[ALLOCINFO_STR_SIZE]; + char filename[ALLOCINFO_STR_SIZE]; + __u64 lineno; +}; + +/* The alignment ensures 32-bit compatible interfaces are not broken */ +struct allocinfo_counter { + __u64 bytes; + __u64 calls; + __u8 accurate; +} __attribute__((aligned(8))); + +struct allocinfo_tag_data { + struct allocinfo_tag tag; + struct allocinfo_counter counter; +}; + +struct allocinfo_get_at { + __u64 pos; /* input */ + struct allocinfo_tag_data data; +}; + +#define _ALLOCINFO_IOC_CONTENT_ID 0 +#define _ALLOCINFO_IOC_GET_AT 1 +#define _ALLOCINFO_IOC_GET_NEXT 2 + +#define ALLOCINFO_IOC_BASE 0xA6 +#define ALLOCINFO_IOC_CONTENT_ID _IOR(ALLOCINFO_IOC_BASE, _ALLOCINFO_IOC_CONTENT_ID, \ + struct allocinfo_content_id) +#define ALLOCINFO_IOC_GET_AT _IOWR(ALLOCINFO_IOC_BASE, _ALLOCINFO_IOC_GET_AT, \ + struct allocinfo_get_at) +#define ALLOCINFO_IOC_GET_NEXT _IOR(ALLOCINFO_IOC_BASE, _ALLOCINFO_IOC_GET_NEXT, \ + struct allocinfo_tag_data) + +#endif /* _UAPI_ALLOC_TAG_H */ diff --git a/lib/codetag.c b/lib/codetag.c index 4001a7ea667542..a9cda4c962a303 100644 --- a/lib/codetag.c +++ b/lib/codetag.c @@ -19,6 +19,8 @@ struct codetag_type { struct codetag_type_desc desc; /* generates unique sequence number for module load */ unsigned long next_mod_seq; + /* bumped on every module load and unload */ + unsigned long content_id; }; struct codetag_range { @@ -50,6 +52,20 @@ void codetag_unlock_module_list(struct codetag_type *cttype) up_read(&cttype->mod_lock); } +unsigned long codetag_get_content_id(struct codetag_type *cttype) +{ + lockdep_assert_held(&cttype->mod_lock); + + return cttype->content_id; +} + +unsigned int codetag_get_count(struct codetag_type *cttype) +{ + lockdep_assert_held(&cttype->mod_lock); + + return cttype->count; +} + struct codetag_iterator codetag_get_ct_iter(struct codetag_type *cttype) { struct codetag_iterator iter = { @@ -204,6 +220,7 @@ static int codetag_module_init(struct codetag_type *cttype, struct module *mod) down_write(&cttype->mod_lock); cmod->mod_seq = ++cttype->next_mod_seq; + ++cttype->content_id; mod_id = idr_alloc(&cttype->mod_idr, cmod, 0, 0, GFP_KERNEL); if (mod_id >= 0) { if (cttype->desc.module_load) { @@ -368,6 +385,7 @@ void codetag_unload_module(struct module *mod) cttype->count -= range_size(cttype, &cmod->range); idr_remove(&cttype->mod_idr, mod_id); kfree(cmod); + ++cttype->content_id; } up_write(&cttype->mod_lock); if (found && cttype->desc.free_section_mem) diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c index b60ee89704cce0..b2ac166880ac09 100644 --- a/mm/alloc_tag.c +++ b/mm/alloc_tag.c @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include #include @@ -14,6 +16,7 @@ #include #include #include +#include #include "internal.h" #include "page_alloc.h" @@ -59,6 +62,10 @@ struct allocinfo_private { struct codetag_iterator iter; struct codetag_iterator reported_iter; bool print_header; + /* ioctl uses a separate iterator not to interfere with reads */ + struct codetag_iterator ioctl_iter; + bool positioned; /* seq_open_private() sets to 0 */ + struct mutex ioctl_lock; }; static void *allocinfo_start(struct seq_file *m, loff_t *pos) @@ -142,6 +149,235 @@ static const struct seq_operations allocinfo_seq_op = { .show = allocinfo_show, }; +/* + * Initializes seq_file operations and allocates private state when opening + * the /proc/allocinfo procfs entry. + */ +static int allocinfo_open(struct inode *inode, struct file *file) +{ + int ret; + + ret = seq_open_private(file, &allocinfo_seq_op, + sizeof(struct allocinfo_private)); + if (!ret) { + struct seq_file *m = file->private_data; + struct allocinfo_private *priv = m->private; + + mutex_init(&priv->ioctl_lock); + } + return ret; +} + +/* + * Cleans up the seq_file state and frees up the private state allocated in + * allocinfo_open() when closing the /proc/allocinfo file descriptor. + */ +static int allocinfo_release(struct inode *inode, struct file *file) +{ + struct seq_file *m = file->private_data; + struct allocinfo_private *priv = m->private; + + mutex_destroy(&priv->ioctl_lock); + return seq_release_private(inode, file); +} + +/* + * Returns a pointer to the suffix of a string so that its length fits within + * ALLOCINFO_STR_SIZE, preserving the trailing characters. + * Function, file and module names often have the same prefixes, therefore + * when filtering by these criteria, we compare the last 64 characters to + * minimize the chances of name collisions + */ +static const char *allocinfo_str(const char *str) +{ + size_t len = strlen(str); + + /* Keep an extra space for the trailing NULL. */ + if (len >= ALLOCINFO_STR_SIZE) + str += (len - ALLOCINFO_STR_SIZE) + 1; + return str; +} + +/* Copy a string and trim from the beginning if it's too long */ +static void allocinfo_copy_str(char *dest, const char *src) +{ + strscpy_pad(dest, allocinfo_str(src), ALLOCINFO_STR_SIZE); +} + +/* + * Populates the UAPI allocinfo_tag_data structure with active runtime + * profiling counters extracted from the given kernel codetag. + */ +static void allocinfo_to_params(struct codetag *ct, + struct allocinfo_tag_data *data) +{ + struct alloc_tag *tag = ct_to_alloc_tag(ct); + struct alloc_tag_counters counter = alloc_tag_read(tag); + + if (ct->modname) + allocinfo_copy_str(data->tag.modname, ct->modname); + else + data->tag.modname[0] = '\0'; + allocinfo_copy_str(data->tag.function, ct->function); + allocinfo_copy_str(data->tag.filename, ct->filename); + data->tag.lineno = ct->lineno; + data->counter.bytes = counter.bytes; + data->counter.calls = counter.calls; + data->counter.accurate = !alloc_tag_is_inaccurate(tag); +} + +/* + * Retrieves the unique content ID representing the current allocation tag module + * layout, allowing userspace to detect if modules were loaded / unloaded. + */ +static int allocinfo_ioctl_get_content_id(struct seq_file *m, void __user *arg) +{ + struct allocinfo_content_id params; + + codetag_lock_module_list(alloc_tag_cttype); + params.id = codetag_get_content_id(alloc_tag_cttype); + codetag_unlock_module_list(alloc_tag_cttype); + if (copy_to_user(arg, ¶ms, sizeof(params))) + return -EFAULT; + + return 0; +} + +/* + * Seeks the ioctl iterator to the specified 0-indexed tag position, reads its + * profiling data and returns it to userspace. + */ +static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) +{ + struct allocinfo_private *priv; + struct codetag *ct; + __u64 pos; + struct allocinfo_get_at params = {0}; + + if (copy_from_user(¶ms, arg, sizeof(params))) + return -EFAULT; + + priv = m->private; + pos = params.pos; + + mutex_lock(&priv->ioctl_lock); + codetag_lock_module_list(alloc_tag_cttype); + + if (pos >= codetag_get_count(alloc_tag_cttype)) { + codetag_unlock_module_list(alloc_tag_cttype); + mutex_unlock(&priv->ioctl_lock); + return -ENOENT; + } + + /* Find the codetag */ + priv->ioctl_iter = codetag_get_ct_iter(alloc_tag_cttype); + ct = codetag_next_ct(&priv->ioctl_iter); + while (ct && pos--) + ct = codetag_next_ct(&priv->ioctl_iter); + if (ct) { + allocinfo_to_params(ct, ¶ms.data); + priv->positioned = true; + } + + codetag_unlock_module_list(alloc_tag_cttype); + mutex_unlock(&priv->ioctl_lock); + + if (!ct) + return -ENOENT; + + if (copy_to_user(arg, ¶ms, sizeof(params))) + return -EFAULT; + + return 0; +} + +/* + * Advances the ioctl iterator to the next allocation tag in the sequence and + * returns its profiling data to userspace. + */ +static int allocinfo_ioctl_get_next(struct seq_file *m, void __user *arg) +{ + struct allocinfo_private *priv; + struct codetag *ct; + struct allocinfo_tag_data params; + int ret = 0; + + memset(¶ms, 0, sizeof(params)); + priv = m->private; + + mutex_lock(&priv->ioctl_lock); + codetag_lock_module_list(alloc_tag_cttype); + + if (!priv->positioned) { + priv->ioctl_iter = codetag_get_ct_iter(alloc_tag_cttype); + priv->positioned = true; + } + + ct = codetag_next_ct(&priv->ioctl_iter); + if (ct) + allocinfo_to_params(ct, ¶ms); + + if (!ct) { + priv->positioned = false; + ret = -ENOENT; + } + codetag_unlock_module_list(alloc_tag_cttype); + mutex_unlock(&priv->ioctl_lock); + + if (ret == 0) { + if (copy_to_user(arg, ¶ms, sizeof(params))) + return -EFAULT; + } + return ret; +} + +/* + * Entry point ioctl function for /proc/allocinfo routing requests to fetch the + * layout content ID, seek to a specific tag, or read sequential tags. + */ +static long allocinfo_ioctl(struct file *file, unsigned int cmd, + unsigned long __arg) +{ + void __user *arg = (void __user *)__arg; + int ret; + + switch (cmd) { + case ALLOCINFO_IOC_CONTENT_ID: + ret = allocinfo_ioctl_get_content_id(file->private_data, arg); + break; + case ALLOCINFO_IOC_GET_AT: + ret = allocinfo_ioctl_get_at(file->private_data, arg); + break; + case ALLOCINFO_IOC_GET_NEXT: + ret = allocinfo_ioctl_get_next(file->private_data, arg); + break; + default: + ret = -ENOIOCTLCMD; + break; + } + + return ret; +} + +#ifdef CONFIG_COMPAT +static long allocinfo_compat_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + return allocinfo_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); +} +#endif + +static const struct proc_ops allocinfo_proc_ops = { + .proc_open = allocinfo_open, + .proc_read_iter = seq_read_iter, + .proc_lseek = seq_lseek, + .proc_release = allocinfo_release, + .proc_ioctl = allocinfo_ioctl, +#ifdef CONFIG_COMPAT + .proc_compat_ioctl = allocinfo_compat_ioctl, +#endif +}; + size_t alloc_tag_top_users(struct codetag_bytes *tags, size_t count, bool can_sleep) { struct codetag_iterator iter; @@ -999,8 +1235,7 @@ static int __init alloc_tag_init(void) return 0; } - if (!proc_create_seq_private(ALLOCINFO_FILE_NAME, 0400, NULL, &allocinfo_seq_op, - sizeof(struct allocinfo_private), NULL)) { + if (!proc_create(ALLOCINFO_FILE_NAME, 0400, NULL, &allocinfo_proc_ops)) { pr_err("Failed to create %s file\n", ALLOCINFO_FILE_NAME); shutdown_mem_profiling(false); return -ENOMEM; From 36db2e1c58f7dbdf9cb5afc68356132fd741af37 Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 8 Jul 2026 18:01:24 +0000 Subject: [PATCH 137/250] alloc_tag: add ioctl filters to /proc/allocinfo Extend the capability of the IOCTL mechanism to filter allocations based on tag's module name, function name, file name and line number. Link: https://lore.kernel.org/6a6100c0c58cb2911f39126b9fe177a8c17db16f.1783532853.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Acked-by: Hao Ge Acked-by: Suren Baghdasaryan Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Signed-off-by: Andrew Morton --- include/uapi/linux/alloc_tag.h | 26 ++++++++++++- mm/alloc_tag.c | 68 ++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h index ee6a023cbaf423..13e9b5916bf5ab 100644 --- a/include/uapi/linux/alloc_tag.h +++ b/include/uapi/linux/alloc_tag.h @@ -45,8 +45,32 @@ struct allocinfo_tag_data { struct allocinfo_counter counter; }; +enum { + ALLOCINFO_FILTER_MODNAME, + ALLOCINFO_FILTER_FUNCTION, + ALLOCINFO_FILTER_FILENAME, + ALLOCINFO_FILTER_LINENO, + __ALLOCINFO_FILTER_LAST = ALLOCINFO_FILTER_LINENO +}; + +#define ALLOCINFO_FILTER_MASK_MODNAME (1 << ALLOCINFO_FILTER_MODNAME) +#define ALLOCINFO_FILTER_MASK_FUNCTION (1 << ALLOCINFO_FILTER_FUNCTION) +#define ALLOCINFO_FILTER_MASK_FILENAME (1 << ALLOCINFO_FILTER_FILENAME) +#define ALLOCINFO_FILTER_MASK_LINENO (1 << ALLOCINFO_FILTER_LINENO) + +#define ALLOCINFO_FILTER_MASKS \ + ((1 << (__ALLOCINFO_FILTER_LAST + 1)) - 1) + +struct allocinfo_filter { + __u64 mask; /* bitmask of the filter fields used */ + struct allocinfo_tag fields; +}; + struct allocinfo_get_at { - __u64 pos; /* input */ + /* inputs */ + __u64 pos; + struct allocinfo_filter filter; + /* output */ struct allocinfo_tag_data data; }; diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c index b2ac166880ac09..d7ed0034c49f17 100644 --- a/mm/alloc_tag.c +++ b/mm/alloc_tag.c @@ -62,6 +62,7 @@ struct allocinfo_private { struct codetag_iterator iter; struct codetag_iterator reported_iter; bool print_header; + struct allocinfo_filter filter; /* ioctl uses a separate iterator not to interfere with reads */ struct codetag_iterator ioctl_iter; bool positioned; /* seq_open_private() sets to 0 */ @@ -204,6 +205,12 @@ static void allocinfo_copy_str(char *dest, const char *src) strscpy_pad(dest, allocinfo_str(src), ALLOCINFO_STR_SIZE); } +/* Compare two strings and only consider the trimmed suffix if s1 is too long */ +static int allocinfo_cmp_str(const char *str, const char *template) +{ + return strncmp(allocinfo_str(str), template, ALLOCINFO_STR_SIZE); +} + /* * Populates the UAPI allocinfo_tag_data structure with active runtime * profiling counters extracted from the given kernel codetag. @@ -243,6 +250,40 @@ static int allocinfo_ioctl_get_content_id(struct seq_file *m, void __user *arg) return 0; } +/* + * Verifies whether a given codetag satisfies the active filtering criteria by + * matching its characteristics against the specified filter. + */ +static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter) +{ + if (!filter || !filter->mask) + return true; + + if (filter->mask & ALLOCINFO_FILTER_MASK_MODNAME) { + /* user wants to filter by modname but ct->modname is NULL */ + if (!ct->modname) { + /* validate if user was attempting to filter for built-in allocations */ + if (filter->fields.modname[0] != '\0') + return false; + } else if (allocinfo_cmp_str(ct->modname, filter->fields.modname)) + return false; + } + + if ((filter->mask & ALLOCINFO_FILTER_MASK_FUNCTION) && + ct->function && allocinfo_cmp_str(ct->function, filter->fields.function)) + return false; + + if ((filter->mask & ALLOCINFO_FILTER_MASK_FILENAME) && + ct->filename && allocinfo_cmp_str(ct->filename, filter->fields.filename)) + return false; + + if ((filter->mask & ALLOCINFO_FILTER_MASK_LINENO) && + ct->lineno != filter->fields.lineno) + return false; + + return true; +} + /* * Seeks the ioctl iterator to the specified 0-indexed tag position, reads its * profiling data and returns it to userspace. @@ -251,29 +292,46 @@ static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) { struct allocinfo_private *priv; struct codetag *ct; - __u64 pos; struct allocinfo_get_at params = {0}; + __u64 skip_count; if (copy_from_user(¶ms, arg, sizeof(params))) return -EFAULT; + if (params.filter.mask & ~ALLOCINFO_FILTER_MASKS) + return -EINVAL; + priv = m->private; - pos = params.pos; mutex_lock(&priv->ioctl_lock); codetag_lock_module_list(alloc_tag_cttype); - if (pos >= codetag_get_count(alloc_tag_cttype)) { + if (params.pos >= codetag_get_count(alloc_tag_cttype)) { codetag_unlock_module_list(alloc_tag_cttype); mutex_unlock(&priv->ioctl_lock); return -ENOENT; } + skip_count = params.pos; + + if (params.filter.mask) + priv->filter = params.filter; + else + priv->filter.mask = 0; + /* Find the codetag */ priv->ioctl_iter = codetag_get_ct_iter(alloc_tag_cttype); ct = codetag_next_ct(&priv->ioctl_iter); - while (ct && pos--) + + while (ct) { + if (matches_filter(ct, &priv->filter)) { + if (skip_count == 0) + break; + skip_count--; + } ct = codetag_next_ct(&priv->ioctl_iter); + } + if (ct) { allocinfo_to_params(ct, ¶ms.data); priv->positioned = true; @@ -314,6 +372,8 @@ static int allocinfo_ioctl_get_next(struct seq_file *m, void __user *arg) } ct = codetag_next_ct(&priv->ioctl_iter); + while (ct && !matches_filter(ct, &priv->filter)) + ct = codetag_next_ct(&priv->ioctl_iter); if (ct) allocinfo_to_params(ct, ¶ms); From 75fca80f6a967338a4f5e08fcb05f76cf0c21773 Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 8 Jul 2026 18:01:25 +0000 Subject: [PATCH 138/250] alloc_tag: add size-based filtering to ioctl Extend the allocinfo filtering mechanism to allow users to filter tags based on the total number of bytes allocated [min_size, max_size]. The size range is inclusive. Filtering by size involves retrieving allocinfo per-CPU counters, which is an expensive operation. Hence, the performance of size-based filtering will be worse than other filters. Link: https://lore.kernel.org/0a7653b70ae0d64e967fbea0e933bc35f8ac656e.1783532853.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Acked-by: Hao Ge Acked-by: Suren Baghdasaryan Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Signed-off-by: Andrew Morton --- include/uapi/linux/alloc_tag.h | 8 ++++- mm/alloc_tag.c | 64 +++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h index 13e9b5916bf5ab..0de5fc180790f3 100644 --- a/include/uapi/linux/alloc_tag.h +++ b/include/uapi/linux/alloc_tag.h @@ -50,13 +50,17 @@ enum { ALLOCINFO_FILTER_FUNCTION, ALLOCINFO_FILTER_FILENAME, ALLOCINFO_FILTER_LINENO, - __ALLOCINFO_FILTER_LAST = ALLOCINFO_FILTER_LINENO + ALLOCINFO_FILTER_MIN_SIZE, + ALLOCINFO_FILTER_MAX_SIZE, + __ALLOCINFO_FILTER_LAST = ALLOCINFO_FILTER_MAX_SIZE }; #define ALLOCINFO_FILTER_MASK_MODNAME (1 << ALLOCINFO_FILTER_MODNAME) #define ALLOCINFO_FILTER_MASK_FUNCTION (1 << ALLOCINFO_FILTER_FUNCTION) #define ALLOCINFO_FILTER_MASK_FILENAME (1 << ALLOCINFO_FILTER_FILENAME) #define ALLOCINFO_FILTER_MASK_LINENO (1 << ALLOCINFO_FILTER_LINENO) +#define ALLOCINFO_FILTER_MASK_MIN_SIZE (1 << ALLOCINFO_FILTER_MIN_SIZE) +#define ALLOCINFO_FILTER_MASK_MAX_SIZE (1 << ALLOCINFO_FILTER_MAX_SIZE) #define ALLOCINFO_FILTER_MASKS \ ((1 << (__ALLOCINFO_FILTER_LAST + 1)) - 1) @@ -64,6 +68,8 @@ enum { struct allocinfo_filter { __u64 mask; /* bitmask of the filter fields used */ struct allocinfo_tag fields; + __u64 min_size; + __u64 max_size; }; struct allocinfo_get_at { diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c index d7ed0034c49f17..04b640d74bcc0c 100644 --- a/mm/alloc_tag.c +++ b/mm/alloc_tag.c @@ -211,16 +211,20 @@ static int allocinfo_cmp_str(const char *str, const char *template) return strncmp(allocinfo_str(str), template, ALLOCINFO_STR_SIZE); } +/* Fetch the per-CPU counters */ +static inline struct alloc_tag_counters allocinfo_prefetch_counters(struct codetag *ct) +{ + return alloc_tag_read(ct_to_alloc_tag(ct)); +} + /* * Populates the UAPI allocinfo_tag_data structure with active runtime * profiling counters extracted from the given kernel codetag. */ static void allocinfo_to_params(struct codetag *ct, - struct allocinfo_tag_data *data) + struct allocinfo_tag_data *data, + struct alloc_tag_counters *counters) { - struct alloc_tag *tag = ct_to_alloc_tag(ct); - struct alloc_tag_counters counter = alloc_tag_read(tag); - if (ct->modname) allocinfo_copy_str(data->tag.modname, ct->modname); else @@ -228,9 +232,9 @@ static void allocinfo_to_params(struct codetag *ct, allocinfo_copy_str(data->tag.function, ct->function); allocinfo_copy_str(data->tag.filename, ct->filename); data->tag.lineno = ct->lineno; - data->counter.bytes = counter.bytes; - data->counter.calls = counter.calls; - data->counter.accurate = !alloc_tag_is_inaccurate(tag); + data->counter.bytes = counters->bytes; + data->counter.calls = counters->calls; + data->counter.accurate = !alloc_tag_is_inaccurate(ct_to_alloc_tag(ct)); } /* @@ -254,7 +258,9 @@ static int allocinfo_ioctl_get_content_id(struct seq_file *m, void __user *arg) * Verifies whether a given codetag satisfies the active filtering criteria by * matching its characteristics against the specified filter. */ -static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter) +static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter, + struct alloc_tag_counters *counters, + bool *fetched_counters) { if (!filter || !filter->mask) return true; @@ -281,6 +287,19 @@ static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter) ct->lineno != filter->fields.lineno) return false; + if (filter->mask & (ALLOCINFO_FILTER_MASK_MIN_SIZE | ALLOCINFO_FILTER_MASK_MAX_SIZE)) { + if (!*fetched_counters) { + *counters = allocinfo_prefetch_counters(ct); + *fetched_counters = true; + } + if ((filter->mask & ALLOCINFO_FILTER_MASK_MIN_SIZE) && + counters->bytes < filter->min_size) + return false; + if ((filter->mask & ALLOCINFO_FILTER_MASK_MAX_SIZE) && + counters->bytes > filter->max_size) + return false; + } + return true; } @@ -294,6 +313,8 @@ static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) struct codetag *ct; struct allocinfo_get_at params = {0}; __u64 skip_count; + struct alloc_tag_counters counters; + bool fetched_counters; if (copy_from_user(¶ms, arg, sizeof(params))) return -EFAULT; @@ -301,6 +322,11 @@ static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) if (params.filter.mask & ~ALLOCINFO_FILTER_MASKS) return -EINVAL; + if ((params.filter.mask & ALLOCINFO_FILTER_MASK_MIN_SIZE) && + (params.filter.mask & ALLOCINFO_FILTER_MASK_MAX_SIZE) && + params.filter.min_size > params.filter.max_size) + return -EINVAL; + priv = m->private; mutex_lock(&priv->ioctl_lock); @@ -324,7 +350,8 @@ static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) ct = codetag_next_ct(&priv->ioctl_iter); while (ct) { - if (matches_filter(ct, &priv->filter)) { + fetched_counters = false; + if (matches_filter(ct, &priv->filter, &counters, &fetched_counters)) { if (skip_count == 0) break; skip_count--; @@ -333,7 +360,9 @@ static int allocinfo_ioctl_get_at(struct seq_file *m, void __user *arg) } if (ct) { - allocinfo_to_params(ct, ¶ms.data); + if (!fetched_counters) + counters = allocinfo_prefetch_counters(ct); + allocinfo_to_params(ct, ¶ms.data, &counters); priv->positioned = true; } @@ -359,6 +388,8 @@ static int allocinfo_ioctl_get_next(struct seq_file *m, void __user *arg) struct codetag *ct; struct allocinfo_tag_data params; int ret = 0; + struct alloc_tag_counters counters; + bool fetched_counters; memset(¶ms, 0, sizeof(params)); priv = m->private; @@ -372,11 +403,18 @@ static int allocinfo_ioctl_get_next(struct seq_file *m, void __user *arg) } ct = codetag_next_ct(&priv->ioctl_iter); - while (ct && !matches_filter(ct, &priv->filter)) + while (ct) { + fetched_counters = false; + if (matches_filter(ct, &priv->filter, &counters, &fetched_counters)) + break; ct = codetag_next_ct(&priv->ioctl_iter); - if (ct) - allocinfo_to_params(ct, ¶ms); + } + if (ct) { + if (!fetched_counters) + counters = allocinfo_prefetch_counters(ct); + allocinfo_to_params(ct, ¶ms, &counters); + } if (!ct) { priv->positioned = false; ret = -ENOENT; From 603f8781711b5b9ca48558bd3a525a1ea040c979 Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 8 Jul 2026 18:01:26 +0000 Subject: [PATCH 139/250] alloc_tag: add accuracy based filtering to ioctl Extend the allocinfo filtering mechanism to allow users to filter tags based on their accuracy. [abhishekbapat@google.com: move `inaccurate` filtering criteria from `struct allocinfo_tag` to `struct allocinfo_filter`] Link: https://lore.kernel.org/e4e49ec4a5960292aeeb9e196526c18dc95228a2.1785867739.git.abhishekbapat@google.com Link: https://lore.kernel.org/396a5e4bc3b2990223ab355f2cd3ceb6aa15499e.1783532853.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Acked-by: Hao Ge Acked-by: Suren Baghdasaryan Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Signed-off-by: Andrew Morton --- include/uapi/linux/alloc_tag.h | 4 ++++ mm/alloc_tag.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h index 0de5fc180790f3..e3ad94444864d5 100644 --- a/include/uapi/linux/alloc_tag.h +++ b/include/uapi/linux/alloc_tag.h @@ -50,6 +50,7 @@ enum { ALLOCINFO_FILTER_FUNCTION, ALLOCINFO_FILTER_FILENAME, ALLOCINFO_FILTER_LINENO, + ALLOCINFO_FILTER_INACCURATE, ALLOCINFO_FILTER_MIN_SIZE, ALLOCINFO_FILTER_MAX_SIZE, __ALLOCINFO_FILTER_LAST = ALLOCINFO_FILTER_MAX_SIZE @@ -59,6 +60,7 @@ enum { #define ALLOCINFO_FILTER_MASK_FUNCTION (1 << ALLOCINFO_FILTER_FUNCTION) #define ALLOCINFO_FILTER_MASK_FILENAME (1 << ALLOCINFO_FILTER_FILENAME) #define ALLOCINFO_FILTER_MASK_LINENO (1 << ALLOCINFO_FILTER_LINENO) +#define ALLOCINFO_FILTER_MASK_INACCURATE (1 << ALLOCINFO_FILTER_INACCURATE) #define ALLOCINFO_FILTER_MASK_MIN_SIZE (1 << ALLOCINFO_FILTER_MIN_SIZE) #define ALLOCINFO_FILTER_MASK_MAX_SIZE (1 << ALLOCINFO_FILTER_MAX_SIZE) @@ -70,6 +72,8 @@ struct allocinfo_filter { struct allocinfo_tag fields; __u64 min_size; __u64 max_size; + /* filter criteria only; see allocinfo_counter.accurate for actual accuracy */ + __u64 inaccurate; }; struct allocinfo_get_at { diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c index 04b640d74bcc0c..b3341031047796 100644 --- a/mm/alloc_tag.c +++ b/mm/alloc_tag.c @@ -262,6 +262,8 @@ static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter, struct alloc_tag_counters *counters, bool *fetched_counters) { + bool inaccurate; + if (!filter || !filter->mask) return true; @@ -287,6 +289,12 @@ static bool matches_filter(struct codetag *ct, struct allocinfo_filter *filter, ct->lineno != filter->fields.lineno) return false; + if (filter->mask & ALLOCINFO_FILTER_MASK_INACCURATE) { + inaccurate = !!(ct->flags & CODETAG_FLAG_INACCURATE); + if (inaccurate != !!(filter->inaccurate)) + return false; + } + if (filter->mask & (ALLOCINFO_FILTER_MASK_MIN_SIZE | ALLOCINFO_FILTER_MASK_MAX_SIZE)) { if (!*fetched_counters) { *counters = allocinfo_prefetch_counters(ct); From 6c9c14fe595c85c1da71936fc7ab2e58f61cf70a Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 8 Jul 2026 18:01:27 +0000 Subject: [PATCH 140/250] kselftest: alloc_tag: add kselftest for ioctl interface Introduce a kselftest to verify the new IOCTL-based interface for /proc/allocinfo. The test covers: 1. Validation of the filename filter. 2. Validation of the function filter. The first test validates the functionality of the filename filter. Using "mm/memory.c" as the candidate filename filter, it retrieves filtered entries from both procfs and ioctl and matches the first VEC_MAX_ENTRIES entries. The second test validates the functionality of the function filter. It uses "dup_mm" as the candidate function as we do not expect this function name to change frequently and hence won't be needing to modify this test often. Note that both the tests match line no, function name and file name fields. Bytes allocated and calls are not matched as those values may change in the time when the data is being read from procfs and ioctl and hence can lead to false negatives. [abhishekbapat@google.com: fix a typo in the selftest] Link: https://lore.kernel.org/e4e49ec4a5960292aeeb9e196526c18dc95228a2.1785867739.git.abhishekbapat@google.com Closes: https://sashiko.dev/#/patchset/cover.1783532853.git.abhishekbapat@google.com Link: https://lore.kernel.org/e2a3795677a14aeab249758ba570cd5e98402032.1783532853.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Tested-by: Hao Ge Acked-by: Hao Ge Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + tools/testing/selftests/alloc_tag/Makefile | 8 + .../alloc_tag/allocinfo_ioctl_test.c | 334 ++++++++++++++++++ 4 files changed, 344 insertions(+) create mode 100644 tools/testing/selftests/alloc_tag/Makefile create mode 100644 tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c diff --git a/MAINTAINERS b/MAINTAINERS index bf429cd01d3080..9eba56a72a666d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16942,6 +16942,7 @@ F: include/linux/alloc_tag.h F: include/linux/pgalloc_tag.h F: include/uapi/linux/alloc_tag.h F: mm/alloc_tag.c +F: tools/testing/selftests/alloc_tag/ MEMORY MANAGEMENT - BALLOON M: Andrew Morton diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 5528682a3a9122..2cc63e4134fb1f 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 TARGETS += acct +TARGETS += alloc_tag TARGETS += alsa TARGETS += amd-pstate TARGETS += arm64 diff --git a/tools/testing/selftests/alloc_tag/Makefile b/tools/testing/selftests/alloc_tag/Makefile new file mode 100644 index 00000000000000..c4637f69e9c21e --- /dev/null +++ b/tools/testing/selftests/alloc_tag/Makefile @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 + +TEST_GEN_PROGS := allocinfo_ioctl_test + +CFLAGS += -Wall +CFLAGS += $(KHDR_INCLUDES) + +include ../lib.mk diff --git a/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c b/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c new file mode 100644 index 00000000000000..3614ee9b46fb22 --- /dev/null +++ b/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c @@ -0,0 +1,334 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/* kselftest for allocinfo ioctl + * allocinfo ioctl retrieves allocinfo data through ioctl + * Copyright (C) 2026 Google, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../kselftest.h" + +#define MAX_LINE_LEN 512 +#define ALLOCINFO_PROC "/proc/allocinfo" + +enum ioctl_ret { + IOCTL_SUCCESS = 0, + IOCTL_FAILURE = 1, + IOCTL_INVALID_DATA = 2, +}; + +#define VEC_MAX_ENTRIES 32 + +struct allocinfo_tag_data_vec { + struct allocinfo_tag_data tag[VEC_MAX_ENTRIES]; + __u64 count; +}; + +static inline int __allocinfo_get_content_id(int dev_fd, struct allocinfo_content_id *params) +{ + return ioctl(dev_fd, ALLOCINFO_IOC_CONTENT_ID, params); +} + +static inline int __allocinfo_get_at(int dev_fd, struct allocinfo_get_at *params) +{ + return ioctl(dev_fd, ALLOCINFO_IOC_GET_AT, params); +} + +static inline int __allocinfo_get_next(int dev_fd, struct allocinfo_tag_data *params) +{ + return ioctl(dev_fd, ALLOCINFO_IOC_GET_NEXT, params); +} + +static bool match_entry(const struct allocinfo_tag_data *procfs_entry, + const struct allocinfo_tag_data *tag_data, + bool match_bytes, bool match_calls, bool match_lineno, + bool match_function, bool match_filename) +{ + if (match_bytes && tag_data->counter.bytes != procfs_entry->counter.bytes) { + ksft_print_msg("size retrieved through ioctl does not match procfs\n"); + return false; + } + + if (match_calls && tag_data->counter.calls != procfs_entry->counter.calls) { + ksft_print_msg("call count retrieved through ioctl does not match procfs\n"); + return false; + } + + if (match_lineno && tag_data->tag.lineno != procfs_entry->tag.lineno) { + ksft_print_msg("lineno retrieved through ioctl does not match procfs\n"); + return false; + } + + if (match_function && + strncmp(tag_data->tag.function, procfs_entry->tag.function, ALLOCINFO_STR_SIZE)) { + ksft_print_msg("function retrieved through ioctl does not match procfs\n"); + return false; + } + + if (match_filename && + strncmp(tag_data->tag.filename, procfs_entry->tag.filename, ALLOCINFO_STR_SIZE)) { + ksft_print_msg("filename retrieved through ioctl does not match procfs\n"); + return false; + } + return true; +} + +static bool match_entries(const struct allocinfo_tag_data_vec *procfs_entries, + const struct allocinfo_tag_data_vec *tags, + bool match_bytes, bool match_calls, bool match_lineno, + bool match_function, bool match_filename) +{ + __u64 i; + + if (procfs_entries->count != tags->count) { + ksft_print_msg("Entry count mismatch. ioctl entries: %llu, proc entries: %llu\n", + tags->count, procfs_entries->count); + return false; + } + for (i = 0; i < procfs_entries->count; i++) { + if (!match_entry(&procfs_entries->tag[i], &tags->tag[i], + match_bytes, match_calls, match_lineno, + match_function, match_filename)) { + ksft_print_msg("%lluth entry does not match.\n", i); + return false; + } + } + return true; +} + +static const char *allocinfo_str(const char *str) +{ + size_t len = strlen(str); + + if (len >= ALLOCINFO_STR_SIZE) + str += (len - ALLOCINFO_STR_SIZE) + 1; + return str; +} + +static void allocinfo_copy_str(char *dest, const char *src) +{ + strncpy(dest, allocinfo_str(src), ALLOCINFO_STR_SIZE - 1); + dest[ALLOCINFO_STR_SIZE - 1] = '\0'; +} + +static int get_filtered_procfs_entries(struct allocinfo_tag_data_vec *procfs_entries, + const struct allocinfo_filter *filter) +{ + FILE *fp = fopen(ALLOCINFO_PROC, "r"); + char line[MAX_LINE_LEN]; + int matches; + struct allocinfo_tag_data procfs_entry; + + if (!fp) { + ksft_print_msg("Failed to open " ALLOCINFO_PROC " for reading\n"); + return 1; + } + memset(procfs_entries, 0, sizeof(*procfs_entries)); + while (fgets(line, sizeof(line), fp) && procfs_entries->count < VEC_MAX_ENTRIES) { + char filename[MAX_LINE_LEN]; + char function[MAX_LINE_LEN]; + + memset(&procfs_entry, 0, sizeof(procfs_entry)); + matches = sscanf(line, "%llu %llu %[^:]:%llu func:%s", + &procfs_entry.counter.bytes, + &procfs_entry.counter.calls, + filename, + &procfs_entry.tag.lineno, + function); + + if (matches != 5) + continue; + + allocinfo_copy_str(procfs_entry.tag.filename, filename); + allocinfo_copy_str(procfs_entry.tag.function, function); + + if (filter->mask & ALLOCINFO_FILTER_MASK_FILENAME) { + if (strncmp(procfs_entry.tag.filename, + filter->fields.filename, ALLOCINFO_STR_SIZE)) + continue; + } + if (filter->mask & ALLOCINFO_FILTER_MASK_FUNCTION) { + if (strncmp(procfs_entry.tag.function, + filter->fields.function, ALLOCINFO_STR_SIZE)) + continue; + } + if (filter->mask & ALLOCINFO_FILTER_MASK_LINENO) { + if (procfs_entry.tag.lineno != filter->fields.lineno) + continue; + } + if (filter->mask & ALLOCINFO_FILTER_MASK_MIN_SIZE) { + if (procfs_entry.counter.bytes < filter->min_size) + continue; + } + if (filter->mask & ALLOCINFO_FILTER_MASK_MAX_SIZE) { + if (procfs_entry.counter.bytes > filter->max_size) + continue; + } + + memcpy(&procfs_entries->tag[procfs_entries->count++], &procfs_entry, + sizeof(procfs_entry)); + } + fclose(fp); + return 0; +} + +static enum ioctl_ret get_filtered_ioctl_entries(struct allocinfo_tag_data_vec *tags, + const struct allocinfo_filter *filter, + __u64 start_pos) +{ + int fd = open(ALLOCINFO_PROC, O_RDONLY); + + if (fd < 0) { + ksft_print_msg("Failed to open " ALLOCINFO_PROC " for IOCTL\n"); + return IOCTL_FAILURE; + } + + struct allocinfo_content_id start_cont_id, end_cont_id; + struct allocinfo_get_at get_at_params; + const int max_retries = 10; + int retry_count = 0; + int status; + + /* + * __allocinfo_get_content_id may return different values if a kernel module was loaded + * between the two calls. If that happens, the data gathered cannot be considered consistent + * and hence needs to be fetched again to avoid flakiness. + */ + do { + if (__allocinfo_get_content_id(fd, &start_cont_id)) { + ksft_print_msg("allocinfo_get_content_id failed\n"); + status = IOCTL_FAILURE; + break; + } + + memset(tags, 0, sizeof(*tags)); + memset(&get_at_params, 0, sizeof(get_at_params)); + memcpy(&get_at_params.filter, filter, sizeof(*filter)); + get_at_params.pos = start_pos; + if (__allocinfo_get_at(fd, &get_at_params)) { + ksft_print_msg("allocinfo_get_at failed\n"); + status = IOCTL_FAILURE; + break; + } + memcpy(&tags->tag[tags->count++], &get_at_params.data, sizeof(get_at_params.data)); + + while (tags->count < VEC_MAX_ENTRIES && + __allocinfo_get_next(fd, &tags->tag[tags->count]) == 0) + tags->count++; + + if (__allocinfo_get_content_id(fd, &end_cont_id)) { + ksft_print_msg("allocinfo_get_content_id failed\n"); + status = IOCTL_FAILURE; + break; + } + + if (start_cont_id.id == end_cont_id.id) { + status = IOCTL_SUCCESS; + } else { + ksft_print_msg("allocinfo_get_content_id mismatch, retrying...\n"); + status = IOCTL_INVALID_DATA; + } + } while (status == IOCTL_INVALID_DATA && retry_count++ < max_retries); + + close(fd); + return status; +} + +static int run_filter_test(const struct allocinfo_filter *filter) +{ + struct allocinfo_tag_data_vec *tags = malloc(sizeof(*tags)); + struct allocinfo_tag_data_vec *procfs_entries = malloc(sizeof(*procfs_entries)); + int ioctl_status; + int ret = KSFT_PASS; + + if (!tags || !procfs_entries) { + ksft_print_msg("Memory allocation failed.\n"); + ret = KSFT_FAIL; + goto exit; + } + + if (get_filtered_procfs_entries(procfs_entries, filter)) { + ksft_print_msg("Error retrieving entries from " ALLOCINFO_PROC "\n"); + ret = KSFT_SKIP; + goto exit; + } + + if (procfs_entries->count == 0) { + ksft_print_msg("No entries found in " ALLOCINFO_PROC ", skipping test\n"); + ret = KSFT_SKIP; + goto exit; + } + + ioctl_status = get_filtered_ioctl_entries(tags, filter, 0); + if (ioctl_status == IOCTL_INVALID_DATA) { + ksft_print_msg("Trouble retrieving valid IOCTL entries, skipping.\n"); + ret = KSFT_SKIP; + goto exit; + } + if (ioctl_status == IOCTL_FAILURE) { + ksft_print_msg("Error retrieving IOCTL entries.\n"); + ret = KSFT_FAIL; + goto exit; + } + + if (!match_entries(procfs_entries, tags, false, false, true, true, true)) + ret = KSFT_FAIL; + +exit: + free(tags); + free(procfs_entries); + return ret; +} + +static int test_filename_filter(void) +{ + struct allocinfo_filter filter; + const char *target_filename = "mm/memory.c"; + + memset(&filter, 0, sizeof(filter)); + filter.mask |= ALLOCINFO_FILTER_MASK_FILENAME; + strncpy(filter.fields.filename, target_filename, ALLOCINFO_STR_SIZE); + + return run_filter_test(&filter); +} + +static int test_function_filter(void) +{ + struct allocinfo_filter filter; + const char *target_function = "dup_mm"; + + memset(&filter, 0, sizeof(filter)); + filter.mask |= ALLOCINFO_FILTER_MASK_FUNCTION; + strncpy(filter.fields.function, target_function, ALLOCINFO_STR_SIZE); + + return run_filter_test(&filter); +} + +int main(int argc, char *argv[]) +{ + int ret; + + ksft_set_plan(2); + + ret = test_filename_filter(); + if (ret == KSFT_SKIP) + ksft_test_result_skip("Skipping test_filename_filter\n"); + else + ksft_test_result(ret == KSFT_PASS, "test_filename_filter\n"); + + ret = test_function_filter(); + if (ret == KSFT_SKIP) + ksft_test_result_skip("Skipping test_function_filter\n"); + else + ksft_test_result(ret == KSFT_PASS, "test_function_filter\n"); + + ksft_finished(); +} From d15feca161f48528f68d60d11baf727579b13c44 Mon Sep 17 00:00:00 2001 From: Abhishek Bapat Date: Wed, 8 Jul 2026 18:01:28 +0000 Subject: [PATCH 141/250] kselftest: alloc_tag: extend the allocinfo ioctl kselftest Add the following 2 scenarios to the allocinfo ioctl kselftest: 1. Validate size based filtering 2. Validate lineno based filtering The first test uses "do_init_module" as the candidate function for the test. This is because the associated site will only allocate memory when a kernel module is loaded. The return value of get_content_id() changes every time modules are loaded or unloaded. Hence, as long as get_content_id() values at the start and the end of the test are the same, the memory allocated by the do_init_module call site should also remain the same. Consequently, the test can assume consistency between the value returned by the ioctl and the procfs resulting in less flakiness. Link: https://lore.kernel.org/e5171926b48802531284c1cb5f04734017141341.1783532853.git.abhishekbapat@google.com Signed-off-by: Abhishek Bapat Tested-by: Hao Ge Acked-by: Hao Ge Cc: Jonathan Corbet Cc: Kent Overstreet Cc: Sourav Panda Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton --- .../alloc_tag/allocinfo_ioctl_test.c | 216 +++++++++++++++++- 1 file changed, 215 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c b/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c index 3614ee9b46fb22..74fd64b2370ccf 100644 --- a/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c +++ b/tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c @@ -5,6 +5,7 @@ * Copyright (C) 2026 Google, Inc. */ +#include #include #include #include @@ -312,11 +313,212 @@ static int test_function_filter(void) return run_filter_test(&filter); } +static int test_size_filter(void) +{ + int fd; + struct allocinfo_tag_data_vec *tags = malloc(sizeof(*tags)); + struct allocinfo_tag_data_vec *procfs_entries = malloc(sizeof(*procfs_entries)); + struct allocinfo_filter filter; + int ret = KSFT_PASS; + __u64 target_size, i, pos; + struct allocinfo_tag_data *found_tag = NULL; + const char *target_function = "do_init_module"; + struct allocinfo_content_id start_cont_id, end_cont_id; + int retry = 0; + const int max_retries = 10; + + if (!tags || !procfs_entries) { + ksft_print_msg("Memory allocation failed.\n"); + ret = KSFT_FAIL; + goto freemem; + } + + fd = open(ALLOCINFO_PROC, O_RDONLY); + if (fd < 0) { + ksft_print_msg("Failed to open " ALLOCINFO_PROC ": %s\n", strerror(errno)); + ret = KSFT_SKIP; + goto freemem; + } + + do { + found_tag = NULL; + pos = 0; + + if (__allocinfo_get_content_id(fd, &start_cont_id)) { + ksft_print_msg("allocinfo_get_content_id failed\n"); + ret = KSFT_FAIL; + goto exit; + } + + memset(&filter, 0, sizeof(filter)); + filter.mask |= ALLOCINFO_FILTER_MASK_FUNCTION; + strncpy(filter.fields.function, target_function, ALLOCINFO_STR_SIZE); + + if (get_filtered_procfs_entries(procfs_entries, &filter)) { + ksft_print_msg("Error retrieving entries from " ALLOCINFO_PROC "\n"); + ret = KSFT_SKIP; + goto exit; + } + + if (procfs_entries->count == 0) { + ksft_print_msg("Function %s not found in procfs\n", target_function); + ret = KSFT_SKIP; + goto exit; + } + + target_size = procfs_entries->tag[0].counter.bytes; + + memset(&filter, 0, sizeof(filter)); + filter.mask |= ALLOCINFO_FILTER_MASK_MIN_SIZE | ALLOCINFO_FILTER_MASK_MAX_SIZE; + filter.min_size = target_size; + filter.max_size = target_size; + + while (1) { + struct allocinfo_get_at get_at_params; + + memset(&get_at_params, 0, sizeof(get_at_params)); + memcpy(&get_at_params.filter, &filter, sizeof(filter)); + get_at_params.pos = pos; + + if (__allocinfo_get_at(fd, &get_at_params)) + break; + + tags->count = 0; + memcpy(&tags->tag[tags->count++], &get_at_params.data, + sizeof(get_at_params.data)); + + while (tags->count < VEC_MAX_ENTRIES && + __allocinfo_get_next(fd, &tags->tag[tags->count]) == 0) + tags->count++; + + for (i = 0; i < tags->count; i++) { + if (strcmp(tags->tag[i].tag.function, target_function) == 0) { + found_tag = &tags->tag[i]; + break; + } + } + + if (found_tag || tags->count < VEC_MAX_ENTRIES) + break; + + pos += tags->count; + } + + if (__allocinfo_get_content_id(fd, &end_cont_id)) { + ksft_print_msg("allocinfo_get_content_id failed\n"); + ret = KSFT_FAIL; + goto exit; + } + + if (start_cont_id.id == end_cont_id.id) + break; + + ksft_print_msg("Module load detected during size verification, retrying...\n"); + } while (retry++ < max_retries); + + if (start_cont_id.id == end_cont_id.id && !found_tag) { + ksft_print_msg("Entry with function %s not found in IOCTL results\n", + target_function); + ret = KSFT_FAIL; + } else if (start_cont_id.id != end_cont_id.id) { + ksft_print_msg("Failed to match content_ids for procfs and IOCTL, skipping...\n"); + ret = KSFT_SKIP; + } else if (found_tag && found_tag->counter.bytes != target_size) { + ksft_print_msg("IOCTL entry size %llu does not match target size %llu\n", + found_tag->counter.bytes, target_size); + ret = KSFT_FAIL; + } + +exit: + close(fd); +freemem: + free(tags); + free(procfs_entries); + return ret; +} + +static int test_lineno_filter(void) +{ + struct allocinfo_tag_data_vec *tags = malloc(sizeof(*tags)); + struct allocinfo_tag_data_vec *procfs_entries = malloc(sizeof(*procfs_entries)); + struct allocinfo_filter filter; + enum ioctl_ret ioctl_status; + int ret = KSFT_PASS; + __u64 target_lineno, i; + struct allocinfo_tag_data *target_tag; + bool found = false; + + if (!tags || !procfs_entries) { + ksft_print_msg("Memory allocation failed.\n"); + ret = KSFT_FAIL; + goto exit; + } + + memset(&filter, 0, sizeof(filter)); + + if (get_filtered_procfs_entries(procfs_entries, &filter)) { + ksft_print_msg("Error retrieving entries from " ALLOCINFO_PROC "\n"); + ret = KSFT_SKIP; + goto exit; + } + if (procfs_entries->count == 0) { + ksft_print_msg("Could not retrieve procfs entries\n"); + ret = KSFT_SKIP; + goto exit; + } + /* + * We depend on the procfs results to determine the line number for the filter before + * making the ioctl query. Hence, we cannot reuse run_filter_test here. + */ + target_tag = &procfs_entries->tag[0]; + target_lineno = target_tag->tag.lineno; + + filter.mask |= ALLOCINFO_FILTER_MASK_LINENO; + filter.fields.lineno = target_lineno; + + ioctl_status = get_filtered_ioctl_entries(tags, &filter, 0); + if (ioctl_status == IOCTL_INVALID_DATA) { + ksft_print_msg("Trouble retrieving valid IOCTL entries, skipping.\n"); + ret = KSFT_SKIP; + goto exit; + } + if (ioctl_status == IOCTL_FAILURE) { + ksft_print_msg("Error retrieving IOCTL entries.\n"); + ret = KSFT_FAIL; + goto exit; + } + + for (i = 0; i < tags->count; i++) { + if (tags->tag[i].tag.lineno != target_lineno) { + ksft_print_msg("IOCTL entry %llu has incorrect lineno %llu.\n", + i, tags->tag[i].tag.lineno); + ret = KSFT_FAIL; + goto exit; + } + + if (strncmp(tags->tag[i].tag.function, target_tag->tag.function, + ALLOCINFO_STR_SIZE) == 0 && + strncmp(tags->tag[i].tag.filename, target_tag->tag.filename, + ALLOCINFO_STR_SIZE) == 0) + found = true; + } + + if (!found) { + ksft_print_msg("Original procfs entry not found in IOCTL lineno filter results.\n"); + ret = KSFT_FAIL; + } + +exit: + free(tags); + free(procfs_entries); + return ret; +} + int main(int argc, char *argv[]) { int ret; - ksft_set_plan(2); + ksft_set_plan(4); ret = test_filename_filter(); if (ret == KSFT_SKIP) @@ -330,5 +532,17 @@ int main(int argc, char *argv[]) else ksft_test_result(ret == KSFT_PASS, "test_function_filter\n"); + ret = test_size_filter(); + if (ret == KSFT_SKIP) + ksft_test_result_skip("Skipping test_size_filter\n"); + else + ksft_test_result(ret == KSFT_PASS, "test_size_filter\n"); + + ret = test_lineno_filter(); + if (ret == KSFT_SKIP) + ksft_test_result_skip("Skipping test_lineno_filter\n"); + else + ksft_test_result(ret == KSFT_PASS, "test_lineno_filter\n"); + ksft_finished(); } From b5f2034239ddaf9d30ee11e11e5b09c05db1b9c4 Mon Sep 17 00:00:00 2001 From: Zhiling Zou Date: Fri, 31 Jul 2026 11:22:51 +0800 Subject: [PATCH 142/250] mm: shmem: reject page-aligned fallocate end overflow shmem_fallocate() validates offset + len with inode_newsize_ok(), but then rounds that end offset up to a page boundary before entering the preallocation loop. For a valid request ending at MAX_LFS_FILESIZE, such as offset = 0 and len = LLONG_MAX, adding PAGE_SIZE - 1 to the validated end can overflow the signed loff_t used for the rounded end calculation. If that wrapped value is then converted into a page index, shmem_fallocate() can enter the folio allocation loop with an invalid range. Use check_add_overflow() when calculating the page-aligned end, and fail before entering the allocation loop if the rounded end cannot be represented. Link: https://lore.kernel.org/1929a466735dcbb9438936ff50b7a4fc2332a8a4.1785377919.git.zhilinz@nebusec.ai Fixes: e2d12e22c59c ("tmpfs: support fallocate preallocation") Signed-off-by: Zhiling Zou Reported-by: Vega Reviewed-by: Baolin Wang Cc: Hugh Dickins Signed-off-by: Andrew Morton --- mm/shmem.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 774f4b18ff5c6d..8ea776e5282382 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3617,6 +3617,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_falloc shmem_falloc; pgoff_t start, index, end, undo_fallocend; + loff_t aligned_end; int error; if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) @@ -3673,8 +3674,15 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, goto out; } + /* Check for wraparound */ + if (check_add_overflow(offset + len, (loff_t)PAGE_SIZE - 1, + &aligned_end)) { + error = -EFBIG; + goto out; + } + start = offset >> PAGE_SHIFT; - end = (offset + len + PAGE_SIZE - 1) >> PAGE_SHIFT; + end = aligned_end >> PAGE_SHIFT; /* Try to avoid a swapstorm if len is impossible to satisfy */ if (sbinfo->max_blocks && end - start > sbinfo->max_blocks) { error = -ENOSPC; From 10f895ae02df14fc4edea01c235f09d5e4c1377b Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:38 +0200 Subject: [PATCH 143/250] shmem: provide a shmem_write_folio wrapper Patch series "better block swap batching and a different take on swap_ops v5". This series makes use of the swap_iocb for block as well so that it doesn't do inefficient single-bio I/O, and then rebases the swap_ops from Baoquan on top of the now very different method structure. When running doing kernels builds, which is a workload that doesn't really do much THP anonymous memory it still gets 2x clustering for writeout and 1.2x for reading back swap in. The overall times do not actually change, though. This patch (of 7): Provide a wrapper for the shmem abuses in drm to prepare for swap I/O refactoring by keeping swap_iocb handling entirely contained in mm/. Link: https://lore.kernel.org/20260713093350.2154226-1-hch@lst.de Link: https://lore.kernel.org/20260713093350.2154226-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Baoquan He Reviewed-by: Nhat Pham Reviewed-by: Baolin Wang Acked-by: Chris Li Reviewed-by: Kairui Song Cc: Kemeng Shi Cc: Barry Song Cc: Youngjun Park Signed-off-by: Andrew Morton --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- drivers/gpu/drm/ttm/ttm_backup.c | 2 +- include/linux/shmem_fs.h | 5 +---- mm/shmem.c | 7 ++++++- mm/swap.h | 4 ++++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index 06543ae60706ea..ef94401662955a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c @@ -325,7 +325,7 @@ void __shmem_writeback(size_t size, struct address_space *mapping) if (folio_mapped(folio)) folio_redirty_for_writepage(&wbc, folio); else - error = shmem_writeout(folio, NULL, NULL); + error = shmem_write_folio(folio); } } diff --git a/drivers/gpu/drm/ttm/ttm_backup.c b/drivers/gpu/drm/ttm/ttm_backup.c index 3c067aadc52de4..0c2d53a13b2a60 100644 --- a/drivers/gpu/drm/ttm/ttm_backup.c +++ b/drivers/gpu/drm/ttm/ttm_backup.c @@ -160,7 +160,7 @@ ttm_backup_backup_folio(struct file *backup, struct folio *folio, if (writeback && !folio_mapped(to_folio) && folio_clear_dirty_for_io(to_folio)) { folio_set_reclaim(to_folio); - ret = shmem_writeout(to_folio, NULL, NULL); + ret = shmem_write_folio(to_folio); if (!folio_test_writeback(to_folio)) folio_clear_reclaim(to_folio); if (ret == AOP_WRITEPAGE_ACTIVATE) diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index e729b9b0e38d40..5663dff53186e2 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -12,8 +12,6 @@ #include #include -struct swap_iocb; - /* inode in-kernel data */ #ifdef CONFIG_TMPFS_QUOTA @@ -123,8 +121,7 @@ static inline bool shmem_mapping(const struct address_space *mapping) void shmem_unlock_mapping(struct address_space *mapping); struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, pgoff_t index, gfp_t gfp_mask); -int shmem_writeout(struct folio *folio, struct swap_iocb **plug, - struct list_head *folio_list); +int shmem_write_folio(struct folio *folio); void shmem_truncate_range(struct inode *inode, loff_t start, uoff_t end); int shmem_unuse(unsigned int type); diff --git a/mm/shmem.c b/mm/shmem.c index 8ea776e5282382..d245e01416e938 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1751,7 +1751,12 @@ int shmem_writeout(struct folio *folio, struct swap_iocb **plug, folio_mark_dirty(folio); return AOP_WRITEPAGE_ACTIVATE; /* Return with folio locked */ } -EXPORT_SYMBOL_GPL(shmem_writeout); + +int shmem_write_folio(struct folio *folio) +{ + return shmem_writeout(folio, NULL, NULL); +} +EXPORT_SYMBOL_GPL(shmem_write_folio); #if defined(CONFIG_NUMA) && defined(CONFIG_TMPFS) static void shmem_show_mpol(struct seq_file *seq, struct mempolicy *mpol) diff --git a/mm/swap.h b/mm/swap.h index 4e4c291bbfdecd..276b7975a9dc92 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -486,4 +486,8 @@ static inline unsigned int folio_swap_flags(struct folio *folio) } #endif /* CONFIG_SWAP */ + +int shmem_writeout(struct folio *folio, struct swap_iocb **plug, + struct list_head *folio_list); + #endif /* _MM_SWAP_H */ From 1e3d3983713f66f2a5e0c1c33a31e7f14feb8eec Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:39 +0200 Subject: [PATCH 144/250] mm/swap: introduce struct swap_io_ctx Generalize the context currently provided by double pointers to struct swap_iocb to an on-stack context. This cleans up the code and prepares for adding more fields and supporting batching multiple folios into a single bio for block-based swap as well. This new swap_io_ctx is required for all functions using it, the old way of allowing a NULL iocb for some callers is removed to keep the interface consistent. To reduce code duplication caused by this, a new swap_cache_read_folio_sync helper is added to consolidate the code to call swap_cache_read_folio with a local swap_io_ctx. The unpug helpers are renamed to use the submit wording as they are generalized. Link: https://lore.kernel.org/20260713093350.2154226-3-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Nhat Pham Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Youngjun Park Signed-off-by: Andrew Morton --- mm/madvise.c | 16 ++++++------- mm/page_io.c | 60 ++++++++++++++++++++++++++----------------------- mm/shmem.c | 13 +++++++---- mm/swap.h | 35 +++++++++++++---------------- mm/swap_state.c | 53 +++++++++++++++++++++++++------------------ mm/vmscan.c | 15 ++++++------- mm/zswap.c | 4 +++- 7 files changed, 105 insertions(+), 91 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index e60179951d8385..7652e9ffd251dc 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -196,7 +196,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start, unsigned long end, struct mm_walk *walk) { struct vm_area_struct *vma = walk->private; - struct swap_iocb *splug = NULL; + struct swap_io_ctx ctx = {}; pte_t *ptep = NULL; spinlock_t *ptl; unsigned long addr; @@ -220,15 +220,15 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start, pte_unmap_unlock(ptep, ptl); ptep = NULL; - folio = read_swap_cache_async(entry, GFP_HIGHUSER_MOVABLE, - vma, addr, &splug); + folio = read_swap_cache_async(&ctx, entry, GFP_HIGHUSER_MOVABLE, + vma, addr); if (folio) folio_put(folio); } if (ptep) pte_unmap_unlock(ptep, ptl); - swap_read_unplug(splug); + swap_read_submit(&ctx); cond_resched(); return 0; @@ -246,7 +246,7 @@ static void shmem_swapin_range(struct vm_area_struct *vma, XA_STATE(xas, &mapping->i_pages, linear_page_index(vma, start)); pgoff_t end_index = linear_page_index(vma, end) - 1; struct folio *folio; - struct swap_iocb *splug = NULL; + struct swap_io_ctx ctx = {}; rcu_read_lock(); xas_for_each(&xas, folio, end_index) { @@ -265,15 +265,15 @@ static void shmem_swapin_range(struct vm_area_struct *vma, xas_pause(&xas); rcu_read_unlock(); - folio = read_swap_cache_async(entry, mapping_gfp_mask(mapping), - vma, addr, &splug); + folio = read_swap_cache_async(&ctx, entry, + mapping_gfp_mask(mapping), vma, addr); if (folio) folio_put(folio); rcu_read_lock(); } rcu_read_unlock(); - swap_read_unplug(splug); + swap_read_submit(&ctx); } #endif /* CONFIG_SWAP */ diff --git a/mm/page_io.c b/mm/page_io.c index b23f494fcc83da..fe24a49e034c97 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -248,7 +248,7 @@ static void swap_zeromap_folio_clear(struct folio *folio) * We may have stale swap cache pages in memory: notice * them here and get rid of the unnecessary final write. */ -int swap_writeout(struct folio *folio, struct swap_iocb **swap_plug) +int swap_writeout(struct swap_io_ctx *ctx, struct folio *folio) { int ret = 0; @@ -295,7 +295,7 @@ int swap_writeout(struct folio *folio, struct swap_iocb **swap_plug) } rcu_read_unlock(); - __swap_writepage(folio, swap_plug); + __swap_writepage(ctx, folio); return 0; out_unlock: folio_unlock(folio); @@ -390,9 +390,9 @@ static void sio_write_complete(struct kiocb *iocb, long ret) mempool_free(sio, sio_pool); } -static void swap_writepage_fs(struct folio *folio, struct swap_iocb **swap_plug) +static void swap_writepage_fs(struct swap_io_ctx *ctx, struct folio *folio) { - struct swap_iocb *sio = swap_plug ? *swap_plug : NULL; + struct swap_iocb *sio = ctx->sio; struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); struct file *swap_file = sis->swap_file; loff_t pos = swap_dev_pos(folio->swap); @@ -403,7 +403,7 @@ static void swap_writepage_fs(struct folio *folio, struct swap_iocb **swap_plug) if (sio) { if (sio->iocb.ki_filp != swap_file || sio->iocb.ki_pos + sio->len != pos) { - swap_write_unplug(sio); + swap_write_submit(ctx); sio = NULL; } } @@ -418,12 +418,11 @@ static void swap_writepage_fs(struct folio *folio, struct swap_iocb **swap_plug) bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0); sio->len += folio_size(folio); sio->nr_bvecs += 1; - if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs) || !swap_plug) { - swap_write_unplug(sio); + if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { + swap_write_submit(ctx); sio = NULL; } - if (swap_plug) - *swap_plug = sio; + ctx->sio = sio; } static void swap_writepage_bdev_sync(struct folio *folio, @@ -463,7 +462,7 @@ static void swap_writepage_bdev_async(struct folio *folio, submit_bio(bio); } -void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug) +void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio) { struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); @@ -474,7 +473,7 @@ void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug) * is safe. */ if (data_race(sis->flags & SWP_FS_OPS)) - swap_writepage_fs(folio, swap_plug); + swap_writepage_fs(ctx, folio); /* * ->flags can be updated non-atomically, * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race @@ -486,16 +485,20 @@ void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug) swap_writepage_bdev_async(folio, sis); } -void swap_write_unplug(struct swap_iocb *sio) +void swap_write_submit(struct swap_io_ctx *ctx) { + struct swap_iocb *sio = ctx->sio; struct iov_iter from; - struct address_space *mapping = sio->iocb.ki_filp->f_mapping; int ret; + if (!sio) + return; + iov_iter_bvec(&from, ITER_SOURCE, sio->bvecs, sio->nr_bvecs, sio->len); - ret = mapping->a_ops->swap_rw(&sio->iocb, &from); + ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &from); if (ret != -EIOCBQUEUED) sio_write_complete(&sio->iocb, ret); + ctx->sio = NULL; } static void sio_read_complete(struct kiocb *iocb, long ret) @@ -587,18 +590,16 @@ static bool swap_read_folio_zeromap(struct folio *folio) return true; } -static void swap_read_folio_fs(struct folio *folio, struct swap_iocb **plug) +static void swap_read_folio_fs(struct swap_io_ctx *ctx, struct folio *folio) { struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); - struct swap_iocb *sio = NULL; + struct swap_iocb *sio = ctx->sio; loff_t pos = swap_dev_pos(folio->swap); - if (plug) - sio = *plug; if (sio) { if (sio->iocb.ki_filp != sis->swap_file || sio->iocb.ki_pos + sio->len != pos) { - swap_read_unplug(sio); + swap_read_submit(ctx); sio = NULL; } } @@ -613,12 +614,11 @@ static void swap_read_folio_fs(struct folio *folio, struct swap_iocb **plug) bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0); sio->len += folio_size(folio); sio->nr_bvecs += 1; - if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs) || !plug) { - swap_read_unplug(sio); + if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { + swap_read_submit(ctx); sio = NULL; } - if (plug) - *plug = sio; + ctx->sio = sio; } static void swap_read_folio_bdev_sync(struct folio *folio, @@ -658,7 +658,7 @@ static void swap_read_folio_bdev_async(struct folio *folio, submit_bio(bio); } -void swap_read_folio(struct folio *folio, struct swap_iocb **plug) +void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio) { struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); bool synchronous = sis->flags & SWP_SYNCHRONOUS_IO; @@ -693,7 +693,7 @@ void swap_read_folio(struct folio *folio, struct swap_iocb **plug) zswap_folio_swapin(folio); if (data_race(sis->flags & SWP_FS_OPS)) { - swap_read_folio_fs(folio, plug); + swap_read_folio_fs(ctx, folio); } else if (synchronous) { swap_read_folio_bdev_sync(folio, sis); } else { @@ -708,14 +708,18 @@ void swap_read_folio(struct folio *folio, struct swap_iocb **plug) delayacct_swapin_end(); } -void __swap_read_unplug(struct swap_iocb *sio) +void swap_read_submit(struct swap_io_ctx *ctx) { + struct swap_iocb *sio = ctx->sio; struct iov_iter from; - struct address_space *mapping = sio->iocb.ki_filp->f_mapping; int ret; + if (!sio) + return; + iov_iter_bvec(&from, ITER_DEST, sio->bvecs, sio->nr_bvecs, sio->len); - ret = mapping->a_ops->swap_rw(&sio->iocb, &from); + ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &from); if (ret != -EIOCBQUEUED) sio_read_complete(&sio->iocb, ret); + ctx->sio = NULL; } diff --git a/mm/shmem.c b/mm/shmem.c index d245e01416e938..2e4dacdcce11b6 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1597,13 +1597,13 @@ int shmem_unuse(unsigned int type) /** * shmem_writeout - Write the folio to swap + * @ctx: swap I/O context * @folio: The folio to write - * @plug: swap plug * @folio_list: list to put back folios on split * * Move the folio from the page cache to the swap cache. */ -int shmem_writeout(struct folio *folio, struct swap_iocb **plug, +int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio, struct list_head *folio_list) { struct address_space *mapping = folio->mapping; @@ -1715,7 +1715,7 @@ int shmem_writeout(struct folio *folio, struct swap_iocb **plug, shmem_delete_from_page_cache(folio, swp_to_radix_entry(folio->swap)); BUG_ON(folio_mapped(folio)); - error = swap_writeout(folio, plug); + error = swap_writeout(ctx, folio); if (error != AOP_WRITEPAGE_ACTIVATE) { /* folio has been unlocked */ return error; @@ -1754,7 +1754,12 @@ int shmem_writeout(struct folio *folio, struct swap_iocb **plug, int shmem_write_folio(struct folio *folio) { - return shmem_writeout(folio, NULL, NULL); + struct swap_io_ctx ctx = {}; + int err; + + err = shmem_writeout(&ctx, folio, NULL); + swap_write_submit(&ctx); + return err; } EXPORT_SYMBOL_GPL(shmem_write_folio); diff --git a/mm/swap.h b/mm/swap.h index 276b7975a9dc92..70f8e287f14013 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -91,6 +91,10 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) return READ_ONCE(vm_swappiness); } +struct swap_io_ctx { + struct swap_iocb *sio; +}; + #ifdef CONFIG_SWAP #include /* for swp_offset */ #include /* for bio_end_io_t */ @@ -253,17 +257,11 @@ extern void __swap_cluster_free_entries(struct swap_info_struct *si, /* linux/mm/page_io.c */ int sio_pool_init(void); -struct swap_iocb; -void swap_read_folio(struct folio *folio, struct swap_iocb **plug); -void __swap_read_unplug(struct swap_iocb *plug); -static inline void swap_read_unplug(struct swap_iocb *plug) -{ - if (unlikely(plug)) - __swap_read_unplug(plug); -} -void swap_write_unplug(struct swap_iocb *sio); -int swap_writeout(struct folio *folio, struct swap_iocb **swap_plug); -void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug); +void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio); +void swap_read_submit(struct swap_io_ctx *ctx); +void swap_write_submit(struct swap_io_ctx *ctx); +int swap_writeout(struct swap_io_ctx *ctx, struct folio *folio); +void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio); /* linux/mm/swap_state.c */ extern struct address_space swap_space __read_mostly; @@ -330,9 +328,8 @@ void __swap_cache_replace_folio(struct swap_cluster_info *ci, void show_swap_cache_info(void); void swapcache_clear(struct swap_info_struct *si, swp_entry_t entry, int nr); -struct folio *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, - struct vm_area_struct *vma, unsigned long addr, - struct swap_iocb **plug); +struct folio *read_swap_cache_async(struct swap_io_ctx *ctx, swp_entry_t entry, + gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr); struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t flag, struct mempolicy *mpol, pgoff_t ilx); struct folio *swapin_readahead(swp_entry_t entry, gfp_t flag, @@ -348,7 +345,6 @@ static inline unsigned int folio_swap_flags(struct folio *folio) } #else /* CONFIG_SWAP */ -struct swap_iocb; static inline struct swap_cluster_info *swap_cluster_lock( struct swap_info_struct *si, pgoff_t offset, bool irq) { @@ -394,11 +390,11 @@ static inline void folio_put_swap(struct folio *folio, struct page *page) { } -static inline void swap_read_folio(struct folio *folio, struct swap_iocb **plug) +static inline void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio) { } -static inline void swap_write_unplug(struct swap_iocb *sio) +static inline void swap_write_submit(struct swap_io_ctx *ctx) { } @@ -440,8 +436,7 @@ static inline void swap_update_readahead(struct folio *folio, { } -static inline int swap_writeout(struct folio *folio, - struct swap_iocb **swap_plug) +static inline int swap_writeout(struct swap_io_ctx *ctx, struct folio *folio) { return 0; } @@ -487,7 +482,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio) #endif /* CONFIG_SWAP */ -int shmem_writeout(struct folio *folio, struct swap_iocb **plug, +int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio, struct list_head *folio_list); #endif /* _MM_SWAP_H */ diff --git a/mm/swap_state.c b/mm/swap_state.c index 1444d20a40e9f7..5be825911e645e 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -638,9 +638,9 @@ void swap_update_readahead(struct folio *folio, struct vm_area_struct *vma, } } -static struct folio *swap_cache_read_folio(swp_entry_t entry, gfp_t gfp, - struct mempolicy *mpol, pgoff_t ilx, - struct swap_iocb **plug, bool readahead) +static struct folio *swap_cache_read_folio(struct swap_io_ctx *ctx, + swp_entry_t entry, gfp_t gfp, struct mempolicy *mpol, + pgoff_t ilx, bool readahead) { struct folio *folio; @@ -654,7 +654,7 @@ static struct folio *swap_cache_read_folio(swp_entry_t entry, gfp_t gfp, if (IS_ERR_OR_NULL(folio)) return NULL; - swap_read_folio(folio, plug); + swap_read_folio(ctx, folio); if (readahead) { folio_set_readahead(folio); count_vm_event(SWAP_RA); @@ -682,6 +682,7 @@ static struct folio *swap_cache_read_folio(swp_entry_t entry, gfp_t gfp, struct folio *swapin_sync(swp_entry_t entry, gfp_t gfp, unsigned long orders, struct vm_fault *vmf, struct mempolicy *mpol, pgoff_t ilx) { + struct swap_io_ctx ctx = {}; struct folio *folio; do { @@ -694,7 +695,8 @@ struct folio *swapin_sync(swp_entry_t entry, gfp_t gfp, unsigned long orders, if (IS_ERR(folio)) return folio; - swap_read_folio(folio, NULL); + swap_read_folio(&ctx, folio); + swap_read_submit(&ctx); return folio; } @@ -704,9 +706,8 @@ struct folio *swapin_sync(swp_entry_t entry, gfp_t gfp, unsigned long orders, * A failure return means that either the page allocation failed or that * the swap entry is no longer in use. */ -struct folio *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, - struct vm_area_struct *vma, unsigned long addr, - struct swap_iocb **plug) +struct folio *read_swap_cache_async(struct swap_io_ctx *ctx, swp_entry_t entry, + gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr) { struct swap_info_struct *si; struct mempolicy *mpol; @@ -718,13 +719,24 @@ struct folio *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, return NULL; mpol = get_vma_policy(vma, addr, 0, &ilx); - folio = swap_cache_read_folio(entry, gfp_mask, mpol, ilx, plug, false); + folio = swap_cache_read_folio(ctx, entry, gfp_mask, mpol, ilx, false); mpol_cond_put(mpol); put_swap_device(si); return folio; } +static struct folio *swap_cache_read_folio_sync(swp_entry_t entry, gfp_t gfp, + struct mempolicy *mpol, pgoff_t ilx) +{ + struct swap_io_ctx ctx = {}; + struct folio *folio; + + folio = swap_cache_read_folio(&ctx, entry, gfp, mpol, ilx, false); + swap_read_submit(&ctx); + return folio; +} + static unsigned int __swapin_nr_pages(unsigned long prev_offset, unsigned long offset, int hits, @@ -813,8 +825,8 @@ struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, unsigned long start_offset, end_offset; unsigned long mask; struct swap_info_struct *si = __swap_entry_to_info(entry); + struct swap_io_ctx ctx = {}; struct blk_plug plug; - struct swap_iocb *splug = NULL; swp_entry_t ra_entry; mask = swapin_nr_pages(offset) - 1; @@ -833,17 +845,16 @@ struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, for (offset = start_offset; offset <= end_offset ; offset++) { /* Ok, do the async read-ahead now */ ra_entry = swp_entry(swp_type(entry), offset); - folio = swap_cache_read_folio(ra_entry, gfp_mask, mpol, ilx, - &splug, offset != entry_offset); + folio = swap_cache_read_folio(&ctx, ra_entry, gfp_mask, mpol, + ilx, offset != entry_offset); if (!folio) continue; folio_put(folio); } blk_finish_plug(&plug); - swap_read_unplug(splug); + swap_read_submit(&ctx); skip: - /* The page was likely read above, so no need for plugging here */ - return swap_cache_read_folio(entry, gfp_mask, mpol, ilx, NULL, false); + return swap_cache_read_folio_sync(entry, gfp_mask, mpol, ilx); } static int swap_vma_ra_win(struct vm_fault *vmf, unsigned long *start, @@ -903,8 +914,8 @@ static int swap_vma_ra_win(struct vm_fault *vmf, unsigned long *start, static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask, struct mempolicy *mpol, pgoff_t targ_ilx, struct vm_fault *vmf) { + struct swap_io_ctx ctx = {}; struct blk_plug plug; - struct swap_iocb *splug = NULL; struct folio *folio; pte_t *pte = NULL, pentry; int win; @@ -943,8 +954,8 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask, if (!si) continue; } - folio = swap_cache_read_folio(entry, gfp_mask, mpol, ilx, - &splug, addr != vmf->address); + folio = swap_cache_read_folio(&ctx, entry, gfp_mask, mpol, ilx, + addr != vmf->address); if (si) put_swap_device(si); if (!folio) @@ -954,12 +965,10 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask, if (pte) pte_unmap(pte); blk_finish_plug(&plug); - swap_read_unplug(splug); + swap_read_submit(&ctx); skip: /* The folio was likely read above, so no need for plugging here */ - folio = swap_cache_read_folio(targ_entry, gfp_mask, mpol, targ_ilx, - NULL, false); - return folio; + return swap_cache_read_folio_sync(targ_entry, gfp_mask, mpol, targ_ilx); } /** diff --git a/mm/vmscan.c b/mm/vmscan.c index 3a670114362033..4742297693fe0f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -617,8 +617,8 @@ typedef enum { /* * pageout is called by shrink_folio_list() for each dirty folio. */ -static pageout_t pageout(struct folio *folio, struct address_space *mapping, - struct swap_iocb **plug, struct list_head *folio_list) +static pageout_t pageout(struct swap_io_ctx *ctx, struct address_space *mapping, + struct folio *folio, struct list_head *folio_list) { int res; @@ -654,9 +654,9 @@ static pageout_t pageout(struct folio *folio, struct address_space *mapping, * the split out folios get added back to folio_list. */ if (shmem_mapping(mapping)) - res = shmem_writeout(folio, plug, folio_list); + res = shmem_writeout(ctx, folio, folio_list); else - res = swap_writeout(folio, plug); + res = swap_writeout(ctx, folio); if (res < 0) handle_write_error(mapping, folio, res); @@ -1066,7 +1066,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, unsigned int nr_reclaimed = 0, nr_demoted = 0; unsigned int pgactivate = 0; bool do_demote_pass; - struct swap_iocb *plug = NULL; + struct swap_io_ctx ctx = {}; folio_batch_init(&free_folios); memset(stat, 0, sizeof(*stat)); @@ -1394,7 +1394,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, * starts and then write it out here. */ try_to_unmap_flush_dirty(); - switch (pageout(folio, mapping, &plug, folio_list)) { + switch (pageout(&ctx, mapping, folio, folio_list)) { case PAGE_KEEP: goto keep_locked; case PAGE_ACTIVATE: @@ -1582,8 +1582,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, list_splice(&ret_folios, folio_list); count_vm_events(PGACTIVATE, pgactivate); - if (plug) - swap_write_unplug(plug); + swap_write_submit(&ctx); return nr_reclaimed; } diff --git a/mm/zswap.c b/mm/zswap.c index 0b9435b4f57cb2..c33d496bfdb214 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -992,6 +992,7 @@ static int zswap_writeback_entry(struct zswap_entry *entry, struct folio *folio; struct mempolicy *mpol; struct swap_info_struct *si; + struct swap_io_ctx ctx = {}; int ret = 0; /* try to allocate swap cache folio */ @@ -1049,7 +1050,8 @@ static int zswap_writeback_entry(struct zswap_entry *entry, folio_set_reclaim(folio); /* start writeback */ - __swap_writepage(folio, NULL); + __swap_writepage(&ctx, folio); + swap_write_submit(&ctx); out: if (ret) { From 886f912038b2fc64ecfe7081b0d77609d2455129 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:40 +0200 Subject: [PATCH 145/250] mm/swap: also use struct swap_iocb for block I/O Block I/O benefits from batching just as much as remote file systems. Extend struct swap_iocb to support building a bio on the fly as well, and rewrite the block based swap code for it. This especially benefits submit_bio based drivers that do not have the block plugging available, but also saves allocating extra bios for blk-mq drivers. Add a pre-allocated bio to struct swap_iocb in a union with kiocb used for file system based swap so that struct swap_iocb can be used for all swap I/O, and initialize the pool for it unconditionally. Various low-level bdev and fs functions are now replaced with a unified can_merge/add/submit scheme. Note that the block based swap code now uses the same memcg-based check previously added for file system based swap as well. Link: https://lore.kernel.org/20260713093350.2154226-4-hch@lst.de Signed-off-by: Christoph Hellwig Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Youngjun Park Signed-off-by: Andrew Morton --- mm/page_io.c | 526 ++++++++++++++++++++++++-------------------------- mm/swap.h | 1 + mm/swapfile.c | 9 +- 3 files changed, 254 insertions(+), 282 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index fe24a49e034c97..0195c25a77eb32 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -28,54 +28,6 @@ #include "swap.h" #include "swap_table.h" -static void __end_swap_bio_write(struct bio *bio) -{ - struct folio *folio = bio_first_folio_all(bio); - - if (bio->bi_status) { - /* - * We failed to write the page out to swap-space. - * Re-dirty the page in order to avoid it being reclaimed. - * Also print a dire warning that things will go BAD (tm) - * very quickly. - * - * Also clear PG_reclaim to avoid folio_rotate_reclaimable() - */ - folio_mark_dirty(folio); - pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n", - MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), - (unsigned long long)bio->bi_iter.bi_sector); - folio_clear_reclaim(folio); - } - folio_end_writeback(folio); -} - -static void end_swap_bio_write(struct bio *bio) -{ - __end_swap_bio_write(bio); - bio_put(bio); -} - -static void __end_swap_bio_read(struct bio *bio) -{ - struct folio *folio = bio_first_folio_all(bio); - - if (bio->bi_status) { - pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", - MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), - (unsigned long long)bio->bi_iter.bi_sector); - } else { - folio_mark_uptodate(folio); - } - folio_unlock(folio); -} - -static void end_swap_bio_read(struct bio *bio) -{ - __end_swap_bio_read(bio); - bio_put(bio); -} - int generic_swapfile_activate(struct swap_info_struct *sis, struct file *swap_file, sector_t *span) @@ -316,18 +268,36 @@ static inline void count_swpout_vm_event(struct folio *folio) } #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) +static struct cgroup_subsys_state *folio_memcg_blkg_css(struct folio *folio) +{ + return cgroup_e_css(folio_memcg(folio)->css.cgroup, &io_cgrp_subsys); +} + +static bool folio_blkg_can_merge(struct folio *folio, struct folio *prev_folio) +{ + bool can_merge = true; + + if (folio_memcg_charged(folio) != folio_memcg_charged(prev_folio)) + return false; + if (folio_memcg_charged(folio)) { + rcu_read_lock(); + if (folio_memcg_blkg_css(folio) != + folio_memcg_blkg_css(prev_folio)) + can_merge = false; + rcu_read_unlock(); + } + return can_merge; +} + static void bio_associate_blkg_from_page(struct bio *bio, struct folio *folio) { struct cgroup_subsys_state *css; - struct mem_cgroup *memcg; if (!folio_memcg_charged(folio)) return; - rcu_read_lock(); - memcg = folio_memcg(folio); - css = cgroup_e_css(memcg->css.cgroup, &io_cgrp_subsys); - if (!css || !css_tryget(css)) + css = folio_memcg_blkg_css(folio); + if (css && !css_tryget(css)) css = NULL; rcu_read_unlock(); @@ -336,11 +306,18 @@ static void bio_associate_blkg_from_page(struct bio *bio, struct folio *folio) css_put(css); } #else +static bool folio_blkg_can_merge(struct folio *folio, struct folio *prev_folio) +{ + return true; +} #define bio_associate_blkg_from_page(bio, folio) do { } while (0) #endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */ struct swap_iocb { - struct kiocb iocb; + union { + struct kiocb iocb; + struct bio bio; + }; struct bio_vec bvecs[SWAP_CLUSTER_MAX]; int nr_bvecs; int len; @@ -360,171 +337,70 @@ int sio_pool_init(void) return 0; } -static void sio_write_complete(struct kiocb *iocb, long ret) +static bool swap_can_merge(struct swap_io_ctx *ctx, struct folio *folio, + int rw) { - struct swap_iocb *sio = container_of(iocb, struct swap_iocb, iocb); - struct page *page = sio->bvecs[0].bv_page; - int p; + struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); + struct bio_vec *last_bv = &ctx->sio->bvecs[ctx->sio->nr_bvecs - 1]; + struct folio *prev_folio = bvec_folio(last_bv); + size_t prev_folio_size = folio_size(prev_folio); - if (ret != sio->len) { - /* - * In the case of swap-over-nfs, this can be a - * temporary failure if the system has limited - * memory for allocating transmit buffers. - * Mark the page dirty and avoid - * folio_rotate_reclaimable but rate-limit the - * messages. - */ - pr_err_ratelimited("Write error %ld on dio swapfile (%llu)\n", - ret, swap_dev_pos(page_swap_entry(page))); - for (p = 0; p < sio->nr_bvecs; p++) { - page = sio->bvecs[p].bv_page; - set_page_dirty(page); - ClearPageReclaim(page); - } - } + if (ctx->sis != sis) + return false; - for (p = 0; p < sio->nr_bvecs; p++) - end_page_writeback(sio->bvecs[p].bv_page); + if (sis->flags & SWP_FS_OPS) { + if (swap_dev_pos(folio->swap) != + swap_dev_pos(prev_folio->swap) + prev_folio_size) + return false; + } else { + if (swap_folio_sector(folio) != + swap_folio_sector(prev_folio) + + (prev_folio_size >> SECTOR_SHIFT)) + return false; + if (rw == WRITE && !folio_blkg_can_merge(folio, prev_folio)) + return false; + } - mempool_free(sio, sio_pool); + return true; } -static void swap_writepage_fs(struct swap_io_ctx *ctx, struct folio *folio) +static void swap_add_folio(struct swap_io_ctx *ctx, struct folio *folio, int rw) { - struct swap_iocb *sio = ctx->sio; struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); - struct file *swap_file = sis->swap_file; - loff_t pos = swap_dev_pos(folio->swap); + struct swap_iocb *sio = ctx->sio; - count_swpout_vm_event(folio); - folio_start_writeback(folio); - folio_unlock(folio); - if (sio) { - if (sio->iocb.ki_filp != swap_file || - sio->iocb.ki_pos + sio->len != pos) { + if (sio && !swap_can_merge(ctx, folio, rw)) { + if (rw == WRITE) swap_write_submit(ctx); - sio = NULL; - } + else + swap_read_submit(ctx); + sio = ctx->sio; } + if (!sio) { - sio = mempool_alloc(sio_pool, GFP_NOIO); - init_sync_kiocb(&sio->iocb, swap_file); - sio->iocb.ki_complete = sio_write_complete; - sio->iocb.ki_pos = pos; + ctx->sis = sis; + ctx->sio = sio = mempool_alloc(sio_pool, GFP_NOIO); sio->nr_bvecs = 0; sio->len = 0; } bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0); sio->len += folio_size(folio); - sio->nr_bvecs += 1; - if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { - swap_write_submit(ctx); - sio = NULL; + if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { + if (rw == WRITE) + swap_write_submit(ctx); + else + swap_read_submit(ctx); } - ctx->sio = sio; } -static void swap_writepage_bdev_sync(struct folio *folio, - struct swap_info_struct *sis) -{ - struct bio_vec bv; - struct bio bio; - - bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP); - bio.bi_iter.bi_sector = swap_folio_sector(folio); - bio_add_folio_nofail(&bio, folio, folio_size(folio), 0); - - bio_associate_blkg_from_page(&bio, folio); - count_swpout_vm_event(folio); - - folio_start_writeback(folio); - folio_unlock(folio); - - submit_bio_wait(&bio); - __end_swap_bio_write(&bio); -} - -static void swap_writepage_bdev_async(struct folio *folio, - struct swap_info_struct *sis) +void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio) { - struct bio *bio; - - bio = bio_alloc(sis->bdev, 1, REQ_OP_WRITE | REQ_SWAP, GFP_NOIO); - bio->bi_iter.bi_sector = swap_folio_sector(folio); - bio->bi_end_io = end_swap_bio_write; - bio_add_folio_nofail(bio, folio, folio_size(folio), 0); + VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); - bio_associate_blkg_from_page(bio, folio); count_swpout_vm_event(folio); folio_start_writeback(folio); folio_unlock(folio); - submit_bio(bio); -} - -void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio) -{ - struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); - - VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); - /* - * ->flags can be updated non-atomically, - * but that will never affect SWP_FS_OPS, so the data_race - * is safe. - */ - if (data_race(sis->flags & SWP_FS_OPS)) - swap_writepage_fs(ctx, folio); - /* - * ->flags can be updated non-atomically, - * but that will never affect SWP_SYNCHRONOUS_IO, so the data_race - * is safe. - */ - else if (data_race(sis->flags & SWP_SYNCHRONOUS_IO)) - swap_writepage_bdev_sync(folio, sis); - else - swap_writepage_bdev_async(folio, sis); -} - -void swap_write_submit(struct swap_io_ctx *ctx) -{ - struct swap_iocb *sio = ctx->sio; - struct iov_iter from; - int ret; - - if (!sio) - return; - - iov_iter_bvec(&from, ITER_SOURCE, sio->bvecs, sio->nr_bvecs, sio->len); - ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &from); - if (ret != -EIOCBQUEUED) - sio_write_complete(&sio->iocb, ret); - ctx->sio = NULL; -} - -static void sio_read_complete(struct kiocb *iocb, long ret) -{ - struct swap_iocb *sio = container_of(iocb, struct swap_iocb, iocb); - int p; - - if (ret == sio->len) { - for (p = 0; p < sio->nr_bvecs; p++) { - struct folio *folio = bvec_folio(&sio->bvecs[p]); - - count_mthp_stat(folio_order(folio), MTHP_STAT_SWPIN); - count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio)); - folio_mark_uptodate(folio); - folio_unlock(folio); - } - count_vm_events(PSWPIN, sio->len >> PAGE_SHIFT); - } else { - for (p = 0; p < sio->nr_bvecs; p++) { - struct folio *folio = bvec_folio(&sio->bvecs[p]); - - folio_unlock(folio); - } - pr_alert_ratelimited("Read-error on swap-device\n"); - } - mempool_free(sio, sio_pool); + swap_add_folio(ctx, folio, WRITE); } /* @@ -590,74 +466,6 @@ static bool swap_read_folio_zeromap(struct folio *folio) return true; } -static void swap_read_folio_fs(struct swap_io_ctx *ctx, struct folio *folio) -{ - struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); - struct swap_iocb *sio = ctx->sio; - loff_t pos = swap_dev_pos(folio->swap); - - if (sio) { - if (sio->iocb.ki_filp != sis->swap_file || - sio->iocb.ki_pos + sio->len != pos) { - swap_read_submit(ctx); - sio = NULL; - } - } - if (!sio) { - sio = mempool_alloc(sio_pool, GFP_KERNEL); - init_sync_kiocb(&sio->iocb, sis->swap_file); - sio->iocb.ki_pos = pos; - sio->iocb.ki_complete = sio_read_complete; - sio->nr_bvecs = 0; - sio->len = 0; - } - bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0); - sio->len += folio_size(folio); - sio->nr_bvecs += 1; - if (sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { - swap_read_submit(ctx); - sio = NULL; - } - ctx->sio = sio; -} - -static void swap_read_folio_bdev_sync(struct folio *folio, - struct swap_info_struct *sis) -{ - struct bio_vec bv; - struct bio bio; - - bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); - bio.bi_iter.bi_sector = swap_folio_sector(folio); - bio_add_folio_nofail(&bio, folio, folio_size(folio), 0); - /* - * Keep this task valid during swap readpage because the oom killer may - * attempt to access it in the page fault retry time check. - */ - get_task_struct(current); - count_mthp_stat(folio_order(folio), MTHP_STAT_SWPIN); - count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio)); - count_vm_events(PSWPIN, folio_nr_pages(folio)); - submit_bio_wait(&bio); - __end_swap_bio_read(&bio); - put_task_struct(current); -} - -static void swap_read_folio_bdev_async(struct folio *folio, - struct swap_info_struct *sis) -{ - struct bio *bio; - - bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); - bio->bi_iter.bi_sector = swap_folio_sector(folio); - bio->bi_end_io = end_swap_bio_read; - bio_add_folio_nofail(bio, folio, folio_size(folio), 0); - count_mthp_stat(folio_order(folio), MTHP_STAT_SWPIN); - count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio)); - count_vm_events(PSWPIN, folio_nr_pages(folio)); - submit_bio(bio); -} - void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio) { struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); @@ -691,14 +499,7 @@ void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio) /* We have to read from slower devices. Increase zswap protection. */ zswap_folio_swapin(folio); - - if (data_race(sis->flags & SWP_FS_OPS)) { - swap_read_folio_fs(ctx, folio); - } else if (synchronous) { - swap_read_folio_bdev_sync(folio, sis); - } else { - swap_read_folio_bdev_async(folio, sis); - } + swap_add_folio(ctx, folio, READ); finish: if (workingset) { @@ -708,18 +509,189 @@ void swap_read_folio(struct swap_io_ctx *ctx, struct folio *folio) delayacct_swapin_end(); } -void swap_read_submit(struct swap_io_ctx *ctx) +static void swap_write_end(struct swap_iocb *sio, bool failed) +{ + int p; + + for (p = 0; p < sio->nr_bvecs; p++) { + struct page *page = sio->bvecs[p].bv_page; + + if (failed) { + set_page_dirty(page); + ClearPageReclaim(page); + } + end_page_writeback(page); + } + mempool_free(sio, sio_pool); +} + +static void swap_fs_write_complete(struct kiocb *iocb, long ret) +{ + struct swap_iocb *sio = container_of(iocb, struct swap_iocb, iocb); + bool failed = ret != sio->len; + + if (failed) { + struct page *page = sio->bvecs[0].bv_page; + + /* + * In the case of swap-over-nfs, this can be a temporary failure + * if the system has limited memory for allocating transmit + * buffers. Mark the page dirty and avoid + * folio_rotate_reclaimable but rate-limit the messages. + */ + pr_err_ratelimited("Write error %ld on dio swapfile (%llu)\n", + ret, swap_dev_pos(page_swap_entry(page))); + } + + swap_write_end(sio, failed); +} + +static void end_swap_bio_write(struct bio *bio) +{ + struct swap_iocb *sio = container_of(bio, struct swap_iocb, bio); + bool failed = !!bio->bi_status; + + if (failed) + pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n", + MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), + (unsigned long long)bio->bi_iter.bi_sector); + bio_uninit(bio); + swap_write_end(sio, failed); +} + +static void swap_read_end(struct swap_iocb *sio, bool failed) +{ + int p; + + for (p = 0; p < sio->nr_bvecs; p++) { + struct folio *folio = bvec_folio(&sio->bvecs[p]); + + if (!failed) { + count_mthp_stat(folio_order(folio), MTHP_STAT_SWPIN); + count_memcg_folio_events(folio, PSWPIN, + folio_nr_pages(folio)); + folio_mark_uptodate(folio); + } + folio_unlock(folio); + } + + if (!failed) + count_vm_events(PSWPIN, sio->len >> PAGE_SHIFT); + + mempool_free(sio, sio_pool); +} + +static void swap_fs_read_complete(struct kiocb *iocb, long ret) +{ + struct swap_iocb *sio = container_of(iocb, struct swap_iocb, iocb); + bool failed = ret != sio->len; + + if (failed) + pr_alert_ratelimited("Read-error on swap-device\n"); + swap_read_end(sio, failed); +} + +static void swap_bio_read_end_io(struct bio *bio) +{ + struct swap_iocb *sio = container_of(bio, struct swap_iocb, bio); + bool failed = !!bio->bi_status; + + if (failed) + pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", + MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), + (unsigned long long)bio->bi_iter.bi_sector); + bio_uninit(bio); + swap_read_end(sio, failed); +} + +static void swap_bdev_submit_write(struct swap_io_ctx *ctx) { struct swap_iocb *sio = ctx->sio; - struct iov_iter from; + struct bio *bio = &sio->bio; + + bio_init(bio, ctx->sis->bdev, sio->bvecs, ARRAY_SIZE(sio->bvecs), + REQ_OP_WRITE | REQ_SWAP); + bio->bi_iter.bi_size = sio->len; + bio->bi_iter.bi_sector = swap_folio_sector(bio_first_folio_all(bio)); + bio_associate_blkg_from_page(bio, bio_first_folio_all(bio)); + + if (ctx->sis->flags & SWP_SYNCHRONOUS_IO) { + submit_bio_wait(bio); + end_swap_bio_write(bio); + } else { + bio->bi_end_io = end_swap_bio_write; + submit_bio(bio); + } +} + +static void swap_bdev_submit_read(struct swap_io_ctx *ctx) +{ + struct swap_iocb *sio = ctx->sio; + struct bio *bio = &sio->bio; + + bio_init(bio, ctx->sis->bdev, sio->bvecs, ARRAY_SIZE(sio->bvecs), + REQ_OP_READ); + bio->bi_iter.bi_size = sio->len; + bio->bi_iter.bi_sector = swap_folio_sector(bio_first_folio_all(bio)); + + if (ctx->sis->flags & SWP_SYNCHRONOUS_IO) { + /* + * Keep this task valid during swap readpage because the oom + * killer may attempt to access it in the page fault retry + * time check. + */ + get_task_struct(current); + submit_bio_wait(bio); + swap_bio_read_end_io(bio); + put_task_struct(current); + } else { + bio->bi_end_io = swap_bio_read_end_io; + submit_bio(bio); + } +} + +static void swap_fs_submit(struct swap_io_ctx *ctx, int rw) +{ + struct swap_iocb *sio = ctx->sio; + struct iov_iter iter; int ret; - if (!sio) - return; + init_sync_kiocb(&sio->iocb, ctx->sis->swap_file); + sio->iocb.ki_pos = swap_dev_pos(bvec_folio(&sio->bvecs[0])->swap); + if (rw == WRITE) + sio->iocb.ki_complete = swap_fs_write_complete; + else + sio->iocb.ki_complete = swap_fs_read_complete; - iov_iter_bvec(&from, ITER_DEST, sio->bvecs, sio->nr_bvecs, sio->len); - ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &from); + iov_iter_bvec(&iter, rw == WRITE ? ITER_SOURCE : ITER_DEST, + sio->bvecs, sio->nr_bvecs, sio->len); + ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &iter); if (ret != -EIOCBQUEUED) - sio_read_complete(&sio->iocb, ret); + sio->iocb.ki_complete(&sio->iocb, ret); +} + +void swap_write_submit(struct swap_io_ctx *ctx) +{ + if (!ctx->sio) + return; + + if (ctx->sis->flags & SWP_FS_OPS) + swap_fs_submit(ctx, WRITE); + else + swap_bdev_submit_write(ctx); + ctx->sio = NULL; + ctx->sis = NULL; +} + +void swap_read_submit(struct swap_io_ctx *ctx) +{ + if (!ctx->sio) + return; + + if (ctx->sis->flags & SWP_FS_OPS) + swap_fs_submit(ctx, READ); + else + swap_bdev_submit_read(ctx); ctx->sio = NULL; + ctx->sis = NULL; } diff --git a/mm/swap.h b/mm/swap.h index 70f8e287f14013..86b2a241b7343e 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -93,6 +93,7 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) struct swap_io_ctx { struct swap_iocb *sio; + struct swap_info_struct *sis; }; #ifdef CONFIG_SWAP diff --git a/mm/swapfile.c b/mm/swapfile.c index d7f749ad60c2f8..be75c995c49b86 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2959,6 +2959,10 @@ static int setup_swap_extents(struct swap_info_struct *sis, struct inode *inode = mapping->host; int ret; + ret = sio_pool_init(); + if (ret) + return ret; + if (S_ISBLK(inode->i_mode)) { ret = add_swap_extent(sis, 0, sis->max, 0); *span = sis->pages; @@ -2970,11 +2974,6 @@ static int setup_swap_extents(struct swap_info_struct *sis, if (ret < 0) return ret; sis->flags |= SWP_ACTIVATED; - if ((sis->flags & SWP_FS_OPS) && - sio_pool_init() != 0) { - destroy_swap_extents(sis, swap_file); - return -ENOMEM; - } return ret; } From b41a6f7c77c6b9569ce9d14b6569528064e1e90e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:41 +0200 Subject: [PATCH 146/250] mm/swap: remove count_swpout_vm_event There is only one caller left, so merge it into that. Link: https://lore.kernel.org/20260713093350.2154226-5-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Baoquan He Reviewed-by: Nhat Pham Cc: Baolin Wang Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Youngjun Park Signed-off-by: Andrew Morton --- mm/page_io.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 0195c25a77eb32..56f21e49572ef0 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -254,19 +254,6 @@ int swap_writeout(struct swap_io_ctx *ctx, struct folio *folio) return ret; } -static inline void count_swpout_vm_event(struct folio *folio) -{ -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (unlikely(folio_test_pmd_mappable(folio))) { - count_memcg_folio_events(folio, THP_SWPOUT, 1); - count_vm_event(THP_SWPOUT); - } -#endif - count_mthp_stat(folio_order(folio), MTHP_STAT_SWPOUT); - count_memcg_folio_events(folio, PSWPOUT, folio_nr_pages(folio)); - count_vm_events(PSWPOUT, folio_nr_pages(folio)); -} - #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) static struct cgroup_subsys_state *folio_memcg_blkg_css(struct folio *folio) { @@ -397,7 +384,16 @@ void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio) { VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio); - count_swpout_vm_event(folio); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + if (unlikely(folio_test_pmd_mappable(folio))) { + count_memcg_folio_events(folio, THP_SWPOUT, 1); + count_vm_event(THP_SWPOUT); + } +#endif + count_mthp_stat(folio_order(folio), MTHP_STAT_SWPOUT); + count_memcg_folio_events(folio, PSWPOUT, folio_nr_pages(folio)); + count_vm_events(PSWPOUT, folio_nr_pages(folio)); + folio_start_writeback(folio); folio_unlock(folio); swap_add_folio(ctx, folio, WRITE); From fcf98f8770ed0cb46396f01427e898c48201930e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:42 +0200 Subject: [PATCH 147/250] mm/swap: use swap_ops to register swap device's methods This simplifies codes and makes logic clearer. And also makes later any new swap device type being added easier to handle. Currently there are two types of swap devices: fs and bdev. [hch@lst.de: updated for the new submit and can_merge abstraction] Link: https://lore.kernel.org/20260713093350.2154226-6-hch@lst.de Signed-off-by: Baoquan He Signed-off-by: Christoph Hellwig Suggested-by: Chris Li Reviewed-by: Nhat Pham Cc: Baolin Wang Cc: Barry Song Cc: Kairui Song Cc: Kemeng Shi Cc: Youngjun Park Signed-off-by: Andrew Morton --- include/linux/swap.h | 1 + mm/page_io.c | 68 ++++++++++++++++++++++++++++---------------- mm/swap.h | 10 +++++++ mm/swapfile.c | 4 +++ 4 files changed, 58 insertions(+), 25 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index b4b1c0a84c8b1c..5979b142736863 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -276,6 +276,7 @@ struct swap_info_struct { struct work_struct reclaim_work; /* reclaim worker */ struct list_head discard_clusters; /* discard clusters list */ struct plist_node avail_list; /* entry in swap_avail_head */ + const struct swap_ops *ops; }; static inline swp_entry_t page_swap_entry(struct page *page) diff --git a/mm/page_io.c b/mm/page_io.c index 56f21e49572ef0..c36b44ffe94717 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -334,21 +334,7 @@ static bool swap_can_merge(struct swap_io_ctx *ctx, struct folio *folio, if (ctx->sis != sis) return false; - - if (sis->flags & SWP_FS_OPS) { - if (swap_dev_pos(folio->swap) != - swap_dev_pos(prev_folio->swap) + prev_folio_size) - return false; - } else { - if (swap_folio_sector(folio) != - swap_folio_sector(prev_folio) + - (prev_folio_size >> SECTOR_SHIFT)) - return false; - if (rw == WRITE && !folio_blkg_can_merge(folio, prev_folio)) - return false; - } - - return true; + return sis->ops->can_merge(folio, prev_folio, prev_folio_size, rw); } static void swap_add_folio(struct swap_io_ctx *ctx, struct folio *folio, int rw) @@ -646,6 +632,23 @@ static void swap_bdev_submit_read(struct swap_io_ctx *ctx) } } +static bool swap_bdev_can_merge(struct folio *folio, struct folio *prev_folio, + size_t prev_folio_size, int rw) +{ + if (swap_folio_sector(folio) != + swap_folio_sector(prev_folio) + (prev_folio_size >> SECTOR_SHIFT)) + return false; + if (rw == WRITE && !folio_blkg_can_merge(folio, prev_folio)) + return false; + return true; +} + +const struct swap_ops swap_bdev_ops = { + .submit_write = swap_bdev_submit_write, + .submit_read = swap_bdev_submit_read, + .can_merge = swap_bdev_can_merge, +}; + static void swap_fs_submit(struct swap_io_ctx *ctx, int rw) { struct swap_iocb *sio = ctx->sio; @@ -666,15 +669,34 @@ static void swap_fs_submit(struct swap_io_ctx *ctx, int rw) sio->iocb.ki_complete(&sio->iocb, ret); } +static void swap_fs_submit_write(struct swap_io_ctx *ctx) +{ + swap_fs_submit(ctx, WRITE); +} + +static void swap_fs_submit_read(struct swap_io_ctx *ctx) +{ + swap_fs_submit(ctx, READ); +} + +static bool swap_fs_can_merge(struct folio *folio, struct folio *prev_folio, + size_t prev_folio_size, int rw) +{ + return swap_dev_pos(folio->swap) == + swap_dev_pos(prev_folio->swap) + prev_folio_size; +} + +const struct swap_ops swap_fs_ops = { + .submit_write = swap_fs_submit_write, + .submit_read = swap_fs_submit_read, + .can_merge = swap_fs_can_merge, +}; + void swap_write_submit(struct swap_io_ctx *ctx) { if (!ctx->sio) return; - - if (ctx->sis->flags & SWP_FS_OPS) - swap_fs_submit(ctx, WRITE); - else - swap_bdev_submit_write(ctx); + ctx->sis->ops->submit_write(ctx); ctx->sio = NULL; ctx->sis = NULL; } @@ -683,11 +705,7 @@ void swap_read_submit(struct swap_io_ctx *ctx) { if (!ctx->sio) return; - - if (ctx->sis->flags & SWP_FS_OPS) - swap_fs_submit(ctx, READ); - else - swap_bdev_submit_read(ctx); + ctx->sis->ops->submit_read(ctx); ctx->sio = NULL; ctx->sis = NULL; } diff --git a/mm/swap.h b/mm/swap.h index 86b2a241b7343e..ffc36695d4ace9 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -96,6 +96,13 @@ struct swap_io_ctx { struct swap_info_struct *sis; }; +struct swap_ops { + bool (*can_merge)(struct folio *folio, struct folio *prev_folio, + size_t prev_folio_size, int rw); + void (*submit_write)(struct swap_io_ctx *ctx); + void (*submit_read)(struct swap_io_ctx *ctx); +}; + #ifdef CONFIG_SWAP #include /* for swp_offset */ #include /* for bio_end_io_t */ @@ -483,6 +490,9 @@ static inline unsigned int folio_swap_flags(struct folio *folio) #endif /* CONFIG_SWAP */ +extern const struct swap_ops swap_bdev_ops; +extern const struct swap_ops swap_fs_ops; + int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio, struct list_head *folio_list); diff --git a/mm/swapfile.c b/mm/swapfile.c index be75c995c49b86..ad623dae483b6a 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2963,6 +2963,8 @@ static int setup_swap_extents(struct swap_info_struct *sis, if (ret) return ret; + sis->ops = &swap_bdev_ops; + if (S_ISBLK(inode->i_mode)) { ret = add_swap_extent(sis, 0, sis->max, 0); *span = sis->pages; @@ -2973,6 +2975,8 @@ static int setup_swap_extents(struct swap_info_struct *sis, ret = mapping->a_ops->swap_activate(sis, swap_file, span); if (ret < 0) return ret; + if (sis->flags & SWP_FS_OPS) + sis->ops = &swap_fs_ops; sis->flags |= SWP_ACTIVATED; return ret; } From bb2363bf68b4033eab855d454be92b5890fe46aa Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:43 +0200 Subject: [PATCH 148/250] mm/swap: remove SWP_FS_OPS Provide a swap_fs_activate helper that directly sets up swap_fs_ops, and a flag in struct swap_ops to indicate of NOFS swapping is allowed. Link: https://lore.kernel.org/20260713093350.2154226-7-hch@lst.de Signed-off-by: Christoph Hellwig Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Youngjun Park Signed-off-by: Andrew Morton --- Documentation/filesystems/locking.rst | 5 +++-- Documentation/filesystems/vfs.rst | 4 ++-- fs/nfs/file.c | 4 +--- fs/smb/client/file.c | 4 +--- include/linux/swap.h | 6 +++++- mm/page_io.c | 10 +++++++++- mm/swap.h | 22 ++++++++++------------ mm/swapfile.c | 2 -- mm/vmscan.c | 15 +++++++-------- 9 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst index 08d01bc62c319e..1a50d41a39a1ea 100644 --- a/Documentation/filesystems/locking.rst +++ b/Documentation/filesystems/locking.rst @@ -355,13 +355,14 @@ should perform any validation and preparation necessary to ensure that writes can be performed with minimal memory allocation. It should call add_swap_extent(), or the helper iomap_swapfile_activate(), and return the number of extents added. If IO should be submitted through -->swap_rw(), it should set SWP_FS_OPS, otherwise IO will be submitted +->swap_rw(), it should call swap_fs_activate, otherwise IO will be submitted directly to the block device ``sis->bdev``. ->swap_deactivate() will be called in the sys_swapoff() path after ->swap_activate() returned success. -->swap_rw will be called for swap IO if SWP_FS_OPS was set by ->swap_activate(). +->swap_rw will be called for swap IO if swap_fs_activate was called by +->swap_activate(). file_lock_operations ==================== diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index 7c753148af8883..e7677423a20f7a 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -977,7 +977,7 @@ cache in your filesystem. The following members are defined: can be performed with minimal memory allocation. It should call add_swap_extent(), or the helper iomap_swapfile_activate(), and return the number of extents added. If IO should be submitted - through ->swap_rw(), it should set SWP_FS_OPS, otherwise IO will + through ->swap_rw(), it should call swap_fs_activate, otherwise IO will be submitted directly to the block device ``sis->bdev``. ``swap_deactivate`` @@ -985,7 +985,7 @@ cache in your filesystem. The following members are defined: successful. ``swap_rw`` - Called to read or write swap pages when SWP_FS_OPS is set. + Called to read or write swap pages when swap_fs_activate was called. The File Object =============== diff --git a/fs/nfs/file.c b/fs/nfs/file.c index a0d8f1c1cf103e..851d93a099889e 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -597,7 +597,7 @@ static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file, ret = rpc_clnt_swap_activate(clnt); if (ret) return ret; - ret = add_swap_extent(sis, 0, sis->max, 0); + ret = swap_fs_activate(sis); if (ret < 0) { rpc_clnt_swap_deactivate(clnt); return ret; @@ -607,8 +607,6 @@ static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file, if (cl->rpc_ops->enable_swap) cl->rpc_ops->enable_swap(inode); - - sis->flags |= SWP_FS_OPS; return ret; } diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index b279a44be72977..7f2924ce2881d8 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -3451,9 +3451,7 @@ static int cifs_swap_activate(struct swap_info_struct *sis, * but we could add call to grab a byte range lock to prevent others * from reading or writing the file */ - - sis->flags |= SWP_FS_OPS; - return add_swap_extent(sis, 0, sis->max, 0); + return swap_fs_activate(sis); } static void cifs_swap_deactivate(struct file *file) diff --git a/include/linux/swap.h b/include/linux/swap.h index 5979b142736863..8dd68733c955a8 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -202,7 +202,6 @@ enum { SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ SWP_BLKDEV = (1 << 6), /* its a block device */ SWP_ACTIVATED = (1 << 7), /* set after swap_activate success */ - SWP_FS_OPS = (1 << 8), /* swapfile operations go through fs */ SWP_AREA_DISCARD = (1 << 9), /* single-time swap area discards */ SWP_PAGE_DISCARD = (1 << 10), /* freed swap page-cluster discards */ SWP_STABLE_WRITES = (1 << 11), /* no overwrite PG_writeback pages */ @@ -343,6 +342,7 @@ extern void __meminit kswapd_stop(int nid); #ifdef CONFIG_SWAP +int swap_fs_activate(struct swap_info_struct *sis); int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, unsigned long nr_pages, sector_t start_block); int generic_swapfile_activate(struct swap_info_struct *, struct file *, @@ -468,6 +468,10 @@ static inline bool folio_free_swap(struct folio *folio) return false; } +static inline int swap_fs_activate(struct swap_info_struct *sis) +{ + return -EINVAL; +} static inline int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, unsigned long nr_pages, sector_t start_block) diff --git a/mm/page_io.c b/mm/page_io.c index c36b44ffe94717..cea438b66bceba 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -686,12 +686,20 @@ static bool swap_fs_can_merge(struct folio *folio, struct folio *prev_folio, swap_dev_pos(prev_folio->swap) + prev_folio_size; } -const struct swap_ops swap_fs_ops = { +static const struct swap_ops swap_fs_ops = { + .flags = SWAP_OPS_F_REQUIRE_NOFS, .submit_write = swap_fs_submit_write, .submit_read = swap_fs_submit_read, .can_merge = swap_fs_can_merge, }; +int swap_fs_activate(struct swap_info_struct *sis) +{ + sis->ops = &swap_fs_ops; + return add_swap_extent(sis, 0, sis->max, 0); +} +EXPORT_SYMBOL_GPL(swap_fs_activate); + void swap_write_submit(struct swap_io_ctx *ctx) { if (!ctx->sio) diff --git a/mm/swap.h b/mm/swap.h index ffc36695d4ace9..1a78578fd0672e 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -96,7 +96,17 @@ struct swap_io_ctx { struct swap_info_struct *sis; }; +/* + * SWAP_OPS_F_REQUIRE_NOFS: + * When set, all reclaim operations must operated as GFS_NOFS and not + * just GFP_NOIO, as GFP_NOIO allocations could recourse into the + * file system backing this swap file. + */ +#define SWAP_OPS_F_REQUIRE_NOFS (1U << 0) + struct swap_ops { + unsigned int flags; + bool (*can_merge)(struct folio *folio, struct folio *prev_folio, size_t prev_folio_size, int rw); void (*submit_write)(struct swap_io_ctx *ctx); @@ -347,11 +357,6 @@ struct folio *swapin_sync(swp_entry_t entry, gfp_t flag, unsigned long orders, void swap_update_readahead(struct folio *folio, struct vm_area_struct *vma, unsigned long addr); -static inline unsigned int folio_swap_flags(struct folio *folio) -{ - return __swap_entry_to_info(folio->swap)->flags; -} - #else /* CONFIG_SWAP */ static inline struct swap_cluster_info *swap_cluster_lock( struct swap_info_struct *si, pgoff_t offset, bool irq) @@ -482,16 +487,9 @@ static inline void __swap_cache_replace_folio(struct swap_cluster_info *ci, struct folio *old, struct folio *new) { } - -static inline unsigned int folio_swap_flags(struct folio *folio) -{ - return 0; -} - #endif /* CONFIG_SWAP */ extern const struct swap_ops swap_bdev_ops; -extern const struct swap_ops swap_fs_ops; int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio, struct list_head *folio_list); diff --git a/mm/swapfile.c b/mm/swapfile.c index ad623dae483b6a..dacef34a3ed7a4 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2975,8 +2975,6 @@ static int setup_swap_extents(struct swap_info_struct *sis, ret = mapping->a_ops->swap_activate(sis, swap_file, span); if (ret < 0) return ret; - if (sis->flags & SWP_FS_OPS) - sis->ops = &swap_fs_ops; sis->flags |= SWP_ACTIVATED; return ret; } diff --git a/mm/vmscan.c b/mm/vmscan.c index 4742297693fe0f..3194da7dcc795e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1040,16 +1040,15 @@ static bool may_enter_fs(struct folio *folio, gfp_t gfp_mask) { if (gfp_mask & __GFP_FS) return true; - if (!folio_test_swapcache(folio) || !(gfp_mask & __GFP_IO)) - return false; /* - * We can "enter_fs" for swap-cache with only __GFP_IO - * providing this isn't SWP_FS_OPS. - * ->flags can be updated non-atomically, - * but that will never affect SWP_FS_OPS, so the data_race - * is safe. + * We can "enter_fs" for swap-cache with only __GFP_IO unless backed by + * a swapfile that requires GFP_NOFS I/O. */ - return !data_race(folio_swap_flags(folio) & SWP_FS_OPS); + if (folio_test_swapcache(folio) && (gfp_mask & __GFP_IO) && + !(__swap_entry_to_info(folio->swap)->ops->flags & + SWAP_OPS_F_REQUIRE_NOFS)) + return true; + return false; } /* From 90a215154dcf095c28126e4070852d6be878d711 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Jul 2026 11:33:44 +0200 Subject: [PATCH 149/250] mm/vmstat: add NRSWP{IN,OUT} counters Count how many swap I/Os we cause. Due to batching this can be different than the current counter number of pages written/read, and tracking this information is useful to see how efficient the batching is. The counters are added at the end of enum vm_event_item and the vmstat_text array under the assumption that the order of fields in /proc/vmstat is an ABI. If that is not the case, they could be grouped with the other swap counters. Link: https://lore.kernel.org/20260713093350.2154226-8-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Nhat Pham Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Youngjun Park Signed-off-by: Andrew Morton --- include/linux/vm_event_item.h | 4 ++++ mm/page_io.c | 2 ++ mm/vmstat.c | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 03fe95f5a0201a..2628ccda076a07 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -175,6 +175,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, KSTACK_REST, #endif #endif /* CONFIG_DEBUG_STACK_USAGE */ +#ifdef CONFIG_SWAP + NRSWPIN, + NRSWPOUT, +#endif /* CONFIG_SWAP */ NR_VM_EVENT_ITEMS }; diff --git a/mm/page_io.c b/mm/page_io.c index cea438b66bceba..e4fa7ffffe8bbb 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -704,6 +704,7 @@ void swap_write_submit(struct swap_io_ctx *ctx) { if (!ctx->sio) return; + count_vm_events(NRSWPOUT, 1); ctx->sis->ops->submit_write(ctx); ctx->sio = NULL; ctx->sis = NULL; @@ -713,6 +714,7 @@ void swap_read_submit(struct swap_io_ctx *ctx) { if (!ctx->sio) return; + count_vm_events(NRSWPIN, 1); ctx->sis->ops->submit_read(ctx); ctx->sio = NULL; ctx->sis = NULL; diff --git a/mm/vmstat.c b/mm/vmstat.c index 7d6e61a01f519b..cb57714539fb5e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1502,7 +1502,11 @@ const char * const vmstat_text[] = { #if THREAD_SIZE > 65536 [I(KSTACK_REST)] = "kstack_rest", #endif -#endif +#endif /* CONFIG_DEBUG_STACK_USAGE */ +#ifdef CONFIG_SWAP + [I(NRSWPIN)] = "nrswpin", + [I(NRSWPOUT)] = "nrswpout", +#endif /* CONFIG_SWAP */ #undef I #endif /* CONFIG_VM_EVENT_COUNTERS */ }; From 0b4e06bbd55c2420ac0623e01bbf0d89d9805ef1 Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Fri, 17 Jul 2026 15:11:04 +0800 Subject: [PATCH 150/250] mm/swap: fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch The !CONFIG_SWAP stub for swap_cluster_lock() has mismatched prototype: it has an extra unused irq argument and uses pgoff_t instead of unsigned long for offset. All callers are under CONFIG_SWAP so the extra parameter is dead. Delete the unused stub function entirely. Link: https://lore.kernel.org/20260717071104.73467-1-hongfu.li@linux.dev Signed-off-by: Hongfu Li Reviewed-by: Baoquan He Acked-by: Kairui Song Cc: Barry Song Cc: Chris Li Cc: Hongfu Li Cc: Kemeng Shi Cc: Nhat Pham Signed-off-by: Andrew Morton --- mm/swap.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/swap.h b/mm/swap.h index 1a78578fd0672e..48379b2ab20272 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -358,11 +358,6 @@ void swap_update_readahead(struct folio *folio, struct vm_area_struct *vma, unsigned long addr); #else /* CONFIG_SWAP */ -static inline struct swap_cluster_info *swap_cluster_lock( - struct swap_info_struct *si, pgoff_t offset, bool irq) -{ - return NULL; -} static inline struct swap_cluster_info *swap_cluster_get_and_lock( struct folio *folio) From 2da2935c7cf8bfbd769ef82c771c3e12c457ef73 Mon Sep 17 00:00:00 2001 From: Yunzhao Li Date: Thu, 2 Jul 2026 11:07:35 -0700 Subject: [PATCH 151/250] mm/zswap: use ratelimited stats flush in zswap_shrinker_count() zswap_shrinker_count() calls mem_cgroup_flush_stats(), which takes the global cgroup rstat lock synchronously. On machines with many CPUs and NUMA nodes, this creates severe lock contention in the kswapd reclaim path: - Multiple kswapd threads (one per NUMA node) run concurrently. - do_shrink_slab() invokes zswap_shrinker_count() for each memcg-aware shrinker pass. - Each call flushes the full cgroup rstat hierarchy under the global lock. On AMD EPYC 9684X machines (96 cores, 192 threads, 12 NUMA nodes) running production workloads with zswap enabled, perf shows 2.88% of kernel cycles in osq_lock contention from this path: 2.88% [k] osq_lock --__mutex_lock.constprop.0 --__cgroup_rstat_lock --cgroup_rstat_flush_locked --cgroup_rstat_flush --zswap_shrinker_count do_shrink_slab shrink_slab shrink_node balance_pgdat kswapd 84% of kswapd kernel cycles are spent in shrink_slab -> zswap_shrinker_count -> cgroup_rstat_flush, not in actual page reclaim (shrink_lruvec). Controlled A/B on identical hardware and workload: shrinker=Y: 2.88% osq_lock, memory PSI 1.58% shrinker=N: 0.00% osq_lock, memory PSI 0.57% eBPF-based rstat lock wait measurement across 8 production metals confirms the contention splits cleanly along shrinker enablement: shrinker=Y: 50-250x more contended lock acquisitions (248/s vs 1.1/s) shrinker=N: baseline lock wait (0.0017 s/s vs 1.04 s/s) zswap_shrinker_count() only produces a heuristic estimate, scaled by compression ratio via mult_frac(). The actual writeback happens in zswap_shrinker_scan(). Slightly stale stats are acceptable here. Switch to mem_cgroup_flush_stats_ratelimited(), which only flushes if the periodic 2-second flusher is one full cycle late. This matches the approach already used in prepare_scan_control() (mm/vmscan.c) for the same reclaim path. After applying this patch, rstat flush latency and lock wait time on shrinker=Y machines dropped to the same level as shrinker=N controls, while the zswap shrinker continues to function (pool size remains bounded under the max_pool_percent cap). Previously discussed: - Chengming Zhou (Dec 2023): rstat contention from zswap_shrinker_count [1] - Shakeel Butt (Aug 2024): zswap_shrinker_count still uses sync flush [2] - Yosry Ahmed (Aug 2024): suggested eliminating in-kernel flushers [3] - Jesper Dangaard Brouer (Sep 2024): cgroup/rstat V11 patch [4] Link: https://lore.kernel.org/20260702180908.150136-1-yunzhao@cloudflare.com Link: https://lore.kernel.org/linux-mm/20231206103935.3440502-1-zhouchengming@bytedance.com/ [1] Link: https://lore.kernel.org/linux-mm/CALvZod7LFxLCxVpOFH8b2Ppm8T40HPGMKQwX_=NPCWB_mFW+oQ@mail.gmail.com/ [2] Link: https://lore.kernel.org/linux-mm/CAJD7tkYvFyOSX+rP_FKGBhxvZiCDxtpsNp-c5CGOA-4Bq9oXSg@mail.gmail.com/ [3] Link: https://lore.kernel.org/linux-mm/172616070094.2055617.17676042522679701515.stgit@firesoul/ [4] Suggested-by: Jesper Dangaard Brouer Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Yunzhao Li Tested-by: Yunzhao Li Acked-by: Johannes Weiner Acked-by: Jesper Dangaard Brouer Acked-by: Nhat Pham Cc: Chengming Zhou Cc: Shakeel Butt Cc: Yosry Ahmed Cc: Yunzhao Li Cc: Sourav Panda Signed-off-by: Andrew Morton --- mm/zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zswap.c b/mm/zswap.c index c33d496bfdb214..9f777a48b106f1 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1219,7 +1219,7 @@ static unsigned long zswap_shrinker_count(struct shrinker *shrinker, * Without memcg, use the zswap pool-wide metrics. */ if (!mem_cgroup_disabled()) { - mem_cgroup_flush_stats(memcg); + mem_cgroup_flush_stats_ratelimited(memcg); nr_backing = memcg_page_state(memcg, MEMCG_ZSWAP_B) >> PAGE_SHIFT; nr_stored = memcg_page_state(memcg, MEMCG_ZSWAPPED); } else { From c4e20e8abc88c52bd49370f32677e4947d06fea4 Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Mon, 10 Aug 2026 17:32:15 +0800 Subject: [PATCH 152/250] mm/cma: remove stray newline from auto-generated CMA area name When no name is supplied, cma_new_area() generates names with format "cma%d\n", introducing an unintended newline character ('\n') in the CMA name. Most CMA regions are created with explicit names, so this path is seldom hit. The newline only creates cosmetic noise in debug logs, traces and debugfs with no functional impact. Link: https://lore.kernel.org/20260810093215.91419-1-hongfu.li@linux.dev Signed-off-by: Hongfu Li Acked-by: David Hildenbrand (Arm) Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: SJ Park Reviewed-by: Anshuman Khandual Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index a7929c758df15b..a10ea37a261da3 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -242,7 +242,7 @@ static int __init cma_new_area(const char *name, phys_addr_t size, if (name) strscpy(cma->name, name); else - snprintf(cma->name, CMA_MAX_NAME, "cma%d\n", cma_area_count); + snprintf(cma->name, CMA_MAX_NAME, "cma%d", cma_area_count); cma->available_count = cma->count = size >> PAGE_SHIFT; cma->order_per_bit = order_per_bit; From 02957cf44282ef15f0b72257a46485f7d43f7660 Mon Sep 17 00:00:00 2001 From: Hui Su Date: Sat, 8 Aug 2026 11:14:59 +0800 Subject: [PATCH 153/250] kasan: fix cache shrink race with CPU hotplug kasan_quarantine_remove_cache() first invokes per_cpu_remove_cache() on all online CPUs. Each callback moves objects belonging to the cache from cpu_quarantine to the CPU's shrink_qlist, where they can later be freed from task context. kmem_cache_destroy() invokes the quarantine removal path while holding cpus_read_lock(), but kmem_cache_shrink() does not. The latter can therefore race with CPU offlining as follows: kmem_cache_shrink() CPU hotplug ------------------- ----------- on_each_cpu() CPU1 moves objects to CPU1's shrink_qlist on_each_cpu() returns CPU1 goes offline kasan_cpu_offline() drains cpu_quarantine leaves shrink_qlist untouched for_each_online_cpu() skips CPU1 The objects left on CPU1's shrink_qlist are not returned to the slab allocator. This may prevent kmem_cache_shrink() from releasing slabs that would otherwise become empty. If CPU1 remains offline, a later kmem_cache_destroy() also skips the list and can report that the cache still contains objects. An intermittent occurrence was observed with a virtio-9p filesystem. The mount and umount commands both returned 0, but the kernel logged the following during the userspace-triggered teardown: [ 2994.380134][ T111] BUG 9p-fcall-cache-1 (Tainted: G B ): Objects remaining on __kmem_cache_shutdown() [ 2994.381140][ T111] Object 0xff11000004361118 @offset=4376 [ 2994.381607][ T111] Allocated in p9_fcall_init+0x201/0x400 age=19564 cpu=1 pid=104 [ 2994.382591][ T111] p9_fcall_init+0x201/0x400 [ 2994.382810][ T111] p9_tag_alloc+0x12f/0x700 [ 2994.382982][ T111] p9_client_prepare_req+0x102/0x3e0 [ 2994.383165][ T111] p9_client_rpc+0x1ab/0xa50 [ 2994.383334][ T111] p9_client_getattr_dotl+0xb0/0x1a0 [ 2994.383515][ T111] v9fs_vfs_getattr_dotl+0x115/0x360 [ 2994.383719][ T111] vfs_getattr_nosec+0x22c/0x3a0 [ 2994.383910][ T111] vfs_statx+0xd7/0x170 [ 2994.384062][ T111] vfs_fstatat+0x45/0x80 [ 2994.384215][ T111] __do_sys_newfstatat+0x84/0xe0 [ 2994.384386][ T111] do_syscall_64+0x115/0x6a0 [ 2994.384566][ T111] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 2994.399720][ T111] WARNING: mm/slub.c:1244 at __kmem_cache_shutdown+0x363/0x500, CPU#0: busybox/111 [ 2994.405655][ T111] Call Trace: [ 2994.406325][ T111] kmem_cache_destroy+0x73/0x1b0 [ 2994.406630][ T111] p9_client_destroy+0x271/0x3c0 [ 2994.407210][ T111] v9fs_session_close+0x3c/0x260 [ 2994.407409][ T111] v9fs_kill_super+0x48/0x90 [ 2994.407584][ T111] deactivate_locked_super+0xa3/0x160 [ 2994.407778][ T111] cleanup_mnt+0x1dd/0x3e0 Thus, a successful umount left objects in the 9p fcall cache and prevented the cache from being destroyed cleanly. Per-CPU shrink_qlist storage exists for every possible CPU, and each list is protected by its own raw spinlock. Iterate over possible CPUs so that a list populated before its CPU went offline is drained as well. for_each_possible_cpu() can do more work than for_each_online_cpu(), but this change only affects CONFIG_KASAN_GENERIC kernels. The extra work is limited to cache shrink and cache destruction paths and does not affect the normal allocation/free fast path. It adds one raw-spinlock-protected scan of each possible CPU's shrink list. These lists are normally empty; a non-empty list is traversed to remove objects belonging to the cache being shrunk or destroyed. Link: https://lore.kernel.org/20260808031459.3032812-1-sh_def@163.com Fixes: 07d067e4f2ce ("kasan: fix sleeping function called from invalid context on RT kernel") Signed-off-by: Hui Su Reviewed-by: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Cc: "Zhang, Qiang1" Cc: Signed-off-by: Andrew Morton --- mm/kasan/quarantine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 6958aa713c67ee..16f4e67beee82b 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c @@ -355,7 +355,12 @@ void kasan_quarantine_remove_cache(struct kmem_cache *cache) */ on_each_cpu(per_cpu_remove_cache, cache, 1); - for_each_online_cpu(cpu) { + /* + * A CPU can go offline after on_each_cpu() returns, leaving cache + * objects on that CPU's shrink list. Scan all possible CPUs to + * drain those lists. + */ + for_each_possible_cpu(cpu) { sq = per_cpu_ptr(&shrink_qlist, cpu); raw_spin_lock_irqsave(&sq->lock, flags); qlist_move_cache(&sq->qlist, &to_free, cache); From 8ff5b9863ec7fa98bb4cd214eb195ec9baf0a82c Mon Sep 17 00:00:00 2001 From: "David Hildenbrand (Arm)" Date: Mon, 10 Aug 2026 13:31:14 +0200 Subject: [PATCH 154/250] mm/gup_test: keep longterm pin state per file The pin longterm test currently stores its data globally, shared among multiple concurrent users of the interface (multiple open file descriptors -> multiple "struct file"'s). That makes the gup_test interface problematic to use concurrently: two users, such as concurrent selftest runs, can interfere with the same longterm pin state. While this has not been observed as a problem so far in practice, let's just handle it cleanly. There could be a way to trigger selftest failures by e.g., running the cow.c and gup_longerm.c selftests concurrently, but we usually run them sequentially. Let's add a "Fixes" tag to be safe, but not need to CC stable. Link: https://lore.kernel.org/20260810-gup_test_data-v1-1-fb1d41be5bb4@kernel.org Fixes: c77369b437f9 ("mm/gup_test: start/stop/read functionality for PIN LONGTERM test") Signed-off-by: David Hildenbrand (Arm) Reported-by: yunhui cui Closes: https://lore.kernel.org/r/20260608025043.88087-1-cuiyunhui@bytedance.com Tested-by: Yunhui Cui Tested-by: Lance Yang Cc: Jason Gunthorpe Cc: John Hubbard Cc: Peter Xu Cc: Yang Li Signed-off-by: Andrew Morton --- mm/gup_test.c | 94 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 32 deletions(-) diff --git a/mm/gup_test.c b/mm/gup_test.c index eb4c9cda16ed8d..44c1cdfb9c3717 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -8,6 +8,12 @@ #include #include "gup_test.h" +struct gup_test_data { + struct mutex longterm_mutex; + struct page **longterm_pages; + unsigned long longterm_nr_pages; +}; + static void put_back_pages(unsigned int cmd, struct page **pages, unsigned long nr_pages, unsigned int gup_test_flags) { @@ -208,23 +214,20 @@ static int __gup_test_ioctl(unsigned int cmd, return ret; } -static DEFINE_MUTEX(pin_longterm_test_mutex); -static struct page **pin_longterm_test_pages; -static unsigned long pin_longterm_test_nr_pages; - -static inline void pin_longterm_test_stop(void) +static inline void pin_longterm_test_stop(struct gup_test_data *data) { - if (pin_longterm_test_pages) { - if (pin_longterm_test_nr_pages) - unpin_user_pages(pin_longterm_test_pages, - pin_longterm_test_nr_pages); - kvfree(pin_longterm_test_pages); - pin_longterm_test_pages = NULL; - pin_longterm_test_nr_pages = 0; + if (data->longterm_pages) { + if (data->longterm_nr_pages) + unpin_user_pages(data->longterm_pages, + data->longterm_nr_pages); + kvfree(data->longterm_pages); + data->longterm_pages = NULL; + data->longterm_nr_pages = 0; } } -static inline int pin_longterm_test_start(unsigned long arg) +static inline int pin_longterm_test_start(struct gup_test_data *data, + unsigned long arg) { long nr_pages, cur_pages, addr, remaining_pages; int gup_flags = FOLL_LONGTERM; @@ -233,7 +236,7 @@ static inline int pin_longterm_test_start(unsigned long arg) int ret = 0; bool fast; - if (pin_longterm_test_pages) + if (data->longterm_pages) return -EINVAL; if (copy_from_user(&args, (void __user *)arg, sizeof(args))) @@ -263,12 +266,12 @@ static inline int pin_longterm_test_start(unsigned long arg) return -EINTR; } - pin_longterm_test_pages = pages; - pin_longterm_test_nr_pages = 0; + data->longterm_pages = pages; + data->longterm_nr_pages = 0; - while (nr_pages - pin_longterm_test_nr_pages) { - remaining_pages = nr_pages - pin_longterm_test_nr_pages; - addr = args.addr + pin_longterm_test_nr_pages * PAGE_SIZE; + while (nr_pages - data->longterm_nr_pages) { + remaining_pages = nr_pages - data->longterm_nr_pages; + addr = args.addr + data->longterm_nr_pages * PAGE_SIZE; if (fast) cur_pages = pin_user_pages_fast(addr, remaining_pages, @@ -277,11 +280,11 @@ static inline int pin_longterm_test_start(unsigned long arg) cur_pages = pin_user_pages(addr, remaining_pages, gup_flags, pages); if (cur_pages < 0) { - pin_longterm_test_stop(); + pin_longterm_test_stop(data); ret = cur_pages; break; } - pin_longterm_test_nr_pages += cur_pages; + data->longterm_nr_pages += cur_pages; pages += cur_pages; } @@ -290,19 +293,20 @@ static inline int pin_longterm_test_start(unsigned long arg) return ret; } -static inline int pin_longterm_test_read(unsigned long arg) +static inline int pin_longterm_test_read(struct gup_test_data *data, + unsigned long arg) { __u64 user_addr; unsigned long i; - if (!pin_longterm_test_pages) + if (!data->longterm_pages) return -EINVAL; if (copy_from_user(&user_addr, (void __user *)arg, sizeof(user_addr))) return -EFAULT; - for (i = 0; i < pin_longterm_test_nr_pages; i++) { - void *addr = kmap_local_page(pin_longterm_test_pages[i]); + for (i = 0; i < data->longterm_nr_pages; i++) { + void *addr = kmap_local_page(data->longterm_pages[i]); unsigned long ret; ret = copy_to_user((void __user *)(unsigned long)user_addr, addr, @@ -318,25 +322,26 @@ static inline int pin_longterm_test_read(unsigned long arg) static long pin_longterm_test_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) { + struct gup_test_data *data = filep->private_data; int ret = -EINVAL; - if (mutex_lock_killable(&pin_longterm_test_mutex)) + if (mutex_lock_killable(&data->longterm_mutex)) return -EINTR; switch (cmd) { case PIN_LONGTERM_TEST_START: - ret = pin_longterm_test_start(arg); + ret = pin_longterm_test_start(data, arg); break; case PIN_LONGTERM_TEST_STOP: - pin_longterm_test_stop(); + pin_longterm_test_stop(data); ret = 0; break; case PIN_LONGTERM_TEST_READ: - ret = pin_longterm_test_read(arg); + ret = pin_longterm_test_read(data, arg); break; } - mutex_unlock(&pin_longterm_test_mutex); + mutex_unlock(&data->longterm_mutex); return ret; } @@ -375,15 +380,40 @@ static long gup_test_ioctl(struct file *filep, unsigned int cmd, return 0; } +static int gup_test_open(struct inode *inode, struct file *file) +{ + struct gup_test_data *data; + int ret; + + data = kzalloc_obj(*data); + if (!data) + return -ENOMEM; + + ret = nonseekable_open(inode, file); + if (ret) { + kfree(data); + return ret; + } + + mutex_init(&data->longterm_mutex); + file->private_data = data; + return 0; +} + static int gup_test_release(struct inode *inode, struct file *file) { - pin_longterm_test_stop(); + struct gup_test_data *data = file->private_data; + + pin_longterm_test_stop(data); + mutex_destroy(&data->longterm_mutex); + kfree(data); + file->private_data = NULL; return 0; } static const struct file_operations gup_test_fops = { - .open = nonseekable_open, + .open = gup_test_open, .unlocked_ioctl = gup_test_ioctl, .compat_ioctl = compat_ptr_ioctl, .release = gup_test_release, From 265f5337f22ac8d4516f9b9cf433320bc3ffeaba Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 13 Jul 2026 04:48:04 -0700 Subject: [PATCH 155/250] mm: kmemleak: confirm suspected leaks with a second scan Patch series "mm: kmemleak: reduce transient false positives by confirming leaks". This series combines two kmemleak enhancements that were originally submitted separately but both required rebasing after commit 79c37ae3733e9 ("mm/kmemleak: fix checksum computation for per-cpu objects"). The first feature introduces a second scan to confirm suspected leaks: https://lore.kernel.org/all/20260709173347.689607-1-catalin.marinas@arm.com/ The second feature adds a module parameter controlling the minimum number of consecutive unreferenced scans before a leak is reported, as discussed in: https://lore.kernel.org/all/20260626-kmemleak_twice-v1-0-ab28f7cc0971@debian.org/ Changes from v1: Now that commit 79c37ae3733e9 is upstream, the selftest includes an additional priming phase scan as requested by Catalin. Additionally, I've factored out the leak-detection conditional into a helper function to be more digestible for the reader's eye. This 4-patch series resolves all outstanding kmemleak issues I've been tracking. This patch (of 4): The kmemleak marking phase is not atomic. While the object graph is traversed, the kernel can modify pointers, free objects or allocate new ones. If a reference to an object is moved from one location to another, kmemleak scanning may miss it. We have explicit annotations like kmemleak_transient_leak() but identifying and maintaining them is not trivial. Given that such transient leaks are short-lived, rather than just reporting such objects as leaks, do another scan to confirm the suspected objects. If no new leaks are found during the first scan, skip the confirmation one. Link: https://lore.kernel.org/20260713-catalin_pto-v1-0-5b93b1131089@debian.org Link: https://lore.kernel.org/20260713-catalin_pto-v1-1-5b93b1131089@debian.org Signed-off-by: Catalin Marinas Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Breno Leitao Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton --- mm/kmemleak.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 0a6045c857d661..95bd8ccd3c5bf1 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -175,6 +175,8 @@ struct kmemleak_object { #define OBJECT_PHYS (1 << 4) /* flag set for per-CPU pointers */ #define OBJECT_PERCPU (1 << 5) +/* flag set on an object left unreferenced by the full scan, pending confirmation */ +#define OBJECT_SUSPECT (1 << 6) /* set when __remove_object() called */ #define DELSTATE_REMOVED (1 << 0) @@ -235,6 +237,8 @@ static unsigned long jiffies_min_age; static unsigned long jiffies_last_scan; /* delay between automatic memory scannings */ static unsigned long jiffies_scan_wait; +/* number of objects flagged OBJECT_SUSPECT during the current scan */ +static int nr_suspects; /* enables or disables the task stacks scanning */ static int kmemleak_stack_scan = 1; /* protects the memory scanning, parameters and debug/kmemleak file access */ @@ -1440,6 +1444,11 @@ static void update_refs(struct kmemleak_object *object) */ object->count++; if (color_gray(object)) { + /* referenced after all, no longer a suspect */ + if (object->flags & OBJECT_SUSPECT) { + object->flags &= ~OBJECT_SUSPECT; + nr_suspects--; + } /* put_object() called when removing from gray_list */ WARN_ON(!get_object(object)); list_add_tail(&object->gray_list, &gray_list); @@ -1844,16 +1853,16 @@ static void dedup_flush(struct xarray *dedup) * kernel's standard allocators. This function must be called with the * scan_mutex held. */ -static void kmemleak_scan(void) +static int __kmemleak_scan(bool full) { struct kmemleak_object *object; struct zone *zone; int __maybe_unused i; - struct xarray dedup; - int new_leaks = 0; int stop = 0; jiffies_last_scan = jiffies; + if (full) + nr_suspects = 0; /* prepare the kmemleak_object's */ rcu_read_lock(); @@ -1883,6 +1892,8 @@ static void kmemleak_scan(void) /* reset the reference count (whiten the object) */ object->count = 0; + if (full) + object->flags &= ~OBJECT_SUSPECT; if (color_gray(object) && get_object(object)) list_add_tail(&object->gray_list, &gray_list); @@ -1950,6 +1961,10 @@ static void kmemleak_scan(void) scan_gray: scan_gray_list(); + /* a confirmation scan does not look for modified objects */ + if (!full) + return nr_suspects; + /* * Check for new or unreferenced objects modified since the previous * scan and color them gray until the next scan. @@ -1972,6 +1987,11 @@ static void kmemleak_scan(void) /* color it gray temporarily */ object->count = object->min_count; list_add_tail(&object->gray_list, &gray_list); + } else if (unreferenced_object(object) && + !(object->flags & OBJECT_REPORTED)) { + /* flag the objects left unreferenced by this scan */ + object->flags |= OBJECT_SUSPECT; + nr_suspects++; } raw_spin_unlock_irq(&object->lock); } @@ -1982,12 +2002,42 @@ static void kmemleak_scan(void) */ scan_gray_list(); + return nr_suspects; +} + +/* + * Scan the memory and report the unreferenced objects as leaks. Must be + * called with the scan_mutex held. + */ +static void kmemleak_scan(void) +{ + struct kmemleak_object *object; + struct xarray dedup; + int new_leaks = 0; + + /* + * Full scan. Objects left unreferenced are flagged OBJECT_SUSPECT and + * counted in the return value; nothing to confirm or report otherwise. + */ + if (!__kmemleak_scan(true)) + return; + /* * If scanning was stopped do not report any new unreferenced objects. */ if (scan_should_stop()) return; + /* + * A live object whose only reference is moved by, for example, a + * concurrent RCU update can be missed for one scan and reported as a + * transient false positive. Scan again and only report the objects + * left unreferenced (still flagged OBJECT_SUSPECT) by both scans. + */ + __kmemleak_scan(false); + if (scan_should_stop()) + return; + /* * Scanning result reporting. When verbose printing is enabled, dedupe * by stackdepot trace_handle so each unique backtrace is logged once @@ -2015,6 +2065,7 @@ static void kmemleak_scan(void) trace_handle = 0; dedup_print = false; if (unreferenced_object(object) && + (object->flags & OBJECT_SUSPECT) && !(object->flags & OBJECT_REPORTED)) { object->flags |= OBJECT_REPORTED; if (kmemleak_verbose) { From 6e9ffadd8f21396f66e7c2238ef4d1dd21356daf Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 13 Jul 2026 04:48:05 -0700 Subject: [PATCH 156/250] mm: kmemleak: report leaks only after N consecutive unreferenced scans kmemleak reports an object the first scan it is found unreferenced. Its mark phase runs without stopping the rest of the kernel and without a write barrier, so a live object whose only reference is briefly invisible during a concurrent RCU update -- e.g. a VMA moved between maple tree nodes, or a page-cache xa_node -- can be seen as unreferenced for that one scan. Because an object is flagged as reported only once, such a transient race turns into a permanent false positive. Track how many consecutive scans each object has been seen unreferenced and only report it once that reaches min_unref_scans, a new module parameter. It defaults to 1, leaving the behaviour unchanged; setting it higher (e.g. 2) still reports a genuine leak, one scan later, while an object referenced again before the threshold restarts its run and is never reported. min_unref_scans can be set at boot with kmemleak.min_unref_scans= or at run-time via /sys/module/kmemleak/parameters/min_unref_scans. Link: https://lore.kernel.org/20260713-catalin_pto-v1-2-5b93b1131089@debian.org Signed-off-by: Breno Leitao Reviewed-by: Catalin Marinas Cc: David Hildenbrand Cc: Geert Uytterhoeven Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- Documentation/dev-tools/kmemleak.rst | 8 ++++++++ mm/kmemleak.c | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kmemleak.rst b/Documentation/dev-tools/kmemleak.rst index 7d784e03f3f9d5..a8a83bc69ceb88 100644 --- a/Documentation/dev-tools/kmemleak.rst +++ b/Documentation/dev-tools/kmemleak.rst @@ -198,6 +198,14 @@ systems, because of pointers temporarily stored in CPU registers or stacks. Kmemleak defines MSECS_MIN_AGE (defaulting to 1000) representing the minimum age of an object to be reported as a memory leak. +The ``min_unref_scans`` module parameter (default 1) requires an object to +be seen unreferenced in that many consecutive scans before it is reported. +Keeping it at 1 preserves the historical behaviour; higher values filter +the transient false positives described above, at the cost of delaying +genuine reports by up to that many scans. It can be set at boot with +``kmemleak.min_unref_scans=`` or at run-time via +``/sys/module/kmemleak/parameters/min_unref_scans``. + Limitations and Drawbacks ------------------------- diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 95bd8ccd3c5bf1..7afd08ed85464f 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -151,6 +151,8 @@ struct kmemleak_object { int min_count; /* the total number of pointers found pointing to this object */ int count; + /* consecutive scans the object has been seen unreferenced */ + unsigned int unref_scans; /* checksum for detecting modified objects */ u32 checksum; depot_stack_handle_t trace_handle; @@ -234,6 +236,9 @@ static unsigned long max_percpu_addr; static struct task_struct *scan_thread; /* used to avoid reporting of recently allocated objects */ static unsigned long jiffies_min_age; +/* consecutive scans an object must stay unreferenced before reporting */ +static unsigned int min_unref_scans = 1; +module_param(min_unref_scans, uint, 0644); static unsigned long jiffies_last_scan; /* delay between automatic memory scannings */ static unsigned long jiffies_scan_wait; @@ -692,6 +697,7 @@ static struct kmemleak_object *__alloc_object(gfp_t gfp) object->excess_ref = 0; object->count = 0; /* white color initially */ object->checksum = ~0; + object->unref_scans = 0; object->del_state = 0; /* task information */ @@ -1890,6 +1896,9 @@ static int __kmemleak_scan(bool full) __paint_it(object, KMEMLEAK_BLACK); } + /* referenced last scan: restart the unreferenced run */ + if (!color_white(object)) + object->unref_scans = 0; /* reset the reference count (whiten the object) */ object->count = 0; if (full) @@ -2064,9 +2073,11 @@ static void kmemleak_scan(void) raw_spin_lock_irq(&object->lock); trace_handle = 0; dedup_print = false; + if (unreferenced_object(object) && (object->flags & OBJECT_SUSPECT) && - !(object->flags & OBJECT_REPORTED)) { + !(object->flags & OBJECT_REPORTED) && + ++object->unref_scans >= min_unref_scans) { object->flags |= OBJECT_REPORTED; if (kmemleak_verbose) { trace_handle = object->trace_handle; From 2531eb0d0989b3e1f97be89372735303eeff7b3f Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 13 Jul 2026 04:48:06 -0700 Subject: [PATCH 157/250] mm: kmemleak: factor leak confirmation into a helper The reporting loop in kmemleak_scan() decided whether to tag an object as a reported leak with a four-term compound condition whose last operand also had a side effect (++object->unref_scans). Mixing the candidate tests with the counter update made the check hard to read. Move the state transition into confirm_leak(): it returns true when a still-unreferenced suspect crosses min_unref_scans consecutive scans and is newly flagged OBJECT_REPORTED, leaving only the reporting bookkeeping in the caller. No functional change. Link: https://lore.kernel.org/20260713-catalin_pto-v1-3-5b93b1131089@debian.org Signed-off-by: Breno Leitao Reviewed-by: Catalin Marinas Cc: David Hildenbrand Cc: Geert Uytterhoeven Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/kmemleak.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 7afd08ed85464f..f63dfacee7ca10 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -2014,6 +2014,26 @@ static int __kmemleak_scan(bool full) return nr_suspects; } +/* + * Promote a suspected object to a reported leak once it has stayed + * unreferenced for min_unref_scans consecutive scans. Called with + * object->lock held; returns true when the object is newly reported. + */ +static bool confirm_leak(struct kmemleak_object *object) +{ + if (!unreferenced_object(object) || + !(object->flags & OBJECT_SUSPECT) || + (object->flags & OBJECT_REPORTED)) + return false; + + object->unref_scans += 1; + if (object->unref_scans < min_unref_scans) + return false; + + object->flags |= OBJECT_REPORTED; + return true; +} + /* * Scan the memory and report the unreferenced objects as leaks. Must be * called with the scan_mutex held. @@ -2074,11 +2094,7 @@ static void kmemleak_scan(void) trace_handle = 0; dedup_print = false; - if (unreferenced_object(object) && - (object->flags & OBJECT_SUSPECT) && - !(object->flags & OBJECT_REPORTED) && - ++object->unref_scans >= min_unref_scans) { - object->flags |= OBJECT_REPORTED; + if (confirm_leak(object)) { if (kmemleak_verbose) { trace_handle = object->trace_handle; dedup_print = true; From 71ff9be17f153df147e15d8bcfdeced81b855e6a Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Mon, 13 Jul 2026 04:48:07 -0700 Subject: [PATCH 158/250] selftests: mm: test kmemleak's N-consecutive-scan leak confirmation Add a functional test for the min_unref_scans kmemleak module parameter. Using samples/kmemleak's helper module it checks that min_unref_scans=1 reports an orphan on the first scan, min_unref_scans=2 reports nothing on the first scan but does on the second, and that the parameter reads back what was written. It counts only the helper module's own orphans (matched by their [kmemleak_test] backtrace, with the module kept loaded so the symbols resolve) so unrelated leaks already present on the system do not perturb the result. The test skips when run as non-root, without CONFIG_DEBUG_KMEMLEAK / CONFIG_SAMPLE_KMEMLEAK, on a kernel without the parameter, or when the helper yields no detectable orphan. Link: https://lore.kernel.org/20260713-catalin_pto-v1-4-5b93b1131089@debian.org Signed-off-by: Breno Leitao Reviewed-by: Catalin Marinas Cc: David Hildenbrand Cc: Geert Uytterhoeven Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/Makefile | 1 + .../selftests/mm/ksft_kmemleak_confirm.sh | 132 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100755 tools/testing/selftests/mm/ksft_kmemleak_confirm.sh diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 0f31d850707d05..2d5366196e3091 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -149,6 +149,7 @@ TEST_PROGS += ksft_gup_test.sh TEST_PROGS += ksft_hmm.sh TEST_PROGS += ksft_hugetlb.sh TEST_PROGS += ksft_hugevm.sh +TEST_PROGS += ksft_kmemleak_confirm.sh TEST_PROGS += ksft_kmemleak_dedup.sh TEST_PROGS += ksft_ksm.sh TEST_PROGS += ksft_ksm_numa.sh diff --git a/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh b/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh new file mode 100755 index 00000000000000..3a8576e835c8d1 --- /dev/null +++ b/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh @@ -0,0 +1,132 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Functional test for kmemleak's N-consecutive-scan leak confirmation +# (the min_unref_scans module parameter). +# +# kmemleak only reports an object once it has stayed unreferenced for +# min_unref_scans consecutive scans. The default of 1 reports on the first +# scan (historical behaviour); higher values filter transient false +# positives where a live object's only reference is briefly invisible to a +# single scan (e.g. an RCU tree update in flight while the scan runs). The +# test loads samples/kmemleak's helper module to create orphan allocations +# and, counting only those orphans (matched by their [kmemleak_test] +# backtrace so unrelated leaks already present on the system are ignored), +# checks that: +# - a freshly allocated object is greyed on its first scan (its checksum +# settles then), so nothing can be reported before that priming scan; +# each case below primes once first, +# - with the default threshold (min_unref_scans=1) one scan after priming +# reports the orphans, +# - raising the threshold to 2 needs two scans after priming: one is not +# enough, the second reports, +# - the parameter reads back what was written. +# +# The "one post-prime scan is not enough at min_unref_scans=2" check is the +# core regression test: raising min_unref_scans must push the report +# strictly later. Like ksft_kmemleak_dedup.sh, if the module yields no +# detectable orphan at all in the running environment the test skips rather +# than failing. +# +# Author: Breno Leitao + +# KTAP output helpers (ktap_skip_all, ktap_exit_fail_msg, ktap_test_pass, ...). +DIR="$(dirname "$(readlink -f "$0")")" +# shellcheck source=../kselftest/ktap_helpers.sh +source "${DIR}"/../kselftest/ktap_helpers.sh + +KMEMLEAK=/sys/kernel/debug/kmemleak +PARAM=/sys/module/kmemleak/parameters/min_unref_scans +MODULE=kmemleak-test +AGE=6 # seconds; must exceed kmemleak's 5s minimum object age + +ktap_print_header + +[ "$(id -u)" -eq 0 ] || { ktap_skip_all "must run as root"; exit "$KSFT_SKIP"; } +[ -r "$KMEMLEAK" ] || + { ktap_skip_all "no kmemleak debugfs (CONFIG_DEBUG_KMEMLEAK)"; exit "$KSFT_SKIP"; } +[ -w "$PARAM" ] || + { ktap_skip_all "min_unref_scans module parameter not present"; exit "$KSFT_SKIP"; } +modinfo "$MODULE" >/dev/null 2>&1 || + { ktap_skip_all "$MODULE not built (CONFIG_SAMPLE_KMEMLEAK)"; exit "$KSFT_SKIP"; } + +# kmemleak can be present but disabled at runtime (kmemleak=off boot arg, +# or it self-disabled after an internal error); a "scan" then returns +# EPERM. Probe once and skip if so. +echo scan > "$KMEMLEAK" 2>/dev/null || + { ktap_skip_all "kmemleak is disabled (check dmesg or kmemleak= boot arg)"; exit "$KSFT_SKIP"; } + +prev=$(cat "$PARAM") +# shellcheck disable=SC2317 # invoked indirectly via trap +cleanup() { + echo "$prev" > "$PARAM" 2>/dev/null # restore the parameter + echo scan=on > "$KMEMLEAK" 2>/dev/null # re-enable auto scan + rmmod "$MODULE" 2>/dev/null + echo clear > "$KMEMLEAK" 2>/dev/null +} +trap cleanup EXIT + +# Stop the automatic scan thread: only our manual scans should advance an +# object's consecutive-unreferenced run. An auto scan landing between two +# manual scans would change the result and make the test flaky. +echo scan=off > "$KMEMLEAK" 2>/dev/null + +# Create a fresh, aged set of orphan objects from the helper module's init +# path (its kmalloc/vmalloc/percpu allocations are dropped right away). +# Pre-existing reported leaks are greyed first ("clear") so only our +# orphans are counted. The module is left loaded on purpose: once it is +# unloaded its symbols are gone, so the orphan backtraces no longer resolve +# to [kmemleak_test] and could not be matched below. +gen_orphans() { + rmmod "$MODULE" 2>/dev/null + echo clear > "$KMEMLEAK" + modprobe "$MODULE" || + { ktap_skip_all "failed to load $MODULE"; exit "$KSFT_SKIP"; } + sleep "$AGE" +} + +scan() { echo scan > "$KMEMLEAK"; } + +# Number of helper-module orphans currently reported by kmemleak. Matching +# the module's own backtrace ([kmemleak_test]) keeps the count immune to +# unrelated leaks on the running system. kmemleak only lists an object here +# once it has been reported, so this reflects the confirmation gating. +count_orphans() { + c=$(grep -c '\[kmemleak_test\]' "$KMEMLEAK" 2>/dev/null) + echo "${c:-0}" +} + +# 0) the parameter reads back what was written. +echo 3 > "$PARAM" +[ "$(cat "$PARAM")" = "3" ] || ktap_exit_fail_msg "min_unref_scans did not read back as 3" + +# Priming scan: kmemleak greys a freshly allocated object on its first scan +# (its checksum settles then), so nothing can be reported until a second +# scan. Every case below runs this priming scan before counting. +prime() { scan; } + +# 1) min_unref_scans=1 (default): one scan after priming reports the +# orphans. This also establishes that the helper produces detectable +# orphans here. +echo 1 > "$PARAM" +gen_orphans +prime +scan +first=$(count_orphans) +[ "$first" -gt 0 ] || + { ktap_skip_all "$MODULE produced no detectable orphans (cannot test min_unref_scans)"; exit "$KSFT_SKIP"; } + +# 2) min_unref_scans=2: after priming, one scan is not enough (still +# gated), the second reports. The gated-scan-zero check is the core +# regression. +echo 2 > "$PARAM" +gen_orphans +prime +scan; s1=$(count_orphans) +scan; s2=$(count_orphans) +[ "$s1" -eq 0 ] || ktap_exit_fail_msg "min_unref_scans=2: $s1 orphan(s) after 1 post-prime scan (must be 0)" +[ "$s2" -gt 0 ] || ktap_exit_fail_msg "min_unref_scans=2: no report after 2 post-prime scans (false negative)" + +ktap_set_plan 1 +ktap_test_pass "min_unref_scans=1 reported $first orphan(s) one scan after priming; =2 held them one scan longer ($s1 after one scan, $s2 after two); param read-back ok" +ktap_finished From 5e75190f2854369a008445fe674e22edcc89e3c8 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 31 Jul 2026 03:13:04 -0700 Subject: [PATCH 159/250] mm: kmemleak: default min_unref_scans to 2 for verbose auto-scan Patch series "mm: kmemleak: default min_unref_scans to 2 for verbose kernels", v2. When CONFIG_DEBUG_KMEMLEAK_VERBOSE is set, which means the host is in auto scan mode, set min_unref_scans to 2, avoiding false positives. CONFIG_DEBUG_KMEMLEAK_VERBOSE depends on CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN, so a kernel built with it already runs the scan thread periodically and the user has asked for detailed leak reports. The confirming second scan comes for free there, so default min_unref_scans to 2 in that case and keep it at 1 everywhere else. CONFIG_DEBUG_KMEMLEAK_VERBOSE defaults to n, so nothing changes for kernels that do not opt in. The other two patches bring the documentation and the selftest comments in line with the new conditional default. PS: A similar patch (v1 of this patchset) is applied to Meta's kernel, in real production hosts. This patch (of 3): min_unref_scans defers reporting an object as leaked until it has stayed unreferenced for that many consecutive scans, filtering out objects that are only transiently unreferenced during a scan. It defaults to 1, which reports on the first unreferenced scan. CONFIG_DEBUG_KMEMLEAK_VERBOSE depends on CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN, so a kernel built with it runs the scan thread periodically and the user has opted into detailed leak reporting. A second confirming scan then happens on its own. Default min_unref_scans to 2 there to suppress transient false positives, and keep it at 1 otherwise, where a manually triggered scan is expected to report immediately. The value stays writable through the module parameter. CONFIG_DEBUG_KMEMLEAK_VERBOSE defaults to n, so this does not change the default for kernels that do not opt in. Link: https://lore.kernel.org/20260731-kmemleak_hardened-v2-0-7b9689ac77cb@debian.org Link: https://lore.kernel.org/20260731-kmemleak_hardened-v2-1-7b9689ac77cb@debian.org Signed-off-by: Breno Leitao Acked-by: Catalin Marinas Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/kmemleak.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index f63dfacee7ca10..8fa409a4f9fb26 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -237,7 +237,8 @@ static struct task_struct *scan_thread; /* used to avoid reporting of recently allocated objects */ static unsigned long jiffies_min_age; /* consecutive scans an object must stay unreferenced before reporting */ -static unsigned int min_unref_scans = 1; +static unsigned int min_unref_scans = + IS_ENABLED(CONFIG_DEBUG_KMEMLEAK_VERBOSE) ? 2 : 1; module_param(min_unref_scans, uint, 0644); static unsigned long jiffies_last_scan; /* delay between automatic memory scannings */ From 6328346995a930f5ec6a07c36119052195107511 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 31 Jul 2026 03:13:05 -0700 Subject: [PATCH 160/250] Documentation: kmemleak: document the conditional min_unref_scans default min_unref_scans now defaults to 2 when CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN and CONFIG_DEBUG_KMEMLEAK_VERBOSE are both enabled, but the documentation still states that the default is unconditionally 1. Link: https://lore.kernel.org/20260731-kmemleak_hardened-v2-2-7b9689ac77cb@debian.org Signed-off-by: Breno Leitao Acked-by: Catalin Marinas Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- Documentation/dev-tools/kmemleak.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/dev-tools/kmemleak.rst b/Documentation/dev-tools/kmemleak.rst index a8a83bc69ceb88..d1b690b1716967 100644 --- a/Documentation/dev-tools/kmemleak.rst +++ b/Documentation/dev-tools/kmemleak.rst @@ -198,11 +198,13 @@ systems, because of pointers temporarily stored in CPU registers or stacks. Kmemleak defines MSECS_MIN_AGE (defaulting to 1000) representing the minimum age of an object to be reported as a memory leak. -The ``min_unref_scans`` module parameter (default 1) requires an object to -be seen unreferenced in that many consecutive scans before it is reported. -Keeping it at 1 preserves the historical behaviour; higher values filter -the transient false positives described above, at the cost of delaying -genuine reports by up to that many scans. It can be set at boot with +The ``min_unref_scans`` module parameter requires an object to be seen +unreferenced in that many consecutive scans before it is reported. It +defaults to 2 when CONFIG_DEBUG_KMEMLEAK_VERBOSE is enabled, where the +periodic scan thread confirms a leak on its own, and to 1 otherwise. A +value of 1 preserves the historical behaviour; higher values filter the +transient false positives described above, at the cost of delaying genuine +reports by up to that many scans. It can be set at boot with ``kmemleak.min_unref_scans=`` or at run-time via ``/sys/module/kmemleak/parameters/min_unref_scans``. From d2c8b861e11862ceab1679e1bab756efffe75d1b Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 31 Jul 2026 03:13:06 -0700 Subject: [PATCH 161/250] selftests/mm: kmemleak: drop stale min_unref_scans default from comments The test writes min_unref_scans explicitly for every case, so its comments describing 1 as the default are both unnecessary and, since the default is now conditional, wrong. Refer to the threshold values directly. No functional change. Link: https://lore.kernel.org/20260731-kmemleak_hardened-v2-3-7b9689ac77cb@debian.org Signed-off-by: Breno Leitao Acked-by: Catalin Marinas Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/ksft_kmemleak_confirm.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh b/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh index 3a8576e835c8d1..72ded5e6794c9b 100755 --- a/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh +++ b/tools/testing/selftests/mm/ksft_kmemleak_confirm.sh @@ -5,7 +5,7 @@ # (the min_unref_scans module parameter). # # kmemleak only reports an object once it has stayed unreferenced for -# min_unref_scans consecutive scans. The default of 1 reports on the first +# min_unref_scans consecutive scans. A threshold of 1 reports on the first # scan (historical behaviour); higher values filter transient false # positives where a live object's only reference is briefly invisible to a # single scan (e.g. an RCU tree update in flight while the scan runs). The @@ -16,8 +16,7 @@ # - a freshly allocated object is greyed on its first scan (its checksum # settles then), so nothing can be reported before that priming scan; # each case below primes once first, -# - with the default threshold (min_unref_scans=1) one scan after priming -# reports the orphans, +# - at min_unref_scans=1 one scan after priming reports the orphans, # - raising the threshold to 2 needs two scans after priming: one is not # enough, the second reports, # - the parameter reads back what was written. @@ -105,9 +104,8 @@ echo 3 > "$PARAM" # scan. Every case below runs this priming scan before counting. prime() { scan; } -# 1) min_unref_scans=1 (default): one scan after priming reports the -# orphans. This also establishes that the helper produces detectable -# orphans here. +# 1) min_unref_scans=1: one scan after priming reports the orphans. This +# also establishes that the helper produces detectable orphans here. echo 1 > "$PARAM" gen_orphans prime From 53ee3782f72be7028ac67c892f9712e055a4e8b4 Mon Sep 17 00:00:00 2001 From: Mark Sercombe Date: Thu, 13 Aug 2026 20:38:47 +0200 Subject: [PATCH 162/250] maple_tree: fix comment typo Fix a spelling mistake n a code comment. This is a comment only change with no functional impact. Link: https://lore.kernel.org/20260813183847.474357-1-sercombe.joel.mark@gmail.com Signed-off-by: Mark Sercombe Reviewed-by: Andrew Morton Reviewed-by: Liam R. Howlett (Oracle) Cc: Alice Ryhl Cc: Andrew Ballance Signed-off-by: Andrew Morton --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b48bc4064ad206..a0542b491bc232 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3590,7 +3590,7 @@ static inline void mas_wr_prealloc_setup(struct ma_wr_state *wr_mas) /** * mas_prealloc_calc() - Calculate number of nodes needed for a - * given store oepration + * given store operation * @wr_mas: The maple write state * @entry: The entry to store into the tree * From 348a776cbc4bde52a5b3b79962b63969e1eed32e Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 10 Aug 2026 21:22:37 +0100 Subject: [PATCH 163/250] zram: fix slot lock bit position on big-endian 64-bit The slot lock is a bit operation on the whole __lock word, which flags and ac_time alias as two u32s. On little-endian the lock bit lands in the position ZRAM_ENTRY_LOCK reserves in flags, so the aliasing works out. On 64-bit big-endian it lands in ac_time instead: with ZRAM_TRACK_ENTRY_ACTIME enabled, storing the access time from mark_slot_accessed() or slot_free() wipes out the held lock bit, letting another CPU take the same slot lock; an access time value with that bit set makes the slot look locked forever. Shift the lock bit into the flags half of the word on big-endian 64-bit. Link: https://lore.kernel.org/20260810202241.2436603-1-devnexen@gmail.com Fixes: 2e8ff2f51dde ("zram: use u32 for entry ac_time tracking") Signed-off-by: David Carlier Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 6 +++--- drivers/block/zram/zram_drv.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d09fdca49cbda8..a9b3bb1d3bef35 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -74,7 +74,7 @@ static __must_check bool slot_trylock(struct zram *zram, unsigned long index) { unsigned long *lock = &zram->table[index].__lock; - if (!test_and_set_bit_lock(ZRAM_ENTRY_LOCK, lock)) { + if (!test_and_set_bit_lock(ZRAM_ENTRY_LOCK_BIT, lock)) { mutex_acquire(&zram->table_lock_map, 0, 1, _RET_IP_); lock_acquired(&zram->table_lock_map, _RET_IP_); return true; @@ -88,7 +88,7 @@ static void slot_lock(struct zram *zram, unsigned long index) unsigned long *lock = &zram->table[index].__lock; mutex_acquire(&zram->table_lock_map, 0, 0, _RET_IP_); - wait_on_bit_lock(lock, ZRAM_ENTRY_LOCK, TASK_UNINTERRUPTIBLE); + wait_on_bit_lock(lock, ZRAM_ENTRY_LOCK_BIT, TASK_UNINTERRUPTIBLE); lock_acquired(&zram->table_lock_map, _RET_IP_); } @@ -97,7 +97,7 @@ static void slot_unlock(struct zram *zram, unsigned long index) unsigned long *lock = &zram->table[index].__lock; mutex_release(&zram->table_lock_map, _RET_IP_); - clear_and_wake_up_bit(ZRAM_ENTRY_LOCK, lock); + clear_and_wake_up_bit(ZRAM_ENTRY_LOCK_BIT, lock); } static inline bool init_done(struct zram *zram) diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index 4fddc582f3b826..7a55d751417e20 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -15,6 +15,7 @@ #ifndef _ZRAM_DRV_H_ #define _ZRAM_DRV_H_ +#include #include #include @@ -57,6 +58,19 @@ enum zram_pageflags { __NR_ZRAM_PAGEFLAGS, }; +/* + * The slot lock is a bit-wait lock on the whole __lock word, while + * flags and ac_time alias that word as two u32s. The lock bit must + * land in the slot that ZRAM_ENTRY_LOCK reserves in attr.flags; on + * 64-bit big-endian the flags word maps to the upper half of __lock, + * so the bit position has to be shifted up. + */ +#if defined(CONFIG_64BIT) && defined(__BIG_ENDIAN) +#define ZRAM_ENTRY_LOCK_BIT (ZRAM_ENTRY_LOCK + 32) +#else +#define ZRAM_ENTRY_LOCK_BIT ZRAM_ENTRY_LOCK +#endif + /* * Allocated for each disk page. We use bit-lock (ZRAM_ENTRY_LOCK bit * of flags) to save memory. There can be plenty of entries and standard From ee121d831b89ec1e91c88b7e3fd92a37c3a2807f Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Mon, 10 Aug 2026 20:10:01 +0200 Subject: [PATCH 164/250] mm/page-writeback: document folio_mark_dirty() locking more explicitly We have had bugs where set_page_dirty() was used on a page from GUP without appropriate locking, leading to UAF, in: - KVM, see https://lore.kernel.org/r/20260810-x86-kvm-setpagedirty-v1-1-85f180892d4f@google.com - i915, see commit 0d4bbe3d407f ("drm/i915/userptr: Try to acquire the page lock around set_page_dirty()"). - VMCI, see commit 5a16c535409f ("VMCI: Use set_page_dirty_lock() when unregistering guest memory") - kpc2000 staging driver, see commit b6d13bd9f2c1 ("staging: kpc2000: kpc_dma: Convert set_page_dirty() --> set_page_dirty_lock()") I think set_page_dirty() and folio_mark_dirty() need more explicit documentation on how they should be used with pages from GUP; so add a comment on top of set_page_dirty() and make the comment above folio_mark_dirty() more explicit. Link: https://lore.kernel.org/20260810-set-page-dirty-warnings-v2-1-1bd40fadfacd@google.com Signed-off-by: Jann Horn Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton --- mm/folio-compat.c | 1 + mm/page-writeback.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mm/folio-compat.c b/mm/folio-compat.c index a02179a0bded37..6212fdd6761a8c 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -41,6 +41,7 @@ void set_page_writeback(struct page *page) } EXPORT_SYMBOL(set_page_writeback); +/* Read the comment above folio_mark_dirty() regarding required locks! */ bool set_page_dirty(struct page *page) { return folio_mark_dirty(page_folio(page)); diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 47495be68598f4..3a03e04b640c7a 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2763,6 +2763,11 @@ EXPORT_SYMBOL(folio_redirty_for_writepage); * in this folio. Truncation will block on the page table lock as it * unmaps pages before removing the folio from its mapping. * + * .. DANGER:: + * Do not use this on a folio obtained from a function like + * get_user_pages_fast() without holding appropriate locks; you might want to + * use set_page_dirty_lock() or folio_mark_dirty_lock() instead. + * * Return: True if the folio was newly dirtied, false if it was already dirty. */ bool folio_mark_dirty(struct folio *folio) From 6b3ded977d5e40d1dd0ab0d6904da3cd095a46c0 Mon Sep 17 00:00:00 2001 From: Longlong Xia Date: Sun, 9 Aug 2026 19:55:18 +0800 Subject: [PATCH 165/250] zsmalloc: account for handle size in class lookup zs_lookup_class_index() lets zram recompression decide whether a newly compressed object would use a smaller size class. It currently classifies the payload size directly, while zs_malloc() adds ZS_HANDLE_SIZE before selecting the class. This makes lookup disagree with allocation near size-class boundaries. With 4 KiB pages, CONFIG_ZSMALLOC_CHAIN_SIZE=8, and 64-bit handles, a 1025-to-1024-byte recompression appears to move from class 64 to class 62 although both allocations use class 64. Conversely, a 1049-to-1025-byte recompression appears to stay in class 64 although the allocations move from class 65 to class 64. As a result, zram can accept replacements with no allocation benefit or reject ones that would save memory, potentially marking the object incompressible. Factor size-class selection into lookup_size_class(), account for the handle there, and use the helper for both lookup and allocation. Link: https://lore.kernel.org/20260809115518.3791787-1-xialonglong2025@163.com Fixes: 7c2af309abd2 ("zram: add size class equals check into recompression") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Longlong Xia Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton --- mm/zsmalloc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 8204b76f78308f..825022a7a328fe 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -552,6 +552,11 @@ static int get_size_class_index(int size) return min_t(int, ZS_SIZE_CLASSES - 1, idx); } +static struct size_class *lookup_size_class(struct zs_pool *pool, size_t size) +{ + return pool->size_class[get_size_class_index(size + ZS_HANDLE_SIZE)]; +} + static inline void class_stat_add(struct size_class *class, int type, unsigned long cnt) { @@ -1117,7 +1122,7 @@ unsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size) { struct size_class *class; - class = pool->size_class[get_size_class_index(size)]; + class = lookup_size_class(pool, size); return class->index; } @@ -1407,9 +1412,7 @@ unsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp, if (!handle) return (unsigned long)ERR_PTR(-ENOMEM); - /* extra space in chunk to keep the handle */ - size += ZS_HANDLE_SIZE; - class = pool->size_class[get_size_class_index(size)]; + class = lookup_size_class(pool, size); /* class->lock effectively protects the zpage migration */ spin_lock(&class->lock); From 6470e03f98663ecc166ed2aa2ce87548308c8a6f Mon Sep 17 00:00:00 2001 From: Karl Mehltretter Date: Sat, 8 Aug 2026 22:03:12 +0200 Subject: [PATCH 166/250] selftests/proc: make proc-maps-race work with READ_IMPLIES_EXEC test_maps_tearing_from_split times out when READ_IMPLIES_EXEC is set. This happens by default on pre-ARMv6 CPUs, which lack no-execute support. split_vma() re-maps the first page with mod_info->prot | PROT_EXEC to make it differ from its neighbours. With READ_IMPLIES_EXEC the original mapping is already executable, so no split occurs and the test hangs waiting for the modifier child. Use PROT_NONE for the split mapping, which always differs from its readable neighbours. Link: https://lore.kernel.org/20260808200312.6326-1-kmehltretter@gmail.com Fixes: beb69e817246 ("selftests/proc: add /proc/pid/maps tearing from vma split test") Assisted-by: Codex:gpt-5.6-terra Signed-off-by: Karl Mehltretter Cc: Alexey Dobriyan Cc: Jann Horn Cc: Liam R. Howlett Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/proc/proc-maps-race.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/proc/proc-maps-race.c b/tools/testing/selftests/proc/proc-maps-race.c index 1026d8c400e1ba..415eccb7046848 100644 --- a/tools/testing/selftests/proc/proc-maps-race.c +++ b/tools/testing/selftests/proc/proc-maps-race.c @@ -490,7 +490,8 @@ static bool query_addr_at(int maps_fd, void *addr, static inline bool split_vma(FIXTURE_DATA(proc_maps_race) *self) { - return mmap(self->mod_info->addr, self->page_size, self->mod_info->prot | PROT_EXEC, + /* PROT_NONE differs from both readable neighbors. */ + return mmap(self->mod_info->addr, self->page_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0) != MAP_FAILED; } From f5a5c528b9c74e525e1c80cecdf5fd4c3a26e179 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 23 Jul 2026 07:46:04 +0200 Subject: [PATCH 167/250] mm/swap: revert to single-folio writes for synchronous swap devices Patch series "swap_ops updates", v2. This series is a follow on to the swap ops series now in mm-unstable. The first patch reintroduces direct folio writes for synchronous swap files, the other two remove the double indirect for file system based swap. This patch (of 3): Kairui Song reported that zram benefits from submitting each folio directly instead of batching up I/O because the classic LRU scanning benefits from clearing the folio writeback bit in the scan loop. Accommodate that by kicking off writes for synchronous devices for each iteration. Link: https://lore.kernel.org/20260723054622.3460249-1-hch@lst.de Link: https://lore.kernel.org/20260723054622.3460249-2-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Usama Arif Acked-by: Chris Li Cc: Baoquan He Cc: Kairui Song Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Steve French Signed-off-by: Andrew Morton --- mm/page_io.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mm/page_io.c b/mm/page_io.c index e4fa7ffffe8bbb..c984a4023a6518 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -358,7 +358,16 @@ static void swap_add_folio(struct swap_io_ctx *ctx, struct folio *folio, int rw) } bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0); sio->len += folio_size(folio); - if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) { + + /* + * Write out the iocb if we filled it, or if the device is synchronous. + * + * The latter is to work around expectations in the classic LRU code + * which make synchronous clearing of the folio writeback flag in the + * reclaim path beneficial. + */ + if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs) || + (rw == WRITE && (sis->flags & SWP_SYNCHRONOUS_IO))) { if (rw == WRITE) swap_write_submit(ctx); else From afc38453e371d81b9ca6c5798cd52077af65535e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 23 Jul 2026 07:46:05 +0200 Subject: [PATCH 168/250] mm/swap: add a new swap_ops.h header to allow for pluggable swap ops Add a new header to declare the swap_iocb, swap_ops and swap_ctx to allow for swap_ops implementations outside of mm/page_io.c. This will be used to remove the double indirection for file system-based swap. There is no functional change, just a move of the declarations. Note that there already is a swapops.h header, which is totally unrelated to struct swap_ops. The close naming is a bit unfortunate, but I could not think of a better name for this header. Link: https://lore.kernel.org/20260723054622.3460249-3-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Chris Li Cc: Baoquan He Cc: Kairui Song Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Steve French Cc: Usama Arif Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + include/linux/swap_ops.h | 39 +++++++++++++++++++++++++++++++++++++++ mm/madvise.c | 1 + mm/page_io.c | 10 +--------- mm/shmem.c | 1 + mm/swap.h | 23 +---------------------- mm/swap_state.c | 1 + mm/vmscan.c | 1 + mm/zswap.c | 2 +- 9 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 include/linux/swap_ops.h diff --git a/MAINTAINERS b/MAINTAINERS index 9eba56a72a666d..ebd8741f1357c0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17242,6 +17242,7 @@ S: Maintained F: Documentation/ABI/testing/sysfs-kernel-mm-swap F: Documentation/mm/swap-table.rst F: include/linux/swap.h +F: include/linux/swap_ops.h F: include/linux/swapfile.h F: include/linux/swapops.h F: mm/page_io.c diff --git a/include/linux/swap_ops.h b/include/linux/swap_ops.h new file mode 100644 index 00000000000000..e92b4f53260469 --- /dev/null +++ b/include/linux/swap_ops.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _MM_SWAP_OPS_H +#define _MM_SWAP_OPS_H + +#include /* for SWAP_CLUSTER_MAX */ + +struct swap_iocb { + union { + struct kiocb iocb; + struct bio bio; + }; + struct bio_vec bvecs[SWAP_CLUSTER_MAX]; + int nr_bvecs; + int len; +}; + +struct swap_io_ctx { + struct swap_iocb *sio; + struct swap_info_struct *sis; +}; + +/* + * SWAP_OPS_F_REQUIRE_NOFS: + * When set, all reclaim operations must operated as GFS_NOFS and not + * just GFP_NOIO, as GFP_NOIO allocations could recourse into the + * file system backing this swap file. + */ +#define SWAP_OPS_F_REQUIRE_NOFS (1U << 0) + +struct swap_ops { + unsigned int flags; + + bool (*can_merge)(struct folio *folio, struct folio *prev_folio, + size_t prev_folio_size, int rw); + void (*submit_write)(struct swap_io_ctx *ctx); + void (*submit_read)(struct swap_io_ctx *ctx); +}; + +#endif /* _MM_SWAP_OPS_H */ diff --git a/mm/madvise.c b/mm/madvise.c index 7652e9ffd251dc..cb93cf82d8df6b 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -32,6 +32,7 @@ #include #include #include +#include #include diff --git a/mm/page_io.c b/mm/page_io.c index c984a4023a6518..e741e67d6592b7 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "swap.h" #include "swap_table.h" @@ -300,15 +301,6 @@ static bool folio_blkg_can_merge(struct folio *folio, struct folio *prev_folio) #define bio_associate_blkg_from_page(bio, folio) do { } while (0) #endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */ -struct swap_iocb { - union { - struct kiocb iocb; - struct bio bio; - }; - struct bio_vec bvecs[SWAP_CLUSTER_MAX]; - int nr_bvecs; - int len; -}; static mempool_t *sio_pool; int sio_pool_init(void) diff --git a/mm/shmem.c b/mm/shmem.c index 2e4dacdcce11b6..599665a3d6e7b6 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "swap.h" static struct vfsmount *shm_mnt __ro_after_init; diff --git a/mm/swap.h b/mm/swap.h index 48379b2ab20272..90a551a88df63b 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -10,6 +10,7 @@ struct mempolicy; struct swap_iocb; struct swap_memcg_table; +struct swap_io_ctx; #if defined(MAX_POSSIBLE_PHYSMEM_BITS) #define SWAP_CACHE_PFN_BITS (MAX_POSSIBLE_PHYSMEM_BITS - PAGE_SHIFT) @@ -91,28 +92,6 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) return READ_ONCE(vm_swappiness); } -struct swap_io_ctx { - struct swap_iocb *sio; - struct swap_info_struct *sis; -}; - -/* - * SWAP_OPS_F_REQUIRE_NOFS: - * When set, all reclaim operations must operated as GFS_NOFS and not - * just GFP_NOIO, as GFP_NOIO allocations could recourse into the - * file system backing this swap file. - */ -#define SWAP_OPS_F_REQUIRE_NOFS (1U << 0) - -struct swap_ops { - unsigned int flags; - - bool (*can_merge)(struct folio *folio, struct folio *prev_folio, - size_t prev_folio_size, int rw); - void (*submit_write)(struct swap_io_ctx *ctx); - void (*submit_read)(struct swap_io_ctx *ctx); -}; - #ifdef CONFIG_SWAP #include /* for swp_offset */ #include /* for bio_end_io_t */ diff --git a/mm/swap_state.c b/mm/swap_state.c index 5be825911e645e..b76eb3d876fd7b 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "internal.h" #include "swap_table.h" #include "swap.h" diff --git a/mm/vmscan.c b/mm/vmscan.c index 3194da7dcc795e..be6bd26e8c5789 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include diff --git a/mm/zswap.c b/mm/zswap.c index 9f777a48b106f1..37f34e406c8e3b 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include From 32b04d1f2b82fb04336b4986e3589cac08be9182 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 23 Jul 2026 07:46:06 +0200 Subject: [PATCH 169/250] mm/swap: move swap_ops into file systems for file system-based swap Currently swap to and from file systems goes through two indirect calls between the swap ops and the swap_rw method. Reduce this by directly providing the swap_ops from the file system. For this refactor swap_fs_submit into a swap_fs_prepare_rw helper that initializes the iov_iter on the callers stack so that file systems can call it directly, and use that to initialize file system specific ops in the NFS and SMB clients, which then get passed to swap_fs_activate. Link: https://lore.kernel.org/20260723054622.3460249-4-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Chris Li Cc: Baoquan He Cc: Kairui Song Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Steve French Cc: Usama Arif Signed-off-by: Andrew Morton --- Documentation/filesystems/locking.rst | 9 +--- Documentation/filesystems/vfs.rst | 8 +--- fs/nfs/direct.c | 20 --------- fs/nfs/file.c | 42 ++++++++++++++++-- fs/smb/client/file.c | 63 +++++++++++++++++---------- include/linux/fs.h | 1 - include/linux/nfs_fs.h | 1 - include/linux/swap.h | 6 --- include/linux/swap_ops.h | 5 +++ mm/page_io.c | 34 +++------------ 10 files changed, 93 insertions(+), 96 deletions(-) diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst index 1a50d41a39a1ea..f58a8d7d5897b6 100644 --- a/Documentation/filesystems/locking.rst +++ b/Documentation/filesystems/locking.rst @@ -266,7 +266,6 @@ prototypes:: int (*error_remove_folio)(struct address_space *, struct folio *); int (*swap_activate)(struct swap_info_struct *sis, struct file *f, sector_t *span) int (*swap_deactivate)(struct file *); - int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter); locking rules: All except dirty_folio and free_folio may block @@ -291,7 +290,6 @@ is_partially_uptodate: yes error_remove_folio: yes swap_activate: no swap_deactivate: no -swap_rw: yes, unlocks ====================== ======================== ========= =============== ->write_begin(), ->write_end() and ->read_folio() may be called from @@ -355,15 +353,12 @@ should perform any validation and preparation necessary to ensure that writes can be performed with minimal memory allocation. It should call add_swap_extent(), or the helper iomap_swapfile_activate(), and return the number of extents added. If IO should be submitted through -->swap_rw(), it should call swap_fs_activate, otherwise IO will be submitted -directly to the block device ``sis->bdev``. +the file system it should call swap_fs_activate, otherwise IO will be +submitted directly to the block device ``sis->bdev``. ->swap_deactivate() will be called in the sys_swapoff() path after ->swap_activate() returned success. -->swap_rw will be called for swap IO if swap_fs_activate was called by -->swap_activate(). - file_lock_operations ==================== diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index e7677423a20f7a..c437a342d4f311 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -776,7 +776,6 @@ cache in your filesystem. The following members are defined: int (*error_remove_folio)(struct mapping *mapping, struct folio *); int (*swap_activate)(struct swap_info_struct *sis, struct file *f, sector_t *span) int (*swap_deactivate)(struct file *); - int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter); }; ``read_folio`` @@ -977,16 +976,13 @@ cache in your filesystem. The following members are defined: can be performed with minimal memory allocation. It should call add_swap_extent(), or the helper iomap_swapfile_activate(), and return the number of extents added. If IO should be submitted - through ->swap_rw(), it should call swap_fs_activate, otherwise IO will - be submitted directly to the block device ``sis->bdev``. + through the file system it should call swap_fs_activate, otherwise IO + will be submitted directly to the block device ``sis->bdev``. ``swap_deactivate`` Called during swapoff on files where swap_activate was successful. -``swap_rw`` - Called to read or write swap pages when swap_fs_activate was called. - The File Object =============== diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index e626c72495e69a..ccafdc1ce64d48 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -145,26 +145,6 @@ static void nfs_direct_file_adjust_size_locked(struct inode *inode, } } -/** - * nfs_swap_rw - NFS address space operation for swap I/O - * @iocb: target I/O control block - * @iter: I/O buffer - * - * Perform IO to the swap-file. This is much like direct IO. - */ -int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) -{ - ssize_t ret; - - if (iov_iter_rw(iter) == READ) - ret = nfs_file_direct_read(iocb, iter, true); - else - ret = nfs_file_direct_write(iocb, iter, true); - if (ret < 0) - return ret; - return 0; -} - static void nfs_direct_release_pages(struct page **pages, unsigned int npages) { unsigned int i; diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 851d93a099889e..e1bdd10b35f10d 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -29,9 +29,8 @@ #include #include #include -#include #include - +#include #include #include @@ -575,6 +574,38 @@ static int nfs_launder_folio(struct folio *folio) return ret; } +#ifdef CONFIG_SWAP +static void nfs_swap_submit_write(struct swap_io_ctx *ctx) +{ + struct swap_iocb *sio = ctx->sio; + struct iov_iter iter; + int ret; + + swap_fs_prepare_rw(ctx, WRITE, &iter); + ret = nfs_file_direct_write(&sio->iocb, &iter, true); + if (ret != -EIOCBQUEUED) + sio->iocb.ki_complete(&sio->iocb, ret); +} + +static void nfs_swap_submit_read(struct swap_io_ctx *ctx) +{ + struct swap_iocb *sio = ctx->sio; + struct iov_iter iter; + int ret; + + swap_fs_prepare_rw(ctx, READ, &iter); + ret = nfs_file_direct_read(&sio->iocb, &iter, true); + if (ret != -EIOCBQUEUED) + sio->iocb.ki_complete(&sio->iocb, ret); +} + +static const struct swap_ops nfs_swap_ops = { + .flags = SWAP_OPS_F_REQUIRE_NOFS, + .submit_write = nfs_swap_submit_write, + .submit_read = nfs_swap_submit_read, + .can_merge = swap_fs_can_merge, +}; + static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file, sector_t *span) { @@ -597,7 +628,7 @@ static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file, ret = rpc_clnt_swap_activate(clnt); if (ret) return ret; - ret = swap_fs_activate(sis); + ret = swap_fs_activate(sis, &nfs_swap_ops); if (ret < 0) { rpc_clnt_swap_deactivate(clnt); return ret; @@ -620,6 +651,10 @@ static void nfs_swap_deactivate(struct file *file) if (cl->rpc_ops->disable_swap) cl->rpc_ops->disable_swap(file_inode(file)); } +#else +#define nfs_swap_activate NULL +#define nfs_swap_deactivate NULL +#endif /* CONFIG_SWAP */ const struct address_space_operations nfs_file_aops = { .read_folio = nfs_read_folio, @@ -636,7 +671,6 @@ const struct address_space_operations nfs_file_aops = { .error_remove_folio = generic_error_remove_folio, .swap_activate = nfs_swap_activate, .swap_deactivate = nfs_swap_deactivate, - .swap_rw = nfs_swap_rw, }; /* diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 7f2924ce2881d8..ead69232ac1c75 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "cifsfs.h" @@ -3410,6 +3410,38 @@ void cifs_oplock_break(struct work_struct *work) cifs_done_oplock_break(cinode); } +#ifdef CONFIG_SWAP +static void cifs_swap_submit_write(struct swap_io_ctx *ctx) +{ + struct swap_iocb *sio = ctx->sio; + struct iov_iter iter; + int ret; + + swap_fs_prepare_rw(ctx, WRITE, &iter); + ret = netfs_unbuffered_write_iter_locked(&sio->iocb, &iter, NULL); + if (ret != -EIOCBQUEUED) + sio->iocb.ki_complete(&sio->iocb, ret); +} + +static void cifs_swap_submit_read(struct swap_io_ctx *ctx) +{ + struct swap_iocb *sio = ctx->sio; + struct iov_iter iter; + int ret; + + swap_fs_prepare_rw(ctx, READ, &iter); + ret = netfs_unbuffered_read_iter_locked(&sio->iocb, &iter); + if (ret != -EIOCBQUEUED) + sio->iocb.ki_complete(&sio->iocb, ret); +} + +static const struct swap_ops cifs_swap_ops = { + .flags = SWAP_OPS_F_REQUIRE_NOFS, + .submit_write = cifs_swap_submit_write, + .submit_read = cifs_swap_submit_read, + .can_merge = swap_fs_can_merge, +}; + static int cifs_swap_activate(struct swap_info_struct *sis, struct file *swap_file, sector_t *span) { @@ -3420,7 +3452,7 @@ static int cifs_swap_activate(struct swap_info_struct *sis, cifs_dbg(FYI, "swap activate\n"); - if (!swap_file->f_mapping->a_ops->swap_rw) + if (swap_file->f_mapping->a_ops != &cifs_addr_ops) /* Cannot support swap */ return -EINVAL; @@ -3451,7 +3483,7 @@ static int cifs_swap_activate(struct swap_info_struct *sis, * but we could add call to grab a byte range lock to prevent others * from reading or writing the file */ - return swap_fs_activate(sis); + return swap_fs_activate(sis, &cifs_swap_ops); } static void cifs_swap_deactivate(struct file *file) @@ -3467,26 +3499,10 @@ static void cifs_swap_deactivate(struct file *file) /* do we need to unpin (or unlock) the file */ } - -/** - * cifs_swap_rw - SMB3 address space operation for swap I/O - * @iocb: target I/O control block - * @iter: I/O buffer - * - * Perform IO to the swap-file. This is much like direct IO. - */ -static int cifs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) -{ - ssize_t ret; - - if (iov_iter_rw(iter) == READ) - ret = netfs_unbuffered_read_iter_locked(iocb, iter); - else - ret = netfs_unbuffered_write_iter_locked(iocb, iter, NULL); - if (ret < 0) - return ret; - return 0; -} +#else +#define cifs_swap_activate NULL +#define cifs_swap_deactivate NULL +#endif /* CONFIG_SWAP */ const struct address_space_operations cifs_addr_ops = { .read_folio = netfs_read_folio, @@ -3503,7 +3519,6 @@ const struct address_space_operations cifs_addr_ops = { */ .swap_activate = cifs_swap_activate, .swap_deactivate = cifs_swap_deactivate, - .swap_rw = cifs_swap_rw, }; /* diff --git a/include/linux/fs.h b/include/linux/fs.h index 50ce731a2b78f1..87b5e9957c0019 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -438,7 +438,6 @@ struct address_space_operations { int (*swap_activate)(struct swap_info_struct *sis, struct file *file, sector_t *span); void (*swap_deactivate)(struct file *file); - int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter); }; extern const struct address_space_operations empty_aops; diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index ec17e602c979c5..764056498ebac3 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -548,7 +548,6 @@ static inline const struct cred *nfs_file_cred(struct file *file) /* * linux/fs/nfs/direct.c */ -int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter); ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, bool swap); ssize_t nfs_file_direct_write(struct kiocb *iocb, diff --git a/include/linux/swap.h b/include/linux/swap.h index 8dd68733c955a8..5658a1634b85ea 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -341,8 +341,6 @@ extern void __meminit kswapd_run(int nid); extern void __meminit kswapd_stop(int nid); #ifdef CONFIG_SWAP - -int swap_fs_activate(struct swap_info_struct *sis); int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, unsigned long nr_pages, sector_t start_block); int generic_swapfile_activate(struct swap_info_struct *, struct file *, @@ -468,10 +466,6 @@ static inline bool folio_free_swap(struct folio *folio) return false; } -static inline int swap_fs_activate(struct swap_info_struct *sis) -{ - return -EINVAL; -} static inline int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, unsigned long nr_pages, sector_t start_block) diff --git a/include/linux/swap_ops.h b/include/linux/swap_ops.h index e92b4f53260469..57ac6c703f6858 100644 --- a/include/linux/swap_ops.h +++ b/include/linux/swap_ops.h @@ -36,4 +36,9 @@ struct swap_ops { void (*submit_read)(struct swap_io_ctx *ctx); }; +void swap_fs_prepare_rw(struct swap_io_ctx *ctx, int rw, struct iov_iter *iter); +bool swap_fs_can_merge(struct folio *folio, struct folio *prev_folio, + size_t prev_folio_size, int rw); +int swap_fs_activate(struct swap_info_struct *sis, const struct swap_ops *ops); + #endif /* _MM_SWAP_OPS_H */ diff --git a/mm/page_io.c b/mm/page_io.c index e741e67d6592b7..88962571cb931e 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -650,11 +650,9 @@ const struct swap_ops swap_bdev_ops = { .can_merge = swap_bdev_can_merge, }; -static void swap_fs_submit(struct swap_io_ctx *ctx, int rw) +void swap_fs_prepare_rw(struct swap_io_ctx *ctx, int rw, struct iov_iter *iter) { struct swap_iocb *sio = ctx->sio; - struct iov_iter iter; - int ret; init_sync_kiocb(&sio->iocb, ctx->sis->swap_file); sio->iocb.ki_pos = swap_dev_pos(bvec_folio(&sio->bvecs[0])->swap); @@ -663,40 +661,22 @@ static void swap_fs_submit(struct swap_io_ctx *ctx, int rw) else sio->iocb.ki_complete = swap_fs_read_complete; - iov_iter_bvec(&iter, rw == WRITE ? ITER_SOURCE : ITER_DEST, + iov_iter_bvec(iter, rw == WRITE ? ITER_SOURCE : ITER_DEST, sio->bvecs, sio->nr_bvecs, sio->len); - ret = sio->iocb.ki_filp->f_mapping->a_ops->swap_rw(&sio->iocb, &iter); - if (ret != -EIOCBQUEUED) - sio->iocb.ki_complete(&sio->iocb, ret); } +EXPORT_SYMBOL_GPL(swap_fs_prepare_rw); -static void swap_fs_submit_write(struct swap_io_ctx *ctx) -{ - swap_fs_submit(ctx, WRITE); -} - -static void swap_fs_submit_read(struct swap_io_ctx *ctx) -{ - swap_fs_submit(ctx, READ); -} - -static bool swap_fs_can_merge(struct folio *folio, struct folio *prev_folio, +bool swap_fs_can_merge(struct folio *folio, struct folio *prev_folio, size_t prev_folio_size, int rw) { return swap_dev_pos(folio->swap) == swap_dev_pos(prev_folio->swap) + prev_folio_size; } +EXPORT_SYMBOL_GPL(swap_fs_can_merge); -static const struct swap_ops swap_fs_ops = { - .flags = SWAP_OPS_F_REQUIRE_NOFS, - .submit_write = swap_fs_submit_write, - .submit_read = swap_fs_submit_read, - .can_merge = swap_fs_can_merge, -}; - -int swap_fs_activate(struct swap_info_struct *sis) +int swap_fs_activate(struct swap_info_struct *sis, const struct swap_ops *ops) { - sis->ops = &swap_fs_ops; + sis->ops = ops; return add_swap_extent(sis, 0, sis->max, 0); } EXPORT_SYMBOL_GPL(swap_fs_activate); From e22347b14b0d683e23c13cd2d3d61e8639653894 Mon Sep 17 00:00:00 2001 From: Hui Su Date: Tue, 11 Aug 2026 15:33:32 +0800 Subject: [PATCH 170/250] kasan: fix quarantine_size accounting during cache removal quarantine_size tracks the total number of bytes stored in global_quarantine[]. It is incremented when per-CPU quarantine objects are moved into the global quarantine and decremented when a global batch is evicted by kasan_quarantine_reduce(). kasan_quarantine_remove_cache() also removes objects from the global quarantine. qlist_move_cache() rebuilds the source batch and updates its .bytes field, but quarantine_size is not adjusted accordingly. As a result, quarantine_size remains over-counted by the size of the removed objects. The stale accounting accumulates across cache removals. Once the inflated value exceeds quarantine_max_size, kasan_quarantine_reduce() can evict a batch even though the actual number of bytes in global_quarantine[] is still below quarantine_max_size, shortening the quarantine window. Fix the accounting by recording each batch's size before qlist_move_cache() and subtracting the number of bytes actually removed from quarantine_size while holding quarantine_lock. A KUnit reproducer used during testing observed the over-count grow by 4698864 bytes after one kasan_quarantine_remove_cache() call with the fix reverted. With this change applied, the over-count did not grow. Link: https://lore.kernel.org/20260811073332.1351893-1-sh_def@163.com Fixes: 64abdcb24351 ("kasan: eliminate long stalls during quarantine reduction") Signed-off-by: Hui Su Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260808031459.3032812-1-sh_def%40163.com Reviewed-by: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Signed-off-by: Andrew Morton --- mm/kasan/quarantine.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 16f4e67beee82b..c9944fdf48ca76 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c @@ -370,9 +370,14 @@ void kasan_quarantine_remove_cache(struct kmem_cache *cache) raw_spin_lock_irqsave(&quarantine_lock, flags); for (i = 0; i < QUARANTINE_BATCHES; i++) { + size_t old_bytes; + if (qlist_empty(&global_quarantine[i])) continue; + old_bytes = global_quarantine[i].bytes; qlist_move_cache(&global_quarantine[i], &to_free, cache); + WRITE_ONCE(quarantine_size, quarantine_size - + (old_bytes - global_quarantine[i].bytes)); /* Scanning whole quarantine can take a while. */ raw_spin_unlock_irqrestore(&quarantine_lock, flags); cond_resched(); From 9e51e14f7bac3c6d788f2404bff1200d4d29adf9 Mon Sep 17 00:00:00 2001 From: Wilson Felipe Pereira Date: Tue, 11 Aug 2026 05:14:11 +0000 Subject: [PATCH 171/250] selftests/cgroup: test_zswap: skip test_no_kmem_bypass if debugfs is unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_no_kmem_bypass() needs to read /sys/kernel/debug/zswap/stored_pages via get_zswap_stored_pages() to verify that compressed pages are charged to the memcg. When running in an environment where debugfs is not mounted or CONFIG_DEBUG_FS is disabled, get_zswap_stored_pages() fails, causing the loop to terminate early and report a false negative (KSFT_FAIL). Selftests should not fail if debugfs is unavailable, and it should print a message when it is skipped. While I'm here, also add a warning message if the test is being skipped due to totalram size and make the check for totalram more readable. Link: https://lore.kernel.org/20260812050848.848882-1-wfelipe@google.com Link: https://lore.kernel.org/20260811051434.3805648-1-wfelipe@google.com Signed-off-by: Wilson Felipe Pereira Reviewed-by: Anshuman Khandual Reviewed-by: SJ Park Cc: Chengming Zhou Cc: Johannes Weiner Cc: Michal Koutný Cc: Nhat Pham Cc: Shuah Khan Cc: Tejun Heo Signed-off-by: Andrew Morton --- .../selftests/cgroup/lib/include/cgroup_util.h | 1 + tools/testing/selftests/cgroup/test_zswap.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h index febc1723d09038..c0f07226b222f1 100644 --- a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h +++ b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h @@ -7,6 +7,7 @@ #endif #define MB(x) (x << 20) +#define GB(x) ((unsigned long long)(x) << 30) #define USEC_PER_SEC 1000000L #define NSEC_PER_SEC 1000000000L diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index 49b36ee791606f..a836337440040c 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -20,6 +20,7 @@ static int page_size; #define PATH_ZSWAP "/sys/module/zswap" #define PATH_ZSWAP_ENABLED "/sys/module/zswap/parameters/enabled" +#define PATH_ZSWAP_STORED_PAGES "/sys/kernel/debug/zswap/stored_pages" static int read_int(const char *path, size_t *value) { @@ -55,7 +56,7 @@ static int read_min_free_kb(size_t *value) static int get_zswap_stored_pages(size_t *value) { - return read_int("/sys/kernel/debug/zswap/stored_pages", value); + return read_int(PATH_ZSWAP_STORED_PAGES, value); } static long get_cg_wb_count(const char *cg) @@ -570,8 +571,16 @@ static int test_no_kmem_bypass(const char *root) /* Read sys info and compute test values accordingly */ if (sysinfo(&sys_info) != 0) return KSFT_FAIL; - if (sys_info.totalram > 5000000000) + if (sys_info.totalram > GB(4)) { + ksft_print_msg( + "requires less than 4GB total ram, sys_info.totalram: %.1fGB\n", + (double)sys_info.totalram / GB(1)); return KSFT_SKIP; + } + if (access(PATH_ZSWAP_STORED_PAGES, R_OK)) { + ksft_print_msg("mount debugfs at /sys/kernel/debug\n"); + return KSFT_SKIP; + } values = mmap(0, sizeof(struct no_kmem_bypass_child_args), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); if (values == MAP_FAILED) From ec59bedaec0fd1dbb8cec31bae5c4a29bbf0e7a7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 11 Aug 2026 19:04:40 -0700 Subject: [PATCH 172/250] selftests-cgroup-test_zswap-skip-test_no_kmem_bypass-if-debugfs-is-unavailable-fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clarify debugfs-unavailable error message Cc: Anshuman Khandual Cc: Chengming Zhou Cc: Johannes Weiner Cc: Michal Koutný Cc: Nhat Pham Cc: Shuah Khan Cc: Tejun Heo Cc: Wilson Felipe Pereira Cc: SJ Park Signed-off-by: Andrew Morton --- tools/testing/selftests/cgroup/test_zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index a836337440040c..f7b4c4370db630 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -578,7 +578,7 @@ static int test_no_kmem_bypass(const char *root) return KSFT_SKIP; } if (access(PATH_ZSWAP_STORED_PAGES, R_OK)) { - ksft_print_msg("mount debugfs at /sys/kernel/debug\n"); + ksft_print_msg("debugfs not mounted at /sys/kernel/debug\n"); return KSFT_SKIP; } values = mmap(0, sizeof(struct no_kmem_bypass_child_args), PROT_READ | From 712c9e1e40abf5ea25bc1c681f93d49e2deb7db3 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Wed, 12 Aug 2026 14:59:33 +0800 Subject: [PATCH 173/250] mm/mglru: fix young counter undercount for large folios lru_gen_look_around() feeds its local 'young' counter into suitable_to_scan(), which decides whether the current PMD is added to the bloom filter and checked again on the next aging round. The folio triggering the look-around is processed at function entry: test_and_clear_young_ptes_notify() clears the accessed bits of the nr PTEs it maps, and the function bails out if none of them is young. The loop that follows therefore never recounts this folio, since its accessed bits are already cleared. Every other young folio the loop finds is accounted as a batch (young += nr), where nr is the number of consecutive PTEs it maps. The triggering folio, however, still contributes a fixed young = 1 regardless of its size -- a leftover from before PTE batching. A large triggering folio is thus accounted inconsistently with the rest of the window. Initialize young to nr so the triggering folio is accounted the same way as any other young folio batch in the loop. Note this is a deliberate overestimate, not a measured value. The test-and-clear helper only reports whether any of the nr PTEs is young, not how many were accessed, so the true number of accessed PTEs in a large folio is unknown and can be smaller than nr. Counting the full batch is intentional: the mm core tracks accessed/dirty state per folio, not per page, so a per-page count is neither obtainable nor meaningful. The only consumer is suitable_to_scan(), and the bloom filter it feeds tolerates error. Overestimating is also the safe direction: at worst a PMD that saw little access is rescanned, whereas underestimating could skip rescanning a PMD whose folios are still hot and reclaim them incorrectly. (nr here is the PTE batch size, not necessarily folio_nr_pages().) Link: https://lore.kernel.org/20260813061019.49806-1-hui.zhu@linux.dev Link: https://lore.kernel.org/20260812065933.103627-1-hui.zhu@linux.dev Fixes: 56e5b60b2114 ("mm: support batched checking of the young flag for MGLRU") Signed-off-by: Hui Zhu Reviewed-by: Baolin Wang Reviewed-by: Barry Song Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Johannes Weiner Cc: Kairui Song Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Shakeel Butt Cc: Wei Xu Cc: Yuanchu Xie Signed-off-by: Andrew Morton --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index be6bd26e8c5789..6c35f7e2146501 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4261,7 +4261,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr) unsigned long end; struct lru_gen_mm_walk *walk; struct folio *last = NULL; - int young = 1; + int young = nr; pte_t *pte = pvmw->pte; unsigned long addr = pvmw->address; struct vm_area_struct *vma = pvmw->vma; From 052ef2d9451556a8e2a7b358b70af26a887c13e8 Mon Sep 17 00:00:00 2001 From: "Lorenzo Stoakes (ARM)" Date: Wed, 12 Aug 2026 08:43:31 +0100 Subject: [PATCH 174/250] MAINTAINERS: add drivers/char/mem.c to mm misc, memory mapping sections This file is a 'special' driver that implements /dev/zero and /dev/mem among other things. As such it makes sense for mm to be cc'd on mails and to have some say in how things are changed there, so add it to the mm misc section. Uniquely, it provides the 'old way' of obtaining an anonymous mapping - MAP_PRIVATE of /dev/zero - so is directly tied to memory mapping, therefore also add it to the memory mapping section. scripts/get_maintainer.pl copes perfectly fine with files in multiple sections so everything should work correctly. Link: https://lore.kernel.org/20260812-add-drivers-mem-to-mm-maintainers-v1-1-6218b861f4c8@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Acked-by: SJ Park Reviewed-by: Anshuman Khandual Cc: Arnd Bergmann Cc: Jann Horn Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Pedro Falcato Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ebd8741f1357c0..29236523cefb68 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17115,6 +17115,7 @@ F: Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers F: Documentation/ABI/testing/sysfs-kernel-mm-numa F: Documentation/admin-guide/mm/ F: Documentation/mm/ +F: drivers/char/mem.c F: include/linux/cma.h F: include/linux/dmapool.h F: include/linux/ioremap.h @@ -17319,6 +17320,7 @@ L: linux-mm@kvack.org S: Maintained W: http://www.linux-mm.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm +F: drivers/char/mem.c F: include/trace/events/mmap.h F: fs/proc/task_mmu.c F: fs/proc/task_nommu.c From 65678674acc4f4afa19048707fec6e26415afec4 Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:33 -0600 Subject: [PATCH 175/250] mm/khugepaged: refactor per-scan state clearing into collapse_control_init_scan() Patch series "mm/khugepaged: several cleanups", v4. The following changes stem from a number of reviews during my khugepaged mTHP support series [1]. Some of these are minor code cleanups, issues or reviews that we decided to deferred to a followup series, or in the case of the more major patch of the series, changes [2] Lance Yang attempted while my series was in-flight and we decided to wait till later to try. The first 3 patches introduce helper functions to increase code reuse and readability. This includes a per-scan state clearing function, extracting the young page check into a helper, and a count_collapse_event() function to reduce a repetative pattern used across mTHP collapse. The 4th patch was the byproduct of me throwing Claude at all the comments in khugepaged verifying and looking for any outdated info. The 5th patch is based on Lance Yang's commit series [2] trying to extract the PTE state checking into a helper function. This required a bit of rewriting due to differences after mTHP collapse was introduced. I also took into account the changes requested during his patches review cycle. The remaining 2 patches were review points during my mTHP series that we agreed can be deferred to a later series. Thank you to those whos reviews and work I leveraged to achieve these cleanups. This patch (of 6): Extract the repeated clearing of node_load, alloc_nmask, and mthp_present_ptes into a helper to reduce duplication in collapse_scan_pmd() and collapse_scan_file(). Althought file scans do not current use the bitmap, they will in the future, and clearing it now is harmless. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-0-ddac39d61c4a@linux.dev Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-1-ddac39d61c4a@linux.dev Link: https://lore.kernel.org/all/20260605161422.213817-1-npache@redhat.com/ [1] Link: https://lore.kernel.org/all/20251008043748.45554-1-lance.yang@linux.dev/ [2] Signed-off-by: Nico Pache (Red Hat) Reviewed-by: Baolin Wang Acked-by: Usama Arif Acked-by: David Hildenbrand (Arm) Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Zi Yan Reviewed-by: Pedro Falcato Reviewed-by: Lance Yang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/khugepaged.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 8b7c3959d193cd..9c94cf252686a1 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -623,6 +623,13 @@ void __khugepaged_exit(struct mm_struct *mm) } } +static void collapse_control_init_scan(struct collapse_control *cc) +{ + memset(cc->node_load, 0, sizeof(cc->node_load)); + nodes_clear(cc->alloc_nmask); + bitmap_zero(cc->mthp_present_ptes, MAX_PTRS_PER_PTE); +} + static void release_pte_folio(struct folio *folio) { node_stat_mod_folio(folio, @@ -1611,9 +1618,7 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, goto out; } - bitmap_zero(cc->mthp_present_ptes, MAX_PTRS_PER_PTE); - memset(cc->node_load, 0, sizeof(cc->node_load)); - nodes_clear(cc->alloc_nmask); + collapse_control_init_scan(cc); enabled_orders = collapse_possible_orders(vma, vma->vm_flags, tva_flags); @@ -2685,8 +2690,7 @@ static enum scan_result collapse_scan_file(struct mm_struct *mm, present = 0; swap = 0; - memset(cc->node_load, 0, sizeof(cc->node_load)); - nodes_clear(cc->alloc_nmask); + collapse_control_init_scan(cc); rcu_read_lock(); xas_for_each(&xas, folio, start + HPAGE_PMD_NR - 1) { if (xas_retry(&xas, folio)) From 17cfe62b0ae19873a75ff5b9c7d57728b64559d6 Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:34 -0600 Subject: [PATCH 176/250] mm/khugepaged: extract reference check into folio_pte_referenced() helper This change deduplicates the "is this PTE/folio referenced enough to be considered for a collapse" condition that was repeated in both __collapse_huge_page_isolate() and collapse_scan_pmd(), extracting it into a single inline helper function. Also move the comment and use it as the function header. While we are at it, updated the comment to clarify that a young pte is a recently accessed one. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-2-ddac39d61c4a@linux.dev Signed-off-by: Nico Pache (Red Hat) Acked-by: Usama Arif Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Reviewed-by: Baolin Wang Reviewed-by: Lance Yang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes (ARM) Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Pedro Falcato Signed-off-by: Andrew Morton --- mm/khugepaged.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 9c94cf252686a1..c3b3ef5c57b45e 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -666,6 +666,22 @@ static void release_pte_pages(pte_t *pte, pte_t *_pte, } } +/* + * folio_pte_referenced() - Check if a folio or its PTE mapping was recently used + * + * Return: true if recent access was observed through either the folio state + * or the current PTE mapping. + */ +static inline bool folio_pte_referenced(struct folio *folio, + struct vm_area_struct *vma, unsigned long addr, pte_t pteval) +{ + /* The folio was referenced previously ... */ + if (folio_test_young(folio) || folio_test_referenced(folio)) + return true; + /* ... or the PTE mapping was recently used */ + return pte_young(pteval) || mmu_notifier_test_young(vma->vm_mm, addr); +} + static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, unsigned long start_addr, pte_t *pte, struct collapse_control *cc, unsigned int order, struct list_head *compound_pagelist) @@ -804,14 +820,8 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, if (folio_test_large(folio)) list_add_tail(&folio->lru, compound_pagelist); next: - /* - * If collapse was initiated by khugepaged, check that there is - * enough young pte to justify collapsing the page - */ if (cc->is_khugepaged && - (pte_young(pteval) || folio_test_young(folio) || - folio_test_referenced(folio) || - mmu_notifier_test_young(vma->vm_mm, addr))) + folio_pte_referenced(folio, vma, addr, pteval)) referenced++; } @@ -1760,14 +1770,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, goto out_unmap; } - /* - * If collapse was initiated by khugepaged, check that there is - * enough young pte to justify collapsing the page - */ if (cc->is_khugepaged && - (pte_young(pteval) || folio_test_young(folio) || - folio_test_referenced(folio) || - mmu_notifier_test_young(vma->vm_mm, addr))) + folio_pte_referenced(folio, vma, addr, pteval)) referenced++; } if (cc->is_khugepaged && From c9809ca3d2410a21270d7fb1d4d17dd8ae50c1a3 Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:35 -0600 Subject: [PATCH 177/250] mm/khugepaged: introduce a count_collapse_event() helper Provide a simple helper function to help reduce a often used, and duplicate pattern across the khugepaged code. When collapsing to a PMD we need to record a vm_event and the mTHP_stat event. When doing mTHP collapse we only update the mTHP stat. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-3-ddac39d61c4a@linux.dev Signed-off-by: Nico Pache (Red Hat) Reviewed-by: Baolin Wang Acked-by: David Hildenbrand (Arm) Acked-by: Usama Arif Reviewed-by: Zi Yan Reviewed-by: Pedro Falcato Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Lance Yang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/khugepaged.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index c3b3ef5c57b45e..6521d2baa05823 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -682,6 +682,14 @@ static inline bool folio_pte_referenced(struct folio *folio, return pte_young(pteval) || mmu_notifier_test_young(vma->vm_mm, addr); } +static void count_collapse_event(unsigned int order, enum vm_event_item vm_event, + enum mthp_stat_item mthp_event) +{ + if (is_pmd_order(order)) + count_vm_event(vm_event); + count_mthp_stat(order, mthp_event); +} + static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, unsigned long start_addr, pte_t *pte, struct collapse_control *cc, unsigned int order, struct list_head *compound_pagelist) @@ -702,9 +710,8 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, if (pte_none_or_zero(pteval)) { if (++none_or_zero > max_ptes_none) { result = SCAN_EXCEED_NONE_PTE; - if (is_pmd_order(order)) - count_vm_event(THP_SCAN_EXCEED_NONE_PTE); - count_mthp_stat(order, MTHP_STAT_COLLAPSE_EXCEED_NONE); + count_collapse_event(order, THP_SCAN_EXCEED_NONE_PTE, + MTHP_STAT_COLLAPSE_EXCEED_NONE); goto out; } continue; @@ -746,9 +753,8 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, */ if (++shared > max_ptes_shared) { result = SCAN_EXCEED_SHARED_PTE; - if (is_pmd_order(order)) - count_vm_event(THP_SCAN_EXCEED_SHARED_PTE); - count_mthp_stat(order, MTHP_STAT_COLLAPSE_EXCEED_SHARED); + count_collapse_event(order, THP_SCAN_EXCEED_SHARED_PTE, + MTHP_STAT_COLLAPSE_EXCEED_SHARED); goto out; } } @@ -1258,15 +1264,12 @@ static enum scan_result alloc_charge_folio(struct folio **foliop, struct mm_stru folio = __folio_alloc(gfp, order, node, &cc->alloc_nmask); if (!folio) { *foliop = NULL; - if (is_pmd_order(order)) - count_vm_event(THP_COLLAPSE_ALLOC_FAILED); - count_mthp_stat(order, MTHP_STAT_COLLAPSE_ALLOC_FAILED); + count_collapse_event(order, THP_COLLAPSE_ALLOC_FAILED, + MTHP_STAT_COLLAPSE_ALLOC_FAILED); return SCAN_ALLOC_HUGE_PAGE_FAIL; } - if (is_pmd_order(order)) - count_vm_event(THP_COLLAPSE_ALLOC); - count_mthp_stat(order, MTHP_STAT_COLLAPSE_ALLOC); + count_collapse_event(order, THP_COLLAPSE_ALLOC, MTHP_STAT_COLLAPSE_ALLOC); if (unlikely(mem_cgroup_charge(folio, mm, gfp))) { folio_put(folio); @@ -1656,9 +1659,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, if (pte_none_or_zero(pteval)) { if (++none_or_zero > max_ptes_none) { result = SCAN_EXCEED_NONE_PTE; - count_vm_event(THP_SCAN_EXCEED_NONE_PTE); - count_mthp_stat(HPAGE_PMD_ORDER, - MTHP_STAT_COLLAPSE_EXCEED_NONE); + count_collapse_event(HPAGE_PMD_ORDER, THP_SCAN_EXCEED_NONE_PTE, + MTHP_STAT_COLLAPSE_EXCEED_NONE); goto out_unmap; } continue; @@ -1666,9 +1668,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, if (!pte_present(pteval)) { if (++unmapped > max_ptes_swap) { result = SCAN_EXCEED_SWAP_PTE; - count_vm_event(THP_SCAN_EXCEED_SWAP_PTE); - count_mthp_stat(HPAGE_PMD_ORDER, - MTHP_STAT_COLLAPSE_EXCEED_SWAP); + count_collapse_event(HPAGE_PMD_ORDER, THP_SCAN_EXCEED_SWAP_PTE, + MTHP_STAT_COLLAPSE_EXCEED_SWAP); goto out_unmap; } /* @@ -1725,9 +1726,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, if (folio_maybe_mapped_shared(folio)) { if (++shared > max_ptes_shared) { result = SCAN_EXCEED_SHARED_PTE; - count_vm_event(THP_SCAN_EXCEED_SHARED_PTE); - count_mthp_stat(HPAGE_PMD_ORDER, - MTHP_STAT_COLLAPSE_EXCEED_SHARED); + count_collapse_event(HPAGE_PMD_ORDER, THP_SCAN_EXCEED_SHARED_PTE, + MTHP_STAT_COLLAPSE_EXCEED_SHARED); goto out_unmap; } } From cdcd2b944fa2968c1dc383cf04ae13a7d4184859 Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:36 -0600 Subject: [PATCH 178/250] mm/khugepaged: fix outdated comments Fix comment in collapse_scan_pmd() that still described the old folio_mapcount() > folio_ref_count() check and a "512" false-positive scenario. The code now uses folio_expected_ref_count() != folio_ref_count() which doesn't suffer from the same limitation. Fix comment in collapse_huge_page() that referenced ptep_clear_flush, when the code actually uses pmdp_collapse_flush. Fix comment in __collapse_huge_page_swapin() that referenced the old function name khugepaged_scan_pmd, now collapse_scan_pmd. Also clean up some simple typos and stale terminology (mmap_sem -> mmap_lock, PG_lock -> folio lock, page -> folio, grammar). We also clarify a comment regarding where the max_ptes_none check is deferred to in mthp_collapse() from the original collapse_scan_pmd check. Update all comments that references a function to include parentheses. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-4-ddac39d61c4a@linux.dev Signed-off-by: Nico Pache (Red Hat) Acked-by: Usama Arif Assisted-by: Cursor(claude-sonnet-4):4.6 Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Acked-by: Pedro Falcato Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Lance Yang Cc: Baolin Wang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/khugepaged.c | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 6521d2baa05823..95545039c840f0 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -614,7 +614,7 @@ void __khugepaged_exit(struct mm_struct *mm) /* * This is required to serialize against * collapse_test_exit() (which is guaranteed to run - * under mmap sem read mode). Stop here (after we return all + * under mmap_lock read mode). Stop here (after we return all * pagetables will be destroyed) until khugepaged has finished * working on the pagetables under the mmap_lock. */ @@ -782,8 +782,8 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, /* * We can do it before folio_isolate_lru because the - * folio can't be freed from under us. NOTE: PG_lock - * is needed to serialize against split_huge_page + * folio can't be freed from under us. NOTE: folio lock + * is needed to serialize against split_huge_page() * when invoked from the VM. */ if (!folio_trylock(folio)) { @@ -809,7 +809,7 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma, } /* - * Isolate the page to avoid collapsing an hugepage + * Isolate the folio to avoid collapsing a hugepage * currently in use by the VM. */ if (!folio_isolate_lru(folio)) { @@ -921,7 +921,7 @@ static void __collapse_huge_page_copy_failed(pte_t *pte, * Re-establish the PMD to point to the original page table * entry. Restoring PMD needs to be done prior to releasing * pages. Since pages are still isolated and locked here, - * acquiring anon_vma_lock_write is unnecessary. + * acquiring anon_vma_lock_write() is unnecessary. */ pmd_ptl = pmd_lock(vma->vm_mm, pmd); pmd_populate(vma->vm_mm, pmd, pmd_pgtable(orig_pmd)); @@ -1095,9 +1095,9 @@ static enum scan_result hugepage_vma_revalidate(struct mm_struct *mm, unsigned l return SCAN_VMA_CHECK; /* * Anon VMA expected, the address may be unmapped then - * remapped to file after khugepaged reaquired the mmap_lock. + * remapped to file after khugepaged reacquired the mmap_lock. * - * thp_vma_allowable_orders may return true for qualified file + * thp_vma_allowable_orders() may return true for qualified file * vmas. */ if (expect_anon && (!(*vmap)->anon_vma || !vma_is_anonymous(*vmap))) @@ -1153,7 +1153,7 @@ static enum scan_result check_pmd_still_valid(struct mm_struct *mm, /* * Bring missing pages in from swap, to complete THP collapse. - * Only done if khugepaged_scan_pmd believes it is worthwhile. + * Only done if collapse_scan_pmd() believes it is worthwhile. * * For mTHP orders the function bails on the first swap entry, because * faulting pages back in during collapse could re-populate PTEs that @@ -1221,7 +1221,7 @@ static enum scan_result __collapse_huge_page_swapin(struct mm_struct *mm, pte = NULL; /* - * do_swap_page returns VM_FAULT_RETRY with released mmap_lock. + * do_swap_page() returns VM_FAULT_RETRY with released mmap_lock. * Note we treat VM_FAULT_RETRY as VM_FAULT_ERROR here because * we do not retry here and swap entry will remain in pagetable * resulting in later failure. @@ -1285,7 +1285,7 @@ static enum scan_result alloc_charge_folio(struct folio **foliop, struct mm_stru } /* - * collapse_huge_page expects the mmap_lock to be unlocked before entering and + * collapse_huge_page() expects the mmap_lock to be unlocked before entering and * will always return with the lock unlocked, to avoid holding the mmap_lock * while allocating a THP, as that could trigger direct reclaim/compaction. * Note that the VMA must be rechecked after grabbing the mmap_lock again. @@ -1332,7 +1332,7 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s if (unmapped) { /* - * __collapse_huge_page_swapin will return with mmap_lock + * __collapse_huge_page_swapin() will return with mmap_lock * released when it fails. So we jump out_nolock directly in * that case. Continuing to collapse causes inconsistency. */ @@ -1345,8 +1345,8 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s mmap_read_unlock(mm); /* * Prevent all access to pagetables with the exception of - * gup_fast later handled by the ptep_clear_flush and the VM - * handled by the anon_vma lock + PG_lock. + * gup_fast later handled by the pmdp_collapse_flush() and the VM + * handled by the anon_vma lock + folio lock. * * UFFDIO_MOVE is prevented to race as well thanks to the * mmap_lock. @@ -1403,9 +1403,9 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s spin_lock(pmd_ptl); VM_WARN_ON_ONCE(!pmd_none(*pmd)); /* - * We can only use set_pmd_at when establishing + * We can only use set_pmd_at() when establishing * hugepmds and never for establishing regular pmds that - * points to regular pagetables. Use pmd_populate for that + * points to regular pagetables. Use pmd_populate() for that */ pmd_populate(mm, pmd, pmd_pgtable(_pmd)); spin_unlock(pmd_ptl); @@ -1637,7 +1637,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, /* * If PMD is the only enabled order, enforce max_ptes_none, otherwise - * scan all pages to populate the bitmap for mTHP collapse. + * scan all pages to populate the bitmap for mTHP collapse. The bitmap + * is then checked again in mthp_collapse() for each attempted order. */ if (enabled_orders != BIT(HPAGE_PMD_ORDER)) max_ptes_none = KHUGEPAGED_MAX_PTES_LIMIT; @@ -1758,12 +1759,9 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, /* * Check if the page has any GUP (or other external) pins. * - * Here the check may be racy: - * it may see folio_mapcount() > folio_ref_count(). - * But such case is ephemeral we could always retry collapse - * later. However it may report false positive if the page - * has excessive GUP pins (i.e. 512). Anyway the same check - * will be done again later the risk seems low. + * Here the check is racy, but such case is ephemeral and + * we could always retry collapse later. Anyway the same + * check will be done again later the risk seems low. */ if (folio_expected_ref_count(folio) != folio_ref_count(folio)) { result = SCAN_PAGE_COUNT; @@ -1784,7 +1782,7 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, out_unmap: pte_unmap_unlock(pte, ptl); if (result == SCAN_SUCCEED) { - /* collapse_huge_page expects the lock to be dropped before calling */ + /* collapse_huge_page() expects the lock to be dropped before calling */ mmap_read_unlock(mm); result = mthp_collapse(mm, start_addr, referenced, unmapped, cc, enabled_orders); From 0cbdbd3d4b1067683d3be383805a473d8338243d Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:38 -0600 Subject: [PATCH 179/250] mm/khugepaged: unmap pte before releasing vma write lock We are currently dropping the anon_vma write lock before unmapping the PTE. Although this is safe, due to us still holding the mmap_write_lock, its safer and less confusing to switch the order of these two operations. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-6-ddac39d61c4a@linux.dev Signed-off-by: Nico Pache (Red Hat) Suggested-by: David Hildenbrand Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Reviewed-by: Baolin Wang Acked-by: Pedro Falcato Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Lance Yang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Usama Arif Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/khugepaged.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 95545039c840f0..79effd3f3da4f9 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1463,10 +1463,10 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s result = SCAN_SUCCEED; out_up_write: - if (anon_vma_locked) - anon_vma_unlock_write(vma->anon_vma); if (pte) pte_unmap(pte); + if (anon_vma_locked) + anon_vma_unlock_write(vma->anon_vma); mmap_write_unlock(mm); out_nolock: if (folio) From 5e5e044111eb427b4a63411217de8a5e9fe6fda7 Mon Sep 17 00:00:00 2001 From: "Nico Pache (Red Hat)" Date: Tue, 11 Aug 2026 06:48:39 -0600 Subject: [PATCH 180/250] mm: Documentation: clarify where the mTHP stats live The note about khugepaged counters references /proc/vmstat for the PMD case, but never mentions where the mTHPs stats can be found (i.e.: /sys/kernel/mm/transparent_hugepage/hugepages-kB/stats/) Add a small addition to this section for clarity. Also fix a missing period while we are at it. Link: https://lore.kernel.org/20260811-khugepaged_pte_refactor-v4-7-ddac39d61c4a@linux.dev Signed-off-by: Nico Pache (Red Hat) Reviewed-by: Baolin Wang Suggested-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Acked-by: Pedro Falcato Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Lance Yang Cc: Barry Song Cc: Dev Jain Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Usama Arif Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- Documentation/admin-guide/mm/transhuge.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 16f37135ed80df..b187d618452f44 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -224,7 +224,7 @@ khugepaged will be automatically started when any THP size is enabled (either of the per-size anon control or the top-level control are set to "always" or "madvise"), and it'll be automatically shutdown when all THP sizes are disabled (when both the per-size anon control and the -top-level control are "never") +top-level control are "never"). process THP controls -------------------- @@ -301,7 +301,9 @@ being replaced by a PMD mapping, or (2) physical pages replaced by one hugepage of various sizes (PMD-sized or mTHP). Each may happen independently, or together, depending on the type of memory and the failures that occur. As such, this value should be interpreted roughly as a sign of progress, -and counters in /proc/vmstat consulted for more accurate accounting):: +and counters in /proc/vmstat consulted for more accurate accounting. +Per-order mTHP collapse statistics are also available under +/sys/kernel/mm/transparent_hugepage/hugepages-kB/stats/):: /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed From 10ec12aac5e51e4e637d140514eab1e144246608 Mon Sep 17 00:00:00 2001 From: Song Hu Date: Wed, 12 Aug 2026 15:57:39 +0800 Subject: [PATCH 181/250] Docs/mm: fix outdated "radix tree" in page_migration Steps 7 and 9 of the migration description still say "radix tree", unlike steps 5 and 11 which already use "i_pages lock". The page cache moved to the XArray at mapping->i_pages long ago. Use "page cache tree" for the two remaining references. Link: https://lore.kernel.org/20260812075739.325441-1-husong@kylinos.cn Signed-off-by: Song Hu Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Randy Dunlap Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Matthew Wilcox Cc: Jan Kara Signed-off-by: Andrew Morton --- Documentation/mm/page_migration.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/mm/page_migration.rst b/Documentation/mm/page_migration.rst index 34602b254aa63e..5b8d50308db1f6 100644 --- a/Documentation/mm/page_migration.rst +++ b/Documentation/mm/page_migration.rst @@ -110,13 +110,13 @@ Steps: 6. The refcount of the page is examined and we back out if references remain. Otherwise, we know that we are the only one referencing this page. -7. The radix tree is checked and if it does not contain the pointer to this - page then we back out because someone else modified the radix tree. +7. The page cache tree is checked and if it does not contain the pointer to this + page then we back out because someone else modified the page cache tree. 8. The new page is prepped with some settings from the old page so that accesses to the new page will discover a page with the correct settings. -9. The radix tree is changed to point to the new page. +9. The page cache tree is changed to point to the new page. 10. The reference count of the old page is dropped because the address space reference is gone. A reference to the new page is established because From cc2b32bf600d2504410df4fcd841a67deb013f4f Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 12 Aug 2026 20:22:39 +0800 Subject: [PATCH 182/250] mm/mglru: fix and remove redundant unevictable folio handling sort_folio() has a shortcut for moving folios that are no longer evictable but are still sitting on a generation list. However, this shortcut is buggy. It does not follow the PG_lru usage convention, and it has a more serious issue. Unevictable folios are not threaded on lists[LRU_UNEVICTABLE], so that folio->lru can be reused to hold folio->mlock_count (see the comment in lruvec_init()). Hence lruvec_add_folio() skips the list_add() for them, and every other place that turns a folio unevictable initialises mlock_count explicitly: lru_add() sets it to 0, __mlock_folio() and __mlock_new_folio() set it to !!folio_test_mlocked(folio). sort_folio() sets nothing, and the lru_gen_del_folio() right above it may have already poisoned folio->lru via list_del(), so mlock_count ends up aliasing LIST_POISON2, which reads as 0x122, i.e. 290. The result is user visible. On munlock, __munlock_folio() decrements that bogus count, finds it still non-zero and bails out before clearing PG_mlocked, so the folio remains unevictable and the Mlocked accounting stays inflated until the folio is freed. The shortcut also touches the LRU flags in the wrong order. It calls lru_gen_del_folio() while PG_lru is still set, so a concurrent folio_test_clear_lru() (e.g. compaction, folio_isolate_lru()) can succeed on a folio that has already been taken off the generation list, which may lead to unexpected behavior. So fix it by isolating them as common folios and letting the generic shrink path cull them. This matches the classical LRU behavior, and there should be no visible effect on the generic eviction or isolation behavior. There is no performance concern either, such a folio goes through this once, and then it is off the generation lists for good. Link: https://lore.kernel.org/20260812-mglru-mlock-fix-v2-1-a3fec5853c08@tencent.com Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation") Signed-off-by: Kairui Song Reviewed-by: Barry Song Reviewed-by: Baolin Wang Cc: Axel Rasmussen Cc: Brian Geffon Cc: David Hildenbrand Cc: Jan Alexander Steffens (heftig) Cc: Johannes Weiner Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Oleksandr Natalenko Cc: Shakeel Butt Cc: Steven Barrett Cc: Suleiman Souhlal Cc: Wei Xu Cc: Yuanchu Xie Cc: Yu Zhao Cc: Signed-off-by: Andrew Morton --- mm/vmscan.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 6c35f7e2146501..c1404a59523d65 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4649,7 +4649,6 @@ void lru_gen_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_control *sc, int tier_idx) { - bool success; int gen = folio_lru_gen(folio); int type = folio_is_file_lru(folio); int zone = folio_zonenum(folio); @@ -4661,15 +4660,9 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c VM_WARN_ON_ONCE_FOLIO(gen >= MAX_NR_GENS, folio); - /* unevictable */ - if (!folio_evictable(folio)) { - success = lru_gen_del_folio(lruvec, folio, true); - VM_WARN_ON_ONCE_FOLIO(!success, folio); - folio_set_unevictable(folio); - lruvec_add_folio(lruvec, folio); - __count_vm_events(UNEVICTABLE_PGCULLED, delta); - return true; - } + /* unevictable: let it through and the generic path will cull it */ + if (!folio_evictable(folio)) + return false; /* promoted */ if (gen != lru_gen_from_seq(lrugen->min_seq[type])) { @@ -4922,11 +4915,9 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec, list_for_each_entry_safe_reverse(folio, next, &list, lru) { DEFINE_MIN_SEQ(lruvec); - if (!folio_evictable(folio)) { - list_del(&folio->lru); - folio_putback_lru(folio); + /* move_folios_to_lru() culls unevictable folios via folio_putback_lru() */ + if (!folio_evictable(folio)) continue; - } /* retry folios that may have missed folio_rotate_reclaimable() */ if (!skip_retry && !folio_test_active(folio) && !folio_mapped(folio) && From b64fd7fd44d0da830e9a2df56bdf8a38bdd7e5cd Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 12 Aug 2026 09:47:43 -1000 Subject: [PATCH 183/250] percpu: drop CONFIG_DEBUG_FORCE_WEAK_PER_CPU alpha requires percpu variables in modules to be defined as weak so that the compiler generates GOT based external references for them. This puts two extra restrictions on percpu variable definitions. The symbol must be globally unique even when static and a static percpu variable can't be defined inside a function. DEBUG_FORCE_WEAK_PER_CPU exists to give generic code build coverage for these restrictions without building for alpha. MEM_ALLOC_PROFILING defines a static percpu counter at each allocation call site and thus can't be built with weak percpu definitions, so it depends on !DEBUG_FORCE_WEAK_PER_CPU. As allmodconfig enables DEBUG_FORCE_WEAK_PER_CPU, this knocks MEM_ALLOC_PROFILING out of allmodconfig build coverage. allmodconfig coverage for MEM_ALLOC_PROFILING is worth more than build coverage for restrictions which only matter to alpha module builds. Drop DEBUG_FORCE_WEAK_PER_CPU. Restriction violations will now show up only on alpha builds. Link: https://lore.kernel.org/178656406317.2437052.7257990869957704195@slm.duckdns.org Signed-off-by: Tejun Heo Reported-by: Andrew Morton Reviewed-by: Suren Baghdasaryan Acked-by: Gabriele Monaco [include/rv/da_monitor.h] Cc: Dennis Zhou Cc: Kent Overstreet Cc: Steven Rostedt Signed-off-by: Andrew Morton --- include/linux/percpu-defs.h | 7 +------ include/rv/da_monitor.h | 2 +- lib/Kconfig.debug | 15 --------------- mm/Kconfig.debug | 1 - 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 2cba7cc2b01f95..dbe3267a0a1379 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -65,13 +65,8 @@ * * Archs which need weak percpu definitions should set * CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU when necessary. - * - * To ensure that the generic code observes the above two - * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak - * definition is used for all cases. */ -#if (defined(CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU) && defined(MODULE)) || \ - defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU) +#if defined(CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU) && defined(MODULE) /* * __pcpu_scope_* dummy variable is used to enforce scope. It * receives the static modifier when it's used in front of diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h index 34b8fba9ecd446..6b641697106bf2 100644 --- a/include/rv/da_monitor.h +++ b/include/rv/da_monitor.h @@ -24,7 +24,7 @@ /* * Per-cpu variables require a unique name although static in some - * configurations (e.g. CONFIG_DEBUG_FORCE_WEAK_PER_CPU or alpha modules). + * configurations (e.g. alpha modules). */ #define DA_MON_NAME CONCATENATE(da_mon_, MONITOR_NAME) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b82515cde538ca..00921b1676e879 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -613,21 +613,6 @@ config BUILTIN_MODULE_RANGES It also records an anchor symbol to determine the load address of the section. -config DEBUG_FORCE_WEAK_PER_CPU - bool "Force weak per-cpu definitions" - depends on DEBUG_KERNEL - help - s390 and alpha require percpu variables in modules to be - defined weak to work around addressing range issue which - puts the following two restrictions on percpu variable - definitions. - - 1. percpu symbols must be unique whether static or not - 2. percpu variables can't be defined inside a function - - To ensure that generic code follows the above rules, this - option forces all percpu variables to be defined as weak. - config WARN_CONTEXT_ANALYSIS bool "Compiler context-analysis warnings" depends on CC_IS_CLANG && CLANG_VERSION >= 230000 diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index 5737a504efbbec..15dca19dd07da9 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -326,7 +326,6 @@ config MEM_ALLOC_PROFILING default n depends on MMU depends on PROC_FS - depends on !DEBUG_FORCE_WEAK_PER_CPU select CODE_TAGGING select PAGE_EXTENSION select SLAB_OBJ_EXT From 2453765e011959096e09d1f420be9acd04ef7dd2 Mon Sep 17 00:00:00 2001 From: Qiang Liu Date: Wed, 12 Aug 2026 17:28:56 +0800 Subject: [PATCH 184/250] lib/test_hmm: fix garbage pfn and wrong direction in devmem fault debug Move pr_debug() inside the `if (dpage)` block to avoid printing garbage pfn for NULL dpage, and correct the direction label from "sys to dev" to "dev to sys". Link: https://lore.kernel.org/20260812092856.55296-1-liuqiangneo@163.com Signed-off-by: Qiang Liu Assisted-by: Qoder:Qwen-3.8-MAX-Preview Cc: Jason Gunthorpe Cc: Leon Romanovsky Signed-off-by: Andrew Morton --- lib/test_hmm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/test_hmm.c b/lib/test_hmm.c index 6205fb313bd05e..7c4d10eae6fe45 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -1151,10 +1151,9 @@ static vm_fault_t dmirror_devmem_fault_alloc_and_copy(struct migrate_vma *args, if (!dpage && !order) return VM_FAULT_OOM; - pr_debug("migrating from sys to dev pfn src: 0x%lx pfn dst: 0x%lx\n", - page_to_pfn(spage), page_to_pfn(dpage)); - if (dpage) { + pr_debug("migrating from dev to sys pfn src: 0x%lx pfn dst: 0x%lx\n", + page_to_pfn(spage), page_to_pfn(dpage)); lock_page(dpage); *dst |= migrate_pfn(page_to_pfn(dpage)); } From e96bb7b3ee487b44c75e54f20de455105c466d57 Mon Sep 17 00:00:00 2001 From: Xie Yuanbin Date: Thu, 13 Aug 2026 21:49:16 +0800 Subject: [PATCH 185/250] mm/Kconfig: make MEMORY_FAILURE select MIGRATION For embedded devices, lacking support for NUMA, memory hotplug/hotremove, CMA and huge pages is a quite common scenario. In this scenario, the demand for contiguous physical memory allocation is very low. To reduce the kernel image size, some devices disable the compaction. However, their SoCs do support DDR ECC, meaning that memory-failure may be needed. Migration is very useful for soft_offline_page() in memory-failure, which may be triggered by correctable memory errors. Most anonymous and file-mapped faulty pages can be migrated to other healthy pages. Currently, MEMORY_FAILURE does not explicitly select MIGRATION. When COMPACTION, MEMORY_HOTREMOVE, NUMA_MIGRATION and CMA are all disabled, MEMORY_FAILURE can be enabled, but MIGRATION cannot be selected. Make MEMORY_FAILURE select MIGRATION to handle this situation. Link: https://lore.kernel.org/20260813134916.292733-1-xieyuanbin1@huawei.com Signed-off-by: Xie Yuanbin Suggested-by: Mike Rapoport Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Mike Rapoport (Microsoft) Acked-by: Zi Yan Acked-by: David Hildenbrand (Arm) Acked-by: Miaohe Lin Cc: Alistair Popple Cc: "Borislav Petkov (AMD)" Cc: Byungchul Park Cc: David Hildenbrand Cc: Gregory Price Cc: "Huang, Ying" Cc: Joshua Hahn Cc: Liam R. Howlett Cc: liaohua Cc: "Luck, Tony" Cc: Matthew Brost Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Rakie Kim Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yuanbin Xie Signed-off-by: Andrew Morton --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index 8a24c130d008a8..604c58199acbf8 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -767,6 +767,7 @@ config MEMORY_FAILURE depends on ARCH_SUPPORTS_MEMORY_FAILURE bool "Enable recovery from hardware memory errors" select INTERVAL_TREE + select MIGRATION help Enables code to recover from some memory failures on systems with MCA recovery. This allows a system to continue running From 011d9d23d650e7d67065bf4b90dea3423aa9fa54 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 Aug 2026 13:16:37 -0700 Subject: [PATCH 186/250] mm/hmm.c:hmm_do_fault(): suppress sparse warning mm/hmm.c:673 hmm_do_fault() error: we previously assumed 'hmm_vma_walk->locked' could be null (see line 654) Stanislav says this can't happen. Waste a few cycles to make the warning go away. Fixes: 121170831228 ("mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support") Reported-by: kernel test robot Closes: https://lore.kernel.org/202608101053.PhnVUM4u-lkp@intel.com Cc: Stanislav Kinsburskii Cc: David Hildenbrand Signed-off-by: Andrew Morton --- mm/hmm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 2b05c53b82dc3a..6ce1b409ece7df 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -670,7 +670,8 @@ static int hmm_do_fault(struct mm_struct *mm, ret = handle_mm_fault(vma, addr, fault_flags, NULL); if (ret & (VM_FAULT_COMPLETED | VM_FAULT_RETRY)) { - *hmm_vma_walk->locked = false; + if (hmm_vma_walk->locked) /* needed by sparse */ + *hmm_vma_walk->locked = false; return HMM_FAULT_UNLOCKED; } From 6a47272106fb469e981297c4f9ac80a1d83b450c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 11 Aug 2026 17:23:28 -0700 Subject: [PATCH 187/250] mm-hmmc-hmm_do_fault-suppress-sparse-warning-fix WARN_ON_ONCE() if the handler didn't set ->locked, per Stanislav Link: https://lore.kernel.org/anu1N-DOnQwxO1kF@skinsburskii Cc: David Hildenbrand Cc: kernel test robot Cc: Stanislav Kinsburskii Signed-off-by: Andrew Morton --- mm/hmm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 6ce1b409ece7df..2f1e98c6b6440b 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -670,8 +670,10 @@ static int hmm_do_fault(struct mm_struct *mm, ret = handle_mm_fault(vma, addr, fault_flags, NULL); if (ret & (VM_FAULT_COMPLETED | VM_FAULT_RETRY)) { - if (hmm_vma_walk->locked) /* needed by sparse */ + if (hmm_vma_walk->locked) /* needed by sparse */ *hmm_vma_walk->locked = false; + else + WARN_ON_ONCE(1); /* broken fault handler */ return HMM_FAULT_UNLOCKED; } From 17f71b292018d8a19d7966336159a959a41c9f6a Mon Sep 17 00:00:00 2001 From: Eric Kim Date: Fri, 14 Aug 2026 15:30:51 +0900 Subject: [PATCH 188/250] mm/rmap: synchronize lock and unlock target in anon_vma_clone Currently, in anon_vma_clone(), src vma's anon_vma is assigned to active_anon_vma and is used when unlocking anon_vma after linking new AVCs. However, the anon_vma is locked using src->anon_vma, instead of active_anon_vma, making the lock and unlock target inconsistent. Use active_anon_vma for both locking and unlocking. Link: https://lore.kernel.org/OS7PR01MB139142FE16EC63B892559D40496DA2@OS7PR01MB13914.jpnprd01.prod.outlook.com Signed-off-by: Eric Kim Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Lance Yang Cc: David Hildenbrand Cc: Harry Yoo Cc: Jann Horn Cc: Liam R. Howlett Cc: Rik van Riel Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index 14f2f9b07572ab..d1819fd6993800 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -350,7 +350,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src, * Now link the anon_vma's back to the newly inserted AVCs. * Note that all anon_vma's share the same root. */ - anon_vma_lock_write(src->anon_vma); + anon_vma_lock_write(active_anon_vma); list_for_each_entry_reverse(avc, &dst->anon_vma_chain, same_vma) { struct anon_vma *anon_vma = avc->anon_vma; From af2db75dcbcced5063f39551434099d4d20ee551 Mon Sep 17 00:00:00 2001 From: Audra Mitchell Date: Thu, 6 Aug 2026 14:17:04 -0400 Subject: [PATCH 189/250] selftests/mm: fix soft-dirty kselftest supported check On architectures with separate user address space, such as s390 or those without an MMU, the soft-dirty kselftest may fail when checking to see if the feature is supported. # -------------------- # running ./soft-dirty # -------------------- # TAP version 13 # 1..15 # Bail out! PAGEMAP_SCAN succeeded unexpectedly # # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 # [FAIL] not ok 1 soft-dirty # exit=1 # SUMMARY: PASS=0 SKIP=0 FAIL=1 The soft-dirty test will initate an ioctl with the PAGEMAP_SCAN flag with an invalid address for the page_region. This is done intentionally to have the ioctl return with an expected EFAULT and with the correct categories returned. However, on architectures with separate user address space, such as s390 or those without an MMU, the call to __access_ok (used to validate the variables provided with the ioctl) will always return true and we will not fail as expected. if (IS_ENABLED(CONFIG_ALTERNATE_USER_ADDRESS_SPACE) || !IS_ENABLED(CONFIG_MMU)) return true; Let's simplify the check for PAGEMAP_SCAN and provide a valid page_region address so that we get a non-errno return if it is supported. [akpm@linux-foundation.org: remove comment, per Sashiko] Link: https://sashiko.dev/#/patchset/20260806181843.1839943-2-audra@redhat.com Link: https://lore.kernel.org/20260806181843.1839943-3-audra@redhat.com Fixes: 600bca580579 ("selftests/mm: check that PAGEMAP_SCAN returns correct categories") Signed-off-by: Audra Mitchell Cc: Andrei Vagin Cc: Colin Ian King Cc: David Hildenbrand Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muhammad Usama Anjum Cc: Rafael Aquini Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/vm_util.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 4821a356303631..80bc9f597b5215 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -68,21 +68,25 @@ static uint64_t pagemap_scan_get_categories(int fd, char *start) return r.categories; } -/* `start` is any valid address. */ -static bool pagemap_scan_supported(int fd, char *start) +static bool pagemap_scan_supported(int fd) { + const size_t pagesize = getpagesize(); static int supported = -1; - int ret; + struct page_region r; + void *test_area; if (supported != -1) return supported; - /* Provide an invalid address in order to trigger EFAULT. */ - ret = __pagemap_scan_get_categories(fd, start, (struct page_region *) ~0UL); - if (ret == 0) - ksft_exit_fail_msg("PAGEMAP_SCAN succeeded unexpectedly\n"); - - supported = errno == EFAULT; + test_area = mmap(0, pagesize, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if (test_area == MAP_FAILED) { + ksft_print_msg("WARN: mmap() failed: %s\n", strerror(errno)); + supported = 0; + } else { + supported = __pagemap_scan_get_categories(fd, test_area, &r) >= 0; + munmap(test_area, pagesize); + } return supported; } @@ -92,7 +96,7 @@ static bool page_entry_is(int fd, char *start, char *desc, { bool m = pagemap_get_entry(fd, start) & pagemap_flags; - if (pagemap_scan_supported(fd, start)) { + if (pagemap_scan_supported(fd)) { bool s = pagemap_scan_get_categories(fd, start) & pagescan_flags; if (m == s) From d560f4595e6f42a7a513903e56efb5d2d2b5caa5 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:25 -0400 Subject: [PATCH 190/250] maple_tree: add rcu locking check when LOCKDEP is enabled Patch series "maple_tree: lock checking and clean ups", v2. The goals of this series are: 1. Lock issue detection A number of syzbot reports are incorrectly pointing to the mm exit as a source of the locking error. The first three patches attempt to help users detect errors in their locking - but they still have to use LOCKDEP. I guess it's still down to hope and prayers. 2. Documentation fixes The documentation was lacking clarity, there are updates to try and help the users, especially around the erase() cases. 3. Two benign issues The cyclic allocator may have a race, although no in-kernel user can hit it. The erase functions may cause allocation issues if used with the incorrect locking type, but none are present in-tree. Beyond these goals there are some test fixes, some general speed-up patches targeting extra work and cycles, and dropping dead code. This patch (of 19): When CONFIG_LOCKDEP and CONFIG_RCU_STRICT_GRACE_PERIOD is enabled, check for rcu locking issues by recording the grace period in the maple state and checking the rcu window is still valid whenever the maple state is reused with a state that is not MA_START or MA_PAUSED. Link: https://lore.kernel.org/20260630190843.3563858-1-liam@infradead.org Link: https://lore.kernel.org/20260630190843.3563858-2-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 3 +++ lib/maple_tree.c | 50 +++++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 1b3014377105cd..1acf932fcd33cb 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -484,6 +484,9 @@ struct ma_state { unsigned char mas_flags; unsigned char end; /* The end of the node */ enum store_type store_type; /* The type of store needed for this operation */ +#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) + unsigned long rcu_gp; +#endif }; struct ma_wr_state { diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a0542b491bc232..6d805521beddf9 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1148,6 +1148,42 @@ static inline void mas_free(struct ma_state *mas, struct maple_enode *used) ma_free_rcu(mte_to_node(used)); } +void mas_lock_check(struct ma_state *mas) +{ + +#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) + if (!mas_is_active(mas)) + return; + + if (!mt_locked(mas->tree)) { + if (mt_in_rcu(mas->tree)) + WARN_ON_ONCE(poll_state_synchronize_rcu(mas->rcu_gp)); + } +#endif + +} + +void mas_init_lock_check(struct ma_state *mas) +{ +#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) + if (!mt_locked(mas->tree)) { + if (mt_in_rcu(mas->tree)) + mas->rcu_gp = get_state_synchronize_rcu(); + } +#endif + +} + +static void mas_may_init_lock_check(struct ma_state *mas) +{ +#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) + if (mas_is_start(mas) || mas_is_paused(mas)) + mas_init_lock_check(mas); + else + mas_lock_check(mas); +#endif +} + /* * mas_start() - Sets up maple state for operations. * @mas: The maple state. @@ -1166,6 +1202,7 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) if (likely(mas_is_start(mas))) { struct maple_enode *root; + mas_init_lock_check(mas); mas->min = 0; mas->max = ULONG_MAX; @@ -4355,6 +4392,7 @@ void *mas_walk(struct ma_state *mas) { void *entry; + mas_may_init_lock_check(mas); if (!mas_is_active(mas) && !mas_is_start(mas)) mas->status = ma_start; retry: @@ -4992,6 +5030,7 @@ static void mas_may_activate(struct ma_state *mas) mas->status = ma_start; } else { mas->status = ma_active; + mas_lock_check(mas); } } @@ -5069,6 +5108,7 @@ void *mas_next(struct ma_state *mas, unsigned long max) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_next_setup(mas, max, &entry)) return entry; @@ -5092,6 +5132,7 @@ void *mas_next_range(struct ma_state *mas, unsigned long max) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_next_setup(mas, max, &entry)) return entry; @@ -5200,6 +5241,7 @@ void *mas_prev(struct ma_state *mas, unsigned long min) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_prev_setup(mas, min, &entry)) return entry; @@ -5223,6 +5265,7 @@ void *mas_prev_range(struct ma_state *mas, unsigned long min) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_prev_setup(mas, min, &entry)) return entry; @@ -5269,6 +5312,7 @@ EXPORT_SYMBOL_GPL(mt_prev); */ void mas_pause(struct ma_state *mas) { + mas_lock_check(mas); mas->status = ma_pause; mas->node = NULL; } @@ -5377,6 +5421,7 @@ void *mas_find(struct ma_state *mas, unsigned long max) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_find_setup(mas, max, &entry)) return entry; @@ -5404,6 +5449,7 @@ void *mas_find_range(struct ma_state *mas, unsigned long max) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_find_setup(mas, max, &entry)) return entry; @@ -5516,6 +5562,7 @@ void *mas_find_rev(struct ma_state *mas, unsigned long min) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_find_rev_setup(mas, min, &entry)) return entry; @@ -5542,6 +5589,7 @@ void *mas_find_range_rev(struct ma_state *mas, unsigned long min) { void *entry = NULL; + mas_may_init_lock_check(mas); if (mas_find_rev_setup(mas, min, &entry)) return entry; @@ -5618,7 +5666,7 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) if (!mas->sheaf && !mas->alloc) return false; - mas->status = ma_start; + mas_reset(mas); return true; } From e5b4bbb48266871be232bb30658f2e88d8b9d724 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:26 -0400 Subject: [PATCH 191/250] locking/lockdep: add sequence counter to held_lock Add an 8 bit small sequence counter to the held_lock struct to detect if the lock as been dropped and reacquired. This is useful when a data structure depends on a constant locking context, but is not able to detect locking and unlocking of the lock through its own API. Since the __lock_unpin_lock() will no longer detect underflow by casting the unsigned int to a signed int, update the casting code to use a temp variable for calculations using a signed int. Link: https://lore.kernel.org/20260630190843.3563858-3-liam@infradead.org Link: https://lore.kernel.org/all/h3tpnj5kzcrxms5picmimtkpg4aypcpip5wbd6bt2rpdj5k7eb@nhtzs3lefrkq/ Signed-off-by: Liam R. Howlett (Oracle) Suggested-by: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Boqun Feng Cc: Waiman Long Cc: Chris Mason Cc: Chuck Lever Cc: Jason Gunthorpe Cc: Joe Perches Cc: Rik van Riel Signed-off-by: Andrew Morton --- include/linux/lockdep.h | 3 ++ include/linux/lockdep_types.h | 3 +- include/linux/sched.h | 1 + kernel/locking/lockdep.c | 58 ++++++++++++++++++++++++++++++----- 4 files changed, 57 insertions(+), 8 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 621566345406dd..a6451ecbbe9a05 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -273,6 +273,9 @@ extern struct pin_cookie lock_pin_lock(struct lockdep_map *lock); extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); +extern u32 lock_sequence(struct lockdep_map *lock); +#define lockdep_sequence(lock) lock_sequence(&(lock)->dep_map) + #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) #define lockdep_assert(cond) \ diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h index eae115a2648856..55c4b152fedf7c 100644 --- a/include/linux/lockdep_types.h +++ b/include/linux/lockdep_types.h @@ -253,7 +253,8 @@ struct held_lock { unsigned int hardirqs_off:1; unsigned int sync:1; unsigned int references:11; /* 32 bits */ - unsigned int pin_count; + unsigned int pin_count:24; + unsigned int seq_count:8; }; #else /* !CONFIG_LOCKDEP */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 373bcc0598d10b..14d5ce8dd61365 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1288,6 +1288,7 @@ struct task_struct { u64 curr_chain_key; int lockdep_depth; unsigned int lockdep_recursion; + unsigned int lockdep_seq; struct held_lock held_locks[MAX_LOCK_DEPTH]; #endif diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 2d4c5bab5af887..a69567bdd7912e 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -5077,7 +5077,7 @@ static int __lock_is_held(const struct lockdep_map *lock, int read); static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, int trylock, int read, int check, int hardirqs_off, struct lockdep_map *nest_lock, unsigned long ip, - int references, int pin_count, int sync) + int references, int pin_count, int sync, int seq) { struct task_struct *curr = current; struct lock_class *class = NULL; @@ -5183,6 +5183,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, hlock->holdtime_stamp = lockstat_clock(); #endif hlock->pin_count = pin_count; + hlock->seq_count = seq; if (check_wait_context(curr, hlock)) return 0; @@ -5388,7 +5389,7 @@ static int reacquire_held_locks(struct task_struct *curr, unsigned int depth, hlock->read, hlock->check, hlock->hardirqs_off, hlock->nest_lock, hlock->acquire_ip, - hlock->references, hlock->pin_count, 0)) { + hlock->references, hlock->pin_count, 0, hlock->seq_count)) { case 0: return 1; case 1: @@ -5669,14 +5670,17 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie struct held_lock *hlock = curr->held_locks + i; if (match_held_lock(hlock, lock)) { + int pin_count; + if (WARN(!hlock->pin_count, "unpinning an unpinned lock\n")) return; - hlock->pin_count -= cookie.val; + pin_count = hlock->pin_count - cookie.val; - if (WARN((int)hlock->pin_count < 0, "pin count corrupted\n")) - hlock->pin_count = 0; + if (WARN(pin_count < 0, "pin count corrupted\n")) + pin_count = 0; + hlock->pin_count = pin_count; return; } } @@ -5684,6 +5688,24 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie WARN(1, "unpinning an unheld lock\n"); } +static u32 __lock_sequence(struct lockdep_map *lock) +{ + struct task_struct *curr = current; + int i; + + if (unlikely(!debug_locks)) + return ~0; + + for (i = 0; i < curr->lockdep_depth; i++) { + struct held_lock *hlock = curr->held_locks + i; + + if (match_held_lock(hlock, lock)) + return hlock->seq_count; + } + + return ~0; +} + /* * Check whether we follow the irq-flags state precisely: */ @@ -5866,7 +5888,8 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, lockdep_recursion_inc(); __lock_acquire(lock, subclass, trylock, read, check, - irqs_disabled_flags(flags), nest_lock, ip, 0, 0, 0); + irqs_disabled_flags(flags), nest_lock, ip, 0, 0, 0, + ++current->lockdep_seq); lockdep_recursion_finish(); raw_local_irq_restore(flags); } @@ -5914,7 +5937,8 @@ void lock_sync(struct lockdep_map *lock, unsigned subclass, int read, lockdep_recursion_inc(); __lock_acquire(lock, subclass, 0, read, check, - irqs_disabled_flags(flags), nest_lock, ip, 0, 0, 1); + irqs_disabled_flags(flags), nest_lock, ip, 0, 0, 1, + ++current->lockdep_seq); check_chain_key(current); lockdep_recursion_finish(); raw_local_irq_restore(flags); @@ -6000,6 +6024,26 @@ void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie) } EXPORT_SYMBOL_GPL(lock_unpin_lock); +u32 lock_sequence(struct lockdep_map *lock) +{ + unsigned long flags; + u32 seq = ~0; + + if (unlikely(!lockdep_enabled())) + return seq; + + raw_local_irq_save(flags); + check_flags(flags); + + lockdep_recursion_inc(); + seq = __lock_sequence(lock); + lockdep_recursion_finish(); + raw_local_irq_restore(flags); + + return seq; +} +EXPORT_SYMBOL_GPL(lock_sequence); + #ifdef CONFIG_LOCK_STAT static void print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock, From c59fd676aff251aff50b12708526a44209e14ac7 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:27 -0400 Subject: [PATCH 192/250] maple_tree: add write lock checking with lockdep sequence numbers Use the lockdep sequence numbers to ensure the write lock is not dropped between write operations. The lockdep sequence is recorded on any walk that starts from the top of the tree and re-checked prior to any operation using an active node. Link: https://lore.kernel.org/20260630190843.3563858-4-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Cc: Breno Leitao Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 7 +++-- lib/maple_tree.c | 58 ++++++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 1acf932fcd33cb..d63ac92208d02f 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -484,9 +484,12 @@ struct ma_state { unsigned char mas_flags; unsigned char end; /* The end of the node */ enum store_type store_type; /* The type of store needed for this operation */ -#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) +#ifdef CONFIG_LOCKDEP + u32 ld_seq; +#ifdef CONFIG_RCU_STRICT_GRACE_PERIOD unsigned long rcu_gp; -#endif +#endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ +#endif /* CONFIG_LOCKDEP */ }; struct ma_wr_state { diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 6d805521beddf9..ca25609cbe61ff 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1148,40 +1148,71 @@ static inline void mas_free(struct ma_state *mas, struct maple_enode *used) ma_free_rcu(mte_to_node(used)); } -void mas_lock_check(struct ma_state *mas) + +#ifdef CONFIG_LOCKDEP +static struct lockdep_map *mas_lockdep_map(struct ma_state *mas) { + struct maple_tree *mt = mas->tree; + + if (mt_external_lock(mt)) + return mt->ma_external_lock; + + return &(mt->ma_lock).dep_map; +} + +#endif -#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) +static void mas_lock_check(struct ma_state *mas) +{ +#ifdef CONFIG_LOCKDEP + struct lockdep_map *map; if (!mas_is_active(mas)) return; +#ifdef CONFIG_RCU_STRICT_GRACE_PERIOD if (!mt_locked(mas->tree)) { if (mt_in_rcu(mas->tree)) WARN_ON_ONCE(poll_state_synchronize_rcu(mas->rcu_gp)); } -#endif +#endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ + + map = mas_lockdep_map(mas); + if (map && lock_is_held(map)) + WARN_ON_ONCE(mas->ld_seq != lock_sequence(map)); +#endif /* CONFIG_LOCKDEP */ } -void mas_init_lock_check(struct ma_state *mas) +static void mas_init_lock_check(struct ma_state *mas) { -#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) +#ifdef CONFIG_LOCKDEP + struct lockdep_map *map; +#ifdef CONFIG_RCU_STRICT_GRACE_PERIOD if (!mt_locked(mas->tree)) { if (mt_in_rcu(mas->tree)) mas->rcu_gp = get_state_synchronize_rcu(); + return; } -#endif +#endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ + + map = mas_lockdep_map(mas); + if (map && lock_is_held(map)) + mas->ld_seq = lock_sequence(mas_lockdep_map(mas)); +#endif /* CONFIG_LOCKDEP */ } static void mas_may_init_lock_check(struct ma_state *mas) { -#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) - if (mas_is_start(mas) || mas_is_paused(mas)) +#ifdef CONFIG_LOCKDEP +#ifdef CONFIG_RCU_STRICT_GRACE_PERIOD + if (mas_is_start(mas) || mas_is_paused(mas)) { mas_init_lock_check(mas); - else - mas_lock_check(mas); -#endif + return; + } +#endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ + mas_lock_check(mas); +#endif /* CONFIG_LOCKDEP */ } /* @@ -4864,6 +4895,7 @@ void *mas_store(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); + mas_may_init_lock_check(mas); trace_ma_write(TP_FCT, mas, 0, entry); #ifdef CONFIG_DEBUG_MAPLE_TREE if (MAS_WARN_ON(mas, mas->index > mas->last)) @@ -4922,6 +4954,7 @@ int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp) MA_WR_STATE(wr_mas, mas, entry); int ret = 0; + mas_may_init_lock_check(mas); retry: mas_wr_preallocate(&wr_mas, entry); if (unlikely(mas_nomem(mas, gfp))) { @@ -4952,6 +4985,7 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); + mas_lock_check(mas); if (mas->store_type == wr_store_root) { mas_wr_prealloc_setup(&wr_mas); goto store; @@ -4984,6 +5018,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); + mas_may_init_lock_check(mas); mas_wr_prealloc_setup(&wr_mas); mas->store_type = mas_wr_store_type(&wr_mas); mas_prealloc_calc(&wr_mas, entry); @@ -5469,7 +5504,6 @@ EXPORT_SYMBOL_GPL(mas_find_range); static bool mas_find_rev_setup(struct ma_state *mas, unsigned long min, void **entry) { - switch (mas->status) { case ma_active: goto active; From 1207798d0e913b9e14f4d1a6784cefc686d73e4e Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Mon, 20 Jul 2026 17:30:38 -0400 Subject: [PATCH 193/250] maple_tree-stop-flooding-logs-when-debug_locks-is-set-to-zero-fix stop flooding logs when debug_locks is set to zero When lockdep detects an issue, it sets debug_locks to 0 disabling further reports. The newly added maple tree sequence counting on locks to detect errors is not taking this nor the fact that lock_is_held() can return -1 (unknown state) into account. The resulting action is a flood of logging of not matching sequence numbers being reported on failure. __lock_sequnece() will return u32 ~0 when debug_locks is zero, and the real sequnece count cannot return such a high value as it is less than 32bits. By always updating the sequence number, regardless of lock state and by ignoring ~0 value in the sequence number will avoid ever printing a WARN_ON when this condition is hit. Link: https://lore.kernel.org/fo5r2xl3fql6gyvjasfvfu4ftugjti2vxg7zskdw7hjeo3xvqm@kk66qmsf762s Signed-off-by: Liam R. Howlett (Oracle) Tested-by: Breno Leitao Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ca25609cbe61ff..d8c826e1ca0cfa 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1166,6 +1166,8 @@ static void mas_lock_check(struct ma_state *mas) { #ifdef CONFIG_LOCKDEP struct lockdep_map *map; + u32 seq; + if (!mas_is_active(mas)) return; @@ -1177,8 +1179,12 @@ static void mas_lock_check(struct ma_state *mas) #endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ map = mas_lockdep_map(mas); - if (map && lock_is_held(map)) - WARN_ON_ONCE(mas->ld_seq != lock_sequence(map)); + if (!map) + return; + + seq = lock_sequence(map); + if (seq != UINT_MAX && mas->ld_seq != UINT_MAX) + WARN_ON_ONCE(mas->ld_seq != seq); #endif /* CONFIG_LOCKDEP */ } @@ -1196,8 +1202,8 @@ static void mas_init_lock_check(struct ma_state *mas) #endif /* CONFIG_RCU_STRICT_GRACE_PERIOD */ map = mas_lockdep_map(mas); - if (map && lock_is_held(map)) - mas->ld_seq = lock_sequence(mas_lockdep_map(mas)); + if (map) /* Update regardless of lock state */ + mas->ld_seq = lock_sequence(map); #endif /* CONFIG_LOCKDEP */ } From b635c523c8a29d527246be5cce7e811f18dd8c9e Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:28 -0400 Subject: [PATCH 194/250] maple_tree: documentation fix Don't include the word flag in the quotes with the actual flag. Link: https://lore.kernel.org/20260630190843.3563858-5-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- Documentation/core-api/maple_tree.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/core-api/maple_tree.rst b/Documentation/core-api/maple_tree.rst index ccdd1615cf974f..34964ec88d179d 100644 --- a/Documentation/core-api/maple_tree.rst +++ b/Documentation/core-api/maple_tree.rst @@ -211,7 +211,7 @@ Advanced Locking The maple tree uses a spinlock by default, but external locks can be used for tree updates as well. To use an external lock, the tree must be initialized -with the ``MT_FLAGS_LOCK_EXTERN flag``, this is usually done with the +with the ``MT_FLAGS_LOCK_EXTERN`` flag, this is usually done with the MTREE_INIT_EXT() #define, which takes an external lock as an argument. Functions and structures From 83357f60fe0b1f1cead453c4850f222669dc37a1 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:29 -0400 Subject: [PATCH 195/250] maple_tree: drop dead code from mas_extend_spanning_null() mas_extend_spanning_null() had a clause if the end of the range being written (mas->last) is the same as the end of the existing range it is overwriting (wr_mas->r_max), action will be taken. This code path is not possible because the only calling function increments mas->last (unless it's ULONG_MAX) to walk to one beyond the write and then resets the value back to the initial value. In the case of mas->last == ULONG_MAX, then the second part of the statement will always be false - mas->last cannot be less than the node max. This code never executed and is flawed anyways (the arguments are incorrectly ordered), so removing it is the safest action. Since the code never executes, it is not fixing any issue so Fixes tag is not given. Link: https://lore.kernel.org/20260630190843.3563858-6-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d8c826e1ca0cfa..3509e293c84f91 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2997,13 +2997,6 @@ static inline void mas_extend_spanning_null(struct ma_wr_state *l_wr_mas, if (r_mas->last < r_wr_mas->r_max) r_mas->last = r_wr_mas->r_max; r_mas->offset++; - } else if ((r_mas->last == r_wr_mas->r_max) && - (r_mas->last < r_mas->max) && - !mas_slot_locked(r_mas, r_wr_mas->slots, r_mas->offset + 1)) { - r_mas->last = mas_safe_pivot(r_mas, r_wr_mas->pivots, - r_wr_mas->type, r_mas->offset + 1); - r_mas->offset++; - r_wr_mas->r_max = r_mas->last; } } From 9a18ee12167a58d5c1adf954543abf5d1d473f10 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:30 -0400 Subject: [PATCH 196/250] maple_tree: drop MAPLE_ALLOC_SLOTS MAPLE_ALLOC_SLOTS is no longer used, so remove it. Link: https://lore.kernel.org/20260630190843.3563858-7-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index d63ac92208d02f..14ca9ac775d995 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -28,13 +28,11 @@ #define MAPLE_NODE_SLOTS 31 /* 256 bytes including ->parent */ #define MAPLE_RANGE64_SLOTS 16 /* 256 bytes */ #define MAPLE_ARANGE64_SLOTS 10 /* 240 bytes */ -#define MAPLE_ALLOC_SLOTS (MAPLE_NODE_SLOTS - 1) #else /* 32bit sizes */ #define MAPLE_NODE_SLOTS 63 /* 256 bytes including ->parent */ #define MAPLE_RANGE64_SLOTS 32 /* 256 bytes */ #define MAPLE_ARANGE64_SLOTS 21 /* 240 bytes */ -#define MAPLE_ALLOC_SLOTS (MAPLE_NODE_SLOTS - 2) #endif /* defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64) */ #define MAPLE_NODE_MASK 255UL From cfcb9e7c76430b89cf2f09a48f18cdd69f727bc2 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:31 -0400 Subject: [PATCH 197/250] maple_tree: clarify comments on mas_nomem() When an allocation completely fails, the return is false. If the allocation succeeds or partially succeeds, return true to indicate a retry of the operation. Note that since the lock may have been dropped, the operation is retried from the start - including potentially allocating more memory. Link: https://lore.kernel.org/20260630190843.3563858-8-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3509e293c84f91..baaaa128594c27 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5677,10 +5677,11 @@ EXPORT_SYMBOL_GPL(mas_erase); /** * mas_nomem() - Check if there was an error allocating and do the allocation - * if necessary If there are allocations, then free them. + * if necessary. + * * @mas: The maple state * @gfp: The GFP_FLAGS to use for allocations - * Return: true on allocation, false otherwise. + * Return: False on no memory. True otherwise (partial success as well) */ bool mas_nomem(struct ma_state *mas, gfp_t gfp) __must_hold(mas->tree->ma_lock) @@ -5696,6 +5697,10 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) mas_alloc_nodes(mas, gfp); } + /* + * Return false on zero forward progress. Partial allocations are kept + * so the retry path will attempt to get the rest. + */ if (!mas->sheaf && !mas->alloc) return false; From 3352d7b5fe13a147ad97a11957bd3060cec59203 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:32 -0400 Subject: [PATCH 198/250] maple_tree: use prefetched value in mas_wr_store_type() The slot contents exist in wr_mas->content, which has less overhead than reading the slot again. Link: https://lore.kernel.org/20260630190843.3563858-9-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index baaaa128594c27..d5fa85bc7aab0d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3280,7 +3280,7 @@ static inline void mas_wr_slot_store(struct ma_wr_state *wr_mas) void __rcu **slots = wr_mas->slots; bool gap = false; - gap |= !mt_slot_locked(mas->tree, slots, offset); + gap |= !wr_mas->content; gap |= !mt_slot_locked(mas->tree, slots, offset + 1); if (wr_mas->offset_end - offset == 1) { From 0bbf421f29df76faa22154195b5ac1b210eddf07 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:33 -0400 Subject: [PATCH 199/250] maple_tree: optimise mas_wr_node_store() when not in rcu mode Clearing the entire node on the stack is unnecessary since most of the node will be overwritten anyways. Just clear what isn't used after the data is in place. Benchmarking shows a speedup of 0.67% on a height 4 tree with 2048 entries. Link: https://lore.kernel.org/20260630190843.3563858-10-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d5fa85bc7aab0d..56812db8b0efe1 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3187,7 +3187,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) static inline void mas_wr_node_store(struct ma_wr_state *wr_mas) { unsigned char dst_offset, offset_end; - unsigned char copy_size, node_pivots; + unsigned char copy_size, node_pivots, node_slots; struct maple_node reuse, *newnode; unsigned long *dst_pivots; void __rcu **dst_slots; @@ -3200,6 +3200,7 @@ static inline void mas_wr_node_store(struct ma_wr_state *wr_mas) in_rcu = mt_in_rcu(mas->tree); offset_end = wr_mas->offset_end; node_pivots = mt_pivots[wr_mas->type]; + node_slots = mt_slots[wr_mas->type]; /* Assume last adds an entry */ new_end = mas->end + 1 - offset_end + mas->offset; if (mas->last == wr_mas->end_piv) { @@ -3211,7 +3212,6 @@ static inline void mas_wr_node_store(struct ma_wr_state *wr_mas) if (in_rcu) { newnode = mas_pop_node(mas); } else { - memset(&reuse, 0, sizeof(struct maple_node)); newnode = &reuse; } @@ -3255,7 +3255,21 @@ static inline void mas_wr_node_store(struct ma_wr_state *wr_mas) dst_pivots[new_end] = mas->max; done: - mas_leaf_set_meta(newnode, maple_leaf_64, new_end); + if (!in_rcu && new_end + 2 < node_slots) { + unsigned char clear_from = new_end + 1; + + /* + * Note that the last slot is never cleared, since the metadata + * will be stored there or it has a value. + */ + memset(dst_slots + clear_from, 0, + sizeof(void __rcu *) * (node_slots - clear_from)); + if (clear_from < node_pivots) + memset(dst_pivots + clear_from, 0, + sizeof(unsigned long) * (node_pivots - clear_from)); + } + + mas_leaf_set_meta(newnode, wr_mas->type, new_end); if (in_rcu) { struct maple_enode *old_enode = mas->node; From 07511773d6a66fc371b3591b1dba2a4b12c8f28f Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:34 -0400 Subject: [PATCH 200/250] maple_tree: micro optimisation of mas_wr_store_type() Use three new local booleans instead of reading other structures. This has shown an increase of 0.62% on a 2048 entry tree of height 4. Link: https://lore.kernel.org/20260630190843.3563858-11-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 56812db8b0efe1..e2c780a64c9c1f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3737,6 +3737,9 @@ static inline enum store_type mas_wr_store_type(struct ma_wr_state *wr_mas) { struct ma_state *mas = wr_mas->mas; unsigned char new_end; + bool appending; + bool one_slot; + bool in_rcu; if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) return wr_store_root; @@ -3756,21 +3759,30 @@ static inline enum store_type mas_wr_store_type(struct ma_wr_state *wr_mas) return wr_new_root; new_end = mas_wr_new_end(wr_mas); + in_rcu = mt_in_rcu(mas->tree); + appending = mas->offset == mas->end; + one_slot = wr_mas->offset_end - mas->offset == 1; + /* Potential spanning rebalance collapsing a node */ if (new_end < mt_min_slots[wr_mas->type]) { if (!mte_is_root(mas->node)) return wr_rebalance; + if (!in_rcu) { + if (appending) + return wr_append; + else if (mas->end == new_end && one_slot) + return wr_slot_store; + } return wr_node_store; } if (new_end >= mt_slots[wr_mas->type]) return wr_split_store; - if (!mt_in_rcu(mas->tree) && (mas->offset == mas->end)) + if (!in_rcu && appending) return wr_append; - if ((new_end == mas->end) && (!mt_in_rcu(mas->tree) || - (wr_mas->offset_end - mas->offset == 1))) + if (new_end == mas->end && (!in_rcu || one_slot)) return wr_slot_store; return wr_node_store; From ed1da9d3777a49183385c783dd719eca1907e182 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:35 -0400 Subject: [PATCH 201/250] maple_tree: add bulk parent set helper Instead of calculating the parent pointer each time for a child, cache the majority of the parent pointer and only change the slot per child. Drop the mas_set_parent() function since the last user has been removed. Testing on a tree containing 2048 entries of height 4 had an increased gain of 3.51% on nodes tracking gaps. Link: https://lore.kernel.org/20260630190843.3563858-12-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 97 +++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 55 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e2c780a64c9c1f..c968e25bea0ae0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -450,46 +450,6 @@ enum maple_type mas_parent_type(struct ma_state *mas, struct maple_enode *enode) return 0; } -/* - * mas_set_parent() - Set the parent node and encode the slot - * @mas: The maple state - * @enode: The encoded maple node. - * @parent: The encoded maple node that is the parent of @enode. - * @slot: The slot that @enode resides in @parent. - * - * Slot number is encoded in the enode->parent bit 3-6 or 2-6, depending on the - * parent type. - */ -static inline -void mas_set_parent(struct ma_state *mas, struct maple_enode *enode, - const struct maple_enode *parent, unsigned char slot) -{ - unsigned long val = (unsigned long)parent; - unsigned long shift; - unsigned long type; - enum maple_type p_type = mte_node_type(parent); - - MAS_BUG_ON(mas, p_type == maple_dense); - MAS_BUG_ON(mas, p_type == maple_leaf_64); - - switch (p_type) { - case maple_range_64: - case maple_arange_64: - shift = MAPLE_PARENT_SLOT_SHIFT; - type = MAPLE_PARENT_RANGE64; - break; - default: - case maple_dense: - case maple_leaf_64: - shift = type = 0; - break; - } - - val &= ~MAPLE_NODE_MASK; /* Clear all node metadata in parent */ - val |= (slot << shift) | type; - mte_to_node(enode)->parent = ma_parent_ptr(val); -} - /* * mte_parent_slot() - get the parent slot of @enode. * @enode: The encoded maple node. @@ -871,6 +831,42 @@ static inline void ma_set_meta_gap(struct maple_node *mn, enum maple_type mt, meta->gap = offset; } +/* + * mas_set_parent_slots() - Bulk operation to set many slot parent pointers + * @mas: The maple state + * @parent: The encoded maple node that is the parent of @enode. + * @slot: The slot that of the @enode. + * @start_slot: The offset into @slot + * @count: The number of slots to set (eg: exclusive) + */ +static inline +void mas_set_parent_slots(struct ma_state *mas, struct maple_enode *parent, + void __rcu **slots, unsigned char start_slot, unsigned char count) +{ + unsigned long val; + unsigned long shift; + unsigned long type; + enum maple_type p_type = mte_node_type(parent); + unsigned char i; + + MAS_BUG_ON(mas, p_type != maple_range_64 && + p_type != maple_arange_64); + + shift = MAPLE_PARENT_SLOT_SHIFT; + type = MAPLE_PARENT_RANGE64; + + val = (unsigned long)parent; + val &= ~MAPLE_NODE_MASK; + + for (i = 0; i < count; i++) { + unsigned long pval = val | ((start_slot + i) << shift) | type; + struct maple_enode *child; + + child = mt_slot_locked(mas->tree, slots, i); + mte_to_node(child)->parent = ma_parent_ptr(pval); + } +} + /* * mat_add() - Add a @dead_enode to the ma_topiary of a list of dead nodes. * @mat: the ma_topiary, a linked list of dead nodes. @@ -1609,14 +1605,10 @@ static inline void mas_adopt_children(struct ma_state *mas, struct maple_node *node = mte_to_node(parent); void __rcu **slots = ma_slots(node, type); unsigned long *pivots = ma_pivots(node, type); - struct maple_enode *child; - unsigned char offset; + unsigned char end; - offset = ma_data_end(node, type, pivots, mas->max); - do { - child = mas_slot_locked(mas, slots, offset); - mas_set_parent(mas, child, parent, offset); - } while (offset--); + end = ma_data_end(node, type, pivots, mas->max); + mas_set_parent_slots(mas, parent, slots, 0, end + 1); } /* @@ -1998,15 +1990,10 @@ unsigned long node_copy(struct ma_state *mas, struct maple_node *src, s_slots = ma_slots(src, s_mt) + start; s_pivots = ma_pivots(src, s_mt) + start; memcpy(d_slots, s_slots, size * sizeof(void __rcu *)); - if (!ma_is_leaf(d_mt) && s_mt == maple_copy) { - struct maple_enode *edst = mt_mk_node(dst, d_mt); - - for (int i = 0; i < size; i++) - mas_set_parent(mas, - mt_slot_locked(mas->tree, d_slots, i), - edst, d_start + i); - } + if (!ma_is_leaf(d_mt) && s_mt == maple_copy) + mas_set_parent_slots(mas, mt_mk_node(dst, d_mt), + d_slots, d_start, size); d_gaps = ma_gaps(dst, d_mt); if (d_gaps) { From 08f84af834d6f9023e37f5aca86d771ba11d3a09 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:36 -0400 Subject: [PATCH 202/250] maple_tree: catch race in mas_alloc_cyclic() If mas_alloc_cyclic() is called during a low memory situation, it is possible the lock may be dropped so reclaim can occur. There is a window where some other task may allocate the same id and cause the mas_insert() to fail with -EEXIST. In this scenario the function will return -EEXIST, which is not expected. Modifying the retry on mas_nomem() to re-search for a slot means that any race with other writes will not matter as the lock will be held between finding the index and writing the index. Moving the flag logic avoids cases where the flag is modified on drop lock/reacquire or when the write fails after clearing the flag. No existing users are exposed to this issue. Link: https://lore.kernel.org/20260630190843.3563858-13-liam@infradead.org Fixes: 9b6713cc7522 ("maple_tree: Add mtree_alloc_cyclic()") Signed-off-by: Liam R. Howlett (Oracle) Reported-by: Chris Mason Reviewed-by: Chuck Lever Cc: Boqun Feng Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c968e25bea0ae0..190f480d68502c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3868,35 +3868,40 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, void *entry, unsigned long range_lo, unsigned long range_hi, unsigned long *next, gfp_t gfp) { - unsigned long min = range_lo; - int ret = 0; - - range_lo = max(min, *next); - ret = mas_empty_area(mas, range_lo, range_hi, 1); - if ((mas->tree->ma_flags & MT_FLAGS_ALLOC_WRAPPED) && ret == 0) { - mas->tree->ma_flags &= ~MT_FLAGS_ALLOC_WRAPPED; - ret = 1; - } - if (ret < 0 && range_lo > min) { - mas_reset(mas); - ret = mas_empty_area(mas, min, range_hi, 1); - if (ret == 0) - ret = 1; - } - if (ret < 0) - return ret; + int ret; + unsigned long min; + min = range_lo; do { + range_lo = max(min, *next); + ret = mas_empty_area(mas, range_lo, range_hi, 1); + if (ret < 0 && range_lo > min) { + mas_reset(mas); + ret = mas_empty_area(mas, min, range_hi, 1); + if (ret == 0) + ret = 1; + } + if (ret < 0) + goto out; + mas_insert(mas, entry); } while (mas_nomem(mas, gfp)); - if (mas_is_err(mas)) - return xa_err(mas->node); + if (mas_is_err(mas)) { + ret = xa_err(mas->node); + goto out; + } + + if ((mas->tree->ma_flags & MT_FLAGS_ALLOC_WRAPPED) && ret == 0) { + mas->tree->ma_flags &= ~MT_FLAGS_ALLOC_WRAPPED; + ret = 1; + } *startp = mas->index; *next = *startp + 1; if (*next == 0) mas->tree->ma_flags |= MT_FLAGS_ALLOC_WRAPPED; +out: mas_destroy(mas); return ret; } From d08b60944135abb01b65bcc32b910511fcebfc5b Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:37 -0400 Subject: [PATCH 203/250] maple_tree: document that erase may use GFP_KERNEL for allocations State that the mas_erase() and mtree_erase() functions may use GFP_KERNEL on allocation retry. Don't just depend on people reading the documentation by adding a check that will warn of the use. Link: https://lore.kernel.org/20260630190843.3563858-14-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Reviewed-by: Rik van Riel Cc: Jason Gunthorpe Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Joe Perches Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 190f480d68502c..440863bdea2672 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5658,6 +5658,10 @@ EXPORT_SYMBOL_GPL(mas_find_range_rev); * Searches for @mas->index, sets @mas->index and @mas->last to the range and * erases that range. * + * Note that erase requires allocations and will use GFP_KERNEL to do so if + * necessary. If the allocation fails, the internal lock will be dropped to + * retry. + * * Return: the entry that was erased or %NULL, @mas->index and @mas->last are updated. */ void *mas_erase(struct ma_state *mas) @@ -5666,13 +5670,21 @@ void *mas_erase(struct ma_state *mas) unsigned long index = mas->index; MA_WR_STATE(wr_mas, mas, NULL); + /* + * In low memory situations, the allocation is retried with the gfp flag + * GFP_KERNEL. The internal spinlock is dropped in mas_nomem(), however + * the external lock is not dropped. + */ + if (mt_external_lock(mas->tree)) + might_alloc(GFP_KERNEL); + if (!mas_is_active(mas) || !mas_is_start(mas)) mas->status = ma_start; write_retry: entry = mas_state_walk(mas); if (!entry) - return NULL; + goto out; /* Must reset to ensure spanning writes of last slot are detected */ mas_reset(mas); @@ -5683,8 +5695,10 @@ void *mas_erase(struct ma_state *mas) goto write_retry; } - if (mas_is_err(mas)) + if (mas_is_err(mas)) { + entry = NULL; goto out; + } mas_wr_store_entry(&wr_mas); out: @@ -6012,6 +6026,10 @@ EXPORT_SYMBOL(mtree_alloc_rrange); * Erasing is the same as a walk to an entry then a store of a NULL to that * ENTIRE range. In fact, it is implemented as such using the advanced API. * + * Note that erase requires allocations and will use GFP_KERNEL to do so if + * necessary. If the allocation fails, the internal lock will be dropped to + * retry. + * * Return: The entry stored at the @index or %NULL */ void *mtree_erase(struct maple_tree *mt, unsigned long index) @@ -6021,6 +6039,7 @@ void *mtree_erase(struct maple_tree *mt, unsigned long index) MA_STATE(mas, mt, index, index); trace_ma_op(TP_FCT, &mas); + might_alloc(GFP_KERNEL); mtree_lock(mt); entry = mas_erase(&mas); mtree_unlock(mt); From 025d124bbc93e2dc7e95cd63cebbfae68b28dce0 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:38 -0400 Subject: [PATCH 204/250] maple_tree: WARN_ON_ONCE when allocations fail Allocations should never fail in the circumstances that are expected to occur. Add checks in the code to ensure the circumstances are correctly set up by the user and warn if they are not. Also add a warning on failure to allocate, which should never happen. Link: https://lore.kernel.org/20260630190843.3563858-15-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Rik van Riel Cc: Jason Gunthorpe Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Joe Perches Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 440863bdea2672..054de396c873bb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5721,6 +5721,10 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) if (likely(mas->node != MA_ERROR(-ENOMEM))) return false; + /* Allocations can fail, don't do this. */ + WARN_ON_ONCE(!gfpflags_allow_blocking(gfp) && + mt_external_lock(mas->tree)); + if (gfpflags_allow_blocking(gfp) && !mt_external_lock(mas->tree)) { mtree_unlock(mas->tree); mas_alloc_nodes(mas, gfp); @@ -5731,9 +5735,12 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) /* * Return false on zero forward progress. Partial allocations are kept - * so the retry path will attempt to get the rest. + * so the retry path will attempt to get the rest. The failure should + * not happen as we try our best to reclaim. The user would need an + * external lock with a non-blocking gfp in a low memory situation - + * which would have triggered the first warning in this function. */ - if (!mas->sheaf && !mas->alloc) + if (WARN_ON_ONCE(!mas->sheaf && !mas->alloc)) return false; mas_reset(mas); From 334349ee8ecae9ff9af2cd557834ec6d488468a4 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:39 -0400 Subject: [PATCH 205/250] maple_tree: document erase and allocations better During a discussion on the maple tree erase process and GFP flags, Jason suggested there be an amendment to the documentation to clarify the situation on allocations within the tree. The added text is an attempt to better explain that the tree may allocate, even when erasing, and provide some guidance on how to work around such issues. Link: https://lore.kernel.org/all/20260617180419.GA231643@ziepe.ca/ Link: https://lore.kernel.org/20260630190843.3563858-16-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Suggested-by: Jason Gunthorpe Cc: Rik van Riel Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Joe Perches Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- Documentation/core-api/maple_tree.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation/core-api/maple_tree.rst b/Documentation/core-api/maple_tree.rst index 34964ec88d179d..1eae24a9c18b4a 100644 --- a/Documentation/core-api/maple_tree.rst +++ b/Documentation/core-api/maple_tree.rst @@ -17,7 +17,8 @@ supports iterating over a range of entries and going to the previous or next entry in a cache-efficient manner. The tree can also be put into an RCU-safe mode of operation which allows reading and writing concurrently. Writers must synchronize on a lock, which can be the default spinlock, or the user can set -the lock to an external lock of a different type. +the lock to an external lock of a different type. Note that external locks may +interfere with allocations in a low memory situation. The Maple Tree maintains a small memory footprint and was designed to use modern processor cache efficiently. The majority of the users will be able to @@ -42,6 +43,15 @@ successful store operation within a given code segment when allocating cannot be done. Allocations of nodes are relatively small at around 256 bytes. +Since the maple tree uses internal nodes that are allocated and has rules on +data density, erasing an entry may cause allocations to occur. That is, +erasing an entry may consume memory. Users must take care to ensure that they +do not violate the larger system constraints on when and how memory is +allocated. Most situations are fine to allocate, but the pre-allocation +support is provided as a mechanism to avoid trickier situations. There is also +the possibility of using special entries and clean up the tree later, in +extreme circumstances. + .. _maple-tree-normal-api: Normal API @@ -63,7 +73,8 @@ success or an error code otherwise. mtree_store_range() works in the same way but takes a range. mtree_load() is used to retrieve the entry stored at a given index. You can use mtree_erase() to erase an entire range by only knowing one value within that range, or mtree_store() call with an entry of -NULL may be used to partially erase a range or many ranges at once. +NULL may be used to partially erase a range or many ranges at once. Note that +mtree_erase() may use GFP_KERNEL on allocations. If you want to only store a new entry to a range (or index) if that range is currently ``NULL``, you can use mtree_insert_range() or mtree_insert() which @@ -163,7 +174,9 @@ You can use mas_erase() to erase an entire range by setting index and last of the maple state to the desired range to erase. This will erase the first range that is found in that range, set the maple state index and last as the range that was erased and return the entry that existed -at that location. +at that location. Note that mas_erase() may allocate with the GFP_KERNEL flag. +If this is not okay, consider using mas_store_gfp() and pass it a ``NULL``, +after setting up the correct range by walking to the entry. You can walk each entry within a range by using mas_for_each(). If you want to walk each element of the tree then ``0`` and ``ULONG_MAX`` may be used as From 4265e15523d3bb877b4bd70100b91c7dcfb90fb1 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:40 -0400 Subject: [PATCH 206/250] maple_tree: change two GFP flags in tests The GFP flags in two tests are obviously incorrect. Make the tests correctly run by updating the GFP flags. Link: https://lore.kernel.org/all/d9cbb89faa5bdb71d451781d214a51ce8923a83e.camel@perches.com/ Link: https://lore.kernel.org/20260630190843.3563858-17-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Reported-by: Joe Perches Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- tools/testing/radix-tree/maple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 0607913a3022d5..d967e76a3c0650 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35234,7 +35234,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) mt_set_non_kernel(1); /* Spanning store */ mas_set_range(&mas, 1, 100); - MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL & GFP_NOWAIT) == 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_NOWAIT) == 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated != 0); @@ -35257,7 +35257,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != 0); mas_set_range(&mas, 0, 200); mt_set_non_kernel(1); - MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL & GFP_NOWAIT) == 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_NOWAIT) == 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated != 0); From 546565c1003c20841a6e05a4e5d4edd5dd67c0f5 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:41 -0400 Subject: [PATCH 207/250] maple_tree: fix argument name in header The mas_prev_range() function takes a min and not a max. Link: https://lore.kernel.org/20260630190843.3563858-18-liam@infradead.org Fixes: 6b9e93e01020 ("maple_tree: add mas_prev_range() and mas_find_range_rev interface") Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 14ca9ac775d995..b723384b3bf49e 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -575,7 +575,7 @@ void maple_tree_init(void); void mas_destroy(struct ma_state *mas); void *mas_prev(struct ma_state *mas, unsigned long min); -void *mas_prev_range(struct ma_state *mas, unsigned long max); +void *mas_prev_range(struct ma_state *mas, unsigned long min); void *mas_next(struct ma_state *mas, unsigned long max); void *mas_next_range(struct ma_state *mas, unsigned long max); From 699055cd0b1158766e015a245b5799704092cadc Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:42 -0400 Subject: [PATCH 208/250] maple_tree: avoid extra gap calculation Prior to ending the ascension loop of larger operations like split, rebalance, and spanning store the gap in the node had been calculated. Once the node is inserted into the tree, the gap is recalculated in mas_update_gap(). This can be avoided by creating a helper for mas_update_gap() that accepts the known gap value, which reduces the operations required for gap updating path. Link: https://lore.kernel.org/20260630190843.3563858-19-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 054de396c873bb..ccda926a67e30e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1566,14 +1566,26 @@ static inline void mas_parent_gap(struct ma_state *mas, unsigned char offset, goto ascend; } +static __always_inline void mas_update_gap_known(struct ma_state *mas, + unsigned long gap) +{ + unsigned char pslot; + unsigned long p_gap; + + pslot = mte_parent_slot(mas->node); + p_gap = ma_gaps(mte_parent(mas->node), + mas_parent_type(mas, mas->node))[pslot]; + + if (p_gap != gap) + mas_parent_gap(mas, pslot, gap); +} + /* * mas_update_gap() - Update a nodes gaps and propagate up if necessary. * @mas: the maple state. */ static inline void mas_update_gap(struct ma_state *mas) { - unsigned char pslot; - unsigned long p_gap; unsigned long max_gap; if (!mt_is_alloc(mas->tree)) @@ -1583,13 +1595,7 @@ static inline void mas_update_gap(struct ma_state *mas) return; max_gap = mas_max_gap(mas); - - pslot = mte_parent_slot(mas->node); - p_gap = ma_gaps(mte_parent(mas->node), - mas_parent_type(mas, mas->node))[pslot]; - - if (p_gap != max_gap) - mas_parent_gap(mas, pslot, max_gap); + mas_update_gap_known(mas, max_gap); } /* @@ -2137,8 +2143,8 @@ static inline void mas_wmb_replace(struct ma_state *mas, struct maple_copy *cp) mas->node = mt_slot_locked(mas->tree, cp->slot, 0); /* Insert the new data in the tree */ mas_topiary_replace(mas, old_enode, cp->height); - if (!mte_is_leaf(mas->node)) - mas_update_gap(mas); + if (mt_is_alloc(mas->tree) && !mte_is_root(mas->node)) + mas_update_gap_known(mas, cp->gap[0]); mtree_range_walk(mas); } From f95cb159e39f1ac8ea660b1a1730e6b9e960c7b0 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett (Oracle)" Date: Tue, 30 Jun 2026 15:08:43 -0400 Subject: [PATCH 209/250] maple_tree: add helper mas_make_walkable() A check in mas_walk() was incorrect and caused inefficient use of the maple state. The same issue existed in mas_erase(), but was left unfixed. Making a helper function is the obvious answer. Link: https://lore.kernel.org/20260630190843.3563858-20-liam@infradead.org Signed-off-by: Liam R. Howlett (Oracle) Cc: Boqun Feng Cc: Chris Mason Cc: Chuck Lever Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joe Perches Cc: Peter Zijlstra Cc: Rik van Riel Cc: Waiman Long Cc: Will Deacon Signed-off-by: Andrew Morton --- lib/maple_tree.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ccda926a67e30e..5ee1175af26eed 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -261,6 +261,12 @@ static inline bool mas_is_underflow(struct ma_state *mas) return mas->status == ma_underflow; } +static inline void mas_make_walkable(struct ma_state *mas) +{ + if (!mas_is_active(mas) && !mas_is_start(mas)) + mas->status = ma_start; +} + static __always_inline struct maple_node *mte_to_node( const struct maple_enode *entry) { @@ -4447,8 +4453,7 @@ void *mas_walk(struct ma_state *mas) void *entry; mas_may_init_lock_check(mas); - if (!mas_is_active(mas) && !mas_is_start(mas)) - mas->status = ma_start; + mas_make_walkable(mas); retry: entry = mas_state_walk(mas); if (mas_is_start(mas)) { @@ -5684,9 +5689,7 @@ void *mas_erase(struct ma_state *mas) if (mt_external_lock(mas->tree)) might_alloc(GFP_KERNEL); - if (!mas_is_active(mas) || !mas_is_start(mas)) - mas->status = ma_start; - + mas_make_walkable(mas); write_retry: entry = mas_state_walk(mas); if (!entry) From 5d8c34e78463ed3907d23d466c3509df167c86fc Mon Sep 17 00:00:00 2001 From: Vivian Wang Date: Mon, 29 Jun 2026 17:25:45 +0800 Subject: [PATCH 210/250] riscv: mm: fix concurrency in mark_new_valid_map() Turns out, the concurrency concerns [1] were justified - BOSC reported a spurious fault in KFENCE that still triggers despite previous fixes, which KFENCE reports as a false-positive. Fix the concurrency problems in mark_new_valid_map(): - Add smp_wmb() before filling the bitmap, to make sure page table writes are "received". - Use WRITE_ONCE() to fill the bitmap. This fixes the KFENCE false positives in internal testing. Also update comments in the assembly exception handler code to match. Link: https://lore.kernel.org/20260629-riscv-mm-new-valid-map-ordering-v1-1-60d8c10c6292@iscas.ac.cn Fixes: 26c171fc4853 ("riscv: mm: Use the bitmap API for new_valid_map_cpus") Signed-off-by: Vivian Wang Reported-by: Yaxing Guo Suggested-by: David Hildenbrand (Arm) Link: https://lore.kernel.org/linux-riscv/da19ffcf-8042-4f96-9c2d-649468dc6a0a@kernel.org/ # [1] Cc: Alexandre Ghiti Cc: David Hildenbrand Cc: Palmer Dabbelt Cc: Albert Ou Cc: Pasha Tatashin Cc: Paul Walmsley Cc: tongtiangen Cc: Yunhui Cui Signed-off-by: Andrew Morton --- arch/riscv/include/asm/cacheflush.h | 15 ++++++++++++++- arch/riscv/kernel/entry.S | 11 ++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h index c2b0a2928f0674..c6297a1d26459c 100644 --- a/arch/riscv/include/asm/cacheflush.h +++ b/arch/riscv/include/asm/cacheflush.h @@ -6,7 +6,9 @@ #ifndef _ASM_RISCV_CACHEFLUSH_H #define _ASM_RISCV_CACHEFLUSH_H +#include #include +#include static inline void local_flush_icache_all(void) { @@ -46,12 +48,23 @@ extern DECLARE_BITMAP(new_valid_map_cpus, NR_CPUS); extern char _end[]; static inline void mark_new_valid_map(void) { + /* + * Orders any previous page table writes before setting bits in + * new_valid_map_cpus. Pairs with the sfence.vma in + * new_valid_map_cpus_check. + */ + smp_wmb(); + /* * We don't care if concurrently a cpu resets this value since * the only place this can happen is in handle_exception() where * an sfence.vma is emitted. + * + * Not memset() or bitmap_fill() to avoid any possible compiler + * shenanigans. */ - bitmap_fill(new_valid_map_cpus, NR_CPUS); + for (size_t i = 0; i < ARRAY_SIZE(new_valid_map_cpus); i++) + WRITE_ONCE(new_valid_map_cpus[i], -1UL); } #define flush_cache_vmap flush_cache_vmap static inline void flush_cache_vmap(unsigned long start, unsigned long end) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index d799c4e56f8049..4bb78dff1f3888 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -76,6 +76,8 @@ amoxor.d a0, a1, (a0) /* + * Pairs with the smp_wmb() in mark_new_valid_map() + * * A sfence.vma is required here. Even if we had Svvptc, there's no * guarantee that after returning we wouldn't just fault again. */ @@ -141,13 +143,8 @@ SYM_CODE_START(handle_exception) /* * The RISC-V kernel does not flush TLBs on all CPUS after each new * vmalloc mapping or kfence_unprotect(), which may result in - * exceptions: - * - * - if the uarch caches invalid entries, the new mapping would not be - * observed by the page table walker and an invalidation is needed. - * - if the uarch does not cache invalid entries, a reordered access - * could "miss" the new mapping and traps: in that case, we only need - * to retry the access, no sfence.vma is required. + * exceptions. In that case, we need to sfence.vma to "receive" the new + * mappings and retry, whether or not we have Svvptc. */ new_valid_map_cpus_check #endif From 4006e73c2600eff0e9b02029128b3ddac9c8b834 Mon Sep 17 00:00:00 2001 From: Yunhui Cui Date: Sat, 23 May 2026 12:20:52 +0800 Subject: [PATCH 211/250] riscv: mm: exclude invalid THP PMDs from page table check RISC-V THP splitting uses a temporary invalid PMD state where pmd_mkinvalid() clears _PAGE_PRESENT and _PAGE_PROT_NONE but leaves _PAGE_LEAF set so the MM code can still recognize the PMD as a THP split in-progress entry. That temporary state no longer describes a user-accessible mapping, but page_table_check currently treats it as one because the RISC-V PMD user-accessibility test only checks whether the PMD is a leaf and has user permissions. As a result, when a PMD-sized anonymous THP is split during a COW fault, page_table_check can account the invalid intermediate PMD as a live PMD mapping, and then account the replacement PTE mappings again when the split installs the PTE table. This leaves stale PMD accounting behind and later triggers page_table_check failures such as a non-zero anon_map_count when the folio is freed. Fix this by tightening pmd_user_accessible_page() so PMD page-table-check accounting only considers leaf PMDs that still carry either _PAGE_PRESENT or _PAGE_PROT_NONE. This preserves the THP split semantics required by the MM code while preventing page_table_check from treating invalid split PMDs as live user mappings. With CONFIG_PAGE_TABLE_CHECK=y and CONFIG_PAGE_TABLE_CHECK_ENFORCED=y, tools/testing/selftests/mm/cow completes successfully on RISC-V after this change. Link: https://lore.kernel.org/20260523042052.35476-1-cuiyunhui@bytedance.com Fixes: 3fee229a8eb9 ("riscv/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Yunhui Cui Cc: Albert Ou Cc: Palmer Dabbelt Cc: Pasha Tatashin Cc: Paul Walmsley Cc: tongtiangen Cc: Alexandre Ghiti Cc: David Hildenbrand (Arm) Cc: Vivian Wang Cc: Yaxing Guo Cc: Signed-off-by: Andrew Morton --- arch/riscv/include/asm/pgtable.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 7f21742b2b6a0c..1225cf05696a2f 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -983,7 +983,14 @@ static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd) { - return pmd_leaf(pmd) && pmd_user(pmd); + /* + * page_table_check() must ignore THP split invalidation entries created by + * pmd_mkinvalid(). These retain _PAGE_LEAF so pmd_present()/pmd_leaf() stay + * true during the split, but they no longer describe a user-accessible + * mapping once both _PAGE_PRESENT and _PAGE_PROT_NONE are cleared. + */ + return (pmd_val(pmd) & (_PAGE_PRESENT | _PAGE_PROT_NONE)) && + (pmd_val(pmd) & _PAGE_LEAF) && pmd_user(pmd); } static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud) From 762b014d37bebe2370383ffaa069d197574930f7 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:37 +0300 Subject: [PATCH 212/250] sh: remove CONFIG_NUMA and related configuration options Patch series "sh: remove NUMA and SPARSEMEM support", v2. NUMA support for SuperH was introduced a long time ago by commit b241cb0c885e ("sh: Support for multiple nodes.") "... for boards with many different memory blocks that are otherwise unused (SH7722/SH7785 URAM and so forth)" In reality, this added 128K of memory on sh7722 and sh7785 and 256K on shx3 at the expense of all the NUMA related code in the kernel. For build of v7.0-rc7 with defconfig and the same configuration with CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only overhead in code and static data that does not take into the account data structures allocated at run time. And all this overhead has been there for nothing for almost 8 years because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM") those additional "nodes" could not be used by the core MM because the maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory. This patch (of 10): NUMA support for SuperH was introduced a long time ago by commit b241cb0c885e ("sh: Support for multiple nodes.") "... for boards with many different memory blocks that are otherwise unused (SH7722/SH7785 URAM and so forth)" In reality, this added 128K of memory on sh7722 and sh7785 and 256K on shx3 at the expense of all the NUMA related code in the kernel. For build of v7.0-rc7 with defconfig and the same configuration with CONFIG_NUMA disabled, bloat-o-meter reports difference of ~76k. Disabling CONFIG_SPARSMEM on top increases the difference to ~94k. And that's only overhead in code and static data that does not take into the account data structures allocated at run time. And all this overhead has been there for nothing for almost 8 years because since commit ac21fc2dcb40 ("sh: switch to NO_BOOTMEM") those additional "nodes" could not be used by the core MM because the maximal pfn for ZONE_NORMAL was cut out at the end of the normal memory. Start removing NUMA support on sh with removing CONFIG_NUMA and related configuration options in arch/sh/Kconfig and arch/sh/mm/Kconfig. Link: https://lore.kernel.org/20260510135546.13554-1-rppt@kernel.org Link: https://lore.kernel.org/20260510135546.13554-2-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/Kconfig | 6 ------ arch/sh/configs/migor_defconfig | 1 - arch/sh/configs/sdk7786_defconfig | 1 - arch/sh/configs/se7722_defconfig | 1 - arch/sh/configs/shx3_defconfig | 1 - arch/sh/configs/ul2_defconfig | 1 - arch/sh/mm/Kconfig | 19 ------------------- 7 files changed, 30 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index d5795067befaa4..d0ba91eba71a3e 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -106,9 +106,6 @@ config SYS_SUPPORTS_APM_EMULATION config SYS_SUPPORTS_SMP bool -config SYS_SUPPORTS_NUMA - bool - config STACKTRACE_SUPPORT def_bool y @@ -197,7 +194,6 @@ config CPU_SHX3 bool select DMA_COHERENT select SYS_SUPPORTS_SMP - select SYS_SUPPORTS_NUMA config ARCH_SHMOBILE bool @@ -443,7 +439,6 @@ config CPU_SUBTYPE_SH7785 select CPU_SH4A select CPU_SHX2 select ARCH_SPARSEMEM_ENABLE - select SYS_SUPPORTS_NUMA select PINCTRL config CPU_SUBTYPE_SH7786 @@ -478,7 +473,6 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE - select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT select PINCTRL diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig index 1d9d543eef4c06..db993616f14e26 100644 --- a/arch/sh/configs/migor_defconfig +++ b/arch/sh/configs/migor_defconfig @@ -9,7 +9,6 @@ CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set CONFIG_CPU_SUBTYPE_SH7722=y CONFIG_MEMORY_START=0x0c000000 -CONFIG_NUMA=y # CONFIG_MIGRATION is not set CONFIG_SH_MIGOR=y # CONFIG_SH_TIMER_CMT is not set diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig index d6fa3a422e24d5..36e6dd0622f73f 100644 --- a/arch/sh/configs/sdk7786_defconfig +++ b/arch/sh/configs/sdk7786_defconfig @@ -41,7 +41,6 @@ CONFIG_CPU_SUBTYPE_SH7786=y CONFIG_MEMORY_START=0x40000000 CONFIG_MEMORY_SIZE=0x20000000 CONFIG_PMB=y -CONFIG_NUMA=y CONFIG_HUGETLB_PAGE_SIZE_64MB=y CONFIG_KSM=y CONFIG_SH_STORE_QUEUES=y diff --git a/arch/sh/configs/se7722_defconfig b/arch/sh/configs/se7722_defconfig index 85b8eb013b79fe..2908611b118e19 100644 --- a/arch/sh/configs/se7722_defconfig +++ b/arch/sh/configs/se7722_defconfig @@ -10,7 +10,6 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_CPU_SUBTYPE_SH7722=y CONFIG_MEMORY_START=0x0c000000 -CONFIG_NUMA=y CONFIG_SH_STORE_QUEUES=y CONFIG_SH_7722_SOLUTION_ENGINE=y # CONFIG_SH_TIMER_CMT is not set diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig index 0cb69a0b92cbc9..22c242cf89f79d 100644 --- a/arch/sh/configs/shx3_defconfig +++ b/arch/sh/configs/shx3_defconfig @@ -29,7 +29,6 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_CPU_SUBTYPE_SHX3=y CONFIG_MEMORY_START=0x0c000000 -CONFIG_NUMA=y CONFIG_PAGE_SIZE_64KB=y CONFIG_SH_STORE_QUEUES=y CONFIG_SH_X3PROTO=y diff --git a/arch/sh/configs/ul2_defconfig b/arch/sh/configs/ul2_defconfig index 00a37944b043c1..1740a646528021 100644 --- a/arch/sh/configs/ul2_defconfig +++ b/arch/sh/configs/ul2_defconfig @@ -10,7 +10,6 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_CPU_SUBTYPE_SH7366=y CONFIG_MEMORY_SIZE=0x01f00000 -CONFIG_NUMA=y # CONFIG_MIGRATION is not set # CONFIG_SH_DSP is not set # CONFIG_SH_TIMER_CMT is not set diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 1862411665ab8e..71fecbbb080e4f 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig @@ -112,27 +112,8 @@ config VSYSCALL For systems with an MMU that can afford to give up a page, (the default value) say Y. -config NUMA - bool "Non-Uniform Memory Access (NUMA) Support" - depends on MMU && SYS_SUPPORTS_NUMA - select ARCH_WANT_NUMA_VARIABLE_LOCALITY - default n - help - Some SH systems have many various memories scattered around - the address space, each with varying latencies. This enables - support for these blocks by binding them to nodes and allowing - memory policies to be used for prioritizing and controlling - allocation behaviour. - -config NODES_SHIFT - int - default "3" if CPU_SUBTYPE_SHX3 - default "1" - depends on NUMA - config ARCH_FLATMEM_ENABLE def_bool y - depends on !NUMA config ARCH_SPARSEMEM_ENABLE def_bool y From add0601d2c441ab9d7b1e59daad1cf4f9a1c1f99 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:38 +0300 Subject: [PATCH 213/250] sh: mm: remove numa.c Since CONFIG_NUMA is removed, numa.c won't be ever compiled. Remove it. Link: https://lore.kernel.org/20260510135546.13554-3-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/mm/Makefile | 1 - arch/sh/mm/numa.c | 53 --------------------------------------------- 2 files changed, 54 deletions(-) delete mode 100644 arch/sh/mm/numa.c diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index f69ddc70b14658..7033947955d60f 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile @@ -37,7 +37,6 @@ endif obj-$(CONFIG_DEBUG_FS) += $(debugfs-y) obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_PMB) += pmb.o -obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_IOREMAP_FIXED) += ioremap_fixed.o obj-$(CONFIG_UNCACHED_MAPPING) += uncached.o obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c deleted file mode 100644 index 9bc212b5e762a9..00000000000000 --- a/arch/sh/mm/numa.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * arch/sh/mm/numa.c - Multiple node support for SH machines - * - * Copyright (C) 2007 Paul Mundt - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ -#include -#include -#include -#include -#include -#include - -/* - * On SH machines the conventional approach is to stash system RAM - * in node 0, and other memory blocks in to node 1 and up, ordered by - * latency. Each node's pgdat is node-local at the beginning of the node, - * immediately followed by the node mem map. - */ -void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) -{ - unsigned long start_pfn, end_pfn; - - /* Don't allow bogus node assignment */ - BUG_ON(nid >= MAX_NUMNODES || nid <= 0); - - start_pfn = PFN_DOWN(start); - end_pfn = PFN_DOWN(end); - - pmb_bolt_mapping((unsigned long)__va(start), start, end - start, - PAGE_KERNEL); - - memblock_add(start, end - start); - - __add_active_range(nid, start_pfn, end_pfn); - - /* Node-local pgdat */ - NODE_DATA(nid) = memblock_alloc_node(sizeof(struct pglist_data), - SMP_CACHE_BYTES, nid); - if (!NODE_DATA(nid)) - panic("%s: Failed to allocate %zu bytes align=0x%x nid=%d\n", - __func__, sizeof(struct pglist_data), SMP_CACHE_BYTES, - nid); - - NODE_DATA(nid)->node_start_pfn = start_pfn; - NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn; - - /* It's up */ - node_set_online(nid); -} From f841197d1c13450ee8404fbef755e847581d7256 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:39 +0300 Subject: [PATCH 214/250] sh: mm: drop allocate_pgdat() allocate_pgdat() function used to allocate the node data structure and initialize its node_start_pfn and node_spanned_pages fields. Without CONFIG_NUMA there is no need to allocate the node data and setting node_start_pfn and node_spanned_pages are redundant because they are anyway overwritten later by core MM. Remove allocate_pgdat() function. Link: https://lore.kernel.org/20260510135546.13554-4-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/mm/init.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 110308bdef01d0..fb728906a83f13 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -199,20 +199,6 @@ void __init page_table_range_init(unsigned long start, unsigned long end, } #endif /* CONFIG_MMU */ -void __init allocate_pgdat(unsigned int nid) -{ - unsigned long start_pfn, end_pfn; - - get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); - -#ifdef CONFIG_NUMA - alloc_node_data(nid); -#endif - - NODE_DATA(nid)->node_start_pfn = start_pfn; - NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn; -} - static void __init do_init_bootmem(void) { unsigned long start_pfn, end_pfn; @@ -222,8 +208,6 @@ static void __init do_init_bootmem(void) for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) __add_active_range(0, start_pfn, end_pfn); - /* All of system RAM sits in node 0 for the non-NUMA case */ - allocate_pgdat(0); node_set_online(0); plat_mem_setup(); From 2e0b6b6ac9445e3af6a43c148cf8d13f39e86afa Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:40 +0300 Subject: [PATCH 215/250] sh: remove setup_bootmem_node() and plat_mem_setup() setup_bootmem_node() and plat_mem_setup() were needed to setup NUMA "nodes" for URAM memory ranges. Since there is no NUMA support anymore, these functions are not needed. Remove them. Link: https://lore.kernel.org/20260510135546.13554-5-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 5 ----- arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 6 ------ arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 4 ---- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 6 ------ arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 4 ---- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 17 ----------------- arch/sh/mm/init.c | 7 ------- 7 files changed, 49 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index 6676beef053e59..0a4ceb9785f628 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c @@ -381,8 +381,3 @@ void __init plat_irq_setup(void) { register_intc_controller(&intc_desc); } - -void __init plat_mem_setup(void) -{ - /* TODO: Register Node 1 */ -} diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 0c6757ef63f42c..2180819a1455bc 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c @@ -658,9 +658,3 @@ void __init plat_irq_setup(void) { register_intc_controller(&intc_desc); } - -void __init plat_mem_setup(void) -{ - /* Register the URAM space as Node 1 */ - setup_bootmem_node(1, 0x055f0000, 0x05610000); -} diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index 2ad19a0c5e04ef..1f4396da00e5ca 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c @@ -1239,7 +1239,3 @@ void __init plat_irq_setup_pins(int mode) BUG(); } } - -void __init plat_mem_setup(void) -{ -} diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 3b4a414d60a91c..95c3cc15a44360 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c @@ -600,9 +600,3 @@ void __init plat_irq_setup_pins(int mode) BUG(); } } - -void __init plat_mem_setup(void) -{ - /* Register the URAM space as Node 1 */ - setup_bootmem_node(1, 0xe55f0000, 0xe5610000); -} diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index c048842d8a5898..a46d6c3241a91f 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c @@ -783,10 +783,6 @@ void __init plat_irq_setup_pins(int mode) } } -void __init plat_mem_setup(void) -{ -} - static int __init sh7786_devices_setup(void) { int ret, irq; diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index 7014d6d199b3e6..3197ec2a65cd25 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c @@ -377,20 +377,3 @@ void __init plat_irq_setup(void) { register_intc_controller(&intc_desc); } - -void __init plat_mem_setup(void) -{ - unsigned int nid = 1; - - /* Register CPU#0 URAM space as Node 1 */ - setup_bootmem_node(nid++, 0x145f0000, 0x14610000); /* CPU0 */ - -#if 0 - /* XXX: Not yet.. */ - setup_bootmem_node(nid++, 0x14df0000, 0x14e10000); /* CPU1 */ - setup_bootmem_node(nid++, 0x155f0000, 0x15610000); /* CPU2 */ - setup_bootmem_node(nid++, 0x15df0000, 0x15e10000); /* CPU3 */ -#endif - - setup_bootmem_node(nid++, 0x16000000, 0x16020000); /* CSM */ -} diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index fb728906a83f13..1efc3104a9df55 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -38,11 +38,6 @@ void __init generic_mem_init(void) memblock_add(__MEMORY_START, __MEMORY_SIZE); } -void __init __weak plat_mem_setup(void) -{ - /* Nothing to see here, move along. */ -} - #ifdef CONFIG_MMU static pte_t *__get_pte_phys(unsigned long addr) { @@ -209,8 +204,6 @@ static void __init do_init_bootmem(void) __add_active_range(0, start_pfn, end_pfn); node_set_online(0); - - plat_mem_setup(); } static void __init early_reserve_mem(void) From 4bdc092b2330a282a4e739a3337e9710a8dbce38 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:41 +0300 Subject: [PATCH 216/250] sh: drop dead code guarded by #ifdef CONFIG_NUMA and NUMA-related comments. Link: https://lore.kernel.org/20260510135546.13554-6-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/include/asm/topology.h | 13 ------------- arch/sh/kernel/setup.c | 1 - arch/sh/kernel/topology.c | 12 ------------ arch/sh/kernel/vmcore_info.c | 4 ---- arch/sh/mm/sram.c | 3 +-- 5 files changed, 1 insertion(+), 32 deletions(-) diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h index 1db470e024565b..a3c31754ba5fc1 100644 --- a/arch/sh/include/asm/topology.h +++ b/arch/sh/include/asm/topology.h @@ -2,19 +2,6 @@ #ifndef _ASM_SH_TOPOLOGY_H #define _ASM_SH_TOPOLOGY_H -#ifdef CONFIG_NUMA - -#define cpu_to_node(cpu) ((void)(cpu),0) - -#define cpumask_of_node(node) ((void)node, cpu_online_mask) - -#define pcibus_to_node(bus) ((void)(bus), -1) -#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ - cpu_all_mask : \ - cpumask_of_node(pcibus_to_node(bus))) - -#endif - #define mc_capable() (1) const struct cpumask *cpu_coregroup_mask(int cpu); diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 039a51291002bc..5e25c1db4d61d9 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -227,7 +227,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn, /* * Also make sure that there is a PMB mapping that covers this * range before we attempt to activate it, to avoid reset by MMU. - * We can hit this path with NUMA or memory hot-add. */ pmb_bolt_mapping((unsigned long)__va(start), start, end - start, PAGE_KERNEL); diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c index 2d2a7509b565ac..906b7b1d544325 100644 --- a/arch/sh/kernel/topology.c +++ b/arch/sh/kernel/topology.c @@ -57,18 +57,6 @@ static int __init topology_init(void) __func__, i, ret); } -#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP) - /* - * In the UP case, make sure the CPU association is still - * registered under each node. Without this, sysfs fails - * to make the connection between nodes other than node0 - * and cpu0. - */ - for_each_online_node(i) - if (i != numa_node_id()) - register_cpu_under_node(raw_smp_processor_id(), i); -#endif - return 0; } subsys_initcall(topology_init); diff --git a/arch/sh/kernel/vmcore_info.c b/arch/sh/kernel/vmcore_info.c index a244a204a1b127..9f029b4a7e63bd 100644 --- a/arch/sh/kernel/vmcore_info.c +++ b/arch/sh/kernel/vmcore_info.c @@ -5,10 +5,6 @@ void arch_crash_save_vmcoreinfo(void) { -#ifdef CONFIG_NUMA - VMCOREINFO_SYMBOL(node_data); - VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); -#endif #ifdef CONFIG_X2TLB VMCOREINFO_CONFIG(X2TLB); #endif diff --git a/arch/sh/mm/sram.c b/arch/sh/mm/sram.c index 2d8fa718d55e74..208080f072df15 100644 --- a/arch/sh/mm/sram.c +++ b/arch/sh/mm/sram.c @@ -16,8 +16,7 @@ * This provides a standard SRAM pool for tiny memories that can be * added either by the CPU or the platform code. Typical SRAM sizes * to be inserted in to the pool will generally be less than the page - * size, with anything more reasonably sized handled as a NUMA memory - * node. + * size. */ struct gen_pool *sram_pool; From 1b36861518c63e0ac7aada983bd541d5b9a92128 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:42 +0300 Subject: [PATCH 217/250] sh: drop include/asm/mmzone.h include/asm/mmzone.h was required for declarations of NUMA related functionality. The only function declared there that's not related to NUMA is __add_active_range(). Move __add_active_range() declaration to include/asm/setup.h and drop include/asm/mmzone.h Link: https://lore.kernel.org/20260510135546.13554-7-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/include/asm/mmzone.h | 42 -------------------------- arch/sh/include/asm/setup.h | 3 ++ arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 1 - arch/sh/kernel/cpu/sh4a/setup-shx3.c | 1 - arch/sh/kernel/setup.c | 2 -- arch/sh/mm/init.c | 1 - 11 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 arch/sh/include/asm/mmzone.h diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h deleted file mode 100644 index 63f88b465e3945..00000000000000 --- a/arch/sh/include/asm/mmzone.h +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_SH_MMZONE_H -#define __ASM_SH_MMZONE_H - -#ifdef CONFIG_NUMA -#include - -static inline int pfn_to_nid(unsigned long pfn) -{ - int nid; - - for (nid = 0; nid < MAX_NUMNODES; nid++) - if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid)) - break; - - return nid; -} - -static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn) -{ - return NODE_DATA(pfn_to_nid(pfn)); -} - -/* arch/sh/mm/numa.c */ -void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end); -#else -static inline void -setup_bootmem_node(int nid, unsigned long start, unsigned long end) -{ -} -#endif /* CONFIG_NUMA */ - -/* Platform specific mem init */ -void __init plat_mem_setup(void); - -/* arch/sh/kernel/setup.c */ -void __init __add_active_range(unsigned int nid, unsigned long start_pfn, - unsigned long end_pfn); -/* arch/sh/mm/init.c */ -void __init allocate_pgdat(unsigned int nid); - -#endif /* __ASM_SH_MMZONE_H */ diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h index 8488f76b48b405..6762612f456c2d 100644 --- a/arch/sh/include/asm/setup.h +++ b/arch/sh/include/asm/setup.h @@ -24,4 +24,7 @@ void check_for_initrd(void); void per_cpu_trap_init(void); void sh_fdt_init(phys_addr_t dt_phys); +void __add_active_range(unsigned int nid, unsigned long start_pfn, + unsigned long end_pfn); + #endif /* _SH_SETUP_H */ diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 2180819a1455bc..5e2c24c518b473 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index d64d28c4f0595d..5c24ff407c89ad 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index ef4b26a4b3d642..9441e4a0f4023b 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index 1f4396da00e5ca..3750b598d6bdf7 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c @@ -21,7 +21,6 @@ #include #include -#include #include static struct plat_sci_port scif2_platform_data = { diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 95c3cc15a44360..13f08c44fb02b6 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index a46d6c3241a91f..79484c598b8391 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c @@ -22,7 +22,6 @@ #include #include #include -#include #include static struct plat_sci_port scif0_platform_data = { diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index 3197ec2a65cd25..93cdd1ee888d43 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c @@ -13,7 +13,6 @@ #include #include #include -#include #include /* diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 5e25c1db4d61d9..2f276406100322 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 1efc3104a9df55..b337e6a259eded 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include From 0f72758487cb0daa2b86687297e9e1aacfdc369d Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:43 +0300 Subject: [PATCH 218/250] init/Kconfig: drop ARCH_WANT_NUMA_VARIABLE_LOCALITY sh was the only architecture that selected ARCH_WANT_NUMA_VARIABLE_LOCALITY. With NUMA support on sh gone, there is no need in this configuration option. Remove it. Link: https://lore.kernel.org/20260510135546.13554-8-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- init/Kconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index 13cb6fdd9c372d..5fa7a7aa894b23 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1011,17 +1011,10 @@ config CC_STRINGOP_OVERFLOW config ARCH_SUPPORTS_INT128 bool -# For architectures that (ab)use NUMA to represent different memory regions -# all cpu-local but of different latencies, such as SuperH. -# -config ARCH_WANT_NUMA_VARIABLE_LOCALITY - bool - config NUMA_BALANCING bool "Memory placement aware NUMA scheduler" depends on ARCH_SUPPORTS_NUMA_BALANCING depends on ARCH_HAS_PTE_PROTNONE - depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY depends on SMP && NUMA_MIGRATION && !PREEMPT_RT help This option adds support for automatic NUMA aware memory/task placement. From 34c1873be0e3da0da9cdc022b14d02f6012a2f1e Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:44 +0300 Subject: [PATCH 219/250] sh: init: remove call the memblock_set_node() Without CONFIG_NUMA, the call to memblock_set_node() is not needed. Remove it. Link: https://lore.kernel.org/20260510135546.13554-9-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/kernel/setup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 2f276406100322..43d0f7b62b03b4 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -228,9 +228,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn, */ pmb_bolt_mapping((unsigned long)__va(start), start, end - start, PAGE_KERNEL); - - memblock_set_node(PFN_PHYS(start_pfn), PFN_PHYS(end_pfn - start_pfn), - &memblock.memory, nid); } void __init __weak plat_early_device_setup(void) From 2b9941588e882a63e5dcf7d05f604cdf2d389349 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:45 +0300 Subject: [PATCH 220/250] sh: remove SPARSEMEM related entries from Kconfig Without NUMA support, SPARSEMEM related configuration options only create unnecessary overhead. Remove them. Link: https://lore.kernel.org/20260510135546.13554-10-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/Kconfig | 6 ------ arch/sh/mm/Kconfig | 10 ---------- 2 files changed, 16 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index d0ba91eba71a3e..ec50072a6f22eb 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -386,7 +386,6 @@ config CPU_SUBTYPE_SH7723 select CPU_SH4A select CPU_SHX2 select ARCH_SHMOBILE - select ARCH_SPARSEMEM_ENABLE select SYS_SUPPORTS_SH_CMT select PINCTRL help @@ -397,7 +396,6 @@ config CPU_SUBTYPE_SH7724 select CPU_SH4A select CPU_SHX2 select ARCH_SHMOBILE - select ARCH_SPARSEMEM_ENABLE select SYS_SUPPORTS_SH_CMT select PINCTRL help @@ -438,7 +436,6 @@ config CPU_SUBTYPE_SH7785 bool "Support SH7785 processor" select CPU_SH4A select CPU_SHX2 - select ARCH_SPARSEMEM_ENABLE select PINCTRL config CPU_SUBTYPE_SH7786 @@ -472,7 +469,6 @@ config CPU_SUBTYPE_SH7722 select CPU_SH4AL_DSP select CPU_SHX2 select ARCH_SHMOBILE - select ARCH_SPARSEMEM_ENABLE select SYS_SUPPORTS_SH_CMT select PINCTRL @@ -481,8 +477,6 @@ config CPU_SUBTYPE_SH7366 select CPU_SH4AL_DSP select CPU_SHX2 select ARCH_SHMOBILE - select ARCH_SPARSEMEM_ENABLE - select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT endchoice diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 71fecbbb080e4f..c7d889a1a9d705 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig @@ -115,16 +115,6 @@ config VSYSCALL config ARCH_FLATMEM_ENABLE def_bool y -config ARCH_SPARSEMEM_ENABLE - def_bool y - select SPARSEMEM_STATIC - -config ARCH_SPARSEMEM_DEFAULT - def_bool y - -config ARCH_SELECT_MEMORY_MODEL - def_bool y - config IOREMAP_FIXED def_bool y depends on X2TLB From ad5235eb5558343cc27eec8e7f483b90072fc369 Mon Sep 17 00:00:00 2001 From: "Mike Rapoport (Microsoft)" Date: Sun, 10 May 2026 16:55:46 +0300 Subject: [PATCH 221/250] sh: drop include/asm/sparsemem.h Move MAX_PHYSMEM_BITS declaration to include/asm/mmu.h and drop now unneeded include/asm/sparsemem.h Link: https://lore.kernel.org/20260510135546.13554-11-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Arnd Bergmann Cc: John Paul Adrian Glaubitz Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- arch/sh/include/asm/mmu.h | 2 ++ arch/sh/include/asm/sparsemem.h | 12 ------------ arch/sh/kernel/setup.c | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 arch/sh/include/asm/sparsemem.h diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h index b9c9f91e66165a..def7c1edd605e4 100644 --- a/arch/sh/include/asm/mmu.h +++ b/arch/sh/include/asm/mmu.h @@ -2,6 +2,8 @@ #ifndef __MMU_H #define __MMU_H +#define MAX_PHYSMEM_BITS 32 + /* * Privileged Space Mapping Buffer (PMB) definitions */ diff --git a/arch/sh/include/asm/sparsemem.h b/arch/sh/include/asm/sparsemem.h deleted file mode 100644 index 4703cbe2384481..00000000000000 --- a/arch/sh/include/asm/sparsemem.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_SH_SPARSEMEM_H -#define __ASM_SH_SPARSEMEM_H - -/* - * SECTION_SIZE_BITS 2^N: how big each section will be - * MAX_PHYSMEM_BITS 2^N: how much physical address space we have - */ -#define SECTION_SIZE_BITS 26 -#define MAX_PHYSMEM_BITS 32 - -#endif /* __ASM_SH_SPARSEMEM_H */ diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 43d0f7b62b03b4..99f52d888aa3de 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -41,7 +41,6 @@ #include #include #include -#include #include /* From b86b0e81e2daf96f16cb2b334950daeadb0eacfa Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 13 Aug 2026 20:12:55 -0700 Subject: [PATCH 222/250] arch_numa: avoid false positive fortify warning in setup_node_to_cpumask_map() When building ARCH=riscv using clang with CONFIG_FORTIFY_SOURCE and CONFIG_UBSAN_BOUNDS enabled, CONFIG_NR_CPUS > 64, and the default value of 2 for CONFIG_NODES_SHIFT, there is a compiletime warning from the fortify routines. In file included from mm/arch_numa.c:11: In file included from include/linux/acpi.h:14: In file included from include/linux/resource_ext.h:11: In file included from include/linux/slab.h:17: In file included from include/linux/gfp.h:7: In file included from include/linux/mmzone.h:8: In file included from include/linux/spinlock.h:60: In file included from include/linux/interrupt_rc.h:17: In file included from include/linux/smp.h:13: In file included from include/linux/cpumask.h:11: In file included from include/linux/bitmap.h:13: In file included from include/linux/string.h:383: include/linux/fortify-string.h:430:4: warning: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribue-warning] 430 | __write_overflow_field(p_size_field, size); | ^ include/linux/fortify-string.h:430:4: note: called by function 'fortify_memset_chk(unsigned long, unsigned long, unsigned long)' include/linux/bitmap.h:248:3: note: inlined by function 'setup_node_to_cpumask_map' 248 | memset(dst, 0, len); | ^ include/linux/fortify-string.h:462:25: note: expanded from macro 'memset' 462 | #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ | ^ include/linux/fortify-string.h:453:2: note: expanded from macro '__fortify_memset_chk' 453 | fortify_memset_chk(__fortify_size, p_size, p_size_field), \ | ^ include/linux/fortify-string.h:430:4: note: use '-gline-directives-only' (implied by '-g1') or higher for more accurate inlining chain locations 430 | __write_overflow_field(p_size_field, size); | ^ 1 warning generated. In this configuration, MAX_NUMNODES is 4. clang unrolls the for loop in setup_node_to_cpumask_map() past this, which triggers the fortify check when accessing node_to_cpumask_map on the theoretical fifth loop iteration because it would be an out of bounds write. Make it clear to clang that nr_node_ids is bounded by MAX_NUMNODES due to the logic in setup_nr_node_ids() by early returning in setup_node_to_cpumask_map() should that condition be violated. Link: https://lore.kernel.org/20260813-arch_numa-avoid-fortify-warning-v2-1-093ad97a78df@kernel.org Signed-off-by: Nathan Chancellor Closes: https://github.com/ClangBuiltLinux/linux/issues/2174 Reviewed-by: Mike Rapoport (Microsoft) Cc: Kees Cook Cc: Bill Wendling Cc: Justin Stitt Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Signed-off-by: Andrew Morton --- mm/arch_numa.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/arch_numa.c b/mm/arch_numa.c index 442ea239bba739..459fa60a562143 100644 --- a/mm/arch_numa.c +++ b/mm/arch_numa.c @@ -105,6 +105,18 @@ static void __init setup_node_to_cpumask_map(void) if (nr_node_ids == MAX_NUMNODES) setup_nr_node_ids(); + /* + * This check should never be true but it makes it clear to compilers + * that node_to_cpumask_map is bound by nr_node_ids, avoiding false + * positive fortify warnings when accessing node_to_cpumask_map in the + * for loop below. + */ + if (unlikely(nr_node_ids > MAX_NUMNODES)) { + pr_err("nr_node_ids (%u) is larger than MAX_NUMNODES (%u)\n", + nr_node_ids, MAX_NUMNODES); + return; + } + /* allocate and clear the mapping */ for (node = 0; node < nr_node_ids; node++) { alloc_bootmem_cpumask_var(&node_to_cpumask_map[node]); From 2e46f21dc0ba09a7210c15df10a3ef8b75295f9a Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Mon, 17 Aug 2026 03:38:35 -0700 Subject: [PATCH 223/250] mm/memcontrol: avoid false sharing between vmstats and events Moving v1 userspace eventfd handling into memcontrol-v1.c shrank struct vmpressure from 112 to 24 bytes when CONFIG_MEMCG_V1 is disabled. This moved memory_events_local[MEMCG_SWAP_FAIL] and the hot vmstats_percpu pointer onto the same cacheline. The stress-ng mremap stressor exercises MADV_PAGEOUT with swap disabled, generating about 20 million MEMCG_SWAP_FAIL updates per 60-second run on a 176-CPU test system. Those writes bounce the line while memcg statistics paths load vmstats_percpu. Move cgwb_list into the existing alignment gap and cacheline-align vmstats_percpu. This separates the pointer from the event counters without increasing the size of struct mem_cgroup in the tested configuration. The blamed commit reduced median mremap throughput by 4.38% on the test system with one socket. The patched kernel brings the performance to within 0.5% of the parent which is within the observed boot-to-boot spread (up to 1.2%). Link: https://lore.kernel.org/20260817103835.2937733-1-usama.arif@linux.dev Fixes: ea928e9e18da ("mm/vmpressure: move v1 userspace eventfd code into memcontrol-v1.c") Signed-off-by: Usama Arif Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202608131743.c6a7dda4-lkp@intel.com Tested-by: kernel test robot Link: http://lore.kernel.org/aoAABX59IzUXz/Rv@ly-workstation Acked-by: Shakeel Butt Acked-by: Michal Hocko Cc: David Hildenbrand Cc: Johannes Weiner Cc: Muchun Song Cc: Roman Gushchin Cc: Yi Lai Signed-off-by: Andrew Morton --- include/linux/memcontrol.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e78bc98ab229b2..215e2e87f42b2e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -268,10 +268,15 @@ struct mem_cgroup { #endif int kmemcg_id; - struct memcg_vmstats_percpu __percpu *vmstats_percpu; - #ifdef CONFIG_CGROUP_WRITEBACK struct list_head cgwb_list; +#endif + + /* Keep the hot per-CPU stats pointer away from memory event counters. */ + struct memcg_vmstats_percpu __percpu *vmstats_percpu + ____cacheline_aligned_in_smp; + +#ifdef CONFIG_CGROUP_WRITEBACK struct wb_domain cgwb_domain; struct memcg_cgwb_frn cgwb_frn[MEMCG_CGWB_FRN_CNT]; #endif From f740dbc289f3fad099c8209fe524a8e5cec98feb Mon Sep 17 00:00:00 2001 From: Hongfu Li Date: Mon, 17 Aug 2026 16:06:16 +0800 Subject: [PATCH 224/250] selftests/mm: drop redundant open() in mprotect_tests() Remove duplicate open() for local pagemap_fd in mprotect_tests() that shadows the global pagemap_fd already opened in main(). The local fd is never used in the function. Link: https://lore.kernel.org/20260817080616.52946-1-hongfu.li@linux.dev Signed-off-by: Hongfu Li Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Muhammad Usama Anjum Reviewed-by: SJ Park Acked-by: David Hildenbrand (Arm) Reviewed-by: Anshuman Khandual Cc: Liam R. Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/pagemap_ioctl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index cfd1987339c132..eadc7159ca5b90 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1332,12 +1332,6 @@ int mprotect_tests(void) int ret; char *mem, *mem2; struct page_region vec; - int pagemap_fd = open("/proc/self/pagemap", O_RDONLY); - - if (pagemap_fd < 0) { - fprintf(stderr, "open() failed\n"); - exit(1); - } /* 1. Map two pages */ mem = mmap(0, 2 * page_size, PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); From c4c99fdc227b64a17e3ceeeef01c84eef87fef1a Mon Sep 17 00:00:00 2001 From: Hui Su Date: Mon, 17 Aug 2026 14:08:46 +0800 Subject: [PATCH 225/250] mm/migrate_device: fix cache flush when replacing huge zero PMD migrate_vma_insert_huge_pmd_page() calls flush_cache_page() before replacing an existing huge zero PMD. However, the third argument to flush_cache_page() is a PFN, while addr + HPAGE_PMD_SIZE is an end virtual address. More importantly, the mapping being invalidated is PMD-sized rather than PAGE_SIZE-sized. Flush the whole PMD range with flush_cache_range(), matching other huge PMD invalidation paths. There is no userspace-visible effect today. The architectures that currently enable ARCH_ENABLE_THP_MIGRATION use no-op implementations of flush_cache_page()/flush_cache_range(). 32-bit ARM has non-trivial implementations, but does not enable ARCH_ENABLE_THP_MIGRATION. So this appears to be a latent API misuse rather than a currently observable bug, and I don't think a stable backport is necessary. Link: https://lore.kernel.org/20260817060845.377800-2-sh_def@163.com Fixes: a30b48bf1b24 ("mm/migrate_device: implement THP migration of zone device pages") Signed-off-by: Hui Su Reviewed-by: Balbir Singh Reviewed-by: Zi Yan Acked-by: David Hildenbrand (Arm) Cc: Alistair Popple Cc: Byungchul Park Cc: Gregory Price Cc: "Huang, Ying" Cc: Joshua Hahn Cc: Matthew Brost Cc: Rakie Kim Signed-off-by: Andrew Morton --- mm/migrate_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index ab3281b7fb6e9e..009bfa8b212d5b 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -882,7 +882,7 @@ static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate, if (flush) { pte_free(vma->vm_mm, pgtable); - flush_cache_page(vma, addr, addr + HPAGE_PMD_SIZE); + flush_cache_range(vma, addr, addr + HPAGE_PMD_SIZE); pmdp_invalidate(vma, addr, pmdp); } else { pgtable_trans_huge_deposit(vma->vm_mm, pmdp, pgtable); From f13c52ab5d0fef69a096a0970779d52e11581b5c Mon Sep 17 00:00:00 2001 From: "Kiryl Shutsemau (Meta)" Date: Tue, 18 Aug 2026 12:50:26 +0100 Subject: [PATCH 226/250] mm: include swap.h in swapops.h swapops.h uses MAX_SWAPFILES_SHIFT, SWP_MIGRATION_READ and SWP_PTE_MARKER, all of which swap.h defines, but does not include swap.h. It compiles only where the translation unit pulled swap.h in first. leafops.h includes swapops.h on the line above swap.h, so a file whose include list reaches leafops.h before swap.h gets: In file included from include/linux/leafops.h:11: include/linux/swapops.h:88:21: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' A header that uses a definition has to include the header that provides it. Link: https://lore.kernel.org/20260818115026.656406-1-kirill@shutemov.name Signed-off-by: Kiryl Shutsemau (Meta) Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202608181757.mza9RRj7-lkp@intel.com/ Reviewed-by: Lorenzo Stoakes (ARM) Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Signed-off-by: Andrew Morton --- include/linux/swapops.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 1f3ff3b93e1613..e7d0d529f3e0f9 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -5,6 +5,7 @@ #include #include #include +#include #ifdef CONFIG_MMU From 21efcf3ed0d4c715b174ef063ff806906be2a632 Mon Sep 17 00:00:00 2001 From: Song Hu Date: Tue, 18 Aug 2026 21:01:35 +0800 Subject: [PATCH 227/250] mm: memcg: release the css reference when a stock slot empties consume_stock() can drive a stock slot's nr_pages to zero while its cached[] pointer stays set, so the slot keeps pinning the css reference that refill_stock() took. The offlining drain only flushes slots with cached pages, so the reference is never released unless the slot happens to be displaced by an unrelated charge or by CPU hotplug, and the memcg lingers in the dying state - up to NR_MEMCG_STOCK (7) of them per CPU under container churn. Keeping the slot populated past the last page only saves a css_get()/css_put() pair on the next charge of the same memcg, and costs more than that: the offlining drain has to know about empty slots, and refill_stock() cannot reuse them either, so a charge under a different memcg evicts a live batch through the drain_idx rotation instead. Drop the reference in consume_stock() when the slot empties. Empty slots stop existing, so is_memcg_drain_needed() and the drain path stay as they are, and refill_stock() reuses emptied slots directly. The cost is one refcount pair per emptied slot, at most once per MEMCG_CHARGE_BATCH pages. Link: https://lore.kernel.org/20260818130135.154315-1-husong@kylinos.cn Fixes: d1a05b6973c7 ("memcg: do not try to drain per-cpu caches without pages") Signed-off-by: Song Hu Acked-by: Michal Hocko Acked-by: Shakeel Butt Cc: Audra Mitchell Cc: Johannes Weiner Cc: Joshua Hahn Cc: Matthew Wilcox (Oracle) Cc: Muchun Song Cc: Roman Gushchin Cc: Nico Pache Signed-off-by: Andrew Morton --- mm/memcontrol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1d3339520809f2..11b85f4b6828b7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2140,7 +2140,12 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) stock_pages = READ_ONCE(stock->nr_pages[i]); if (stock_pages >= nr_pages) { - WRITE_ONCE(stock->nr_pages[i], stock_pages - nr_pages); + stock_pages -= nr_pages; + WRITE_ONCE(stock->nr_pages[i], stock_pages); + if (!stock_pages) { + css_put(&memcg->css); + WRITE_ONCE(stock->cached[i], NULL); + } ret = true; } break; From 9bf0797d351fa229373b3f631a6aa0157ebaa91b Mon Sep 17 00:00:00 2001 From: Anshuman Date: Tue, 18 Aug 2026 19:02:06 +0530 Subject: [PATCH 228/250] selftests/mm: fix unchecked ftruncate return value in soft-dirty test test_mprotect() calls ftruncate() to resize the backing file before mmap()'ing it, but never checks the return value. If ftruncate() fails, the file may remain shorter than the requested mapping size. The subsequent mmap() with MAP_SHARED can still succeed in this case, but the very next line writes directly into the mapped memory (*map = 1), which can trigger SIGBUS if the mapping extends beyond the actual file size. Check the return value and fail cleanly with ksft_exit_fail_msg() if ftruncate() fails, matching the error-handling style already used for the mmap() call immediately below it. Link: https://lore.kernel.org/20260818133206.39503-1-anshumantewari123@gmail.com Signed-off-by: Anshuman Reviewed-by: Andrew Morton Reviewed-by: Sarthak Sharma Cc: David Hildenbrand Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/soft-dirty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index e198facf78bb5b..5f278913c4d754 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -152,7 +152,8 @@ static void test_mprotect(int pagemap_fd, int pagesize, bool anon) return; } unlink(fname); - ftruncate(test_fd, pagesize); + if (ftruncate(test_fd, pagesize) != 0) + ksft_exit_fail_msg("ftruncate failed\n"); map = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, test_fd, 0); if (map == MAP_FAILED) From 9004cb6982de9d03a32b7daa3dd6507339eaff30 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Tue, 18 Aug 2026 02:03:40 -0700 Subject: [PATCH 229/250] mm, swap: ratelimit bad swap entry reports A corrupt page table hands the same bogus entry to get_swap_device() on every access to the mapping, and every rejection is logged. One machine logged 6185620 copies of the same line in a few hours. swap_dup_entry_direct() prints the same message from the fork path, once per call: the WARN_ON_ONCE() guarding it warns once, the pr_err() inside does not. Rate limit all three prints. Link: https://lore.kernel.org/20260818-swap_part_one-v1-1-a4fc58119fc0@debian.org Fixes: 23b230ba8ac3 ("mm/swap: print bad swap offset entry in get_swap_device") Signed-off-by: Breno Leitao Reviewed-by: Barry Song Reviewed-by: Nhat Pham Acked-by: Kairui Song Acked-by: David Hildenbrand (Arm) Cc: Baoquan He Cc: Chris Li Cc: Kemeng Shi Cc: Miaohe Lin Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- mm/swapfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index dacef34a3ed7a4..53bf01d5f7f112 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1899,11 +1899,11 @@ struct swap_info_struct *get_swap_device(swp_entry_t entry) return si; bad_nofile: - pr_err("%s: %s%08lx\n", __func__, Bad_file, entry.val); + pr_err_ratelimited("%s: %s%08lx\n", __func__, Bad_file, entry.val); out: return NULL; put_out: - pr_err("%s: %s%08lx\n", __func__, Bad_offset, entry.val); + pr_err_ratelimited("%s: %s%08lx\n", __func__, Bad_offset, entry.val); percpu_ref_put(&si->users); return NULL; } @@ -3883,7 +3883,7 @@ int swap_dup_entry_direct(swp_entry_t entry) si = swap_entry_to_info(entry); if (WARN_ON_ONCE(!si)) { - pr_err("%s%08lx\n", Bad_file, entry.val); + pr_err_ratelimited("%s%08lx\n", Bad_file, entry.val); return -EINVAL; } From 8b5cfe698768b413e70290d68eedb242504b7bf0 Mon Sep 17 00:00:00 2001 From: Leon Hwang Date: Tue, 18 Aug 2026 21:50:29 +0800 Subject: [PATCH 230/250] hugetlb: add cond_resched() to __unmap_hugepage_range() Packet receive timeouts were traced to sparse HugeTLB unmapping in production. A task unmapping a sparse 2.5 TiB HugeTLB mapping could remain in kernel context for over 40 ms without reaching a scheduling point while walking empty huge PTEs. Although hard IRQs could still be handled, the per-CPU ksoftirqd thread and other runnable tasks could not run during that interval, delaying NET_RX softirq work queued to ksoftirqd. Add cond_resched() at the beginning of the hugepage loop so ksoftirqd and other runnable tasks can run between iterations. Testing with PREEMPT_NONE showed that the maximum interval between scheduling points fell from over 40 ms to below 2.5 ms. Total time spent in __unmap_hugepage_range() remained about 36 ms. Link: https://lore.kernel.org/20260818135029.93288-1-leon.hwang@linux.dev Signed-off-by: Leon Hwang Reported-by: Lance Yang Tested-by: Lance Yang Cc: David Hildenbrand Cc: Michal Hocko Cc: Muchun Song Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d8849196ad9b1c..73d65644be1370 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5235,6 +5235,8 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, last_addr_mask = hugetlb_mask_last_page(h); address = start; for (; address < end; address += sz) { + cond_resched(); + ptep = hugetlb_walk(vma, address, sz); if (!ptep) { address |= last_addr_mask; From 4b2ae13f3393ef4b4bce0021e8762790354f369f Mon Sep 17 00:00:00 2001 From: Anshuman Date: Wed, 19 Aug 2026 17:44:26 +0530 Subject: [PATCH 231/250] selftests/mm: check stat() return value in khugepaged get_finfo() get_finfo() calls stat() to get metadata about the target directory, but never checks the return value. On failure, stat() returns -1 and leaves path_stat unmodified, so path_stat.st_mode may contain uninitialized stack data. The code then checks S_ISDIR(path_stat.st_mode) against this potentially garbage value. This can produce a misleading "Not a directory" error when the real problem is a nonexistent or inaccessible path, or, in the worst case, the check could pass by chance on garbage data and let the function continue using an invalid path_stat for the rest of its logic. Check the return value and fail with a clear error message if stat() fails, matching the error-handling style already used for statfs() and read_file() later in the same function. Link: https://lore.kernel.org/20260819121426.49500-1-anshumantewari123@gmail.com Signed-off-by: Anshuman Reviewed-by: Andrew Morton Reviewed-by: SJ Park Cc: David Hildenbrand Cc: Lorenzo Stoakes Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/khugepaged.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index d3a53673e1f9ae..1d2d6bd72fd2af 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -124,7 +124,8 @@ static void get_finfo(const char *dir) char *str, *end; finfo.dir = dir; - stat(finfo.dir, &path_stat); + if (stat(finfo.dir, &path_stat)) + ksft_exit_fail_perror("stat()"); if (!S_ISDIR(path_stat.st_mode)) ksft_exit_fail_msg("%s: Not a directory (%s)\n", __func__, finfo.dir); if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE, From 402fce383bbb1a7b7268451552df088a2c3c0f0f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 26 May 2026 15:14:09 -0700 Subject: [PATCH 232/250] drivers/media/v4l2-core/v4l2-vp9.c: reduce inlining csky allmodconfig, gcc-15.2.0: drivers/media/v4l2-core/v4l2-vp9.c: In function 'v4l2_vp9_adapt_noncoef_probs': drivers/media/v4l2-core/v4l2-vp9.c:1834:1: error: the frame size of 1436 bytes is larger than 1280 bytes [-Werror=frame-larger-than=] The amount of inlining in there is simply nuts. This patch semi-randomly uninlines various things and fixes the above. Ad the .text size reduction is tremendous: ts:/usr/src/25> size drivers/media/v4l2-core/v4l2-vp9.o text data bss dec hex filename 22450 36 0 22486 57d6 drivers/media/v4l2-core/v4l2-vp9.o-before 16144 36 0 16180 3f34 drivers/media/v4l2-core/v4l2-vp9.o-after Reviewed-by: Daniel Almeida Cc: Mauro Carvalho Chehab Signed-off-by: Andrew Morton --- drivers/media/v4l2-core/v4l2-vp9.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-vp9.c b/drivers/media/v4l2-core/v4l2-vp9.c index 859589f1fd35f5..e965ffbd9b8aa2 100644 --- a/drivers/media/v4l2-core/v4l2-vp9.c +++ b/drivers/media/v4l2-core/v4l2-vp9.c @@ -1582,25 +1582,25 @@ static inline u8 noncoef_merge_prob(u8 pre_prob, u32 ct0, u32 ct1) * merge_prob(p[9], c[9], [10]) */ -static inline void merge_probs_variant_a(u8 *p, const u32 *c, u16 count_sat, u32 update_factor) +static noinline_for_stack void merge_probs_variant_a(u8 *p, const u32 *c, u16 count_sat, u32 update_factor) { p[1] = merge_prob(p[1], c[0], c[1] + c[2], count_sat, update_factor); p[2] = merge_prob(p[2], c[1], c[2], count_sat, update_factor); } -static inline void merge_probs_variant_b(u8 *p, const u32 *c, u16 count_sat, u32 update_factor) +static noinline_for_stack void merge_probs_variant_b(u8 *p, const u32 *c, u16 count_sat, u32 update_factor) { p[0] = merge_prob(p[0], c[0], c[1], count_sat, update_factor); } -static inline void merge_probs_variant_c(u8 *p, const u32 *c) +static noinline_for_stack void merge_probs_variant_c(u8 *p, const u32 *c) { p[0] = noncoef_merge_prob(p[0], c[2], c[1] + c[0] + c[3]); p[1] = noncoef_merge_prob(p[1], c[0], c[1] + c[3]); p[2] = noncoef_merge_prob(p[2], c[1], c[3]); } -static void merge_probs_variant_d(u8 *p, const u32 *c) +static noinline_for_stack void merge_probs_variant_d(u8 *p, const u32 *c) { u32 sum = 0, s2; @@ -1624,20 +1624,20 @@ static void merge_probs_variant_d(u8 *p, const u32 *c) p[8] = noncoef_merge_prob(p[8], c[6], c[7]); } -static inline void merge_probs_variant_e(u8 *p, const u32 *c) +static noinline_for_stack void merge_probs_variant_e(u8 *p, const u32 *c) { p[0] = noncoef_merge_prob(p[0], c[0], c[1] + c[2] + c[3]); p[1] = noncoef_merge_prob(p[1], c[1], c[2] + c[3]); p[2] = noncoef_merge_prob(p[2], c[2], c[3]); } -static inline void merge_probs_variant_f(u8 *p, const u32 *c) +static noinline_for_stack void merge_probs_variant_f(u8 *p, const u32 *c) { p[0] = noncoef_merge_prob(p[0], c[0], c[1] + c[2]); p[1] = noncoef_merge_prob(p[1], c[1], c[2]); } -static void merge_probs_variant_g(u8 *p, const u32 *c) +static noinline_for_stack void merge_probs_variant_g(u8 *p, const u32 *c) { u32 sum; @@ -1659,12 +1659,12 @@ static void merge_probs_variant_g(u8 *p, const u32 *c) } /* 8.4.3 Coefficient probability adaptation process */ -static inline void adapt_probs_variant_a_coef(u8 *p, const u32 *c, u32 update_factor) +static noinline_for_stack void adapt_probs_variant_a_coef(u8 *p, const u32 *c, u32 update_factor) { merge_probs_variant_a(p, c, 24, update_factor); } -static inline void adapt_probs_variant_b_coef(u8 *p, const u32 *c, u32 update_factor) +static noinline_for_stack void adapt_probs_variant_b_coef(u8 *p, const u32 *c, u32 update_factor) { merge_probs_variant_b(p, c, 24, update_factor); } @@ -1724,33 +1724,33 @@ static inline void adapt_probs_variant_b(u8 *p, const u32 *c) merge_probs_variant_b(p, c, 20, 128); } -static inline void adapt_probs_variant_c(u8 *p, const u32 *c) +static noinline_for_stack void adapt_probs_variant_c(u8 *p, const u32 *c) { merge_probs_variant_c(p, c); } -static inline void adapt_probs_variant_d(u8 *p, const u32 *c) +static noinline_for_stack void adapt_probs_variant_d(u8 *p, const u32 *c) { merge_probs_variant_d(p, c); } -static inline void adapt_probs_variant_e(u8 *p, const u32 *c) +static noinline_for_stack void adapt_probs_variant_e(u8 *p, const u32 *c) { merge_probs_variant_e(p, c); } -static inline void adapt_probs_variant_f(u8 *p, const u32 *c) +static noinline_for_stack void adapt_probs_variant_f(u8 *p, const u32 *c) { merge_probs_variant_f(p, c); } -static inline void adapt_probs_variant_g(u8 *p, const u32 *c) +static noinline_for_stack void adapt_probs_variant_g(u8 *p, const u32 *c) { merge_probs_variant_g(p, c); } /* 8.4.4 Non coefficient probability adaptation process, adapt_prob() */ -static inline u8 adapt_prob(u8 prob, const u32 counts[2]) +static noinline_for_stack u8 adapt_prob(u8 prob, const u32 counts[2]) { return noncoef_merge_prob(prob, counts[0], counts[1]); } From 5748f1b64e53950fafa6e42307c3ae4d38f02ab4 Mon Sep 17 00:00:00 2001 From: Bradley Morgan Date: Tue, 4 Aug 2026 09:34:00 +0000 Subject: [PATCH 233/250] taskstats: copy signal->stats under siglock in taskstats_exit taskstats_exit() copies tsk->signal->stats into the exit reply without taking any lock. Every other writer of this struct holds sighand->siglock before touching it, and this copy does not. The copy happens on the last thread of a thread group that exits. group_dead being 1 only says that every thread has dropped signal->live, it does not say how far the other threads got in do_exit(). One of them can still be inside fill_tgid_exit() adding its counters to the struct while the last thread copies it out, so the copy can read the struct in the middle of an update. The commit that added the copy assumed no locking was needed because the group was dead: /* No locking needed for tsk->signal->stats since group is dead */ but at that point the other threads have not necessarily finished their exit path. cpu0 (thread A, not last) cpu1 (thread B, last) =========================== ============================== atomic_dec(&signal->live) atomic_dec(&signal->live) -> 0 group_dead = 0 group_dead = 1 ... taskstats_exit(tsk, 1) taskstats_exit(tsk, 0) fill_tgid_exit(tsk) [siglock] fill_tgid_exit(tsk) memcpy(stats, signal->stats) spin_lock(siglock) reads ac_utime (new) stats->ac_utime += x reads ac_stime (old) stats->ac_stime += y torn snapshot -> netlink spin_unlock(siglock) The listeners receive a partially updated tgid snapshot, with some fields from before the concurrent update and some from after. There is no crash or splat, which is likely why this went unnoticed since 2006. A userspace model of the same shape, writer under a lock and a lockless memcpy reader, produces millions of torn reads in a few seconds. Take siglock around the copy like every other access does. sighand is still alive here because taskstats_exit() runs before exit_notify(), and fill_tgid_exit() already takes this same lock earlier in this function. Link: https://lore.kernel.org/20260804093400.3922-1-include@grrlz.net Fixes: ad4ecbcba728 ("[PATCH] delay accounting taskstats interface send tgid once") Signed-off-by: Bradley Morgan Acked-by: Oleg Nesterov Cc: Balbir Singh Signed-off-by: Andrew Morton --- kernel/taskstats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/taskstats.c b/kernel/taskstats.c index f31df72f0e9df1..9a48827e22bce3 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -590,6 +590,7 @@ void taskstats_exit(struct task_struct *tsk, int group_dead) struct sk_buff *rep_skb; size_t size; int is_thread_group; + unsigned long flags; if (!family_registered) return; @@ -635,7 +636,10 @@ void taskstats_exit(struct task_struct *tsk, int group_dead) if (!stats) goto err; + /* This was racy before, copy the stats under siglock. */ + spin_lock_irqsave(&tsk->sighand->siglock, flags); memcpy(stats, tsk->signal->stats, sizeof(*stats)); + spin_unlock_irqrestore(&tsk->sighand->siglock, flags); stats->version = TASKSTATS_VERSION; send: From 775c0f72566e86f6184ec5264574316b23ccd23a Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Mon, 10 Aug 2026 18:11:59 +0200 Subject: [PATCH 234/250] checkpatch: skip CamelCase cache for --no-tree without root Running outside tree (--no-tree) without git root (--root DIR) is not doable because we have no include/ directory which could be cached. But 3445686af721 expected that we are always in Linux tree (w/a git). But --no-tree does not require --root. Therefore skip whole caching in that case. This fixes perl and find errors when running checkpatch.pl *with* --no-tree --strict and *without* --root: No structs that should be const will be found - file 'scripts/const_structs.checkpatch': No such file or directory Use of uninitialized value $root in concatenation (.) or string at scripts/checkpatch.pl line 1213. find: `/include': No such file or directory Link: https://lore.kernel.org/20260810161159.1044160-1-pvorel@suse.cz Fixes: 3445686af721 ("checkpatch: ignore existing CamelCase uses from include/...") Signed-off-by: Petr Vorel Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Joe Perches Cc: Lukas Bulwahn Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 73b5e788e84e1e..8cfe4fec1b5128 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1206,6 +1206,8 @@ sub seed_camelcase_includes { my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`; chomp $git_last_include_commit; $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; + } elsif (not defined $root) { + return; } else { my $last_mod_date = 0; $files = `find $root/include -name "*.h"`; From 2894563833294903f2bb1feac491000aca635c05 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Wed, 19 Aug 2026 10:01:11 +0900 Subject: [PATCH 235/250] ksmbd: enable TCP keepalive for accepted connections A client that disappears without sending a FIN or RST can leave its ksmbd connection in ESTABLISHED indefinitely. ksmbd sets a socket receive timeout, but the connection receive loop retries timeout errors without a limit, so the connection remains in conn_list and consumes the per-IP connection quota. Enable SO_KEEPALIVE on accepted TCP sockets so the TCP stack can detect a silent peer failure. The keepalive idle time, interval, and probe count remain controlled by the existing TCP sysctl settings. Signed-off-by: Namjae Jeon --- fs/smb/server/transport_tcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 0ae5f145a3324d..921e4e86d01c1b 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -292,6 +292,12 @@ static int ksmbd_kthread_fn(void *p) ksmbd_debug(CONN, "connect success: accepted new connection\n"); client_sk->sk->sk_rcvtimeo = KSMBD_TCP_RECV_TIMEOUT; client_sk->sk->sk_sndtimeo = KSMBD_TCP_SEND_TIMEOUT; + /* + * Detect peers that disappear without sending a FIN or RST. + * Otherwise the connection handler can retry receive timeouts + * indefinitely and keep the connection in conn_list. + */ + sock_set_keepalive(client_sk->sk); ksmbd_tcp_new_connection(client_sk); } From c74633de0b6d0d6d7aa596ecbda702302f1fa9f6 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Thu, 20 Aug 2026 08:26:03 +0900 Subject: [PATCH 236/250] ksmbd: keep TCP timers alive for kernel sockets ksmbd creates its listening socket with sock_create_kern(). Kernel sockets do not hold a network namespace reference by default. Accepted sockets inherit this state. When an accepted socket is released, tcp_close() clears its pending TCP timers for a kernel socket after the socket enters an orphaned state. If the peer is unreachable while ksmbd sends a FIN, this can leave a FIN-WAIT-1 orphan without a retransmission timer. Upgrade the listening socket's network namespace reference before kernel_listen(). Accepted sockets inherit the reference, so the TCP stack can keep the retransmission timer active and apply its normal orphan retry policy. Preserve the existing graceful shutdown behavior. Link: https://github.com/openwrt/openwrt/issues/24744 Signed-off-by: Namjae Jeon --- fs/smb/server/transport_tcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 921e4e86d01c1b..832e93084605a9 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -523,6 +523,12 @@ static int create_socket(struct interface *iface) goto out_error; } + /* + * Accepted sockets inherit the listener's net reference. Keep TCP + * timers alive after a kernel socket is released. + */ + sk_net_refcnt_upgrade(ksmbd_socket->sk); + ret = kernel_listen(ksmbd_socket, KSMBD_SOCKET_BACKLOG); if (ret) { pr_err("Port listen() error: %d\n", ret); From 9958a5b7046ad33436b35ae93c369c1e75bf5cf8 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 20 Aug 2026 08:58:15 +0200 Subject: [PATCH 237/250] smb: server: Remove obsolete "select CRYPTO_LIB_DES" from Kconfig file The DES encryption in the smb server code has been removed in 2021 with the removal of the insecure NTLMv1 authentication code. Thus we don't need this "select" statement here anymore. Fixes: ce812992f239f ("ksmbd: remove NTLMv1 authentication") Signed-off-by: Thomas Huth Signed-off-by: Namjae Jeon --- fs/smb/server/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/smb/server/Kconfig b/fs/smb/server/Kconfig index 08d8b7a965a64d..221ec9717a8341 100644 --- a/fs/smb/server/Kconfig +++ b/fs/smb/server/Kconfig @@ -9,7 +9,6 @@ config SMB_SERVER select CRYPTO select CRYPTO_LIB_AES_CBC_MACS select CRYPTO_LIB_ARC4 - select CRYPTO_LIB_DES select CRYPTO_LIB_MD5 select CRYPTO_LIB_SHA256 select CRYPTO_LIB_SHA512 From e77d39eb3ea18cd11f53f268a28cec4d52e41dcd Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Thu, 20 Aug 2026 16:43:15 +0900 Subject: [PATCH 238/250] smb: server: remove unused DES crypto header The DES crypto header is no longer used after the removal of NTLMv1 authentication. Remove it now that the server no longer selects CRYPTO_LIB_DES. Fixes: ce812992f239 ("ksmbd: remove NTLMv1 authentication") Signed-off-by: Namjae Jeon --- fs/smb/server/auth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index 9f3151a9f379df..5ec43e32de3e0c 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -24,7 +24,6 @@ #include #include -#include #include "server.h" #include "smb_common.h" From 4a5b945de8f67b24144078b1be6dfe79074153fe Mon Sep 17 00:00:00 2001 From: ChenXiaoSong Date: Wed, 19 Aug 2026 07:12:24 +0000 Subject: [PATCH 239/250] MAINTAINERS: add myself as KSMBD reviewer I and my team have been working on KSMBD development, and I am also interested in helping maintain this code. Signed-off-by: ChenXiaoSong Signed-off-by: Namjae Jeon --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8014b9f8253edf..a0e04c0ba4536f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14138,6 +14138,8 @@ M: Steve French M: Steve French R: Sergey Senozhatsky R: Tom Talpey +R: ChenXiaoSong +R: ChenXiaoSong L: linux-cifs@vger.kernel.org S: Maintained T: git https://git.samba.org/ksmbd.git ksmbd-for-next From 7079a12d7506b07fb53b54a664bfad5fa9b16d70 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 20 Aug 2026 14:54:26 +0100 Subject: [PATCH 240/250] Add linux-next specific files for 20260820 Signed-off-by: Mark Brown --- Next/SHA1s | 431 ++ Next/Trees | 431 ++ Next/merge.log | 15678 ++++++++++++++++++++++++++++++++++++++++++++ localversion-next | 1 + 4 files changed, 16541 insertions(+) create mode 100644 Next/SHA1s create mode 100644 Next/Trees create mode 100644 Next/merge.log create mode 100644 localversion-next diff --git a/Next/SHA1s b/Next/SHA1s new file mode 100644 index 00000000000000..4770a91034a1d5 --- /dev/null +++ b/Next/SHA1s @@ -0,0 +1,431 @@ +Name SHA1 +---- ---- +origin a4ff2be345d0abc943da8dd8da98151843b750dc +ext4-fixes 981fcc5674e67158d24d23e841523eccba19d0e7 +vfs-brauner-fixes b64a9f67e082e04835ddd69d422a25168d69375b +fscrypt-current cf6c993c0feca7984797e634deba3c80342e199a +fsverity-current d2f96bcb89d36d488a10e3bcf819b98536968286 +btrfs-fixes af5534fe2fbc006e83d75d6283dfc5ec75d5d780 +vfs-fixes 49c5d168a3a8f4eb27d44a2a22b7e8a856ca601f +erofs-fixes 075b74841bd0065a3bda3440873c747938e69b68 +nfsd-fixes 5c4851e4cdfc3204128f88991be64a6e3929d3d0 +v9fs-fixes 028ef9c96e96197026887c0f092424679298aae8 +overlayfs-fixes 4549871118cf616eecdd2d939f78e3b9e1dddc48 +fscrypt 7dd38d9dd7a05329825fe2324d4d8e27ad4b3cec +btrfs f037522c036c041858e59318df577c87e8200ac0 +ceph 91880e4a7fac45bc407771bc57bbaf4f37e9b4c3 +cifs 9ca668da8e4c94ea80f5abb414b6a7f87c76202a +configfs 6363844fdbbb76afe1d44d678fe0746390204a5f +ecryptfs f81cb44f9a4b88d73ee5dec4a1ccdb0232fd2e3f +dlm e61113cfcaf71cbdf4c17e3d086d8fb7f92c62bf +erofs 988c3c186c730590a71df8adc1424c5578ef8bae +exfat 490529f668016c401d3da688104d15d3fc2c4fca +ext3 3d7e6f0b557dab405cc431029a450ff0047da292 +ext4 9091c97be34083587a75db174aab51551d8e8543 +f2fs 0a1703eba23707e3b2edfa2a2329352e7abc0ffa +fsverity dc59e4fea9d83f03bad6bddf3fa2e52491777482 +fuse d1dbc59200b54944f00251ca4dfbb2b318beca13 +gfs2 4bb187d6f379c5490e3034b153fe476127308519 +jfs dad98c5b2a05ef744af4c884c97066a3c8cdad61 +ksmbd 4a5b945de8f67b24144078b1be6dfe79074153fe +nfs 265e3f27bb8796a958fcb2a533f62012e7721d4a +nfs-anna e053b624f5d36669756990743346157be9f68c34 +nfsd 46db3c8a1be96a354758b44b1d4fbb4b70d09a20 +ntfs 9969d58a9b0417393d033b24c670d57b686cabbf +ntfs3 c22f91d82cb9a29d22bdffdce6c803467984ad0c +orangefs d410cd5303ec59c7cf23dd61423752ce8e9ecb59 +overlayfs 1f6ee9be92f8df85a8c9a5a78c20fd39c0c21a95 +ubifs a5e0055eac837a1168c781653943d4a0d9920af3 +v9fs aa88278693cbfaf7a2acf961379973fbb63b165c +v9fs-ericvh 028ef9c96e96197026887c0f092424679298aae8 +xfs 0877338ade31b825884a744e03f27c8de300f101 +zonefs 3a8389d42bdf4213730f4067f8bfa78bae6564ef +vfs-brauner c4463c3bf63d0d5a8e4b55f78ca220ddf27a6859 +vfs 4dda01b67c8662c5d0c53034974cb8280c575a5d +mm-hotfixes 90c4f67f851fd12eeb8eb1111108de90bb44cb3e +fs-current f4acfec974657cd5b764a3d50a955b381ac1eba6 +kbuild-current e5a259d98823a93459643b239b71fed7589ab669 +clang-fixes 175db11786bde9061db526bf1ac5107d915f5163 +arc-current 1590cf0329716306e948a8fc29f1d3ee87d3989f +arm-current 1039bffd6ae9c75b42b7d148d6c1106134107b66 +arm64-fixes f73a8edc2ccc6ec72c37d5c578e7592d2e1f9922 +arm-soc-fixes e36c0670d5ebebd7dba493f14966051f354fbb34 +davinci-current dc59e4fea9d83f03bad6bddf3fa2e52491777482 +realtek-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +drivers-memory-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +sophgo-fixes 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 +sophgo-soc-fixes 0af2f6be1b4281385b618cb86ad946eded089ac8 +m68k-current 2f8e3cad53b5c36ab0ed5d3195bfc55c59ea61a5 +powerpc-fixes fb442a6673ff1046bf67754957d95880fdb394b5 +s390-fixes eb363254472493e3458156fc11fd56dca92f4333 +net 564973a259ec76f2dad0853420e7034cc43994c4 +bpf a13307e97d5c54b65720bb71fa379960ded1e51a +ipsec 4e9442ce551ebd84b52ad649df721e2dc28af95a +netfilter 7b53449540502cb21b32bca62a6258e22cd97bbe +ipvs 2c7c88a412aa6d09cd04b414211b4ef8553b5309 +wireless 2812e64e1575e05500a35c405aaa6e99b7d7930b +ath 2812e64e1575e05500a35c405aaa6e99b7d7930b +iwlwifi d13d5d299c11b7bd3362d5692c56225d9e176664 +wpan 8ce4f287524c74a118b0af1eebd4b24a8efca57a +rdma-fixes 31b7c700670830a0e8a4cdcd451c88a13cc5dc48 +sound-current 2b366b833f52a37f70be845892c1f5fe1d993051 +sound-asoc-fixes 079e27f52b929b554b90514b081ea40b3d632a25 +regmap-fixes 00268f9452d2a0d660aa9c1bb0ca07a994af6a4f +regulator-fixes bd2a0c2d8c49ffb7acfcb0c1177af355ea417caf +spi-fixes 11058bd3d47d57eb3473935feae53868d6d168b7 +pci-current 7678e81498e20e78d7d5f64e552cd153117c1d66 +driver-core.current db2ddb87143519e20a95aa36c60b36107b736a58 +tty.current 440915499231e9db1c361aa45bb702e8fd3b4a32 +usb.current db2ddb87143519e20a95aa36c60b36107b736a58 +usb-serial-fixes d37186bd95a07e334447f47274a38a311dad2172 +phy 075b74841bd0065a3bda3440873c747938e69b68 +staging.current 6829665d050983907b560173e49dcc6c11cb2730 +iio-fixes 16989c88e98fb6b795d514ba81ecb5493babfe09 +watchdog-fixes db2ddb87143519e20a95aa36c60b36107b736a58 +counter-current f1a3a9946aab611dd2200c01ff122f64b033dad2 +char-misc.current db2ddb87143519e20a95aa36c60b36107b736a58 +soundwire-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +thunderbolt-fixes 8d3ae59288f1e7d58d76558a6ee96d533bc5019f +input-current b4d85f863e5a6f1fa01b186001af0f68f4f5239e +crypto-current 7537036a2e6fe96f8ed82034f755c54714a0e417 +libcrypto-fixes 1590cf0329716306e948a8fc29f1d3ee87d3989f +vfio-fixes e242e974e812e7a47e3088860c80d9492fac314f +kselftest-fixes c5c413534d40eb4c982f1794e62813f926aba747 +dmaengine-fixes 075b74841bd0065a3bda3440873c747938e69b68 +backlight-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +mtd-fixes 2b533e775aec580cf60074417f4ca00ac9cf3580 +mfd-fixes d5d2d7a8d8be18681a0864f58e3875f1c639e11c +v4l-dvb-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +reset-fixes 71827776667f4e4677a4fa806bcfb24d4b8dd9d7 +mips-fixes a13c140cc289c0b7b3770bce5b3ad42ab35074aa +at91-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +omap-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +kvm-fixes 8d3ae59288f1e7d58d76558a6ee96d533bc5019f +kvms390-fixes 30300ec2780efa6cb9ea0887d1b94506af9c4eea +kvm-arm-fixes 751a956c75a5449e1769897f374094ea476ba1a1 +hwmon-fixes f7c9176d2326eacae3a87fa3f5214a78c818cc07 +nvdimm-fixes a8aec14230322ed8f1e8042b6d656c1631d41163 +cxl-fixes d90f236f8b9e354848bd226f581db27755ab901d +dma-mapping-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +drivers-x86-fixes 78bf392ba77dd8b2a25656e489449d2f91cfd1eb +samsung-krzk-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +pinctrl-samsung-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +pinctrl-qcom-fixes 1e7b04c12c077e8829991833a9aa2cb3bdacab61 +devicetree-fixes bba13ad17b1a11b3f1ed9b3a5d556191d7755a59 +dt-krzk-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +scsi-fixes c4f6916a99cf105c3ff340b6210fcbba3fa66b35 +drm-fixes 8d3ae59288f1e7d58d76558a6ee96d533bc5019f +drm-intel-fixes 266ebacffc5809478a2e80d61ddc58c921dbe2b4 +mmc-fixes 00179ed9fbe07799676e2cb63c4e7f0e7cd80a5c +rtc-fixes 254f49634ee16a731174d2ae34bc50bd5f45e731 +gnss-fixes a13c140cc289c0b7b3770bce5b3ad42ab35074aa +hyperv-fixes 0fd49f7bfb8f1952ae157344ea9712da74734200 +risc-v-fixes 8d9d4fd2a15ff961a5f4ddd8ac672ec4628542be +riscv-dt-fixes 42c57c049054dfaa0be83f6721f7c4ce4a880e56 +riscv-soc-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +fpga-fixes 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 +spdx dc59e4fea9d83f03bad6bddf3fa2e52491777482 +gpio-brgl-fixes 44f3468a0aef1aabdad551898ab7cfa2a9d20e99 +gpio-intel-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +pinctrl-intel-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +auxdisplay-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +kunit-fixes 5142c56651578abc346d6c17f3fb919b9ffbb317 +memblock-fixes 97090500d776c3f6d08e857e3a0a7cf092999094 +renesas-fixes 6fa6ee724d8dadf392139e242ac936b5da730c4b +perf-current fac520e43a60230b24026f462a2b63e4d170566e +efi-fixes d8809f6931065cbbf3554647a50a65a471ab5983 +battery-fixes 160a783aa65b74782bc17cb874af1a6d3f5fba3c +iommufd-fixes 075b74841bd0065a3bda3440873c747938e69b68 +rust-fixes d24f5cdbeff8b6a063fca92d0a1f94122a799b59 +w1-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +pmdomain-fixes 090a95dbe13df9965279b588d97eda134831769c +i2c-andi-fixes abea5c349368a683e40fdc2e745099aaaacc89d7 +i2c-rust-fixes 4eb422482ca5d924d7212ad2ca1cb7ea6f5b524d +sparc-fixes 254f49634ee16a731174d2ae34bc50bd5f45e731 +clk-fixes 7ae8acad2d5c415ecb754409a4b64f09169c082e +thead-clk-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +tenstorrent-clk-fixes 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f +fustini-config-fixes 254f49634ee16a731174d2ae34bc50bd5f45e731 +pwrseq-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +thead-dt-fixes dc59e4fea9d83f03bad6bddf3fa2e52491777482 +ftrace-fixes 1650a1b6cb1ae6cb99bb4fce21b30ebdf9fc238e +ring-buffer-fixes 057caace5214da3b457bbd295e1a2ad34d3685ea +trace-fixes c3730b8373bb5059d735509b9e6a00d7eb337d7c +tracefs-fixes 07004a8c4b572171934390148ee48c4175c77eed +spacemit-fixes eb525edd48907795c0d4e498ff57ad168070b289 +tip-fixes 57e0daeacc1da5a31da885b868e82d930efb2193 +slab-fixes 5ff172f6c94d282d83cb88bdfec5f647ad9c6105 +kexec-fixes ada2e5a44e99113e08ad9b7b71396c6c572204da +liveupdate-fixes 3a0b8fa2eb36afc88b62a95f33f0c77c71fa5ded +drm-msm-fixes e2332abed2a4d3caa59052095dc16e4ce44791ea +uml-fixes af421e9aed3920c7ac88c24daa48606c7112feca +fwctl-fixes 075b74841bd0065a3bda3440873c747938e69b68 +devsec-tsm-fixes c3fd16c3b98ed726294feab2f94f876290bf7b61 +drm-rust-fixes 8cdeaa50eae8dad34885515f62559ee83e7e8dda +tenstorrent-dt-fixes 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f +nfc-fixes be47ff78de05e931ede1d0a407f8ef6f063054d3 +drm-misc-fixes dc14753664240cedf669623b27ae9922b0618b25 +rust bd5f485f3f026225b86573e559af0b7254ef4184 +rust-interop 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b +rust-alloc dc59e4fea9d83f03bad6bddf3fa2e52491777482 +rust-io 86731a2a651e58953fc949573895f2fa6d456841 +rust-pin-init 1e26aea0355ad2afa1ccbc62885c01f5bcfc58ca +rust-timekeeping ddb1444d3335129ae87d9796ab1debf41c0ee51b +rust-xarray c455f19bbe6104debd980bb15515faf716bd81b8 +rust-analyzer 5f45afb8ab04d934fc0601a202f95267ebc20059 +mm-stable 08745c62350126bc31b09548137be87e2866f628 +mm-nonmm-stable eef628bce8e18ce1eb8531c396bf55e36f86c62c +mm-unstable 4b2ae13f3393ef4b4bce0021e8762790354f369f +mm-nonmm-unstable 775c0f72566e86f6184ec5264574316b23ccd23a +kbuild d900723d78adec229996aefbab0dcaa66a177b77 +clang-format 8f0b4cce4481fb22653697cced8d0d04027cb1e8 +perf 9453bc6a69ef43755f1c28d5688cacdd69fa16bd +compiler-attributes 8f0b4cce4481fb22653697cced8d0d04027cb1e8 +dma-mapping 42311aa29e20fdc0157746143c108b08b268f5cb +asm-generic adbbd9714f8058730f93c8df5c5bf1679456424b +alpha d58041d2c63e09a1c9083e0e9f4151e487c4e16a +arm 1345e9968d318758816dd0910f9d4c73d4d80d49 +arm64 26b77009ee74f6122a067a4f9926ff6e09fffb94 +arm-perf 5936245125f78d896fdb1bbc2ae79213e28a6579 +arm-soc ae77d827fb0e6fb2faf8186f075c6c337f2dcf08 +amlogic 544455a3a844edd6107b15cd0ab0b657399f2d49 +asahi-soc 8776c12e06211d723104a754e047dc3d9bc8d2e6 +at91 d6e7bce8d43920ea01a217b5bccf4a30bf4165b5 +bmc cd7d1ef7d74ed5f5a1790a40389bc38382924556 +broadcom fca5276165993e9ca18e746f9b41af7627cbe349 +cix a0cffbd8878c55b12dc4555f883adf3372cecd91 +davinci dc59e4fea9d83f03bad6bddf3fa2e52491777482 +drivers-memory 96aa6902ff2bf81b9b8e0fa228494595dc2374a9 +fsl e14b8d39388095fb806fe9f98a95b70619e4cabd +imx-mxs 9400c5b6aa357be2379c98ae86a207bc21dc7a48 +mediatek f5be25e697e0362103625b1b197af126ae4ba5f7 +mvebu 5acccc8f8d731a0a184ef10fa4b65ab202a38c99 +omap ba251bb5ce2db9228a4c1ca9aef787c368121af7 +qcom ed2647532a225739e86c7f236a2ce82764ec2772 +realtek 3c778f0c9fa36b6b9a26bd2146df24ed4e830ba4 +renesas f9592c355314cb76e76078dfc58ea747e382ea15 +reset d373605cd514837d8a6de3d00c786d4bae6dbaf8 +rockchip 2d578cd590adc2133aa24496afcd7c3f7f9ba36a +samsung-krzk acde40ba506aae78633e080b5704d33cf4bc13c6 +scmi 8703affc72639ff10c0881db5a9c228bdb7211e4 +sophgo 76acfee87c74dc0dc7a68a00b70b9c39d1c8428f +sophgo-soc c8754c7deab4cbfa947fa2d656cbaf83771828ef +spacemit 3fca3cbc0516b839733a92be712aa34132249a93 +stm32 90d4d470d4d478ea011f2ebb6b4ecf199a6d0653 +sunxi 859c0e1925332d413ca8f9159c8ca5d04eea32a2 +tee a3067938fd192b116b6dfb325b654300a6d1b461 +tegra 48713e5ff96a2c04286071a2136455545e4c72a5 +tenstorrent-dt 33583baeb1ba7d328e6a9775d889036900b74cdb +fustini-config 020e209272bee0b8add8cba21125e4744f034b26 +thead-dt 15d32aaf6300b832814a9930fdbd20efdbc9adcf +ti 61831b50771af5ff3097f12c3396a7e9e33b6dad +xilinx a4ff2be345d0abc943da8dd8da98151843b750dc +socfpga ff98c9832fd430ba7b3158b8521002c8eb8aa16c +clk 69ea2faeb783165377c42dc30598966cea540a3d +clk-imx 39ec460b56b26319d1f31b459e8be7ea34ae9c67 +clk-renesas 0fb9083a6e56f688aeeccfc7ef7eeba586e57dc6 +thead-clk b2ee00d0bf4cca5dd02702fc339d2b523191966f +tenstorrent-clk 23c8ebc952849b3ba47d04d0ec95daf5cc136061 +csky abb81e5ce7d995baa41556b8125fa59e28ba3be8 +loongarch e2a848868441874d416d47a5cba5452b34473504 +m68k 2f8e3cad53b5c36ab0ed5d3195bfc55c59ea61a5 +m68knommu de0dab22cbf6943d0f12f3b1e2eb1bbdd807f039 +microblaze 8d3ae59288f1e7d58d76558a6ee96d533bc5019f +mips 3b7711be02612845e44b5e9ef7c0b9f203cf29b6 +openrisc 6620f5e8c11c4f7e41222a86f5c97150cc5f84a5 +parisc-hd 8b585431a16cfb9d8f2955a9fa0787ce3dceb3c2 +powerpc 1304643a1c20badbb91b86a5084dd76cb7620c05 +risc-v 8da45c93dfa98f25b148512d92ecfa75d027a5cc +riscv-dt 82ab962ef6c2a3571e3d590b30c023118c92b776 +riscv-soc 8cdeaa50eae8dad34885515f62559ee83e7e8dda +s390 53158917ea1a0219f6886a0ae10f6f276ecfa2a6 +sh b0aa5e4b087b686575f1b31ce54048b4d059b7b8 +sparc 5b2a3b1a98fb47c593144c2770e012d463952b70 +uml 1590cf0329716306e948a8fc29f1d3ee87d3989f +xtensa a7c958e8721eb2724ee2e2ef13129bc67e1c8a75 +fs-next e928ee2ede92f33b28270bf9ac3d6f1bf58db91b +printk 703a9d76a45dd97b19b2432fc1ba4beb4d67a94f +pci 115c7e572e50570ab25fc5c0e83bbf93b22ea880 +pstore 24b8f8dcb9a139a36cf48bfbe935e8dc1f33ed79 +hid a8fcb3dbf9024da44f1614c42ea16001f4b860b0 +i2c 8cd9520d35a6c38db6567e97dd93b1f11f185dc6 +i2c-andi b0e590bb83a9e40dc1e77a2c82d7f3e670fb74b3 +i2c-rust 61ddec70c9bcc3d4b0471c8683e57d3b03cecf0a +i3c cab40cfc9e116acd4d60f95b4b1264cab78f3803 +dmi 1afafbaf749d8e8ec53f8e38efdc731131902b5b +hwmon-staging 75f2c0b3690702c90863c2e138cb5520670845ea +jc_docs 791e420360669d55b7f90ca0c6d61b10e4992aec +v4l-dvb 4900cad020c0580dfb1be27776ff10a4ef110cfa +v4l-dvb-next adc218676eef25575469234709c2d87185ca223a +pm a091e6870b6c770cb65e1de490e52be6ede7cc9c +cpufreq-arm 8c3afcf27fa4582c1ab912503dc8a4ebb8dc0f82 +cpupower adfe0057326ffbc2cd5ff69a57ec0e50b5e74095 +devfreq c096be11c2a9d4acca8e75f1f8edeb744aceb521 +pmdomain 3ca7b513aec1db32b75b909395be1111c1198afb +opp 84f05af0975c9f9c8ffee0361d6f7cbb1f289231 +thermal b115930d716defc3a7daa2bc2ae2465d864b7114 +rdma 60a42d510113f46de47e86a84bf5758597644487 +net-next 61eb236c41c2a4717015dff18016a75a5eb90052 +bpf-next f79066c784022fda83f5936559a1af414e41b603 +ipsec-next 298bb2b8903323f6ef2eab4819a2e477765f0ff1 +mlx5-next 36b1d3299d0b6aa51485cc9a79b8d94948d5f3d4 +netfilter-next a50eba1e778ad4da5b6f9ddbbf57dabbea59bc05 +ipvs-next f6f3b36c15ed44de1fbb44e645e4fae8c4a4453e +bluetooth 486f8908aa587ab2a213bbef39311743e4f8f57a +wireless-next ca800a9302764c445de0da0e84d2252400a770ee +ath-next ca800a9302764c445de0da0e84d2252400a770ee +iwlwifi-next 4a2610a5a9fcf77eaad82bb030ec77ec5e381db8 +wpan-next a6bfdfcc6711d1d5a92e98644359dedc67c0c858 +wpan-staging a6bfdfcc6711d1d5a92e98644359dedc67c0c858 +mtd 94d32f1ace8ee3ef3537ac6c8e71b76a418a4762 +nand 15a3cbce32994141252bb4ecfe3ff3a5d22d0b4f +spi-nor df415c5e1de0f1aeefacb4e6252ff98d38c04437 +crypto 7537036a2e6fe96f8ed82034f755c54714a0e417 +libcrypto 0f23d56f17fdfc7db69d51f64c8b91bbab947aa9 +drm c44e278ce02efd0c4be79a8eda1ea6885c1ce5ec +drm-exynos 3a8660878839faadb4f1a6dd72c3179c1df56787 +drm-misc 271e90eb5f9ff34951647e5ed33c1775eebcca50 +amdgpu e4c3ab59021e7c146a84b6671f0d530972bd58b4 +drm-intel 65b92bc671db7c222f8de1146c88e40fe8764d95 +drm-msm 140b13475302601368c0cf4e193e66126a49feb3 +drm-msm-lumag 140b13475302601368c0cf4e193e66126a49feb3 +drm-xe a1c1dbd0f047bb05de6aaf6abe9103031179bf19 +drm-rust 4c9ba407018e8deb06dbc643112bac8f40404f95 +drm-nova 93296e9d9528f0d87f2cf3fee494599060a0f14a +etnaviv 6bde14ba5f7ef59e103ac317df6cc5ac4291ff4a +fbdev 8c3c7f132f1464211ebf01d57533462637b82e73 +regmap efc5e244e825887ed100d5b5bfbf80f210683e1b +sound 2b366b833f52a37f70be845892c1f5fe1d993051 +ieee1394 05bfb1327dc5fb61528bab31cd8f0c1e4bddec23 +sound-asoc 2792cc1b80b7674cc0751b34a964aad76630c1fa +modules 3dfaae04243cde460d82dfc2a7dd0bb6664d20ae +input 9a29ee801f525bcad71fea021bfe2a030885c8df +block a33221f7ab120e9a6caa62c3ff8a1b09674370e8 +device-mapper 39c5aa3bd8ec3912d2cd0b3fe092642b0d2b0713 +libata 73b6bf3c314ad34a9fd389f84de6e8dbfc204880 +pcmcia b3c26ea81ccc522e77ed0b1707add61fc9206216 +mmc 35e689fb79dcbaa8d69cc4a58a7ad4d0d7346e4a +mfd 9d0e4b1ae5b045a2c92b0b9a1c3b268191c219d9 +backlight cf1a12e0804515e0ed8b3f50c1c32f7f425bd660 +battery 2da28b059e0ddcd2e1956eeae383246207965573 +regulator bd2a0c2d8c49ffb7acfcb0c1177af355ea417caf +security 0cee720cfd51402cfcb14d96cb326a36c13b823a +apparmor 4ec11f14d1d6fdda787d991b142537be7841d395 +integrity f1e10b10874051e4d99911dae0dd7b75a9f8ae66 +selinux 3b93fe26412a422d92ef5c4ff3339112e61c24f8 +smack fedc88e38ce979a720cd2de042578cb5df3dc8de +tomoyo 2d2338c93da79b3bfe4b6099a931d9468d539952 +tpmdd-tpm 9ab874896167123cb4b035bf457a96dc752ff15e +tpmdd-keys d239c5a8828cbf615a968e449efed9634d6b1f0a +watchdog 3bbbeb7fddf54a7d7116b2defe0a63a9b583c84e +iommu 3c6a2bac15247bc4f28125247ff89165324612fe +audit 2b10b6de62d7b99d46300afeb1097642a9ab0711 +devicetree e1c13aed4a1641550e8c9518c96f016e1d52d09b +dt-krzk 6bd34d56818cc881a75c789ad6ce8ec4a1e32f3a +mailbox 36cac4b5101f8ecbc851356df175b99543c84ec6 +spi 14a6d09db0c7177df12c22a42af75e2d45821ed3 +tip 57e0daeacc1da5a31da885b868e82d930efb2193 +kexec 9d50f7c5ad5b4b031c9b85f9a43c626d8268ab51 +liveupdate 352ebb57013a08679788bc18c7f9af90903db256 +clockevents 1b8b356b4b06e3a28feb852c04e06caeac07bc87 +edac 9fa765b3ed33d6dd64aca0ba8f6ed7697de50410 +ftrace 3df3ae98c30c249c4bbf3d74559cc6972898052c +rcu 9cc63f8bcd560c760d0b12e15bba8f81c86237cf +paulmck e39a12053df0951120ff6283177e0d5179feda45 +kvm a204badd8432f93b7e862e7dac6db0fe3d65f370 +kvm-arm aa8e5dc6a7a2a1141ab40706a51010adcd0e57d2 +kvms390 dd6f4ef6f8a37412909ad787c837332fb070159c +kvm-ppc f5098b6bae761e346ebcd9da7f95622c04733cff +kvm-riscv b5060a4aa33d7d78a8c1837ab08ef0c81ea96650 +kvm-x86 1b731e5ded480bd1e5546aed35584238661ce72e +xen-tip d330fb86a7170f845123ae82d95df440fad9b707 +percpu 8f0b4cce4481fb22653697cced8d0d04027cb1e8 +workqueues 7e2f2a377ac9f50296ad60bd331f0d4def7aee51 +sched-ext 4fb8d6379d2c7ceecb2b3e111954d29089d59492 +drivers-x86 54745d563114b74f6fecebce68cd020d06c1772b +chrome-platform 81c1c0cb68a13d14dd1bbffcf4c49e26f9a6478c +chrome-platform-firmware a58a57a1076f8c5dae0327e3710899478c3be901 +hsi e81250ec6b69248b00d38c523dc6a13efaf38aab +leds-lj f8cca63a0a4f3475199d9ab7f86782bdfeb0744d +ipmi ae84a2536577057e97f23f75a202e26d0e86cf01 +driver-core 3b5ea0f078e1b72276e99c237f3dfc2fd72938bb +usb e1e6e541c5c9cf548e9fdc35fc26808c82074440 +thunderbolt 86feaba911f2f1a540a7695c8f4a98fd0fd60ac4 +usb-serial 15734de99517b0c81a1a5a3bccaff4593ef8d953 +tty 8b0b29fdcb47907ae0296b8fe829e918e05e300f +char-misc 8992f32c57607bdfaf5de2a2cd26b3b71f3a9d55 +coresight 9e3604d7369cfc0110100eb1a0acab1865ee2d18 +fastrpc dc59e4fea9d83f03bad6bddf3fa2e52491777482 +fpga 4216e549a265701c88df660f42d74a7eb4819af2 +icc 9621c81fd2eb7db4b647814b7b6e537744831e60 +iio 350d1fb9204b13c5f95e511e98b8bcb47574d425 +nfc 9f69d05b5a85c417c73fa2d5c7a2d507ac81cf4b +phy-next ba8376e8c76c6512c98949dffbf4ded0b782a365 +soundwire 5b08a3afd2995e5312c4c47ffea9d21b651e8e13 +extcon 254f49634ee16a731174d2ae34bc50bd5f45e731 +gnss a13c140cc289c0b7b3770bce5b3ad42ab35074aa +vfio 4e3c1fc8abcb8eff062150b4340fa4569696d645 +w1 4d3721b204f961e905714954ff95633337b768e3 +spmi 8cdeaa50eae8dad34885515f62559ee83e7e8dda +staging c6eb4dc5964fdf4086b73b7f0f5dc0d595fb5cf3 +counter-next 353b2e09f44a91e64c6b8117df46b6999c52e465 +mux ac7bde3c53166656d80e3aacc7d274d3c60a6de4 +dmaengine 0d995da5fb97e8c312834575604d4423eb6225b7 +cgroup e0c62cce00d19e9d9d6edc845e38b2ecb505daed +scsi cf1af0ccca54d5547cc31bf476c6a07cf658ad29 +scsi-mkp 30733f28c0347d237ffb5333fdfab7a9a2d4ed34 +vhost ae864da7d762b4c692e2cdf83cad43110d5d46ee +rpmsg d4d61a4b0a52e8f3cdb3e1578602850a3452ec3e +gpio-brgl 146cc263e457ff6055fe7829e4f4f4b0b5d5dd86 +gpio-intel dc59e4fea9d83f03bad6bddf3fa2e52491777482 +pinctrl d067f0f4c96cb5402a111cf649b7bf9c5771ec74 +pinctrl-intel ed1608d5e3c4432c1dcba709668b90f44228c10c +pinctrl-renesas 5a653cedec948423fc8a0180c90b8d05c2239d9d +pinctrl-samsung d441836c9d704d0f3db5dbf44df87af2ba7a9d26 +pinctrl-qcom 1860fb0be224dec0e4d170f46d1cbbc77e25e09e +pwm b4e94b0418ad6dbe62b6ca53369159ed3d9f0d8c +ktest 932cdaf3e273a2727e77af97f79f12577174c5a0 +kselftest 649ba27dfac784427a01f9c95c09ecbcb88900d8 +kunit dc59e4fea9d83f03bad6bddf3fa2e52491777482 +kunit-next dea754ded9518b51740c417d2c1e02ff540784c6 +livepatching e77f165d26f72c280654cff248f5106cb9a53951 +rtc da5e8713aee51dd73310bccf23d28446b39e7b0e +nvdimm e99cb3ecd8334ca21e01ff9a79a916693f58f1fb +at24 dc59e4fea9d83f03bad6bddf3fa2e52491777482 +ntb dc59e4fea9d83f03bad6bddf3fa2e52491777482 +seccomp 41fa04327384148b0e2e828c9be9862c5240e9fa +slimbus c922423ce66bcee6c61d1b5aadea09b29ca81400 +nvmem dc59e4fea9d83f03bad6bddf3fa2e52491777482 +hyperv a4ffc59238be84dd1c26bf1c001543e832674fc6 +auxdisplay e3e3bf40916c1e810df03958cfa7ba6883cdce79 +kgdb fdbdd0ccb30af18d3b29e714ac8d5ab6163279e0 +hmm 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 +cfi dc59e4fea9d83f03bad6bddf3fa2e52491777482 +mhi 9656bcd4c321a799148d00dd830ce7ebf20011da +memblock b3c1ec1a9ad84ec2f14d343d28c6032feaec5b79 +cxl 7098e9cd98a05c0c5de2fae0c2465f9d966fdd07 +zstd 65d1f5507ed2c78c64fce40e44e5574a9419eb09 +efi f56c000d6f5e0b98c1475b2af4fc7c5103afd202 +unicode a511442085c140da9cdbe60e3f0fab1c71480801 +slab e7f630142df2afccce90555e4972e60008222311 +random bb9ff576fdff48c242876f55098a3ee20a29df5d +landlock 172b6a6d8463562b0cbebfd66f770b078f81966b +sysctl 8d75c338f0bcecaa6c9af67f86c176b67b6acf3e +execve ab11176bd3a76058ecafd066d0f9c718dc80f389 +bitmap f4806cc63cc65bd752fd72d84937614dca6504ec +hte 005b25ad11717139ca5c14c9f06c2a60855c2afd +kspp 3421b9b056a6576d0ebac1030eafb48ad0544092 +nolibc b58afc8d1cf85688601b8d7e271125fff666f661 +iommufd 8c07df7cdfcf52f1ff276c588612aabc6c6b8399 +turbostat 1c996a37fd244d19e5dbb715328c1676e28ef607 +pwrseq a39ac4651e3b9d2ca78b6d3dc2a81a6bd25fa616 +capabilities-next 9b0ee13b80798feb0e6a83a6d69e915f23fcb6bc +ipe 028ef9c96e96197026887c0f092424679298aae8 +kcsan a8488ecbd7ba44d65b912dfe88a73f438eba2447 +crc dc59e4fea9d83f03bad6bddf3fa2e52491777482 +keys-next 965e9a2cf23b066d8bdeb690dff9cd7089c5f667 +fwctl e052daab94ee8c4081c91de3549772bd1c235729 +devsec-tsm 3177779ae17db4c66c851f799505fb95c7530c03 +hisilicon a5db65458a911daa6f8927264366dab501715dc0 +device-id 995832b2cebe6969d1b42635db698803ee31294d +kthread fa39ec4f89f2637ed1cdbcde3656825951787668 diff --git a/Next/Trees b/Next/Trees new file mode 100644 index 00000000000000..d95efe8b672802 --- /dev/null +++ b/Next/Trees @@ -0,0 +1,431 @@ +Trees included into this release: + +Name Url +---- --- +origin https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#master +ext4-fixes https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git#fixes +vfs-brauner-fixes https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git#vfs.fixes +fscrypt-current https://git.kernel.org/pub/scm/fs/fscrypt/linux.git#for-current +fsverity-current https://git.kernel.org/pub/scm/fs/fsverity/linux.git#for-current +btrfs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git#next-fixes +vfs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git#fixes +erofs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git#fixes +nfsd-fixes https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux#nfsd-fixes +v9fs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git#fixes/next +overlayfs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs.git#ovl-fixes +fscrypt https://git.kernel.org/pub/scm/fs/fscrypt/linux.git#for-next +btrfs https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git#for-next +ceph https://github.com/ceph/ceph-client.git#master +cifs git://git.samba.org/sfrench/cifs-2.6.git#for-next +configfs https://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux.git#configfs-next +ecryptfs https://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git#next +dlm https://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git#next +erofs https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git#dev +exfat https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat.git#dev +ext3 https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git#for_next +ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git#dev +f2fs https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git#dev +fsverity https://git.kernel.org/pub/scm/fs/fsverity/linux.git#for-next +fuse https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#for-next +gfs2 https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git#for-next +jfs https://github.com/kleikamp/linux-shaggy.git#jfs-next +ksmbd https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/smb.git#ksmbd-for-next +nfs git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git#linux-next +nfs-anna git://git.linux-nfs.org/projects/anna/linux-nfs.git#linux-next +nfsd https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux#nfsd-next +ntfs https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git#ntfs-next +ntfs3 https://github.com/Paragon-Software-Group/linux-ntfs3.git#master +orangefs https://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git#for-next +overlayfs https://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs.git#overlayfs-next +ubifs https://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git#next +v9fs https://github.com/martinetd/linux#9p-next +v9fs-ericvh https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git#ericvh/for-next +xfs https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git#for-next +zonefs https://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs.git#for-next +vfs-brauner https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git#vfs.all +vfs https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git#for-next +mm-hotfixes https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-hotfixes-unstable +kbuild-current https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git#kbuild-fixes-for-next +clang-fixes https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git#clang-fixes-for-next +arc-current https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git#for-curr +arm-current https://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux.git#fixes +arm64-fixes https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux#for-next/fixes +arm-soc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git#arm/fixes +davinci-current https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#davinci/for-current +realtek-fixes https://git.kernel.org/pub/scm/linux/kernel/git/yu_chun/linux.git#fixes +drivers-memory-fixes https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git#fixes +sophgo-fixes https://github.com/sophgo/linux.git#fixes +sophgo-soc-fixes https://github.com/sophgo/linux.git#soc-fixes +m68k-current https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git#for-linus +powerpc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git#fixes +s390-fixes https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git#fixes +net https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git#main +bpf https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/#master +ipsec https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git#master +netfilter https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git#main +ipvs https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git#main +wireless https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git#for-next +ath https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git#for-current +iwlwifi https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git#fixes +wpan https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan.git#master +rdma-fixes https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git#for-rc +sound-current https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git#for-linus +sound-asoc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-linus +regmap-fixes https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-linus +regulator-fixes https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-linus +spi-fixes https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-linus +pci-current https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git#for-linus +driver-core.current https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git#driver-core-linus +tty.current https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-linus +usb.current https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-linus +usb-serial-fixes https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git#usb-linus +phy https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git#fixes +staging.current https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-linus +iio-fixes https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git#fixes-togreg +watchdog-fixes https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#watchdog +counter-current https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter.git#counter-current +char-misc.current https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git#char-misc-linus +soundwire-fixes https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git#fixes +thunderbolt-fixes https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git#fixes +input-current https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git#for-linus +crypto-current https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git#master +libcrypto-fixes https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git#libcrypto-fixes +vfio-fixes https://github.com/awilliam/linux-vfio.git#for-linus +kselftest-fixes https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#fixes +dmaengine-fixes https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git#fixes +backlight-fixes https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git#for-backlight-fixes +mtd-fixes https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git#mtd/fixes +mfd-fixes https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-fixes +v4l-dvb-fixes git://linuxtv.org/media-ci/media-pending.git#fixes +reset-fixes https://git.kernel.org/pub/scm/linux/kernel/git/pza/linux#reset/fixes +mips-fixes https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git#mips-fixes +at91-fixes https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git#at91-fixes +omap-fixes https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap.git#fixes +kvm-fixes git://git.kernel.org/pub/scm/virt/kvm/kvm.git#master +kvms390-fixes https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git#master +kvm-arm-fixes https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git#fixes +hwmon-fixes https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#hwmon +nvdimm-fixes https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git#libnvdimm-fixes +cxl-fixes https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git#fixes +dma-mapping-fixes https://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux.git#dma-mapping-fixes +drivers-x86-fixes https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git#fixes +samsung-krzk-fixes https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git#fixes +pinctrl-samsung-fixes https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git#fixes +pinctrl-qcom-fixes https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#pinctrl-qcom/for-current +devicetree-fixes https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git#dt/linus +dt-krzk-fixes https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt.git#fixes +scsi-fixes https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git#fixes +drm-fixes https://gitlab.freedesktop.org/drm/kernel.git#drm-fixes +drm-intel-fixes https://gitlab.freedesktop.org/drm/i915/kernel.git#for-linux-next-fixes +mmc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git#fixes +rtc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git#rtc-fixes +gnss-fixes https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git#gnss-linus +hyperv-fixes https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git#hyperv-fixes +risc-v-fixes https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git#fixes +riscv-dt-fixes https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git#riscv-dt-fixes +riscv-soc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git#riscv-soc-fixes +fpga-fixes https://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga.git#fixes +spdx https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx.git#spdx-linus +gpio-brgl-fixes https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#gpio/for-current +gpio-intel-fixes https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git#fixes +pinctrl-intel-fixes https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git#fixes +auxdisplay-fixes https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git#fixes +kunit-fixes https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#kunit-fixes +memblock-fixes https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git#fixes +renesas-fixes https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git#fixes +perf-current https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git#perf-tools +efi-fixes https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git#urgent +battery-fixes https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git#fixes +iommufd-fixes https://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git#for-rc +rust-fixes https://github.com/Rust-for-Linux/linux.git#rust-fixes +w1-fixes https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1.git#fixes +pmdomain-fixes https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git#fixes +i2c-andi-fixes https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git#i2c/i2c-fixes +i2c-rust-fixes https://github.com/ikrtn/rust-for-linux#rust-i2c-fixes +sparc-fixes https://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc.git#for-linus +clk-fixes https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-fixes +thead-clk-fixes https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#thead-clk-fixes +tenstorrent-clk-fixes https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git#tenstorrent-clk-fixes +fustini-config-fixes https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#riscv-config-fixes +pwrseq-fixes https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#pwrseq/for-current +thead-dt-fixes https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#thead-dt-fixes +ftrace-fixes https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git#ftrace/fixes +ring-buffer-fixes https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git#ring-buffer/fixes +trace-fixes https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git#trace/fixes +tracefs-fixes https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git#tracefs/fixes +spacemit-fixes https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux#fixes +tip-fixes https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git#tip/urgent +slab-fixes https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git#slab/for-next-fixes +kexec-fixes https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git#kexec-fixes +liveupdate-fixes https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git#fixes +drm-msm-fixes https://gitlab.freedesktop.org/drm/msm.git#msm-fixes +uml-fixes https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git#fixes +fwctl-fixes https://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl.git#for-rc +devsec-tsm-fixes https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git#fixes +drm-rust-fixes https://gitlab.freedesktop.org/drm/rust/kernel.git#for-linux-next-fixes +tenstorrent-dt-fixes https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git#tenstorrent-dt-fixes +nfc-fixes https://codeberg.org/linux-nfc/linux.git#for-linus +drm-misc-fixes https://gitlab.freedesktop.org/drm/misc/kernel.git#for-linux-next-fixes +rust https://github.com/Rust-for-Linux/linux.git#rust-next +rust-interop https://github.com/Rust-for-Linux/linux.git#interop-next +rust-alloc https://github.com/Rust-for-Linux/linux.git#alloc-next +rust-io https://github.com/Rust-for-Linux/linux.git#io-next +rust-pin-init https://github.com/Rust-for-Linux/linux.git#pin-init-next +rust-timekeeping https://github.com/Rust-for-Linux/linux.git#timekeeping-next +rust-xarray https://github.com/Rust-for-Linux/linux.git#xarray-next +rust-analyzer https://github.com/Rust-for-Linux/linux.git#rust-analyzer-next +mm-stable https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-stable +mm-nonmm-stable https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-nonmm-stable +mm-unstable https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-unstable +mm-nonmm-unstable https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-nonmm-unstable +kbuild https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git#kbuild-for-next +clang-format https://github.com/ojeda/linux.git#clang-format +perf https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git#perf-tools-next +compiler-attributes https://github.com/ojeda/linux.git#compiler-attributes +dma-mapping https://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux.git#dma-mapping-for-next +asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic#master +alpha https://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha.git#alpha-next +arm https://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux.git#for-next +arm64 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux#for-next/core +arm-perf https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git#for-next/perf +arm-soc https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git#for-next +amlogic https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git#for-next +asahi-soc https://github.com/AsahiLinux/linux.git#asahi-soc/for-next +at91 https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git#at91-next +bmc https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git#for-next +broadcom https://github.com/Broadcom/stblinux.git#next +cix https://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/cix.git#for-next +davinci https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#davinci/for-next +drivers-memory https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git#for-next +fsl https://git.kernel.org/pub/scm/linux/kernel/git/chleroy/linux.git#soc_fsl +imx-mxs https://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux.git#for-next +mediatek https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux.git#for-next +mvebu https://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu.git#for-next +omap https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap.git#for-next +qcom https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git#for-next +realtek https://git.kernel.org/pub/scm/linux/kernel/git/yu_chun/linux.git#for-next +renesas https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git#next +reset https://git.kernel.org/pub/scm/linux/kernel/git/pza/linux#reset/next +rockchip https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git#for-next +samsung-krzk https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git#for-next +scmi https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git#for-linux-next +sophgo https://github.com/sophgo/linux.git#for-next +sophgo-soc https://github.com/sophgo/linux.git#soc-for-next +spacemit https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux#for-next +stm32 https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git#stm32-next +sunxi https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git#sunxi/for-next +tee https://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git#next +tegra https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git#for-next +tenstorrent-dt https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git#tenstorrent-dt-for-next +fustini-config https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#riscv-config-for-next +thead-dt https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#thead-dt-for-next +ti https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git#ti-next +xilinx https://github.com/Xilinx/linux-xlnx.git#for-next +socfpga https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git#for-next +clk https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-next +clk-imx https://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git#for-next +clk-renesas https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git#renesas-clk +thead-clk https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git#thead-clk-for-next +tenstorrent-clk https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git#tenstorrent-clk-for-next +csky https://github.com/c-sky/csky-linux.git#linux-next +loongarch https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git#loongarch-next +m68k https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git#for-next +m68knommu https://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git#for-next +microblaze git://git.monstr.eu/linux-2.6-microblaze.git#next +mips https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git#mips-next +openrisc https://github.com/openrisc/linux.git#for-next +parisc-hd https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git#for-next +powerpc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git#next +risc-v https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git#for-next +riscv-dt https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git#riscv-dt-for-next +riscv-soc https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git#riscv-soc-for-next +s390 https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git#for-next +sh https://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux.git#for-next +sparc https://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc.git#for-next +uml https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git#next +xtensa https://github.com/jcmvbkbc/linux-xtensa.git#xtensa-for-next +printk https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git#for-next +pci https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git#next +pstore https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/pstore +hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git#for-next +i2c https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#i2c/for-next +i2c-andi https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git#i2c/i2c-next +i2c-rust https://github.com/ikrtn/rust-for-linux#rust-i2c-next +i3c https://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git#i3c/next +dmi https://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging.git#dmi-for-next +hwmon-staging https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#hwmon-next +jc_docs git://git.lwn.net/linux.git#docs-next +v4l-dvb git://linuxtv.org/media-ci/media-pending.git#next +v4l-dvb-next git://linuxtv.org/mchehab/media-next.git#master +pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git#linux-next +cpufreq-arm https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git#cpufreq/arm/linux-next +cpupower https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git#cpupower +devfreq https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git#devfreq-next +pmdomain https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git#next +opp https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git#opp/linux-next +thermal https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git#thermal/linux-next +rdma https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git#for-next +net-next https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git#main +bpf-next https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git#for-next +ipsec-next https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git#master +mlx5-next https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git#mlx5-next +netfilter-next https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git#main +ipvs-next https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git#main +bluetooth https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git#master +wireless-next https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git#for-next +ath-next https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git#for-next +iwlwifi-next https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git#next +wpan-next https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next.git#master +wpan-staging https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next.git#staging +mtd https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git#mtd/next +nand https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git#nand/next +spi-nor https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git#spi-nor/next +crypto https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git#master +libcrypto https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git#libcrypto-next +drm https://gitlab.freedesktop.org/drm/kernel.git#drm-next +drm-exynos https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git#for-linux-next +drm-misc https://gitlab.freedesktop.org/drm/misc/kernel.git#for-linux-next +amdgpu https://gitlab.freedesktop.org/agd5f/linux.git#drm-next +drm-intel https://gitlab.freedesktop.org/drm/i915/kernel.git#for-linux-next +drm-msm https://gitlab.freedesktop.org/drm/msm.git#msm-next +drm-msm-lumag https://gitlab.freedesktop.org/lumag/msm.git#msm-next-lumag +drm-xe https://gitlab.freedesktop.org/drm/xe/kernel.git#drm-xe-next +drm-rust https://gitlab.freedesktop.org/drm/rust/kernel.git#for-linux-next +drm-nova https://gitlab.freedesktop.org/drm/nova.git#nova-next +etnaviv https://git.pengutronix.de/git/lst/linux#etnaviv/next +fbdev https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git#for-next +regmap https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-next +sound https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git#for-next +ieee1394 https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git#for-next +sound-asoc https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-next +modules https://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git#modules-next +input https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git#next +block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git#for-next +device-mapper https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git#for-next +libata https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux#for-next +pcmcia https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git#pcmcia-next +mmc https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git#next +mfd https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-next +backlight https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git#for-backlight-next +battery https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git#for-next +regulator https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-next +security https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git#next +apparmor https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor#apparmor-next +integrity https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity#next-integrity +selinux https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git#next +smack https://github.com/cschaufler/smack-next#next +tomoyo git://git.code.sf.net/p/tomoyo/tomoyo.git#master +tpmdd-tpm https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git#for-next-tpm +tpmdd-keys https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git#for-next-keys +watchdog https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git#watchdog-next +iommu https://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git#next +audit https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git#next +devicetree https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git#for-next +dt-krzk https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt.git#for-next +mailbox https://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox.git#for-next +spi https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-next +tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git#master +kexec https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git#kexec-next +liveupdate https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git#next +clockevents https://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux.git#timers/drivers/next +edac https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git#edac-for-next +ftrace https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git#for-next +rcu https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux#next +paulmck https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git#non-rcu/next +kvm git://git.kernel.org/pub/scm/virt/kvm/kvm.git#next +kvm-arm https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git#next +kvms390 https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git#next +kvm-ppc https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git#topic/ppc-kvm +kvm-riscv https://github.com/kvm-riscv/linux.git#riscv_kvm_next +kvm-x86 https://github.com/kvm-x86/linux.git#next +xen-tip https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git#linux-next +percpu https://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu.git#for-next +workqueues https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git#for-next +sched-ext https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git#for-next +drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git#for-next +chrome-platform https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git#for-next +chrome-platform-firmware https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git#for-firmware-next +hsi https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git#for-next +leds-lj https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git#for-leds-next +ipmi https://github.com/cminyard/linux-ipmi.git#for-next +driver-core https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git#driver-core-next +usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-next +thunderbolt https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git#next +usb-serial https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git#usb-next +tty https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-next +char-misc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git#char-misc-next +coresight https://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git#next +fastrpc https://git.kernel.org/pub/scm/linux/kernel/git/srini/fastrpc.git#for-next +fpga https://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga.git#for-next +icc https://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc.git#icc-next +iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git#togreg +nfc https://codeberg.org/linux-nfc/linux.git#for-next +phy-next https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git#next +soundwire https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git#next +extcon https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git#extcon-next +gnss https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git#gnss-next +vfio https://github.com/awilliam/linux-vfio.git#next +w1 https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1.git#for-next +spmi https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git#spmi-next +staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-next +counter-next https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter.git#counter-next +mux https://gitlab.com/peda-linux/mux.git#for-next +dmaengine https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git#next +cgroup https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git#for-next +scsi https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git#for-next +scsi-mkp https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git#for-next +vhost https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git#linux-next +rpmsg https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git#for-next +gpio-brgl https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#gpio/for-next +gpio-intel https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git#for-next +pinctrl https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git#for-next +pinctrl-intel https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git#for-next +pinctrl-renesas https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git#renesas-pinctrl +pinctrl-samsung https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git#for-next +pinctrl-qcom https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#pinctrl-qcom/for-next +pwm https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git#pwm/for-next +ktest https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git#for-next +kselftest https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#next +kunit https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#test +kunit-next https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git#kunit +livepatching https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git#for-next +rtc https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git#rtc-next +nvdimm https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git#libnvdimm-for-next +at24 https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#at24/for-next +ntb https://github.com/jonmason/ntb.git#ntb-next +seccomp https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/seccomp +slimbus https://git.kernel.org/pub/scm/linux/kernel/git/srini/slimbus.git#for-next +nvmem https://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git#for-next +hyperv https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git#hyperv-next +auxdisplay https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git#for-next +kgdb https://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git#kgdb/for-next +hmm https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git#hmm +cfi https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git#cfi/next +mhi https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git#mhi-next +memblock https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git#for-next +cxl https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git#next +zstd https://github.com/terrelln/linux.git#zstd-next +efi https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git#next +unicode https://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode.git#for-next +slab https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git#slab/for-next +random https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git#master +landlock https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git#next +sysctl https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git#sysctl-next +execve https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/execve +bitmap https://github.com/norov/linux.git#bitmap-for-next +hte https://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux.git#for-next +kspp https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git#for-next/kspp +nolibc https://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc.git#for-next +iommufd https://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git#for-next +turbostat https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git#next +pwrseq https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git#pwrseq/for-next +capabilities-next https://git.kernel.org/pub/scm/linux/kernel/git/sergeh/linux.git#caps-next +ipe https://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe.git#next +kcsan https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git#next +crc https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git#crc-next +keys-next https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git#keys-next +fwctl https://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl.git#for-next +devsec-tsm https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git#next +hisilicon https://github.com/hisilicon/linux-hisi.git#for-next +device-id https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git#device-id-rework +kthread https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git#for-next diff --git a/Next/merge.log b/Next/merge.log new file mode 100644 index 00000000000000..0aaee04f57767a --- /dev/null +++ b/Next/merge.log @@ -0,0 +1,15678 @@ +$ date -R +Thu, 20 Aug 2026 12:36:32 +0100 +$ git checkout master +Already on 'master' +$ git reset --hard stable +Updating files: 37% (4100/10828) Updating files: 38% (4115/10828) Updating files: 39% (4223/10828) Updating files: 40% (4332/10828) Updating files: 41% (4440/10828) Updating files: 42% (4548/10828) Updating files: 43% (4657/10828) Updating files: 44% (4765/10828) Updating files: 45% (4873/10828) Updating files: 46% (4981/10828) Updating files: 47% (5090/10828) Updating files: 48% (5198/10828) Updating files: 49% (5306/10828) Updating files: 50% (5414/10828) Updating files: 51% (5523/10828) Updating files: 52% (5631/10828) Updating files: 53% (5739/10828) Updating files: 54% (5848/10828) Updating files: 55% (5956/10828) Updating files: 56% (6064/10828) Updating files: 57% (6172/10828) Updating files: 58% (6281/10828) Updating files: 59% (6389/10828) Updating files: 60% (6497/10828) Updating files: 61% (6606/10828) Updating files: 62% (6714/10828) Updating files: 63% (6822/10828) Updating files: 64% (6930/10828) Updating files: 65% (7039/10828) Updating files: 66% (7147/10828) Updating files: 67% (7255/10828) Updating files: 68% (7364/10828) Updating files: 69% (7472/10828) Updating files: 70% (7580/10828) Updating files: 71% (7688/10828) Updating files: 71% (7787/10828) Updating files: 72% (7797/10828) Updating files: 73% (7905/10828) Updating files: 74% (8013/10828) Updating files: 75% (8121/10828) Updating files: 76% (8230/10828) Updating files: 77% (8338/10828) Updating files: 78% (8446/10828) Updating files: 79% (8555/10828) Updating files: 80% (8663/10828) Updating files: 81% (8771/10828) Updating files: 82% (8879/10828) Updating files: 83% (8988/10828) Updating files: 84% (9096/10828) Updating files: 85% (9204/10828) Updating files: 86% (9313/10828) Updating files: 87% (9421/10828) Updating files: 88% (9529/10828) Updating files: 89% (9637/10828) Updating files: 90% (9746/10828) Updating files: 91% (9854/10828) Updating files: 92% (9962/10828) Updating files: 93% (10071/10828) Updating files: 94% (10179/10828) Updating files: 95% (10287/10828) Updating files: 96% (10395/10828) Updating files: 97% (10504/10828) Updating files: 98% (10612/10828) Updating files: 99% (10720/10828) Updating files: 100% (10828/10828) Updating files: 100% (10828/10828), done. +HEAD is now at bd5f485f3f026 Merge tag 'soc-arm-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc +Merging origin/master (a4ff2be345d0a Merge tag 'v7.3-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git origin/master +Updating bd5f485f3f026..a4ff2be345d0a +Fast-forward (no commit created; -m option ignored) + CREDITS | 7 + + Documentation/ABI/testing/sysfs-class-spi-master | 34 + + Documentation/ABI/testing/sysfs-firmware-gsmi | 2 +- + .../ABI/testing/sysfs-firmware-sev-vulnerabilities | 19 + + Documentation/ABI/testing/sysfs-uevent | 2 +- + Documentation/admin-guide/device-mapper/dm-ima.rst | 7 +- + .../admin-guide/device-mapper/dm-inlinecrypt.rst | 2 +- + .../admin-guide/device-mapper/dm-integrity.rst | 13 + + Documentation/admin-guide/kernel-parameters.txt | 3 + + .../admin-guide/media/em28xx-cardlist.rst | 4 + + Documentation/admin-guide/sysctl/crypto.rst | 36 + + Documentation/arch/arm64/silicon-errata.rst | 2 + + Documentation/crypto/architecture.rst | 2 +- + Documentation/crypto/userspace-if.rst | 13 +- + .../bindings/arm/arm,juno-fpga-apb-regs.yaml | 2 +- + .../devicetree/bindings/arm/arm,vexpress-juno.yaml | 2 +- + .../devicetree/bindings/arm/arm,vexpress-scc.yaml | 2 +- + .../bindings/arm/firmware/linaro,optee-tz.yaml | 8 +- + .../devicetree/bindings/arm/mediatek.yaml | 2 +- + Documentation/devicetree/bindings/arm/omap/l4.txt | 37 - + Documentation/devicetree/bindings/arm/psci.yaml | 18 +- + .../bindings/arm/qcom,coresight-tnoc.yaml | 2 +- + .../bindings/arm/qcom,coresight-tpdm.yaml | 2 +- + .../devicetree/bindings/arm/qcom-soc.yaml | 4 +- + Documentation/devicetree/bindings/arm/qcom.yaml | 4 +- + .../bindings/arm/samsung/samsung-soc.yaml | 4 +- + Documentation/devicetree/bindings/arm/xen.txt | 62 - + Documentation/devicetree/bindings/arm/xen.yaml | 110 ++ + Documentation/devicetree/bindings/ata/st,ahci.yaml | 22 +- + .../devicetree/bindings/bus/ti,da850-mstpri.txt | 20 - + .../devicetree/bindings/bus/ti,da850-mstpri.yaml | 37 + + .../devicetree/bindings/bus/ti,omap-l4.yaml | 140 ++ + .../bindings/clock/qcom,dispcc-sm8x50.yaml | 2 +- + .../bindings/clock/qcom,gcc-apq8064.yaml | 2 +- + .../bindings/clock/qcom,gcc-apq8084.yaml | 2 +- + .../bindings/clock/qcom,gcc-ipq6018.yaml | 2 +- + .../bindings/clock/qcom,gcc-ipq8064.yaml | 2 +- + .../bindings/clock/qcom,gcc-mdm9607.yaml | 2 +- + .../bindings/clock/qcom,gcc-mdm9615.yaml | 2 +- + .../bindings/clock/qcom,gcc-msm8660.yaml | 2 +- + .../bindings/clock/qcom,gcc-msm8909.yaml | 2 +- + .../bindings/clock/qcom,gcc-msm8916.yaml | 2 +- + .../bindings/clock/qcom,gcc-msm8953.yaml | 2 +- + .../bindings/clock/qcom,gcc-msm8974.yaml | 2 +- + .../devicetree/bindings/clock/qcom,gcc-sdm660.yaml | 2 +- + .../devicetree/bindings/clock/qcom,gpucc.yaml | 2 +- + .../bindings/clock/qcom,ipq5018-gcc.yaml | 2 +- + .../bindings/clock/qcom,ipq9574-gcc.yaml | 2 +- + .../bindings/clock/qcom,qca8k-nsscc.yaml | 2 +- + .../bindings/clock/qcom,qcm2290-gpucc.yaml | 2 +- + .../devicetree/bindings/clock/qcom,rpmcc.yaml | 2 +- + .../bindings/clock/qcom,sc7280-lpasscorecc.yaml | 2 +- + .../bindings/clock/qcom,sc8280xp-lpasscc.yaml | 2 +- + .../bindings/clock/qcom,sm6115-lpasscc.yaml | 2 +- + .../bindings/clock/qcom,sm8350-videocc.yaml | 2 +- + .../devicetree/bindings/clock/qcom,videocc.yaml | 2 +- + .../clock/renesas,rcar-usb2-clock-sel.yaml | 4 +- + .../bindings/clock/samsung,exynos5260-clock.yaml | 6 +- + .../bindings/clock/samsung,exynos5410-clock.yaml | 2 +- + .../bindings/clock/samsung,exynos5433-clock.yaml | 2 +- + .../bindings/clock/samsung,exynos7-clock.yaml | 2 +- + .../bindings/clock/samsung,exynos850-clock.yaml | 2 +- + .../bindings/clock/samsung,exynosautov9-clock.yaml | 2 +- + .../clock/samsung,exynosautov920-clock.yaml | 2 +- + .../bindings/clock/samsung,s5pv210-clock.yaml | 2 +- + .../bindings/crypto/qcom,inline-crypto-engine.yaml | 27 +- + .../devicetree/bindings/crypto/qcom,prng.yaml | 2 + + .../devicetree/bindings/crypto/qcom-qce.yaml | 1 + + .../devfreq/event/samsung,exynos-ppmu.yaml | 2 +- + .../bindings/display/msm/dsi-controller-main.yaml | 20 +- + .../bindings/display/samsung/samsung,fimd.yaml | 4 +- + .../bindings/display/ti/ti,am65x-dss.yaml | 12 +- + .../bindings/display/ti/ti,j721e-dss.yaml | 96 +- + .../devicetree/bindings/display/ti/ti,k2g-dss.yaml | 36 +- + .../bindings/display/verisilicon,dc.yaml | 2 + + .../bindings/dsp/mediatek,mt8195-dsp.yaml | 2 +- + .../devicetree/bindings/dts-coding-style.rst | 15 +- + .../bindings/dvfs/performance-domain.yaml | 2 +- + .../devicetree/bindings/firmware/arm,scmi.yaml | 2 +- + .../devicetree/bindings/firmware/arm,scpi.yaml | 2 +- + .../devicetree/bindings/firmware/qcom,scm.yaml | 3 + + .../devicetree/bindings/gpio/cdns,gpio.yaml | 7 +- + .../devicetree/bindings/gpio/gpio-pca95xx.yaml | 3 + + .../bindings/gpio/realtek,rtd1625-gpio.yaml | 71 + + .../bindings/gpio/rockchip,gpio-bank.yaml | 7 + + .../devicetree/bindings/gpio/st,nomadik-gpio.yaml | 2 +- + .../devicetree/bindings/gpu/img,powervr-rogue.yaml | 1 + + .../devicetree/bindings/hwmon/adi,adm1275.yaml | 43 +- + .../devicetree/bindings/hwmon/adi,adt7470.yaml | 58 + + .../bindings/hwmon/amphenol,chipcap2.yaml | 6 + + .../bindings/hwmon/eswin,eic7700-pvt.yaml | 72 + + .../bindings/hwmon/hpe,gxp-fan-ctrl.yaml | 16 +- + .../bindings/hwmon/pmbus/adi,max20830.yaml | 30 +- + .../bindings/hwmon/pmbus/adi,vt7505.yaml | 85 + + .../bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 +- + .../bindings/hwmon/pmbus/silergy,sq24860.yaml | 74 + + .../bindings/hwmon/pmbus/ti,lm25066.yaml | 20 + + .../devicetree/bindings/hwmon/sensirion,sht30.yaml | 71 + + .../devicetree/bindings/hwmon/smsc,emc1403.yaml | 203 ++ + .../devicetree/bindings/hwmon/ti,ina2xx.yaml | 3 + + .../bindings/i2c/altr,softip-i2c-v1.0.yaml | 62 + + .../devicetree/bindings/i2c/cdns,i2c-r1p10.yaml | 10 +- + .../devicetree/bindings/i2c/i2c-altera.txt | 39 - + .../devicetree/bindings/i2c/i2c-axxia.txt | 30 - + .../devicetree/bindings/i2c/lsi,api2c.yaml | 52 + + .../bindings/i2c/qcom,sa8255p-geni-i2c.yaml | 68 + + .../devicetree/bindings/i2c/renesas,rcar-i2c.yaml | 6 + + .../bindings/i2c/samsung,s3c2410-i2c.yaml | 2 +- + .../devicetree/bindings/i2c/st,sti-i2c.yaml | 2 +- + .../bindings/input/focaltech,ft8112.yaml | 9 +- + .../bindings/input/gpio-charlieplex-keypad.yaml | 2 +- + .../devicetree/bindings/input/imagis,isa1200.yaml | 141 ++ + .../bindings/input/microchip,cap11xx.yaml | 92 +- + .../devicetree/bindings/input/syna,rmi4.yaml | 11 +- + .../bindings/input/ti,tps65217-pwrbutton.yaml | 42 + + .../bindings/input/tps65218-pwrbutton.txt | 30 - + .../bindings/interconnect/qcom,msm8998-bwmon.yaml | 6 +- + .../bindings/interconnect/samsung,exynos-bus.yaml | 14 +- + .../allwinner,sun7i-a20-sc-nmi.yaml | 3 + + .../mediatek,mt6577-sysirq.yaml | 3 +- + .../interrupt-controller/sifive,plic-1.0.0.yaml | 1 + + .../devicetree/bindings/iommu/arm,smmu.yaml | 8 + + .../devicetree/bindings/iommu/ti,omap-iommu.txt | 59 - + .../devicetree/bindings/iommu/ti,omap-iommu.yaml | 114 ++ + .../devicetree/bindings/leds/qcom,pm8058-led.yaml | 4 +- + .../devicetree/bindings/leds/skyworks,aat1290.yaml | 6 +- + .../devicetree/bindings/mailbox/arm,mhuv3.yaml | 2 +- + .../bindings/mailbox/st,sti-mailbox.yaml | 2 +- + .../devicetree/bindings/media/cec/cec-gpio.yaml | 2 +- + .../devicetree/bindings/media/i2c/sony,imx355.yaml | 11 +- + .../devicetree/bindings/media/i2c/sony,imx678.yaml | 130 ++ + .../devicetree/bindings/media/i2c/st,vd55g1.yaml | 3 +- + .../devicetree/bindings/media/nxp,imx8-isi.yaml | 4 +- + .../devicetree/bindings/media/qcom,milos-iris.yaml | 166 ++ + .../bindings/media/qcom,qcm2290-camss.yaml | 15 +- + Documentation/devicetree/bindings/media/rc.yaml | 4 +- + .../devicetree/bindings/media/renesas,fcp.yaml | 18 +- + .../devicetree/bindings/media/renesas,vsp1.yaml | 17 +- + .../devicetree/bindings/media/ti,am437x-vpfe.yaml | 93 + + .../devicetree/bindings/media/ti,da850-vpif.txt | 106 - + .../devicetree/bindings/media/ti,da850-vpif.yaml | 168 ++ + .../devicetree/bindings/media/ti-am437x-vpfe.txt | 61 - + .../bindings/memory-controllers/renesas,dbsc.yaml | 2 +- + .../devicetree/bindings/mfd/maxim,max77620.yaml | 2 +- + .../bindings/mmc/samsung,exynos-dw-mshc.yaml | 2 +- + .../bindings/net/wireless/qcom,ath10k.yaml | 34 +- + Documentation/devicetree/bindings/opp/opp-v2.yaml | 28 +- + .../bindings/phy/samsung,mipi-video-phy.yaml | 4 +- + .../devicetree/bindings/phy/samsung,usb2-phy.yaml | 2 +- + .../bindings/phy/samsung,usb3-drd-phy.yaml | 2 +- + .../bindings/pinctrl/mediatek,mt7988-pinctrl.yaml | 2 +- + .../bindings/pinctrl/samsung,pinctrl.yaml | 2 +- + .../bindings/power/amlogic,meson-sec-pwrc.yaml | 1 + + .../bindings/power/mediatek,power-controller.yaml | 22 +- + .../devicetree/bindings/power/qcom,rpmpd.yaml | 4 + + .../bindings/power/renesas,r8a78000-mdlc.yaml | 61 + + .../bindings/power/renesas,rcar-sysc.yaml | 2 +- + .../bindings/power/reset/keystone-reset.txt | 67 - + .../bindings/power/reset/restart-handler.yaml | 8 +- + .../bindings/power/reset/ti,keystone-reset.yaml | 81 + + .../bindings/power/supply/maxim,max17042.yaml | 4 +- + .../devicetree/bindings/power/ti,smartreflex.yaml | 50 + + .../devicetree/bindings/power/ti-smartreflex.txt | 47 - + Documentation/devicetree/bindings/ptp/fsl,ptp.yaml | 12 +- + .../bindings/pwm/nvidia,tegra20-pwm.yaml | 1 + + .../devicetree/bindings/pwm/pwm-sifive.yaml | 2 +- + .../bindings/regulator/fcs,fan53555.yaml | 8 + + .../bindings/regulator/lltc,ltc3589.yaml | 149 ++ + .../devicetree/bindings/regulator/ltc3589.txt | 99 - + .../bindings/regulator/maxim,max77802.yaml | 4 +- + .../regulator/mediatek,mt6358-regulator.yaml | 2 +- + .../bindings/regulator/nxp,pf8x00-regulator.yaml | 12 +- + .../bindings/regulator/pbias-regulator.txt | 32 - + .../regulator/qcom,sdm845-refgen-regulator.yaml | 31 +- + .../regulator/qcom,usb-vbus-regulator.yaml | 50 +- + .../bindings/regulator/richtek,rtq2208.yaml | 6 +- + .../bindings/regulator/rohm,bd71815-regulator.yaml | 27 +- + .../bindings/regulator/rohm,bd71828-regulator.yaml | 20 +- + .../bindings/regulator/rohm,bd71837-regulator.yaml | 20 +- + .../bindings/regulator/rohm,bd71847-regulator.yaml | 20 +- + .../bindings/regulator/rohm,bd72720-regulator.yaml | 40 +- + .../bindings/regulator/rohm,pmic-states.yaml | 57 + + .../bindings/regulator/ti,pbias-omap.yaml | 137 ++ + .../devicetree/bindings/regulator/ti,tps51632.yaml | 55 + + .../bindings/regulator/tps51632-regulator.txt | 27 - + .../bindings/rng/inside-secure,safexcel-eip76.yaml | 2 +- + .../bindings/serial/qcom,msm-uartdm.yaml | 2 +- + .../devicetree/bindings/slimbus/slimbus.yaml | 4 +- + .../bindings/soc/qcom/qcom,apr-services.yaml | 2 +- + .../bindings/soc/qcom/qcom,rpmh-rsc.yaml | 8 +- + .../devicetree/bindings/soc/qcom/qcom,wcnss.yaml | 2 +- + .../bindings/soc/renesas/renesas-soc.yaml | 4 +- + .../bindings/sound/amlogic,axg-sound-card.yaml | 2 +- + .../bindings/sound/amlogic,gx-sound-card.yaml | 2 +- + .../devicetree/bindings/sound/cirrus,cs35l36.yaml | 240 +++ + .../devicetree/bindings/sound/cirrus,cs42l43.yaml | 1 + + .../devicetree/bindings/sound/cs35l36.txt | 168 -- + .../devicetree/bindings/sound/dmic-codec.yaml | 4 + + .../bindings/sound/eukrea,asoc-tlv320.yaml | 61 + + .../devicetree/bindings/sound/eukrea-tlv320.txt | 26 - + .../devicetree/bindings/sound/everest,es8316.yaml | 28 + + .../devicetree/bindings/sound/fsl,micfil.yaml | 4 + + .../bindings/sound/loongson,ls-audio-card.yaml | 53 +- + .../bindings/sound/loongson,ls2k1000-i2s.yaml | 22 +- + .../bindings/sound/mediatek,mtk-btcvsd-snd.yaml | 59 + + .../devicetree/bindings/sound/mtk-btcvsd-snd.txt | 24 - + .../bindings/sound/neofidelity,ntp8918.yaml | 2 +- + .../devicetree/bindings/sound/omap-dmic.txt | 20 - + .../sound/qcom,msm8916-wcd-digital-codec.yaml | 8 +- + .../sound/qcom,pm8916-wcd-analog-codec.yaml | 11 +- + .../bindings/sound/qcom,q6apm-lpass-dais.yaml | 50 + + .../devicetree/bindings/sound/qcom,q6asm-dais.yaml | 2 +- + .../bindings/sound/qcom,q6dsp-lpass-ports.yaml | 4 +- + .../devicetree/bindings/sound/qcom,sm8250.yaml | 31 + + .../devicetree/bindings/sound/qcom,wsa8855.yaml | 93 + + .../devicetree/bindings/sound/realtek,rt1015.yaml | 2 +- + .../bindings/sound/renesas,r9a09g047-sound.yaml | 2 +- + .../devicetree/bindings/sound/spacemit,k1-i2s.yaml | 64 +- + .../devicetree/bindings/sound/st,sta32x.txt | 2 +- + .../devicetree/bindings/sound/ti,omap4-dmic.yaml | 58 + + .../devicetree/bindings/sound/wlf,wm8524.yaml | 4 + + .../bindings/spi/allwinner,sun6i-a31-spi.yaml | 6 + + .../bindings/spi/andestech,ae350-spi.yaml | 4 - + .../devicetree/bindings/spi/atmel,quadspi.yaml | 1 + + .../devicetree/bindings/spi/axiado,ax3000-spi.yaml | 1 - + .../bindings/spi/cavium,octeon-3010-spi.yaml | 61 + + .../bindings/spi/marvell,armada-3700-spi.yaml | 3 - + .../bindings/spi/nuvoton,ma35d1-qspi.yaml | 65 + + .../devicetree/bindings/spi/nxp,imx94-xspi.yaml | 10 + + .../bindings/spi/qcom,sa8255p-geni-spi.yaml | 68 + + .../devicetree/bindings/spi/snps,dw-apb-ssi.yaml | 22 + + .../devicetree/bindings/spi/spi-cadence.yaml | 1 - + .../devicetree/bindings/spi/spi-octeon.txt | 33 - + .../devicetree/bindings/spi/st,stm32-qspi.yaml | 3 + + .../devicetree/bindings/sram/qcom,imem.yaml | 20 + + .../devicetree/bindings/submitting-patches.rst | 3 + + .../bindings/thermal/samsung,exynos-thermal.yaml | 4 +- + .../devicetree/bindings/trivial-devices.yaml | 4 + + .../devicetree/bindings/usb/qcom,dwc3.yaml | 12 +- + .../devicetree/bindings/usb/qcom,snps-dwc3.yaml | 12 +- + .../devicetree/bindings/usb/ti,twl4030-usb.yaml | 2 +- + .../devicetree/bindings/vendor-prefixes.yaml | 4 + + .../devicetree/bindings/watchdog/apple,wdt.yaml | 3 + + .../bindings/watchdog/microchip,pic32-dmt.txt | 19 - + .../bindings/watchdog/microchip,pic32-wdt.txt | 18 - + .../bindings/watchdog/microchip,pic32mzda-dmt.yaml | 45 + + .../bindings/watchdog/microchip,pic32mzda-wdt.yaml | 44 + + .../bindings/watchdog/nuvoton,ma35d1-wdt.yaml | 55 + + .../bindings/watchdog/nuvoton,npcm750-wdt.yaml | 14 + + .../devicetree/bindings/watchdog/qcom-wdt.yaml | 1 + + .../devicetree/bindings/watchdog/snps,dw-wdt.yaml | 1 + + .../devicetree/bindings/writing-schema.rst | 13 +- + Documentation/driver-api/infrastructure.rst | 4 + + .../driver-api/media/maintainer-entry-profile.rst | 4 + + Documentation/driver-api/vfio.rst | 89 +- + Documentation/hid/hidintro.rst | 50 + + Documentation/hwmon/adm1275.rst | 24 + + Documentation/hwmon/asus_ec_sensors.rst | 5 + + Documentation/hwmon/asus_rog_ryujin.rst | 25 +- + Documentation/hwmon/chipcap2.rst | 2 + + Documentation/hwmon/coretemp.rst | 4 +- + Documentation/hwmon/corsair-psu.rst | 6 +- + Documentation/hwmon/emc1403.rst | 8 +- + Documentation/hwmon/index.rst | 6 + + Documentation/hwmon/kb9002.rst | 64 + + Documentation/hwmon/max20830.rst | 27 +- + Documentation/hwmon/max34440.rst | 26 +- + Documentation/hwmon/mpq82d00.rst | 73 + + Documentation/hwmon/mpq8646.rst | 300 +++ + Documentation/hwmon/nct6775.rst | 24 + + Documentation/hwmon/nzxt-kraken3.rst | 1 + + Documentation/hwmon/sg2042-mcu.rst | 2 +- + Documentation/hwmon/sht3x.rst | 17 +- + Documentation/hwmon/sq24860.rst | 96 + + Documentation/hwmon/tvs-mpfs.rst | 53 + + Documentation/hwmon/vt7505.rst | 89 + + Documentation/hwmon/yogafan.rst | 27 +- + Documentation/process/maintainer-devicetree.rst | 72 + + Documentation/security/credentials.rst | 6 +- + Documentation/sound/alsa-configuration.rst | 5 + + Documentation/sound/hd-audio/notes.rst | 2 +- + Documentation/spi/index.rst | 1 + + Documentation/spi/instantiating-devices.rst | 88 + + Documentation/tools/rtla/common_appendix.txt | 17 + + Documentation/tools/rtla/common_options.txt | 13 +- + .../tools/rtla/common_osnoise_options.txt | 4 + + .../tools/rtla/common_timerlat_options.txt | 4 + + Documentation/trace/ftrace.rst | 5 + + Documentation/trace/rv/monitor_rtapp.rst | 63 +- + .../translations/zh_CN/security/credentials.rst | 4 +- + .../media/cec/cec-ioc-adap-g-log-addrs.rst | 7 + + .../userspace-api/media/dvb/legacy_dvb_video.rst | 2 +- + .../media/v4l/ext-ctrls-colorimetry.rst | 12 +- + .../userspace-api/media/v4l/meta-formats.rst | 1 + + .../userspace-api/media/v4l/metafmt-rppx1.rst | 99 + + Documentation/userspace-api/media/v4l/v4l2-isp.rst | 43 +- + .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 15 +- + .../media/v4l/vidioc-subdev-g-routing.rst | 2 +- + Documentation/watchdog/index.rst | 1 + + Documentation/watchdog/npcm_wdt.rst | 71 + + MAINTAINERS | 121 +- + arch/arm/configs/multi_v7_defconfig | 3 +- + arch/arm/configs/qcom_defconfig | 2 +- + arch/arm64/configs/defconfig | 3 +- + arch/arm64/kernel/pi/idreg-override.c | 2 + + arch/mips/alchemy/board-xxs1500.c | 2 +- + arch/mips/alchemy/devboards/db1000.c | 2 +- + arch/mips/alchemy/devboards/db1200.c | 2 +- + arch/mips/alchemy/devboards/db1550.c | 2 +- + arch/mips/bcm47xx/workarounds.c | 2 +- + arch/mips/bcm63xx/boards/board_bcm963xx.c | 1 + + .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 2 +- + arch/powerpc/crypto/aes_cbc.c | 6 +- + arch/powerpc/platforms/powermac/low_i2c.c | 2 +- + arch/sh/Kconfig | 1 + + arch/sh/boards/Kconfig | 8 + + arch/sh/boards/board-magicpanelr2.c | 2 +- + arch/sh/boards/board-sh7757lcr.c | 2 +- + arch/sh/boards/board-urquell.c | 2 +- + arch/sh/boards/mach-ap325rxa/setup.c | 2 +- + arch/sh/boards/mach-ecovec24/setup.c | 2 +- + arch/sh/boards/mach-highlander/Kconfig | 1 + + arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 2 +- + arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 2 +- + arch/sh/boards/mach-kfr2r09/setup.c | 2 +- + arch/sh/boards/mach-migor/lcd_qvga.c | 2 +- + arch/sh/boards/mach-migor/setup.c | 2 +- + arch/sh/boards/mach-rsk/Kconfig | 3 + + arch/sh/boards/mach-rsk/devices-rsk7269.c | 1 - + arch/sh/boards/mach-se/7724/setup.c | 2 +- + arch/sh/include/mach-common/mach/magicpanelr2.h | 2 - + arch/sh/kernel/cpu/sh4a/setup-shx3.c | 2 +- + arch/x86/Kconfig | 1 + + arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- + crypto/af_alg.c | 76 +- + crypto/algif_aead.c | 11 + + crypto/algif_hash.c | 24 + + crypto/algif_rng.c | 9 + + crypto/algif_skcipher.c | 23 + + crypto/api.c | 2 +- + crypto/crypto_user.c | 9 +- + crypto/ecc.c | 98 +- + crypto/hctr2.c | 3 +- + crypto/krb5/krb5_api.c | 8 +- + crypto/lrw.c | 2 +- + crypto/lskcipher.c | 4 +- + crypto/xts.c | 3 +- + drivers/acpi/arm64/apmt.c | 2 +- + drivers/acpi/arm64/iort.c | 2 +- + drivers/acpi/bus.c | 6 +- + drivers/acpi/scan.c | 2 + + drivers/ata/ahci_da850.c | 17 +- + drivers/ata/ahci_platform.c | 4 +- + drivers/ata/ahci_qoriq.c | 2 +- + drivers/ata/ahci_seattle.c | 4 +- + drivers/ata/ahci_xgene.c | 6 +- + drivers/ata/libata-core.c | 79 +- + drivers/ata/libata-eh.c | 6 +- + drivers/ata/libata-scsi.c | 716 ++++++- + drivers/ata/libata-sff.c | 24 +- + drivers/ata/libata.h | 2 +- + drivers/ata/pata_ep93xx.c | 30 +- + drivers/ata/pata_mpc52xx.c | 4 +- + drivers/ata/pata_pxa.c | 52 +- + drivers/ata/pata_rb532_cf.c | 16 +- + drivers/ata/sata_highbank.c | 18 +- + drivers/ata/sata_mv.c | 52 +- + drivers/base/Kconfig | 9 - + drivers/base/arch_numa.c | 4 - + drivers/base/attribute_container.c | 7 +- + drivers/base/core.c | 8 +- + drivers/base/dd.c | 4 +- + drivers/base/firmware_loader/builtin/Makefile | 32 +- + drivers/base/firmware_loader/builtin/main.c | 2 + + drivers/base/firmware_loader/fallback.c | 10 + + drivers/base/isa.c | 16 +- + drivers/base/module.c | 2 +- + drivers/base/platform.c | 90 +- + drivers/base/property.c | 41 +- + drivers/base/regmap/internal.h | 2 +- + drivers/base/regmap/regcache-flat.c | 4 +- + drivers/base/regmap/regcache-maple.c | 8 +- + drivers/base/regmap/regcache-rbtree.c | 8 +- + drivers/base/regmap/regcache.c | 38 +- + drivers/base/regmap/regmap-irq.c | 22 + + drivers/base/soc.c | 15 +- + drivers/base/swnode.c | 81 +- + drivers/base/test/Kconfig | 6 + + drivers/base/test/Makefile | 2 + + drivers/base/test/platform-device-test.c | 180 ++ + drivers/base/test/property-entry-test.c | 137 ++ + drivers/base/test/swnode-devlink-test.c | 337 ++++ + drivers/base/transport_class.c | 5 +- + drivers/char/hw_random/Kconfig | 13 +- + drivers/char/hw_random/Makefile | 1 + + drivers/char/hw_random/airoha-trng.c | 4 +- + drivers/char/hw_random/atmel-rng.c | 2 +- + drivers/char/hw_random/cctrng.c | 2 +- + drivers/char/hw_random/core.c | 105 +- + drivers/char/hw_random/hisi-trng-v2.c | 2 +- + drivers/char/hw_random/imx-rngc.c | 6 +- + drivers/char/hw_random/jh7110-trng.c | 3 +- + drivers/char/hw_random/ks-sa-rng.c | 9 +- + drivers/char/hw_random/omap-rng.c | 35 +- + drivers/{crypto => char/hw_random}/qcom-rng.c | 156 +- + drivers/char/hw_random/stm32-rng.c | 10 +- + drivers/char/hw_random/xgene-rng.c | 4 +- + drivers/char/hw_random/xilinx-trng.c | 32 +- + drivers/clk/imx/clk-imx8qxp.c | 1 + + drivers/cpufreq/rcpufreq_dt.rs | 1 - + drivers/crypto/Kconfig | 18 +- + drivers/crypto/Makefile | 1 - + drivers/crypto/allwinner/Kconfig | 16 - + drivers/crypto/allwinner/sun8i-ce/Makefile | 1 - + drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 67 +- + drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 159 -- + drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 29 - + drivers/crypto/allwinner/sun8i-ss/Makefile | 1 - + drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 49 +- + drivers/crypto/allwinner/sun8i-ss/sun8i-ss-prng.c | 177 -- + drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 23 - + drivers/crypto/amcc/crypto4xx_core.c | 34 +- + drivers/crypto/amlogic/amlogic-gxl-core.c | 4 +- + drivers/crypto/aspeed/aspeed-acry.c | 6 +- + drivers/crypto/aspeed/aspeed-hace.c | 6 +- + drivers/crypto/atmel-aes.c | 4 +- + drivers/crypto/atmel-ecc.c | 66 +- + drivers/crypto/atmel-i2c.c | 5 +- + drivers/crypto/atmel-sha.c | 4 +- + drivers/crypto/atmel-sha204a.c | 16 +- + drivers/crypto/atmel-tdes.c | 70 +- + drivers/crypto/bcm/cipher.c | 4 +- + drivers/crypto/caam/Kconfig | 9 - + drivers/crypto/caam/Makefile | 1 - + drivers/crypto/caam/caamprng.c | 241 --- + drivers/crypto/caam/intern.h | 15 - + drivers/crypto/caam/jr.c | 48 +- + drivers/crypto/cavium/nitrox/nitrox_hal.c | 3 +- + drivers/crypto/ccp/ccp-crypto-sha.c | 2 +- + drivers/crypto/ccp/sev-dev.c | 196 +- + drivers/crypto/ccp/sev-dev.h | 3 + + drivers/crypto/ccree/cc_driver.c | 4 +- + drivers/crypto/gemini/sl3516-ce-cipher.c | 8 - + drivers/crypto/gemini/sl3516-ce-core.c | 4 +- + drivers/crypto/hisilicon/qm.c | 5 +- + drivers/crypto/hisilicon/sec/sec_drv.c | 19 +- + drivers/crypto/hisilicon/sec2/sec.h | 3 - + drivers/crypto/hisilicon/sec2/sec_crypto.c | 37 +- + drivers/crypto/img-hash.c | 4 +- + drivers/crypto/inside-secure/eip93/eip93-main.c | 6 +- + drivers/crypto/inside-secure/eip93/eip93-main.h | 22 +- + drivers/crypto/inside-secure/safexcel.c | 4 +- + drivers/crypto/intel/iaa/iaa_crypto_main.c | 272 ++- + drivers/crypto/intel/iaa/iaa_crypto_stats.c | 9 + + drivers/crypto/intel/iaa/iaa_crypto_stats.h | 2 + + drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 1 + + .../crypto/intel/keembay/keembay-ocs-aes-core.c | 16 +- + drivers/crypto/intel/keembay/keembay-ocs-ecc.c | 5 +- + .../crypto/intel/keembay/keembay-ocs-hcu-core.c | 4 +- + drivers/crypto/intel/keembay/ocs-aes.c | 3 +- + drivers/crypto/intel/qat/qat_common/adf_aer.c | 2 + + drivers/crypto/intel/qat/qat_common/adf_cfg.c | 10 +- + .../crypto/intel/qat/qat_common/adf_cfg_common.h | 1 - + .../crypto/intel/qat/qat_common/adf_cfg_services.c | 15 +- + .../crypto/intel/qat/qat_common/adf_cfg_services.h | 2 +- + .../crypto/intel/qat/qat_common/adf_gen2_config.c | 8 +- + .../crypto/intel/qat/qat_common/adf_mstate_mgr.c | 3 +- + drivers/crypto/intel/qat/qat_common/adf_sysfs.c | 2 +- + .../intel/qat/qat_common/adf_transport_debug.c | 3 +- + drivers/crypto/intel/qat/qat_common/qat_algs.c | 1 + + .../crypto/intel/qat/qat_common/qat_compression.c | 3 +- + drivers/crypto/marvell/cesa/cesa.c | 55 +- + drivers/crypto/marvell/cesa/cesa.h | 2 + + drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 28 +- + .../marvell/octeontx2/otx2_cpt_mbox_common.c | 7 +- + drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 5 +- + .../crypto/marvell/octeontx2/otx2_cptpf_ucode.c | 4 +- + drivers/crypto/mxs-dcp.c | 10 +- + drivers/crypto/omap-aes.c | 88 +- + drivers/crypto/omap-des.c | 4 +- + drivers/crypto/omap-sham.c | 109 +- + drivers/crypto/qce/aead.c | 58 +- + drivers/crypto/qce/common.c | 55 +- + drivers/crypto/qce/common.h | 16 +- + drivers/crypto/qce/core.c | 115 +- + drivers/crypto/qce/regs-v5.h | 4 - + drivers/crypto/qce/sha.c | 61 +- + drivers/crypto/qce/sha.h | 1 - + drivers/crypto/qce/skcipher.c | 103 +- + drivers/crypto/rockchip/rk3288_crypto.c | 4 +- + drivers/crypto/rockchip/rk3288_crypto_ahash.c | 7 +- + drivers/crypto/sa2ul.c | 9 +- + drivers/crypto/sahara.c | 3 +- + drivers/crypto/stm32/stm32-cryp.c | 4 +- + drivers/crypto/stm32/stm32-hash.c | 4 +- + drivers/crypto/talitos.c | 30 +- + drivers/firmware/cirrus/test/cs_dsp_mock_regmap.c | 2 +- + drivers/firmware/google/coreboot_table.c | 43 +- + drivers/fwctl/Kconfig | 12 + + drivers/fwctl/bnxt/main.c | 396 +++- + drivers/gpib/gpio/gpib_bitbang.c | 1 - + drivers/gpio/Kconfig | 19 +- + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-104-idi-48.c | 7 +- + drivers/gpio/gpio-amd-fch.c | 22 +- + drivers/gpio/gpio-bd72720.c | 24 +- + drivers/gpio/gpio-bt8xx.c | 21 +- + drivers/gpio/gpio-by-pinctrl.c | 4 +- + drivers/gpio/gpio-davinci.c | 8 +- + drivers/gpio/gpio-i8255.c | 4 +- + drivers/gpio/gpio-idio-16.c | 6 +- + drivers/gpio/gpio-max7360.c | 8 +- + drivers/gpio/gpio-mt7621.c | 42 +- + drivers/gpio/gpio-mvebu.c | 44 +- + drivers/gpio/gpio-mxs.c | 4 +- + drivers/gpio/gpio-nomadik.c | 64 +- + drivers/gpio/gpio-omap.c | 9 +- + drivers/gpio/gpio-pca9570.c | 2 +- + drivers/gpio/gpio-pcf857x.c | 13 +- + drivers/gpio/gpio-pcie-idio-24.c | 6 +- + drivers/gpio/gpio-pl061.c | 5 +- + drivers/gpio/gpio-pxa.c | 2 +- + drivers/gpio/gpio-rcar.c | 1 - + drivers/gpio/gpio-rda.c | 4 +- + drivers/gpio/gpio-regmap.c | 104 +- + drivers/gpio/gpio-rockchip.c | 16 +- + drivers/gpio/gpio-rtd1625.c | 677 +++++++ + drivers/gpio/gpio-sa1100.c | 2 +- + drivers/gpio/gpio-sifive.c | 1 + + drivers/gpio/gpio-sloppy-logic-analyzer.c | 1 + + drivers/gpio/gpio-sodaville.c | 2 +- + drivers/gpio/gpio-stmpe.c | 2 +- + drivers/gpio/gpio-tb10x.c | 5 +- + drivers/gpio/gpio-tegra.c | 4 +- + drivers/gpio/gpio-timberdale.c | 2 +- + drivers/gpio/gpio-vf610.c | 1 + + drivers/gpio/gpiolib-cdev.c | 9 +- + drivers/gpio/gpiolib-kunit.c | 571 +++++- + drivers/gpio/gpiolib-swnode.c | 23 +- + drivers/gpu/drm/ci/arm64.config | 2 +- + drivers/gpu/drm/nova/driver.rs | 1 - + drivers/gpu/drm/tyr/driver.rs | 1 - + drivers/gpu/drm/xe/xe_i2c.c | 22 +- + drivers/gpu/drm/xe/xe_i2c.h | 1 - + drivers/gpu/nova-core/driver.rs | 7 +- + drivers/gpu/nova-core/gpu.rs | 6 +- + drivers/gpu/nova-core/gsp.rs | 53 +- + drivers/gpu/nova-core/gsp/cmdq.rs | 66 +- + drivers/gpu/nova-core/gsp/fw.rs | 82 +- + drivers/hid/Kconfig | 46 + + drivers/hid/Makefile | 4 +- + drivers/hid/amd-sfh-hid/Kconfig | 1 + + drivers/hid/amd-sfh-hid/amd_sfh_client.c | 16 + + drivers/hid/amd-sfh-hid/amd_sfh_common.h | 13 + + drivers/hid/amd-sfh-hid/amd_sfh_hid.c | 16 +- + drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 76 +- + drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 39 + + drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 1 - + drivers/hid/hid-apple.c | 22 +- + drivers/hid/hid-appletb-kbd.c | 6 +- + drivers/hid/hid-asus.c | 457 +++-- + drivers/hid/hid-axff.c | 40 +- + drivers/hid/hid-betopff.c | 33 +- + drivers/hid/hid-bigbenff.c | 89 +- + drivers/hid/hid-core.c | 73 +- + drivers/hid/hid-corsair-void.c | 17 + + drivers/hid/hid-corsair.c | 9 +- + drivers/hid/hid-dr.c | 66 +- + drivers/hid/hid-emsff.c | 50 +- + drivers/hid/hid-ft260.c | 70 +- + drivers/hid/hid-gaff.c | 53 +- + drivers/hid/hid-goodix-spi.c | 5 +- + drivers/hid/hid-google-stadiaff.c | 112 +- + drivers/hid/hid-haptic.c | 47 +- + drivers/hid/hid-haptic.h | 6 +- + drivers/hid/hid-holtekff.c | 46 +- + drivers/hid/hid-huawei.c | 5 +- + drivers/hid/hid-hyperv.c | 144 +- + drivers/hid/hid-hyperx.c | 117 ++ + drivers/hid/hid-ids.h | 36 +- + drivers/hid/hid-input.c | 41 +- + drivers/hid/hid-lg4ff.c | 8 + + drivers/hid/hid-logitech-dj.c | 52 +- + drivers/hid/hid-logitech-hidpp.c | 339 +++- + drivers/hid/hid-magicmouse.c | 73 +- + drivers/hid/hid-mcp2221.c | 17 +- + drivers/hid/hid-megaworld.c | 55 +- + drivers/hid/hid-mf.c | 85 +- + drivers/hid/hid-microsoft.c | 38 +- + drivers/hid/hid-msi.c | 2063 ++++++++++++++++++++ + drivers/hid/hid-multitouch.c | 12 +- + drivers/hid/hid-nintendo.c | 62 +- + drivers/hid/hid-oxp.c | 8 +- + drivers/hid/hid-picolcd_debugfs.c | 9 + + drivers/hid/hid-pl.c | 152 +- + drivers/hid/hid-quirks.c | 19 +- + drivers/hid/hid-rapoo.c | 2 +- + drivers/hid/hid-rmi.c | 2 +- + drivers/hid/hid-roccat-kone.c | 65 +- + drivers/hid/hid-roccat.c | 13 +- + drivers/hid/hid-sensor-custom.c | 30 +- + drivers/hid/hid-sensor-hub.c | 46 +- + drivers/hid/hid-sjoy.c | 91 +- + drivers/hid/hid-sony.c | 276 +-- + drivers/hid/hid-steam.c | 1674 ++++++++++++---- + drivers/hid/hid-steelseries-arctis.c | 718 +++++++ + drivers/hid/hid-steelseries.c | 565 +++--- + drivers/hid/hid-tmff.c | 56 +- + drivers/hid/hid-uclogic-core.c | 12 +- + drivers/hid/hid-universal-pidff.c | 4 +- + drivers/hid/hid-zpff.c | 43 +- + drivers/hid/i2c-hid/Makefile | 2 +- + drivers/hid/i2c-hid/i2c-hid-acpi-prp0001.c | 104 + + drivers/hid/i2c-hid/i2c-hid-acpi.c | 54 +- + drivers/hid/i2c-hid/i2c-hid-acpi.h | 33 + + drivers/hid/i2c-hid/i2c-hid-core.c | 2 +- + drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 4 +- + drivers/hid/intel-ish-hid/ipc/pci-ish.c | 4 +- + drivers/hid/intel-ish-hid/ishtp-hid-client.c | 5 +- + .../intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 120 +- + .../intel-thc-hid/intel-quicki2c/quicki2c-dev.h | 19 +- + .../intel-thc-hid/intel-quickspi/pci-quickspi.c | 92 +- + .../intel-thc-hid/intel-quickspi/quickspi-dev.h | 7 + + .../intel-thc-hid/intel-quickspi/quickspi-hid.c | 2 +- + .../intel-quickspi/quickspi-protocol.c | 19 +- + .../intel-quickspi/quickspi-protocol.h | 2 +- + .../hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 69 +- + .../hid/intel-thc-hid/intel-thc/intel-thc-dev.h | 23 +- + .../hid/intel-thc-hid/intel-thc/intel-thc-dma.c | 51 + + .../hid/intel-thc-hid/intel-thc/intel-thc-dma.h | 1 + + drivers/hid/intel-thc-hid/intel-thc/intel-thc-hw.h | 3 + + drivers/hid/usbhid/hid-pidff.c | 13 +- + drivers/hid/wacom_wac.c | 8 +- + drivers/hwmon/Kconfig | 59 +- + drivers/hwmon/Makefile | 3 + + drivers/hwmon/acpi_power_meter.c | 6 +- + drivers/hwmon/adt7470.c | 203 +- + drivers/hwmon/applesmc.c | 490 +++-- + drivers/hwmon/asus-ec-sensors.c | 88 +- + drivers/hwmon/asus_rog_ryujin.c | 96 +- + drivers/hwmon/axi-fan-control.c | 3 +- + drivers/hwmon/chipcap2.c | 25 +- + drivers/hwmon/coretemp.c | 3 +- + drivers/hwmon/corsair-psu.c | 2 +- + drivers/hwmon/cros_ec_hwmon.c | 36 +- + drivers/hwmon/da9055-hwmon.c | 5 +- + drivers/hwmon/eic7700-pvt.c | 509 +++++ + drivers/hwmon/eic7700-pvt.h | 99 + + drivers/hwmon/emc1403.c | 48 +- + drivers/hwmon/gxp-fan-ctrl.c | 106 +- + drivers/hwmon/hwmon.c | 76 +- + drivers/hwmon/ina2xx.c | 20 + + drivers/hwmon/k10temp.c | 14 +- + drivers/hwmon/kb9002.c | 460 +++++ + drivers/hwmon/lm90.c | 58 +- + drivers/hwmon/ltc4283.c | 1 + + drivers/hwmon/max6621.c | 8 +- + drivers/hwmon/nct6775-core.c | 1 + + drivers/hwmon/nct6775-platform.c | 2 +- + drivers/hwmon/npcm750-pwm-fan.c | 4 +- + drivers/hwmon/nzxt-kraken3.c | 9 +- + drivers/hwmon/peci/common.h | 4 +- + drivers/hwmon/pmbus/Kconfig | 91 +- + drivers/hwmon/pmbus/Makefile | 4 + + drivers/hwmon/pmbus/acbel-fsg032.c | 1 + + drivers/hwmon/pmbus/adm1275.c | 151 +- + drivers/hwmon/pmbus/ir36021.c | 22 +- + drivers/hwmon/pmbus/lm25066.c | 37 + + drivers/hwmon/pmbus/ltc2978.c | 21 +- + drivers/hwmon/pmbus/max20830.c | 133 +- + drivers/hwmon/pmbus/max34440.c | 96 +- + drivers/hwmon/pmbus/mp2975.c | 5 - + drivers/hwmon/pmbus/mpq82d00.c | 249 +++ + drivers/hwmon/pmbus/mpq8646.c | 976 +++++++++ + drivers/hwmon/pmbus/pmbus.h | 22 +- + drivers/hwmon/pmbus/pmbus_core.c | 154 +- + drivers/hwmon/pmbus/sq24860.c | 430 ++++ + drivers/hwmon/pmbus/vt7505.c | 287 +++ + drivers/hwmon/pmbus/xdpe1a2g7b.c | 11 + + drivers/hwmon/pwm-fan.c | 6 +- + drivers/hwmon/sht15.c | 4 +- + drivers/hwmon/sht3x.c | 15 +- + drivers/hwmon/tmp102.c | 2 + + drivers/hwmon/tmp401.c | 2 +- + drivers/hwmon/tvs-mpfs.c | 390 ++++ + drivers/hwmon/xgene-hwmon.c | 4 - + drivers/hwmon/yogafan.c | 67 + + drivers/i2c/algos/i2c-algo-bit.c | 2 +- + drivers/i2c/busses/Kconfig | 2 +- + drivers/i2c/busses/i2c-amd-asf-plat.c | 4 + + drivers/i2c/busses/i2c-davinci.c | 4 +- + drivers/i2c/busses/i2c-gpio.c | 223 ++- + drivers/i2c/busses/i2c-k1.c | 183 +- + drivers/i2c/busses/i2c-microchip-corei2c.c | 4 +- + drivers/i2c/busses/i2c-nomadik.c | 4 +- + drivers/i2c/busses/i2c-octeon-core.h | 2 +- + drivers/i2c/busses/i2c-pnx.c | 3 +- + drivers/i2c/busses/i2c-pxa-pci.c | 3 +- + drivers/i2c/busses/i2c-qcom-geni.c | 462 +++-- + drivers/i2c/busses/i2c-qup.c | 31 +- + drivers/i2c/busses/i2c-rcar.c | 22 +- + drivers/i2c/i2c-core-acpi.c | 6 +- + drivers/i2c/i2c-core-base.c | 3 +- + drivers/iio/adc/ad7173.c | 8 +- + drivers/iio/addac/stx104.c | 6 +- + drivers/input/input.c | 172 +- + drivers/input/keyboard/Kconfig | 38 - + drivers/input/keyboard/atkbd.c | 8 - + drivers/input/keyboard/cap11xx.c | 275 ++- + drivers/input/keyboard/charlieplex_keypad.c | 4 +- + drivers/input/keyboard/gpio_keys.c | 7 +- + drivers/input/keyboard/gpio_keys_polled.c | 4 +- + drivers/input/keyboard/hpps2atkbd.h | 110 -- + drivers/input/keyboard/matrix_keypad.c | 1 - + drivers/input/keyboard/pmic8xxx-keypad.c | 8 +- + drivers/input/keyboard/samsung-keypad.c | 39 +- + drivers/input/keyboard/snvs_pwrkey.c | 143 +- + drivers/input/keyboard/tca8418_keypad.c | 3 +- + drivers/input/misc/Kconfig | 30 + + drivers/input/misc/Makefile | 2 + + drivers/input/misc/amd_sfh_tabletmode.c | 81 + + drivers/input/misc/ims-pcu.c | 1 + + drivers/input/misc/isa1200.c | 533 +++++ + drivers/input/misc/soc_button_array.c | 1 - + drivers/input/mouse/elan_i2c.h | 3 +- + drivers/input/mouse/elan_i2c_core.c | 36 +- + drivers/input/mouse/elan_i2c_i2c.c | 5 +- + drivers/input/mouse/elan_i2c_smbus.c | 3 +- + drivers/input/mouse/focaltech.c | 17 +- + drivers/input/mouse/psmouse-base.c | 92 +- + drivers/input/mouse/synaptics.c | 1 + + drivers/input/mouse/synaptics_i2c.c | 2 +- + drivers/input/rmi4/rmi_f12.c | 16 +- + drivers/input/rmi4/rmi_smbus.c | 7 +- + drivers/input/serio/Kconfig | 27 + + drivers/input/serio/gscps2.c | 155 +- + drivers/input/serio/i8042-acpipnpio.h | 27 +- + drivers/input/touchscreen/elo.c | 4 +- + drivers/input/touchscreen/inexio.c | 4 +- + drivers/input/touchscreen/iqs5xx.c | 3 +- + drivers/input/touchscreen/mms114.c | 299 +-- + drivers/input/touchscreen/sur40.c | 4 +- + drivers/input/touchscreen/wacom_w8001.c | 17 +- + drivers/iommu/amd/amd_iommu_types.h | 9 +- + drivers/iommu/amd/debugfs.c | 12 +- + drivers/iommu/amd/init.c | 99 +- + drivers/iommu/amd/iommu.c | 75 +- + drivers/iommu/amd/ppr.c | 12 +- + .../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 7 +- + drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 24 +- + drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 188 +- + drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 13 +- + drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 224 ++- + drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + + drivers/iommu/arm/arm-smmu/arm-smmu.c | 9 +- + drivers/iommu/arm/arm-smmu/qcom_iommu.c | 39 +- + drivers/iommu/dma-iommu.c | 13 + + drivers/iommu/fsl_pamu.c | 16 +- + drivers/iommu/generic_pt/iommu_pt.h | 2 +- + drivers/iommu/intel/cache.c | 5 +- + drivers/iommu/intel/debugfs.c | 16 +- + drivers/iommu/intel/dmar.c | 98 +- + drivers/iommu/intel/iommu.c | 154 +- + drivers/iommu/intel/iommu.h | 73 +- + drivers/iommu/intel/pasid.c | 9 +- + drivers/iommu/intel/prq.c | 2 +- + drivers/iommu/intel/svm.c | 2 +- + drivers/iommu/iommu-sva.c | 2 +- + drivers/iommu/iommu.c | 6 +- + drivers/iommu/iommufd/Kconfig | 12 + + drivers/iommu/iommufd/Makefile | 1 + + drivers/iommu/iommufd/device.c | 232 ++- + drivers/iommu/iommufd/hw_pagetable.c | 19 +- + drivers/iommu/iommufd/hwpt_noiommu.c | 105 + + drivers/iommu/iommufd/io_pagetable.c | 80 +- + drivers/iommu/iommufd/ioas.c | 42 + + drivers/iommu/iommufd/iommufd_private.h | 39 +- + drivers/iommu/iommufd/main.c | 24 + + drivers/iommu/iommufd/selftest.c | 43 +- + drivers/iommu/iommufd/viommu.c | 14 +- + drivers/iommu/iova.c | 31 +- + drivers/iommu/msm_iommu.c | 15 +- + drivers/iommu/mtk_iommu.c | 2 +- + drivers/iommu/mtk_iommu_v1.c | 2 +- + drivers/iommu/riscv/iommu-pci.c | 6 +- + drivers/iommu/rockchip-iommu.c | 117 +- + drivers/md/dm-bufio.c | 10 +- + drivers/md/dm-cache-target.c | 56 +- + drivers/md/dm-dust.c | 16 +- + drivers/md/dm-era-target.c | 5 + + drivers/md/dm-inlinecrypt.c | 1 - + drivers/md/dm-integrity.c | 175 +- + drivers/md/dm-io.c | 96 +- + drivers/md/dm-ioctl.c | 208 +- + drivers/md/dm-kcopyd.c | 10 +- + drivers/md/dm-log-userspace-base.c | 1 + + drivers/md/dm-log.c | 4 +- + drivers/md/dm-pcache/cache.c | 29 + + drivers/md/dm-pcache/cache.h | 43 +- + drivers/md/dm-pcache/cache_dev.c | 22 +- + drivers/md/dm-pcache/cache_gc.c | 36 +- + drivers/md/dm-pcache/cache_key.c | 128 +- + drivers/md/dm-pcache/cache_req.c | 19 +- + drivers/md/dm-pcache/cache_segment.c | 12 +- + drivers/md/dm-pcache/cache_writeback.c | 38 +- + drivers/md/dm-pcache/dm_pcache.c | 4 +- + drivers/md/dm-raid1.c | 26 +- + drivers/md/dm-snap-persistent.c | 4 +- + drivers/md/dm-snap.c | 4 +- + drivers/md/dm-stats.c | 6 +- + drivers/md/dm-switch.c | 2 +- + drivers/md/dm-table.c | 2 +- + drivers/md/dm-vdo/indexer/config.c | 34 +- + drivers/md/dm-vdo/indexer/config.h | 2 +- + drivers/md/dm-vdo/indexer/geometry.c | 88 +- + drivers/md/dm-vdo/indexer/geometry.h | 13 +- + drivers/md/dm-vdo/indexer/index-layout.c | 2 +- + drivers/md/dm-vdo/indexer/index.c | 30 +- + drivers/md/dm-vdo/indexer/open-chapter.c | 2 +- + drivers/md/dm-vdo/indexer/open-chapter.h | 2 +- + drivers/md/dm-vdo/indexer/volume-index.c | 190 +- + drivers/md/dm-vdo/indexer/volume.c | 74 +- + drivers/md/dm-vdo/indexer/volume.h | 2 +- + drivers/md/dm-vdo/repair.c | 6 +- + drivers/md/dm-verity-target.c | 4 +- + drivers/md/dm-writecache.c | 14 +- + drivers/md/dm-zoned-metadata.c | 8 +- + drivers/md/dm-zoned-reclaim.c | 4 +- + drivers/md/dm.c | 14 +- + drivers/md/persistent-data/dm-array.c | 53 +- + drivers/media/cec/core/cec-adap.c | 95 +- + drivers/media/cec/core/cec-api.c | 5 +- + drivers/media/cec/core/cec-core.c | 117 +- + drivers/media/cec/core/cec-pin.c | 18 +- + drivers/media/cec/platform/meson/ao-cec-g12a.c | 5 +- + drivers/media/cec/platform/meson/ao-cec.c | 4 +- + drivers/media/cec/platform/seco/seco-cec.c | 6 +- + drivers/media/cec/platform/stm32/stm32-cec.c | 19 +- + drivers/media/cec/platform/tegra/tegra_cec.c | 38 +- + .../extron-da-hd-4k-plus/extron-da-hd-4k-plus.c | 3 +- + drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 14 +- + drivers/media/common/videobuf2/videobuf2-v4l2.c | 13 - + drivers/media/dvb-core/dmxdev.c | 11 +- + drivers/media/dvb-core/dvb_frontend.c | 157 +- + drivers/media/dvb-frontends/helene.c | 56 +- + drivers/media/dvb-frontends/rtl2832_sdr.c | 23 +- + drivers/media/i2c/Kconfig | 23 + + drivers/media/i2c/Makefile | 2 + + drivers/media/i2c/alvium-csi2.c | 2 +- + drivers/media/i2c/cvs/core.c | 3 + + drivers/media/i2c/cvs/icvs.h | 2 - + drivers/media/i2c/cvs/v4l2.c | 17 +- + drivers/media/i2c/cx25840/cx25840-core.c | 2 + + drivers/media/i2c/gc0310.c | 30 +- + drivers/media/i2c/imx219.c | 27 +- + drivers/media/i2c/imx355.c | 1524 +++++---------- + drivers/media/i2c/imx412.c | 751 +++---- + drivers/media/i2c/imx415.c | 4 +- + drivers/media/i2c/imx471.c | 957 +++++++++ + drivers/media/i2c/imx678.c | 1447 ++++++++++++++ + drivers/media/i2c/max9286.c | 5 +- + drivers/media/i2c/msp3400-driver.c | 3 + + drivers/media/i2c/mt9p031.c | 6 +- + drivers/media/i2c/mt9t112.c | 9 +- + drivers/media/i2c/mt9v011.c | 3 + + drivers/media/i2c/ov02a10.c | 12 +- + drivers/media/i2c/ov2740.c | 37 +- + drivers/media/i2c/ov7740.c | 10 +- + drivers/media/i2c/ov8865.c | 48 +- + drivers/media/i2c/ov9282.c | 4 +- + drivers/media/i2c/rdacm21.c | 5 +- + drivers/media/i2c/saa7115.c | 2 + + drivers/media/i2c/vd55g1.c | 175 +- + drivers/media/i2c/video-i2c.c | 8 +- + drivers/media/pci/bt8xx/bttv-driver.c | 12 +- + drivers/media/pci/cobalt/cobalt-alsa-main.c | 1 - + drivers/media/pci/cobalt/cobalt-driver.c | 5 +- + drivers/media/pci/cx18/cx18-driver.c | 5 +- + drivers/media/pci/cx18/cx18-vbi.c | 2 +- + drivers/media/pci/cx23885/cimax2.c | 1 + + drivers/media/pci/cx23885/cx23885-core.c | 10 +- + drivers/media/pci/cx25821/cx25821-alsa.c | 4 +- + drivers/media/pci/cx25821/cx25821-core.c | 10 +- + drivers/media/pci/cx88/cx88-alsa.c | 6 +- + drivers/media/pci/cx88/cx88-mpeg.c | 6 +- + drivers/media/pci/cx88/cx88-video.c | 5 +- + drivers/media/pci/ddbridge/ddbridge-main.c | 2 +- + drivers/media/pci/ddbridge/ddbridge.h | 2 +- + drivers/media/pci/dm1105/dm1105.c | 10 +- + drivers/media/pci/dt3155/dt3155.c | 4 +- + drivers/media/pci/hws/hws_v4l2_ioctl.h | 4 - + drivers/media/pci/intel/ipu-bridge.c | 69 +- + drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +- + drivers/media/pci/intel/ipu6/ipu6-isys.c | 1 + + drivers/media/pci/intel/ipu6/ipu6.c | 10 +- + drivers/media/pci/ivtv/ivtv-driver.c | 8 +- + drivers/media/pci/ivtv/ivtv-vbi.c | 2 +- + drivers/media/pci/mantis/mantis_common.h | 8 +- + drivers/media/pci/mgb4/mgb4_core.c | 6 +- + drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +- + drivers/media/pci/ngene/ngene-cards.c | 5 +- + drivers/media/pci/pluto2/pluto2.c | 5 +- + drivers/media/pci/saa7134/saa7134-cards.c | 1949 +++++++----------- + drivers/media/pci/saa7146/hexium_gemini.c | 22 +- + drivers/media/pci/saa7146/hexium_orion.c | 33 +- + drivers/media/pci/saa7146/mxb.c | 10 +- + drivers/media/pci/saa7164/saa7164-core.c | 13 +- + drivers/media/pci/smipcie/smipcie-main.c | 5 +- + drivers/media/pci/solo6x10/solo6x10-core.c | 2 +- + drivers/media/pci/ttpci/budget-ci.c | 4 +- + drivers/media/pci/ttpci/budget.c | 4 +- + drivers/media/pci/tw5864/tw5864-core.c | 4 +- + drivers/media/pci/tw68/tw68-core.c | 16 +- + drivers/media/pci/tw686x/tw686x-core.c | 23 +- + drivers/media/pci/zoran/zoran_card.c | 9 +- + drivers/media/platform/Kconfig | 1 + + drivers/media/platform/Makefile | 1 + + drivers/media/platform/amd/isp4/Kconfig | 1 + + drivers/media/platform/amd/isp4/isp4_interface.c | 10 +- + drivers/media/platform/amd/isp4/isp4_interface.h | 2 +- + drivers/media/platform/amd/isp4/isp4_subdev.c | 30 +- + .../media/platform/amlogic/c3/isp/c3-isp-params.c | 42 +- + drivers/media/platform/amphion/venc.c | 2 - + .../media/platform/arm/mali-c55/mali-c55-capture.c | 4 +- + .../media/platform/arm/mali-c55/mali-c55-core.c | 2 + + .../media/platform/arm/mali-c55/mali-c55-params.c | 140 +- + .../platform/arm/mali-c55/mali-c55-registers.h | 15 +- + .../media/platform/arm/mali-c55/mali-c55-resizer.c | 2 +- + drivers/media/platform/broadcom/bcm2835-unicam.c | 5 +- + .../platform/chips-media/wave5/wave5-vpu-dec.c | 64 +- + .../platform/chips-media/wave5/wave5-vpu-enc.c | 6 +- + .../platform/chips-media/wave5/wave5-vpuconfig.h | 2 +- + drivers/media/platform/dreamchip/Kconfig | 3 + + drivers/media/platform/dreamchip/Makefile | 6 + + drivers/media/platform/dreamchip/rppx1/Kconfig | 12 + + drivers/media/platform/dreamchip/rppx1/Makefile | 33 + + .../media/platform/dreamchip/rppx1/rpp_module.c | 39 + + .../media/platform/dreamchip/rppx1/rpp_module.h | 119 ++ + .../media/platform/dreamchip/rppx1/rpp_params.c | 115 ++ + drivers/media/platform/dreamchip/rppx1/rpp_stats.c | 66 + + drivers/media/platform/dreamchip/rppx1/rppx1.c | 381 ++++ + drivers/media/platform/dreamchip/rppx1/rppx1.h | 105 + + drivers/media/platform/dreamchip/rppx1/rppx1_acq.c | 148 ++ + .../media/platform/dreamchip/rppx1/rppx1_awbg.c | 63 + + drivers/media/platform/dreamchip/rppx1/rppx1_bd.c | 53 + + .../media/platform/dreamchip/rppx1/rppx1_bdrgb.c | 81 + + drivers/media/platform/dreamchip/rppx1/rppx1_bls.c | 157 ++ + drivers/media/platform/dreamchip/rppx1/rppx1_cac.c | 30 + + .../media/platform/dreamchip/rppx1/rppx1_ccor.c | 166 ++ + drivers/media/platform/dreamchip/rppx1/rppx1_db.c | 45 + + .../media/platform/dreamchip/rppx1/rppx1_dpcc.c | 77 + + drivers/media/platform/dreamchip/rppx1/rppx1_exm.c | 127 ++ + drivers/media/platform/dreamchip/rppx1/rppx1_ga.c | 91 + + .../media/platform/dreamchip/rppx1/rppx1_hist.c | 186 ++ + .../media/platform/dreamchip/rppx1/rppx1_hist256.c | 47 + + drivers/media/platform/dreamchip/rppx1/rppx1_is.c | 43 + + drivers/media/platform/dreamchip/rppx1/rppx1_lin.c | 112 ++ + drivers/media/platform/dreamchip/rppx1/rppx1_lsc.c | 188 ++ + drivers/media/platform/dreamchip/rppx1/rppx1_ltm.c | 49 + + .../media/platform/dreamchip/rppx1/rppx1_ltmmeas.c | 42 + + .../media/platform/dreamchip/rppx1/rppx1_outif.c | 46 + + .../media/platform/dreamchip/rppx1/rppx1_outregs.c | 76 + + .../media/platform/dreamchip/rppx1/rppx1_rmap.c | 63 + + .../platform/dreamchip/rppx1/rppx1_rmapmeas.c | 47 + + .../media/platform/dreamchip/rppx1/rppx1_shrp.c | 65 + + .../media/platform/dreamchip/rppx1/rppx1_wbmeas.c | 165 ++ + .../media/platform/dreamchip/rppx1/rppx1_xyz2luv.c | 27 + + .../media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 6 +- + .../media/platform/mediatek/mdp3/mtk-mdp3-comp.h | 6 +- + .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 6 +- + .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 29 +- + .../platform/microchip/microchip-sama7g5-isc.c | 7 +- + .../media/platform/nxp/imx8-isi/imx8-isi-core.c | 3 + + .../media/platform/nxp/imx8-isi/imx8-isi-core.h | 12 +- + .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 113 +- + drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c | 22 +- + drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c | 2 +- + .../media/platform/nxp/imx8-isi/imx8-isi-pipe.c | 79 +- + .../media/platform/nxp/imx8-isi/imx8-isi-regs.h | 12 +- + .../media/platform/nxp/imx8-isi/imx8-isi-video.c | 98 +- + drivers/media/platform/qcom/camss/camss-ispif.c | 4 +- + drivers/media/platform/qcom/iris/iris_buffer.c | 123 +- + drivers/media/platform/qcom/iris/iris_buffer.h | 2 +- + drivers/media/platform/qcom/iris/iris_core.c | 12 +- + drivers/media/platform/qcom/iris/iris_ctrls.c | 43 +- + drivers/media/platform/qcom/iris/iris_ctrls.h | 2 + + drivers/media/platform/qcom/iris/iris_firmware.c | 119 +- + drivers/media/platform/qcom/iris/iris_hfi_gen1.c | 26 +- + .../platform/qcom/iris/iris_hfi_gen1_command.c | 5 +- + .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 + + drivers/media/platform/qcom/iris/iris_hfi_gen2.c | 905 ++++++++- + .../platform/qcom/iris/iris_hfi_gen2_command.c | 7 +- + .../platform/qcom/iris/iris_hfi_gen2_defines.h | 8 + + .../platform/qcom/iris/iris_hfi_gen2_response.c | 4 +- + .../platform/qcom/iris/iris_platform_common.h | 11 +- + .../media/platform/qcom/iris/iris_platform_milos.h | 27 + + .../media/platform/qcom/iris/iris_platform_vpu2.c | 46 +- + .../media/platform/qcom/iris/iris_platform_vpu3x.c | 10 +- + drivers/media/platform/qcom/iris/iris_probe.c | 8 +- + drivers/media/platform/qcom/iris/iris_resources.c | 19 +- + drivers/media/platform/qcom/iris/iris_state.c | 4 +- + drivers/media/platform/qcom/iris/iris_vidc.c | 14 +- + drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 4 +- + drivers/media/platform/qcom/iris/iris_vpu_common.c | 2 +- + drivers/media/platform/qcom/venus/hfi_helper.h | 6 +- + drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +- + drivers/media/platform/qcom/venus/hfi_parser.c | 9 +- + drivers/media/platform/qcom/venus/pm_helpers.c | 7 +- + drivers/media/platform/renesas/rcar-csi2.c | 6 +- + drivers/media/platform/renesas/rcar-isp/Kconfig | 2 + + drivers/media/platform/renesas/rcar-isp/Makefile | 2 +- + drivers/media/platform/renesas/rcar-isp/core-io.c | 997 ++++++++++ + drivers/media/platform/renesas/rcar-isp/core.c | 916 +++++++++ + drivers/media/platform/renesas/rcar-isp/csisp.c | 46 +- + .../media/platform/renesas/rcar-isp/risp-core.h | 178 ++ + .../media/platform/renesas/rzg2l-cru/rzg2l-cru.h | 2 - + .../media/platform/renesas/rzg2l-cru/rzg2l-video.c | 5 + + drivers/media/platform/renesas/vsp1/vsp1_brx.c | 7 +- + drivers/media/platform/renesas/vsp1/vsp1_clu.c | 3 +- + drivers/media/platform/renesas/vsp1/vsp1_dl.c | 12 +- + drivers/media/platform/renesas/vsp1/vsp1_drm.c | 14 +- + drivers/media/platform/renesas/vsp1/vsp1_drv.c | 44 +- + drivers/media/platform/renesas/vsp1/vsp1_entity.c | 4 +- + drivers/media/platform/renesas/vsp1/vsp1_hgo.c | 7 +- + drivers/media/platform/renesas/vsp1/vsp1_hgt.c | 13 +- + drivers/media/platform/renesas/vsp1/vsp1_lut.c | 3 +- + drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 5 +- + drivers/media/platform/renesas/vsp1/vsp1_video.c | 34 +- + drivers/media/platform/renesas/vsp1/vsp1_wpf.c | 8 +- + drivers/media/platform/rockchip/rga/rga3-hw.c | 12 +- + .../platform/rockchip/rkvdec/rkvdec-hevc-common.c | 3 + + .../media/platform/rockchip/rkvdec/rkvdec-hevc.c | 4 +- + .../platform/rockchip/rkvdec/rkvdec-vdpu381-hevc.c | 8 +- + .../platform/rockchip/rkvdec/rkvdec-vdpu383-hevc.c | 8 +- + drivers/media/platform/rockchip/rkvdec/rkvdec.c | 8 +- + .../media/platform/samsung/s3c-camif/camif-core.c | 17 +- + drivers/media/platform/st/stm32/stm32-dcmi.c | 19 +- + .../platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 4 +- + drivers/media/platform/ti/Kconfig | 1 + + drivers/media/platform/ti/vpe/vip.c | 37 +- + drivers/media/platform/verisilicon/hantro_drv.c | 12 +- + drivers/media/radio/radio-cadet.c | 4 +- + drivers/media/radio/radio-gemtek.c | 4 +- + drivers/media/rc/fintek-cir.c | 4 +- + drivers/media/rc/ite-cir.c | 29 +- + drivers/media/rc/keymaps/Makefile | 2 +- + .../{rc-videomate-m1f.c => rc-videomate-k100.c} | 2 +- + drivers/media/rc/nuvoton-cir.c | 6 +- + drivers/media/rc/sunxi-cir.c | 9 +- + drivers/media/rc/winbond-cir.c | 4 +- + drivers/media/test-drivers/vicodec/vicodec-core.c | 4 +- + drivers/media/test-drivers/vimc/vimc-capture.c | 4 +- + drivers/media/test-drivers/vimc/vimc-sensor.c | 12 +- + drivers/media/test-drivers/vivid/vivid-meta-out.c | 23 +- + drivers/media/tuners/tda18250.c | 4 +- + drivers/media/usb/airspy/airspy.c | 19 +- + drivers/media/usb/au0828/au0828-cards.c | 14 + + drivers/media/usb/au0828/au0828-cards.h | 1 + + drivers/media/usb/au0828/au0828-dvb.c | 1 + + drivers/media/usb/cx231xx/cx231xx-audio.c | 5 + + drivers/media/usb/cx231xx/cx231xx-video.c | 4 +- + drivers/media/usb/dvb-usb-v2/mxl111sf.c | 12 +- + drivers/media/usb/em28xx/em28xx-cards.c | 36 +- + drivers/media/usb/em28xx/em28xx-core.c | 4 +- + drivers/media/usb/em28xx/em28xx-dvb.c | 2 +- + drivers/media/usb/em28xx/em28xx-reg.h | 1 + + drivers/media/usb/em28xx/em28xx-video.c | 114 +- + drivers/media/usb/em28xx/em28xx.h | 3 +- + drivers/media/usb/go7007/go7007-driver.c | 14 +- + drivers/media/usb/go7007/go7007-fw.c | 28 +- + drivers/media/usb/go7007/s2250-board.c | 54 +- + drivers/media/usb/go7007/snd-go7007.c | 10 +- + drivers/media/usb/gspca/jl2005bcd.c | 7 +- + drivers/media/usb/s2255/s2255drv.c | 422 ++-- + drivers/media/usb/stk1160/stk1160-core.c | 15 +- + drivers/media/usb/stk1160/stk1160-video.c | 3 + + drivers/media/usb/usbtv/usbtv-audio.c | 11 + + drivers/media/usb/usbtv/usbtv-core.c | 5 +- + drivers/media/usb/usbtv/usbtv-video.c | 4 +- + drivers/media/v4l2-core/v4l2-async.c | 16 +- + drivers/media/v4l2-core/v4l2-ctrls-core.c | 64 +- + drivers/media/v4l2-core/v4l2-dev.c | 28 +- + drivers/media/v4l2-core/v4l2-fwnode.c | 2 + + drivers/media/v4l2-core/v4l2-ioctl.c | 2 + + drivers/media/v4l2-core/v4l2-isp.c | 55 + + drivers/mfd/aat2870-core.c | 2 +- + drivers/mfd/arizona-irq.c | 2 +- + drivers/mfd/lp3943.c | 2 +- + drivers/mfd/rohm-bd71828.c | 125 +- + drivers/mfd/rohm-bd718x7.c | 123 +- + drivers/mfd/sm501.c | 2 +- + drivers/mfd/tps6105x.c | 2 +- + drivers/mfd/tps6586x.c | 2 +- + drivers/mfd/tps65911-comparator.c | 2 +- + drivers/mfd/wm8994-irq.c | 2 +- + drivers/net/ethernet/broadcom/genet/bcmmii.c | 3 +- + drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- + drivers/of/base.c | 13 +- + drivers/of/kobj.c | 3 + + drivers/of/of_reserved_mem.c | 47 +- + drivers/of/platform.c | 2 +- + drivers/pci/ats.c | 13 +- + drivers/pcmcia/bcm63xx_pcmcia.c | 2 +- + drivers/pcmcia/db1xxx_ss.c | 2 +- + drivers/pcmcia/sa1100_h3600.c | 2 +- + drivers/pcmcia/soc_common.c | 2 +- + drivers/pcmcia/xxs1500_ss.c | 2 +- + drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c | 1 - + drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 +- + drivers/phy/ti/phy-j721e-wiz.c | 1 - + drivers/pinctrl/bcm/pinctrl-bcm63xx.c | 1 + + drivers/pinctrl/pinctrl-tps6594.c | 1 + + drivers/platform/chrome/chromeos_of_hw_prober.c | 6 +- + drivers/platform/chrome/cros_ec.c | 5 +- + drivers/platform/chrome/cros_ec_chardev.c | 4 +- + drivers/platform/chrome/cros_ec_debugfs.c | 10 +- + drivers/platform/chrome/cros_ec_lightbar.c | 11 +- + drivers/platform/chrome/cros_ec_sensorhub.c | 4 +- + drivers/platform/chrome/cros_ec_sensorhub_ring.c | 28 +- + drivers/platform/chrome/cros_ec_sysfs.c | 4 +- + drivers/platform/chrome/cros_ec_typec.c | 6 + + drivers/platform/chrome/cros_ec_vbc.c | 4 +- + drivers/platform/chrome/cros_kbd_led_backlight.c | 4 +- + drivers/platform/chrome/cros_usbpd_logger.c | 4 +- + drivers/platform/chrome/cros_usbpd_notify.c | 4 +- + drivers/platform/chrome/wilco_ec/core.c | 4 +- + drivers/platform/chrome/wilco_ec/debugfs.c | 4 +- + drivers/platform/chrome/wilco_ec/telemetry.c | 4 +- + drivers/platform/surface/surface_gpe.c | 40 +- + drivers/platform/x86/intel/int3472/discrete.c | 51 +- + drivers/platform/x86/serial-multi-instantiate.c | 10 + + drivers/pmdomain/amlogic/meson-secure-pwrc.c | 69 + + drivers/pmdomain/arm/Kconfig | 2 +- + drivers/pmdomain/bcm/bcm2835-power.c | 9 +- + drivers/pmdomain/imx/Kconfig | 13 +- + drivers/pmdomain/imx/gpc.c | 3 +- + drivers/pmdomain/imx/imx8m-blk-ctrl.c | 1 + + drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 1 + + drivers/pmdomain/imx/scu-pd.c | 8 +- + drivers/pmdomain/mediatek/mt6858-pm-domains.h | 466 +++++ + drivers/pmdomain/mediatek/mt8196-pm-domains.h | 27 + + drivers/pmdomain/mediatek/mtk-pm-domains.c | 195 +- + drivers/pmdomain/mediatek/mtk-pm-domains.h | 7 + + drivers/pmdomain/qcom/rpmhpd.c | 38 +- + drivers/pmdomain/renesas/Kconfig | 4 + + drivers/pmdomain/renesas/Makefile | 1 + + drivers/pmdomain/renesas/r8a78000-mdlc.c | 325 +++ + drivers/pmdomain/rockchip/pm-domains.c | 36 +- + drivers/pmdomain/tegra/powergate-bpmp.c | 9 +- + drivers/power/sequencing/pwrseq-pcie-m2.c | 12 +- + drivers/pwm/Kconfig | 2 +- + drivers/pwm/core.c | 6 +- + drivers/pwm/pwm-adp5585.c | 4 +- + drivers/pwm/pwm-apple.c | 2 +- + drivers/pwm/pwm-argon-fan-hat.c | 2 +- + drivers/pwm/pwm-atmel-hlcdc.c | 15 +- + drivers/pwm/pwm-atmel-tcb.c | 6 +- + drivers/pwm/pwm-atmel.c | 3 +- + drivers/pwm/pwm-bcm-iproc.c | 2 +- + drivers/pwm/pwm-bcm-kona.c | 2 +- + drivers/pwm/pwm-bcm2835.c | 2 +- + drivers/pwm/pwm-berlin.c | 2 +- + drivers/pwm/pwm-brcmstb.c | 2 +- + drivers/pwm/pwm-clk.c | 2 +- + drivers/pwm/pwm-clps711x.c | 2 +- + drivers/pwm/pwm-cros-ec.c | 2 +- + drivers/pwm/pwm-hibvt.c | 2 +- + drivers/pwm/pwm-imx-tpm.c | 2 +- + drivers/pwm/pwm-imx1.c | 2 +- + drivers/pwm/pwm-imx27.c | 2 +- + drivers/pwm/pwm-ipq.c | 4 +- + drivers/pwm/pwm-jz4740.c | 2 +- + drivers/pwm/pwm-loongson.c | 2 +- + drivers/pwm/pwm-lp3943.c | 2 +- + drivers/pwm/pwm-lpc18xx-sct.c | 2 +- + drivers/pwm/pwm-lpc32xx.c | 2 +- + drivers/pwm/pwm-lpss-pci.c | 2 +- + drivers/pwm/pwm-lpss-platform.c | 10 +- + drivers/pwm/pwm-mc33xs2410.c | 2 +- + drivers/pwm/pwm-mediatek.c | 2 +- + drivers/pwm/pwm-meson.c | 9 +- + drivers/pwm/pwm-mtk-disp.c | 8 +- + drivers/pwm/pwm-mxs.c | 2 +- + drivers/pwm/pwm-omap-dmtimer.c | 4 +- + drivers/pwm/pwm-pca9685.c | 6 +- + drivers/pwm/pwm-pxa.c | 30 +- + drivers/pwm/pwm-raspberrypi-poe.c | 2 +- + drivers/pwm/pwm-rcar.c | 4 +- + drivers/pwm/pwm-renesas-tpu.c | 10 +- + drivers/pwm/pwm-rockchip.c | 8 +- + drivers/pwm/pwm-rzg2l-gpt.c | 7 +- + drivers/pwm/pwm-samsung.c | 2 +- + drivers/pwm/pwm-sifive.c | 2 +- + drivers/pwm/pwm-sl28cpld.c | 2 +- + drivers/pwm/pwm-sophgo-sg2042.c | 7 +- + drivers/pwm/pwm-sprd.c | 4 +- + drivers/pwm/pwm-sti.c | 2 +- + drivers/pwm/pwm-stm32-lp.c | 4 +- + drivers/pwm/pwm-stm32.c | 6 +- + drivers/pwm/pwm-sun4i.c | 2 +- + drivers/pwm/pwm-sunplus.c | 4 +- + drivers/pwm/pwm-tegra.c | 160 +- + drivers/pwm/pwm-tiecap.c | 6 +- + drivers/pwm/pwm-tiehrpwm.c | 2 +- + drivers/pwm/pwm-twl-led.c | 2 +- + drivers/pwm/pwm-twl.c | 2 +- + drivers/pwm/pwm-visconti.c | 2 +- + drivers/pwm/pwm-vt8500.c | 2 +- + drivers/pwm/pwm-xilinx.c | 4 +- + drivers/pwm/pwm_th1520.rs | 25 +- + drivers/regulator/88pg86x.c | 4 +- + drivers/regulator/Kconfig | 7 + + drivers/regulator/Makefile | 1 + + drivers/regulator/ab8500.c | 1 - + drivers/regulator/act8865-regulator.c | 2 +- + drivers/regulator/ad5398.c | 4 +- + drivers/regulator/adp5055-regulator.c | 6 +- + drivers/regulator/as3722-regulator.c | 1 - + drivers/regulator/aw37503-regulator.c | 4 +- + drivers/regulator/core.c | 6 +- + drivers/regulator/da9121-regulator.c | 20 +- + drivers/regulator/da9210-regulator.c | 4 +- + drivers/regulator/da9211-regulator.c | 18 +- + drivers/regulator/fan53555.c | 35 +- + drivers/regulator/fan53880.c | 4 +- + drivers/regulator/isl6271a-regulator.c | 2 +- + drivers/regulator/isl9305.c | 4 +- + drivers/regulator/lp3971.c | 2 +- + drivers/regulator/lp3972.c | 2 +- + drivers/regulator/lp872x.c | 4 +- + drivers/regulator/lp8755.c | 4 +- + drivers/regulator/ltc3589.c | 6 +- + drivers/regulator/ltc3676.c | 2 +- + drivers/regulator/max14577-regulator.c | 103 +- + drivers/regulator/max1586.c | 2 +- + drivers/regulator/max20086-regulator.c | 8 +- + drivers/regulator/max20411-regulator.c | 2 +- + drivers/regulator/max77503-regulator.c | 2 +- + drivers/regulator/max77675-regulator.c | 2 +- + drivers/regulator/max77826-regulator.c | 2 +- + drivers/regulator/max77838-regulator.c | 2 +- + drivers/regulator/max77857-regulator.c | 8 +- + drivers/regulator/max8649.c | 2 +- + drivers/regulator/max8893.c | 2 +- + drivers/regulator/max8952.c | 2 +- + drivers/regulator/max8973-regulator.c | 6 +- + drivers/regulator/max8998.c | 1 - + drivers/regulator/mcp16502.c | 27 +- + drivers/regulator/mp5416.c | 6 +- + drivers/regulator/mp8859.c | 4 +- + drivers/regulator/mp886x.c | 6 +- + drivers/regulator/mpq7920.c | 4 +- + drivers/regulator/mt6311-regulator.c | 4 +- + drivers/regulator/pf530x-regulator.c | 8 +- + drivers/regulator/pf8x00-regulator.c | 8 +- + drivers/regulator/pfuze100-regulator.c | 20 + + drivers/regulator/pv88060-regulator.c | 4 +- + drivers/regulator/pv88080-regulator.c | 8 +- + drivers/regulator/pv88090-regulator.c | 4 +- + drivers/regulator/qcom-refgen-regulator.c | 113 +- + drivers/regulator/qcom-rpmh-regulator.c | 128 +- + drivers/regulator/qcom_usb_vbus-regulator.c | 102 +- + drivers/regulator/rt6245-regulator.c | 5 +- + drivers/regulator/rtq2208-regulator.c | 7 +- + drivers/regulator/sc2730-regulator.c | 375 ++++ + drivers/regulator/sgm3804-regulator.c | 2 +- + drivers/regulator/slg51000-regulator.c | 4 +- + drivers/regulator/sy8106a-regulator.c | 2 +- + drivers/regulator/sy8824x.c | 8 +- + drivers/regulator/sy8827n.c | 4 +- + drivers/regulator/tps51632-regulator.c | 4 +- + drivers/regulator/tps62360-regulator.c | 10 +- + drivers/regulator/tps6286x-regulator.c | 10 +- + drivers/regulator/tps6287x-regulator.c | 10 +- + drivers/regulator/tps65023-regulator.c | 6 +- + drivers/regulator/tps65132-regulator.c | 4 +- + drivers/regulator/tps65185.c | 5 +- + drivers/regulator/tps6594-regulator.c | 19 +- + drivers/regulator/wm831x-isink.c | 6 +- + drivers/reset/reset-rzg2l-usbphy-ctrl.c | 2 +- + drivers/scsi/scsi_debug.c | 46 - + drivers/slimbus/qcom-ngd-ctrl.c | 2 +- + drivers/soc/qcom/qcom-geni-se.c | 5 + + drivers/soc/qcom/rpmh-rsc.c | 13 +- + drivers/soc/qcom/rpmh.c | 47 +- + drivers/soc/renesas/Kconfig | 1 + + drivers/soundwire/bus_type.c | 6 +- + drivers/spi/.kunitconfig | 4 + + drivers/spi/Kconfig | 27 +- + drivers/spi/Makefile | 2 + + drivers/spi/atmel-quadspi.c | 148 +- + drivers/spi/internals.h | 9 +- + drivers/spi/spi-altera-platform.c | 13 +- + drivers/spi/spi-amlogic-spifc-a1.c | 15 +- + drivers/spi/spi-at91-usart.c | 8 +- + drivers/spi/spi-atcspi200.c | 6 +- + drivers/spi/spi-ath79.c | 24 +- + drivers/spi/spi-axiado.c | 35 +- + drivers/spi/spi-axiado.h | 5 +- + drivers/spi/spi-bcm-qspi.c | 12 +- + drivers/spi/spi-bcm2835.c | 2 +- + drivers/spi/spi-bcm63xx-hsspi.c | 22 +- + drivers/spi/spi-bcm63xx.c | 11 +- + drivers/spi/spi-bcmbca-hsspi.c | 22 +- + drivers/spi/spi-brcmstb-qspi.c | 2 +- + drivers/spi/spi-cadence-xspi.c | 475 ++--- + drivers/spi/spi-cadence.c | 15 +- + drivers/spi/spi-coldfire-qspi.c | 12 +- + drivers/spi/spi-davinci.c | 7 +- + drivers/spi/spi-dln2.c | 11 +- + drivers/spi/spi-dw-core.c | 387 +++- + drivers/spi/spi-dw-mmio.c | 72 + + drivers/spi/spi-dw-pci.c | 6 +- + drivers/spi/spi-dw.h | 52 +- + drivers/spi/spi-fsl-dspi.c | 29 +- + drivers/spi/spi-fsl-espi.c | 11 +- + drivers/spi/spi-fsl-lpspi.c | 6 +- + drivers/spi/spi-geni-qcom.c | 155 +- + drivers/spi/spi-hisi-sfc-v3xx.c | 4 +- + drivers/spi/spi-img-spfi.c | 16 +- + drivers/spi/spi-iproc-qspi.c | 2 +- + drivers/spi/spi-loongson-core.c | 4 +- + drivers/spi/spi-loongson-pci.c | 2 +- + drivers/spi/spi-loongson-plat.c | 2 +- + drivers/spi/spi-ma35d1-qspi.c | 685 +++++++ + drivers/spi/spi-mem.c | 32 + + drivers/spi/spi-meson-spifc.c | 30 +- + drivers/spi/spi-mpc52xx.c | 16 +- + drivers/spi/spi-mt65xx.c | 11 +- + drivers/spi/spi-mtk-nor.c | 21 +- + drivers/spi/spi-mxic.c | 9 +- + drivers/spi/spi-npcm-fiu.c | 15 +- + drivers/spi/spi-nxp-fspi.c | 31 +- + drivers/spi/spi-nxp-xspi.c | 143 +- + drivers/spi/spi-oc-tiny.c | 24 +- + drivers/spi/spi-omap2-mcspi.c | 9 +- + drivers/spi/spi-orion.c | 37 +- + drivers/spi/spi-pl022.c | 10 +- + drivers/spi/spi-ppc4xx.c | 105 +- + drivers/spi/spi-qcom-qspi.c | 16 +- + drivers/spi/spi-qpic-snand.c | 174 +- + drivers/spi/spi-qup.c | 14 +- + drivers/spi/spi-realtek-rtl.c | 26 +- + drivers/spi/spi-rockchip-sfc.c | 12 +- + drivers/spi/spi-rockchip.c | 12 +- + drivers/spi/spi-rpc-if.c | 4 + + drivers/spi/spi-s3c64xx.c | 12 +- + drivers/spi/spi-slave-mt27xx.c | 12 +- + drivers/spi/spi-spacemit-k1.c | 10 +- + drivers/spi/spi-sprd-adi.c | 6 + + drivers/spi/spi-sprd.c | 9 +- + drivers/spi/spi-sunplus-sp7021.c | 16 +- + drivers/spi/spi-synquacer.c | 10 +- + drivers/spi/spi-tegra114.c | 10 +- + drivers/spi/spi-tegra20-sflash.c | 10 +- + drivers/spi/spi-tegra20-slink.c | 14 +- + drivers/spi/spi-tegra210-quad.c | 14 +- + drivers/spi/spi-topcliff-pch.c | 47 +- + drivers/spi/spi-zynqmp-gqspi.c | 15 +- + drivers/spi/spi.c | 395 +++- + drivers/spi/tests/Makefile | 3 + + drivers/spi/tests/spi-dma-kunit.c | 259 +++ + .../pci/base/circbuf/interface/ia_css_circbuf.h | 40 +- + .../base/circbuf/interface/ia_css_circbuf_comm.h | 4 +- + .../base/circbuf/interface/ia_css_circbuf_desc.h | 14 +- + .../pci/camera/util/interface/ia_css_util.h | 2 +- + .../pci/css_2401_system/host/csi_rx_private.h | 18 +- + .../pci/css_2401_system/host/isys_irq_private.h | 4 +- + .../host/isys_stream2mmio_private.h | 12 +- + .../pci/css_2401_system/host/pixelgen_private.h | 8 +- + .../atomisp/pci/css_2401_system/pixelgen_global.h | 2 +- + .../pci/hive_isp_css_common/timed_ctrl_global.h | 2 +- + .../device_access/device_access.h | 2 +- + .../pci/hive_isp_css_include/host/csi_rx_public.h | 18 +- + .../host/isys_stream2mmio_public.h | 12 +- + .../hive_isp_css_include/host/pixelgen_public.h | 8 +- + .../pci/hive_isp_css_include/host/tag_public.h | 4 +- + .../pci/hive_isp_css_include/platform_support.h | 2 +- + .../pci/hive_isp_css_include/type_support.h | 2 +- + .../media/atomisp/pci/ia_css_frame_public.h | 2 +- + .../staging/media/atomisp/pci/ia_css_host_data.h | 4 +- + .../staging/media/atomisp/pci/ia_css_pipe_public.h | 8 +- + drivers/staging/media/atomisp/pci/ia_css_prbs.h | 4 +- + drivers/staging/media/atomisp/pci/ia_css_stream.h | 2 +- + drivers/staging/media/atomisp/pci/ia_css_timer.h | 7 +- + drivers/staging/media/atomisp/pci/ia_css_types.h | 6 +- + .../conversion_1.0/ia_css_conversion_types.h | 2 +- + .../pci/isp/kernels/eed1_8/ia_css_eed1_8_types.h | 2 +- + .../atomisp/pci/isp/kernels/hdr/ia_css_hdr_types.h | 42 +- + .../ipu2_io_ls/common/ia_css_common_io_param.h | 2 +- + .../ipu2_io_ls/common/ia_css_common_io_types.h | 2 +- + .../yuv444_io_ls/ia_css_yuv444_io.host.h | 2 +- + .../yuv444_io_ls/ia_css_yuv444_io_param.h | 2 +- + .../yuv444_io_ls/ia_css_yuv444_io_types.h | 2 +- + .../pci/isp/kernels/tnr/tnr3/ia_css_tnr3_types.h | 4 +- + .../isp/kernels/xnr/xnr_3.0/ia_css_xnr3_types.h | 14 +- + .../pci/isp/modes/interface/input_buf.isp.h | 2 +- + .../pci/runtime/binary/interface/ia_css_binary.h | 2 +- + .../pci/runtime/bufq/interface/ia_css_bufq.h | 26 +- + .../pci/runtime/debug/interface/ia_css_debug.h | 10 +- + .../runtime/debug/interface/ia_css_debug_pipe.h | 10 +- + .../pci/runtime/eventq/interface/ia_css_eventq.h | 4 +- + .../isp_param/interface/ia_css_isp_param_types.h | 2 +- + .../pci/runtime/isys/interface/ia_css_isys.h | 8 +- + .../runtime/pipeline/interface/ia_css_pipeline.h | 10 +- + .../pci/runtime/rmgr/interface/ia_css_rmgr.h | 4 +- + .../pci/runtime/rmgr/interface/ia_css_rmgr_vbuf.h | 18 +- + .../tagger/interface/ia_css_tagger_common.h | 4 +- + .../staging/media/atomisp/pci/sh_css_internal.h | 4 +- + drivers/staging/media/atomisp/pci/sh_css_sp.h | 14 +- + drivers/staging/media/atomisp/pci/system_global.h | 4 +- + drivers/staging/media/av7110/av7110.c | 20 +- + drivers/staging/media/ipu7/ipu7-isys.c | 2 + + drivers/staging/media/ipu7/ipu7.c | 4 +- + drivers/staging/media/meson/vdec/vdec.c | 4 +- + drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +- + drivers/staging/media/tegra-video/tegra20.c | 6 +- + drivers/staging/media/tegra-video/vi.c | 87 +- + drivers/staging/media/tegra-video/vip.c | 10 +- + drivers/tty/serdev/Kconfig | 7 + + drivers/usb/chipidea/core.c | 2 +- + drivers/usb/musb/jz4740.c | 2 +- + drivers/vfio/Kconfig | 7 +- + drivers/vfio/device_cdev.c | 9 + + drivers/vfio/iommufd.c | 12 +- + drivers/vfio/vfio.h | 23 +- + drivers/vfio/vfio_main.c | 26 +- + drivers/watchdog/Kconfig | 42 +- + drivers/watchdog/Makefile | 3 + + drivers/watchdog/apple_wdt.c | 4 +- + drivers/watchdog/aspeed_wdt.c | 2 + + drivers/watchdog/bd96801_wdt.c | 3 +- + drivers/watchdog/booke_wdt.c | 1 + + drivers/watchdog/cadence_wdt.c | 6 +- + drivers/watchdog/cros_ec_wdt.c | 4 +- + drivers/watchdog/dw_wdt.c | 2 +- + drivers/watchdog/intel-mid_wdt.c | 4 +- + drivers/watchdog/keembay_wdt.c | 4 +- + drivers/watchdog/lenovo_se30g2_se60_wdt.c | 289 +++ + drivers/watchdog/ma35d1_wdt.c | 363 ++++ + drivers/watchdog/marvell_gti_wdt.c | 2 +- + drivers/watchdog/max63xx_wdt.c | 14 +- + drivers/watchdog/max77620_wdt.c | 6 +- + drivers/watchdog/mtk_wdt.c | 4 +- + drivers/watchdog/npcm_wdt.c | 217 +- + drivers/watchdog/orion_wdt.c | 16 +- + drivers/watchdog/pretimeout_dump.c | 45 + + drivers/watchdog/qcom-wdt.c | 55 +- + drivers/watchdog/realtek_otto_wdt.c | 76 +- + drivers/watchdog/sama5d4_wdt.c | 4 +- + drivers/watchdog/sprd_wdt.c | 4 +- + drivers/watchdog/stm32_iwdg.c | 5 +- + drivers/watchdog/via_wdt.c | 1 + + drivers/watchdog/w83627hf_wdt.c | 22 +- + drivers/watchdog/watchdog_core.c | 26 +- + drivers/watchdog/watchdog_pretimeout.h | 4 +- + drivers/watchdog/wdat_wdt.c | 27 +- + fs/debugfs/file.c | 3 +- + fs/debugfs/inode.c | 5 +- + fs/kernfs/dir.c | 4 +- + fs/kernfs/inode.c | 4 +- + fs/kernfs/symlink.c | 2 +- + fs/tracefs/event_inode.c | 4 + + include/acpi/acpi_bus.h | 11 - + include/asm-generic/audit_change_attr.h | 3 + + include/asm-generic/audit_read.h | 31 + + include/asm-generic/audit_write.h | 3 + + include/crypto/aes.h | 2 +- + include/crypto/if_alg.h | 42 +- + include/crypto/internal/ecc.h | 4 +- + include/dt-bindings/power/amlogic,a9-pwrc.h | 61 + + include/dt-bindings/power/mediatek,mt6858-power.h | 23 + + include/dt-bindings/power/mediatek,mt8196-power.h | 4 + + include/dt-bindings/power/renesas,r8a78000-mdlc.h | 15 + + .../dt-bindings/regulator/fcs,fan53555-regulator.h | 20 + + include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 36 +- + include/kunit/fwnode.h | 29 + + include/linux/amd-pmf-io.h | 14 + + include/linux/ata.h | 17 + + include/linux/bnxt/hsi.h | 585 ++++++ + include/linux/btf.h | 2 + + include/linux/container_of.h | 5 +- + include/linux/cred.h | 1 - + include/linux/dm-io.h | 6 +- + include/linux/dmar.h | 1 + + include/linux/fwnode.h | 4 + + include/linux/gpio/machine.h | 2 +- + include/linux/gpio/regmap.h | 73 +- + include/linux/gpio_keys.h | 2 + + include/linux/hid.h | 4 +- + include/linux/hwmon-sysfs.h | 14 +- + include/linux/i2c-algo-bit.h | 1 + + include/linux/input.h | 20 +- + include/linux/input/elan-i2c-ids.h | 2 +- + include/linux/kobject.h | 75 +- + include/linux/libata.h | 93 +- + include/linux/lsm_hooks.h | 2 + + include/linux/mfd/lp3943.h | 2 +- + include/linux/mfd/max14577-private.h | 3 + + include/linux/mfd/ti-lmu.h | 1 - + include/linux/mfd/tps65910.h | 2 +- + include/linux/mfd/ucb1x00.h | 2 +- + include/linux/nmi.h | 10 +- + include/linux/of_reserved_mem.h | 7 + + include/linux/pci.h | 30 + + include/linux/platform_data/omap-twl4030.h | 42 - + include/linux/platform_device.h | 8 + + include/linux/property.h | 2 + + include/linux/psp-sev.h | 51 + + include/linux/regmap.h | 12 +- + include/linux/rhashtable.h | 1 - + include/linux/soc/mediatek/mtk_sip_svc.h | 3 + + include/linux/soc/qcom/geni-se.h | 38 + + include/linux/spi/spi-mem.h | 4 + + include/linux/spi/spi.h | 18 + + include/linux/sys_soc.h | 9 +- + include/linux/trace_events.h | 9 + + include/linux/vfio.h | 1 + + include/media/cec.h | 6 +- + include/media/drv-intf/s3c_camif.h | 2 - + include/media/drv-intf/saa7146.h | 11 +- + include/media/media-entity.h | 1 + + include/media/rc-map.h | 2 - + include/media/rppx1.h | 36 + + include/media/v4l2-ioctl.h | 4 +- + include/media/v4l2-isp.h | 92 +- + include/media/videobuf2-v4l2.h | 13 + + include/rv/da_monitor.h | 31 +- + include/rv/ha_monitor.h | 85 +- + include/rv/kunit.h | 73 + + include/rv/ltl_monitor.h | 14 +- + include/scsi/scsi_proto.h | 74 + + include/soc/qcom/rpmh.h | 5 + + include/soc/qcom/tcs.h | 2 + + include/sound/ac97/codec.h | 4 +- + include/sound/asequencer.h | 3 - + include/sound/aw88399.h | 621 ++++++ + include/sound/control.h | 3 + + include/sound/core.h | 4 +- + include/sound/cs35l56.h | 1 - + include/sound/dmaengine_pcm.h | 6 - + include/sound/hda-mlink.h | 23 +- + include/sound/hda_codec.h | 1 + + include/sound/hda_regmap.h | 42 +- + include/sound/pcm.h | 118 +- + include/sound/pcm_params.h | 13 +- + include/sound/rawmidi.h | 14 +- + include/sound/sdca_asoc.h | 15 +- + include/sound/sdca_fdl.h | 4 + + include/sound/sdca_function.h | 32 +- + include/sound/sdca_hid.h | 11 +- + include/sound/seq_virmidi.h | 1 - + include/sound/simple_card_utils.h | 37 +- + include/sound/soc-acpi.h | 23 +- + include/sound/soc-component.h | 11 + + include/sound/soc.h | 15 +- + include/sound/soc_sdw_utils.h | 31 +- + include/sound/sof/dai-amd.h | 1 + + include/sound/sof/dai.h | 3 + + include/sound/sof/header.h | 4 +- + include/sound/sof/ipc4/header.h | 133 +- + include/sound/tas2781-dsp.h | 7 +- + include/sound/tlv320aic32x4.h | 43 - + include/sound/wm8904.h | 4 +- + include/trace/events/qcom_geni_i2c.h | 82 + + include/trace/events/qcom_geni_se.h | 157 ++ + include/trace/trace_events.h | 23 + + include/uapi/fwctl/bnxt.h | 4 + + include/uapi/linux/cec.h | 2 + + include/uapi/linux/iommufd.h | 45 +- + include/uapi/linux/media/arm/mali-c55-config.h | 86 +- + include/uapi/linux/media/dreamchip/rppx1-config.h | 730 +++++++ + include/uapi/linux/media/v4l2-isp.h | 125 +- + include/uapi/linux/psp-sfs.h | 4 +- + include/uapi/linux/videodev2.h | 4 + + include/uapi/sound/asequencer.h | 18 +- + include/uapi/sound/asound.h | 200 +- + include/uapi/sound/firewire.h | 24 +- + include/uapi/sound/skl-tplg-interface.h | 168 -- + include/uapi/sound/snd_ar_tokens.h | 95 +- + include/uapi/sound/snd_sst_tokens.h | 324 --- + include/uapi/sound/sof/tokens.h | 5 +- + kernel/audit_watch.c | 2 +- + kernel/auditfilter.c | 6 +- + kernel/auditsc.c | 3 +- + kernel/bpf/btf.c | 4 +- + kernel/trace/ftrace.c | 43 +- + kernel/trace/preemptirq_delay_test.c | 9 + + kernel/trace/ring_buffer.c | 276 +-- + kernel/trace/rv/Kconfig | 15 + + kernel/trace/rv/Makefile | 2 + + kernel/trace/rv/monitors/nomiss/nomiss.c | 36 +- + kernel/trace/rv/monitors/nomiss/nomiss_kunit.c | 38 + + kernel/trace/rv/monitors/nomiss/nomiss_kunit.h | 35 + + kernel/trace/rv/monitors/opid/opid.c | 12 + + kernel/trace/rv/monitors/opid/opid_kunit.c | 33 + + kernel/trace/rv/monitors/opid/opid_kunit.h | 23 + + kernel/trace/rv/monitors/pagefault/pagefault.c | 20 +- + .../trace/rv/monitors/pagefault/pagefault_kunit.c | 34 + + .../trace/rv/monitors/pagefault/pagefault_kunit.h | 24 + + kernel/trace/rv/monitors/rtapp/Kconfig | 2 +- + kernel/trace/rv/monitors/sco/sco.c | 13 + + kernel/trace/rv/monitors/sco/sco_kunit.c | 29 + + kernel/trace/rv/monitors/sco/sco_kunit.h | 24 + + kernel/trace/rv/monitors/sleep/Kconfig | 1 - + kernel/trace/rv/monitors/sleep/sleep.c | 107 +- + kernel/trace/rv/monitors/sleep/sleep.h | 142 +- + kernel/trace/rv/monitors/sleep/sleep_kunit.c | 59 + + kernel/trace/rv/monitors/sleep/sleep_kunit.h | 29 + + kernel/trace/rv/monitors/sssw/sssw.c | 14 + + kernel/trace/rv/monitors/sssw/sssw_kunit.c | 33 + + kernel/trace/rv/monitors/sssw/sssw_kunit.h | 30 + + kernel/trace/rv/monitors/stall/stall.c | 2 +- + kernel/trace/rv/monitors/sts/sts.c | 19 + + kernel/trace/rv/monitors/sts/sts_kunit.c | 39 + + kernel/trace/rv/monitors/sts/sts_kunit.h | 33 + + kernel/trace/rv/monitors/wakeup/Kconfig | 16 + + kernel/trace/rv/monitors/wakeup/wakeup.c | 153 ++ + kernel/trace/rv/monitors/wakeup/wakeup.h | 92 + + kernel/trace/rv/monitors/wakeup/wakeup_trace.h | 14 + + kernel/trace/rv/rv.c | 86 +- + kernel/trace/rv/rv_monitors_test.c | 182 ++ + kernel/trace/rv/rv_reactors.c | 1 + + kernel/trace/rv/rv_trace.h | 1 + + kernel/trace/trace.c | 2 +- + kernel/trace/trace.h | 4 +- + kernel/trace/trace_events.c | 152 +- + kernel/trace/trace_events_hist.c | 96 +- + kernel/trace/trace_events_trigger.c | 16 +- + kernel/trace/trace_events_user.c | 10 +- + kernel/trace/trace_functions_graph.c | 2 +- + kernel/trace/trace_mmiotrace.c | 7 +- + kernel/trace/trace_printk.c | 3 +- + kernel/trace/trace_sched_switch.c | 6 +- + kernel/trace/trace_syscalls.c | 18 + + lib/kobject.c | 8 +- + lib/kunit/Makefile | 1 + + lib/kunit/fwnode.c | 146 ++ + lib/nmi_backtrace.c | 7 + + lib/rhashtable.c | 2 + + rust/bindings/bindings_helper.h | 2 + + rust/helpers/acpi.c | 16 - + rust/helpers/fwctl.c | 17 + + rust/helpers/helpers.c | 5 +- + rust/helpers/io.c | 13 + + rust/helpers/pci.c | 5 + + rust/helpers/serdev.c | 22 + + rust/helpers/task.c | 5 - + rust/kernel/acpi.rs | 14 +- + rust/kernel/auxiliary.rs | 96 +- + rust/kernel/debugfs/traits.rs | 41 +- + rust/kernel/device.rs | 71 +- + rust/kernel/device_id.rs | 196 +- + rust/kernel/devres.rs | 151 +- + rust/kernel/dma.rs | 287 +-- + rust/kernel/driver.rs | 135 +- + rust/kernel/firmware.rs | 8 +- + rust/kernel/fwctl.rs | 593 ++++++ + rust/kernel/i2c.rs | 26 +- + rust/kernel/io.rs | 1543 ++++++++++++--- + rust/kernel/io/mem.rs | 94 +- + rust/kernel/io/poll.rs | 6 +- + rust/kernel/io/register.rs | 86 +- + rust/kernel/iommu/pgtable.rs | 3 +- + rust/kernel/irq.rs | 2 +- + rust/kernel/irq/request.rs | 430 ++-- + rust/kernel/lib.rs | 7 + + rust/kernel/net/phy.rs | 66 +- + rust/kernel/of.rs | 14 +- + rust/kernel/pci.rs | 32 +- + rust/kernel/pci/io.rs | 205 +- + rust/kernel/pci/irq.rs | 210 +- + rust/kernel/platform.rs | 53 +- + rust/kernel/ptr.rs | 12 + + rust/kernel/pwm.rs | 4 +- + rust/kernel/serdev.rs | 604 ++++++ + rust/kernel/task.rs | 11 +- + rust/kernel/types.rs | 5 +- + rust/kernel/types/for_lt.rs | 103 +- + rust/kernel/usb.rs | 24 +- + rust/macros/for_lt.rs | 41 +- + rust/macros/lib.rs | 18 +- + samples/ftrace/ftrace-ops.c | 2 +- + samples/kobject/kobject-example.c | 24 +- + samples/rust/Kconfig | 11 + + samples/rust/Makefile | 1 + + samples/rust/rust_debugfs.rs | 5 +- + samples/rust/rust_debugfs_scoped.rs | 5 +- + samples/rust/rust_dma.rs | 25 +- + samples/rust/rust_driver_auxiliary.rs | 96 +- + samples/rust/rust_driver_i2c.rs | 3 - + samples/rust/rust_driver_pci.rs | 4 +- + samples/rust/rust_driver_platform.rs | 2 - + samples/rust/rust_driver_serdev.rs | 88 + + samples/rust/rust_driver_usb.rs | 3 +- + samples/rust/rust_i2c_client.rs | 2 - + samples/rust/rust_soc.rs | 2 - + scripts/coccinelle/hid/ff_race.cocci | 34 + + scripts/dtc/dt-check-style | 151 +- + .../dt-style-selftest/bad/dts-child-name-order.dts | 32 + + .../bad/dts-extend-node-child-name-order.dts | 25 + + .../bad/dts-extend-node-digit-node-order.dts | 33 + + .../dtc/dt-style-selftest/bad/dts-mixed-indent.dts | 21 + + .../dt-style-selftest/bad/dts-property-order.dts | 43 + + .../bad/yaml-prop-order-device-type.yaml | 31 + + .../expected/dts-child-name-order.dts.txt | 2 + + .../dts-extend-node-child-name-order.dts.txt | 2 + + .../dts-extend-node-digit-node-order.dts.txt | 2 + + .../expected/dts-mixed-indent.dts.txt | 9 + + .../expected/dts-property-order.dts.txt | 6 + + .../dt-style-selftest/expected/dts-spaces.dts.txt | 2 +- + .../expected/yaml-indent-strict.yaml.txt | 2 +- + .../expected/yaml-mixed-indent.yaml.txt | 3 +- + .../expected/yaml-prop-order-device-type.yaml.txt | 2 + + .../dt-style-selftest/expected/yaml-tab.yaml.txt | 2 +- + .../good/dts-child-name-order.dts | 32 + + .../good/dts-digit-node-order.dts | 43 + + scripts/dtc/dt-style-selftest/good/dts-dtc.dts | 21 + + .../good/dts-extend-node-child-name-order.dts | 25 + + .../good/dts-extend-node-digit-node-order.dts | 33 + + .../dt-style-selftest/good/dts-preprocessor.dts | 21 + + .../dt-style-selftest/good/dts-property-order.dts | 41 + + scripts/dtc/dt-style-selftest/good/soc.dtsi | 49 + + security/integrity/ima/Kconfig | 10 + + security/integrity/ima/ima.h | 5 + + security/integrity/ima/ima_efi.c | 2 + + security/integrity/ima/ima_fs.c | 9 +- + security/integrity/ima/ima_init.c | 15 +- + security/integrity/ima/ima_main.c | 26 + + security/integrity/ima/ima_policy.c | 95 +- + security/integrity/ima/ima_template_lib.c | 3 +- + security/lsm_init.c | 13 +- + security/security.c | 5 +- + security/selinux/avc.c | 3 +- + security/selinux/hooks.c | 27 +- + security/selinux/ima.c | 65 +- + security/selinux/include/ima.h | 4 + + security/selinux/selinuxfs.c | 19 +- + security/selinux/ss/policydb.c | 46 +- + security/selinux/ss/services.c | 18 +- + security/smack/smack.h | 6 +- + security/smack/smack_access.c | 9 + + security/smack/smack_lsm.c | 71 +- + security/smack/smackfs.c | 224 +-- + sound/atmel/ac97c.c | 67 +- + sound/core/compress_offload.c | 18 +- + sound/core/control.c | 93 +- + sound/core/control_compat.c | 15 +- + sound/core/hwdep.c | 25 +- + sound/core/info.c | 2 +- + sound/core/init.c | 67 +- + sound/core/jack.c | 38 +- + sound/core/oss/mixer_oss.c | 19 +- + sound/core/oss/pcm_oss.c | 43 +- + sound/core/oss/pcm_plugin.c | 20 +- + sound/core/pcm.c | 12 +- + sound/core/pcm_misc.c | 25 +- + sound/core/pcm_native.c | 90 +- + sound/core/rawmidi.c | 32 +- + sound/core/seq/oss/seq_oss.c | 21 +- + sound/core/seq/seq_clientmgr.c | 114 +- + sound/core/seq/seq_clientmgr.h | 1 - + sound/core/seq/seq_midi.c | 61 +- + sound/core/seq/seq_ports.c | 103 +- + sound/core/seq/seq_ports.h | 8 +- + sound/core/seq/seq_ump_client.c | 38 +- + sound/core/seq/seq_virmidi.c | 19 +- + sound/core/sound.c | 25 +- + sound/core/sound_kunit.c | 4 +- + sound/core/timer.c | 30 +- + sound/core/ump.c | 9 +- + sound/core/ump_convert.c | 1 + + sound/drivers/aloop.c | 130 +- + sound/drivers/dummy.c | 39 +- + sound/drivers/mpu401/mpu401.c | 6 + + sound/drivers/mts64.c | 6 + + sound/drivers/portman2x4.c | 6 + + sound/drivers/serial-u16550.c | 6 + + sound/drivers/virmidi.c | 6 + + sound/hda/codecs/ca0132.c | 33 +- + sound/hda/codecs/cm9825.c | 148 +- + sound/hda/codecs/conexant.c | 16 +- + sound/hda/codecs/generic.c | 23 +- + sound/hda/codecs/hdmi/hdmi.c | 5 +- + sound/hda/codecs/helpers/razer_blade16_2025.c | 820 ++++++++ + sound/hda/codecs/realtek/alc269.c | 252 ++- + sound/hda/codecs/realtek/alc662.c | 7 + + sound/hda/codecs/side-codecs/Kconfig | 18 + + sound/hda/codecs/side-codecs/Makefile | 4 + + sound/hda/codecs/side-codecs/aw88399_hda.c | 373 ++++ + sound/hda/codecs/side-codecs/aw88399_hda.h | 36 + + sound/hda/codecs/side-codecs/aw88399_hda_i2c.c | 54 + + sound/hda/codecs/side-codecs/cs35l41_hda.c | 43 +- + sound/hda/codecs/side-codecs/cs35l56_hda.c | 35 +- + sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 16 +- + sound/hda/codecs/side-codecs/tas2781_hda_spi.c | 21 +- + sound/hda/common/auto_parser.c | 66 +- + sound/hda/common/codec.c | 13 +- + sound/hda/common/hda_auto_parser.h | 2 +- + sound/hda/common/hda_local.h | 7 + + sound/hda/common/jack.c | 4 +- + sound/hda/common/proc.c | 2 +- + sound/hda/controllers/Kconfig | 1 + + sound/hda/controllers/intel.c | 25 +- + sound/hda/core/controller.c | 33 +- + sound/hda/core/device.c | 3 +- + sound/hda/core/ext/stream.c | 4 +- + sound/hda/core/hda_bus_type.c | 9 +- + sound/hda/core/stream.c | 40 +- + sound/isa/msnd/msnd_pinnacle.c | 18 +- + sound/isa/sscape.c | 8 +- + sound/isa/wavefront/wavefront_fx.c | 23 +- + sound/isa/wavefront/wavefront_synth.c | 4 +- + sound/pci/Kconfig | 1 + + sound/pci/asihpi/asihpi.c | 2 +- + sound/pci/asihpi/hpi6000.c | 5 + + sound/pci/asihpi/hpidspcd.c | 18 +- + sound/pci/asihpi/hpioctl.c | 17 +- + sound/pci/cs46xx/cs46xx_lib.c | 30 +- + sound/pci/cs5535audio/cs5535audio_olpc.c | 2 +- + sound/pci/emu10k1/emufx.c | 18 +- + sound/pci/korg1212/korg1212.c | 8 +- + sound/pci/mixart/mixart_hwdep.c | 4 +- + sound/pci/pcxhr/pcxhr_hwdep.c | 3 +- + sound/pci/sis7019.c | 10 +- + sound/pci/via82xx_modem.c | 26 +- + sound/sh/aica.c | 4 +- + sound/soc/amd/acp-config.c | 19 + + sound/soc/amd/acp-pcm-dma.c | 8 +- + sound/soc/amd/acp/acp-i2s.c | 6 + + sound/soc/amd/acp/acp-mach-common.c | 11 +- + sound/soc/amd/acp/acp-pci.c | 26 +- + sound/soc/amd/acp/acp-sdw-legacy-mach.c | 20 +- + sound/soc/amd/acp/acp-sdw-sof-mach.c | 16 +- + sound/soc/amd/acp/acp-sof-mach.c | 14 +- + sound/soc/amd/acp/amd-acp70-acpi-match.c | 56 + + sound/soc/amd/mach-config.h | 1 + + sound/soc/amd/raven/acp3x-i2s.c | 6 + + sound/soc/amd/vangogh/acp5x-i2s.c | 6 + + sound/soc/amd/yc/acp6x-mach.c | 12 +- + sound/soc/apple/mca.c | 323 ++- + sound/soc/atmel/atmel-i2s.c | 4 + + sound/soc/atmel/atmel_ssc_dai.c | 7 + + sound/soc/atmel/atmel_wm8904.c | 13 +- + sound/soc/atmel/mchp-i2s-mcc.c | 9 + + sound/soc/atmel/mchp-pdmc.c | 4 + + sound/soc/au1x/db1200.c | 2 +- + sound/soc/au1x/i2sc.c | 11 + + sound/soc/au1x/psc-ac97.c | 4 +- + sound/soc/au1x/psc-i2s.c | 11 + + sound/soc/bcm/bcm2835-i2s.c | 13 + + sound/soc/bcm/cygnus-ssp.c | 7 + + sound/soc/cirrus/ep93xx-i2s.c | 11 + + sound/soc/codecs/Kconfig | 61 +- + sound/soc/codecs/Makefile | 6 + + sound/soc/codecs/ab8500-codec.c | 12 +- + sound/soc/codecs/ad1836.c | 6 + + sound/soc/codecs/ad193x.c | 10 + + sound/soc/codecs/adau1761.c | 34 +- + sound/soc/codecs/adau7118-hw.c | 2 +- + sound/soc/codecs/adav80x.c | 8 + + sound/soc/codecs/ak4613.c | 77 +- + sound/soc/codecs/arizona-jack.c | 121 +- + sound/soc/codecs/arizona.c | 26 +- + sound/soc/codecs/aw87390.c | 17 +- + sound/soc/codecs/aw88081.c | 27 +- + sound/soc/codecs/aw88166.c | 32 +- + sound/soc/codecs/aw88261.c | 35 +- + sound/soc/codecs/aw88261.h | 6 - + sound/soc/codecs/aw88395/aw88395.c | 32 +- + sound/soc/codecs/aw88395/aw88395_device.c | 40 +- + sound/soc/codecs/aw88399-lib.c | 1409 +++++++++++++ + sound/soc/codecs/aw88399.c | 1358 +------------ + sound/soc/codecs/aw88399.h | 582 +----- + sound/soc/codecs/bt-sco.c | 10 +- + sound/soc/codecs/cpcap.c | 130 +- + sound/soc/codecs/cros_ec_codec.c | 26 +- + sound/soc/codecs/cs-amp-lib.c | 11 +- + sound/soc/codecs/cs35l32.c | 10 +- + sound/soc/codecs/cs35l33.c | 14 +- + sound/soc/codecs/cs35l34.c | 14 +- + sound/soc/codecs/cs35l56-i2c.c | 10 +- + sound/soc/codecs/cs35l56-sdw.c | 71 +- + sound/soc/codecs/cs35l56-shared.c | 69 +- + sound/soc/codecs/cs35l56-spi.c | 10 +- + sound/soc/codecs/cs35l56.c | 58 +- + sound/soc/codecs/cs35l56.h | 11 +- + sound/soc/codecs/cs40l50-codec.c | 4 +- + sound/soc/codecs/cs42l42-sdw.c | 14 +- + sound/soc/codecs/cs42l42.c | 56 +- + sound/soc/codecs/cs42l43-jack.c | 138 +- + sound/soc/codecs/cs42l43.c | 20 +- + sound/soc/codecs/cs42l84.c | 11 +- + sound/soc/codecs/cs43130.c | 72 +- + sound/soc/codecs/cs4349.c | 8 +- + sound/soc/codecs/cs47l15.c | 11 +- + sound/soc/codecs/cs47l35.c | 11 +- + sound/soc/codecs/cs47l85.c | 11 +- + sound/soc/codecs/cs47l90.c | 11 +- + sound/soc/codecs/cs47l92.c | 11 +- + sound/soc/codecs/cs48l32.c | 26 +- + sound/soc/codecs/cx2072x.c | 141 +- + sound/soc/codecs/da7213.c | 37 +- + sound/soc/codecs/da7219.c | 62 +- + sound/soc/codecs/dmic.c | 1 - + sound/soc/codecs/es8316.c | 44 +- + sound/soc/codecs/es8326.c | 30 +- + sound/soc/codecs/es8328.c | 5 + + sound/soc/codecs/es8389.c | 236 ++- + sound/soc/codecs/es8389.h | 11 +- + sound/soc/codecs/es9356.c | 33 +- + sound/soc/codecs/fs-amp-lib.c | 3 +- + sound/soc/codecs/fs210x.c | 89 +- + sound/soc/codecs/hdac_hda.c | 7 +- + sound/soc/codecs/hdac_hdmi.c | 137 +- + sound/soc/codecs/hdmi-codec.c | 15 +- + sound/soc/codecs/idt821034.c | 144 +- + sound/soc/codecs/lochnagar-sc.c | 8 + + sound/soc/codecs/lpass-macro-common.c | 12 +- + sound/soc/codecs/lpass-rx-macro.c | 141 +- + sound/soc/codecs/lpass-tx-macro.c | 130 +- + sound/soc/codecs/lpass-va-macro.c | 139 +- + sound/soc/codecs/lpass-wsa-macro.c | 144 +- + sound/soc/codecs/madera.c | 51 +- + sound/soc/codecs/max98090.c | 9 +- + sound/soc/codecs/max98095.c | 35 +- + sound/soc/codecs/max98363.c | 7 +- + sound/soc/codecs/max98373-i2c.c | 9 +- + sound/soc/codecs/max98373-sdw.c | 7 +- + sound/soc/codecs/max98388.c | 8 +- + sound/soc/codecs/max98390.c | 24 +- + sound/soc/codecs/max98396.c | 24 +- + sound/soc/codecs/max9860.c | 2 +- + sound/soc/codecs/max98927.c | 8 +- + sound/soc/codecs/ml26124.c | 4 +- + sound/soc/codecs/msm8916-wcd-analog.c | 144 +- + sound/soc/codecs/mt6357.c | 4 +- + sound/soc/codecs/mt6359-accdet.c | 13 +- + sound/soc/codecs/ntpfw.c | 21 +- + sound/soc/codecs/ntpfw.h | 11 +- + sound/soc/codecs/pcm1681.c | 7 + + sound/soc/codecs/pcm1754.c | 6 + + sound/soc/codecs/pcm1789.c | 7 + + sound/soc/codecs/pcm179x.c | 6 + + sound/soc/codecs/pcm186x.c | 9 + + sound/soc/codecs/pcm3060.c | 8 + + sound/soc/codecs/pcm512x.c | 68 +- + sound/soc/codecs/pcm6240.c | 41 +- + sound/soc/codecs/peb2466.c | 23 +- + sound/soc/codecs/pm4125-sdw.c | 10 +- + sound/soc/codecs/pm4125.c | 3 +- + sound/soc/codecs/rt1017-sdca-sdw.c | 7 +- + sound/soc/codecs/rt1017-sdca-sdw.h | 10 +- + sound/soc/codecs/rt1316-sdw.c | 9 +- + sound/soc/codecs/rt1318-sdw.c | 9 +- + sound/soc/codecs/rt1318.c | 4 +- + sound/soc/codecs/rt1320-sdw.c | 882 +++++++-- + sound/soc/codecs/rt1320-sdw.h | 19 + + sound/soc/codecs/rt274.c | 8 +- + sound/soc/codecs/rt286.c | 14 +- + sound/soc/codecs/rt298.c | 14 +- + sound/soc/codecs/rt5514-spi.c | 21 +- + sound/soc/codecs/rt5514.c | 16 +- + sound/soc/codecs/rt5575-spi.c | 3 +- + sound/soc/codecs/rt5645.c | 180 +- + sound/soc/codecs/rt5665.c | 15 +- + sound/soc/codecs/rt5668.c | 10 +- + sound/soc/codecs/rt5677-spi.c | 36 +- + sound/soc/codecs/rt5677.c | 100 +- + sound/soc/codecs/rt5682-sdw.c | 44 +- + sound/soc/codecs/rt5682.c | 5 +- + sound/soc/codecs/rt5682s.c | 17 +- + sound/soc/codecs/rt700-sdw.c | 20 +- + sound/soc/codecs/rt700-sdw.h | 11 +- + sound/soc/codecs/rt711-sdca-sdw.c | 29 +- + sound/soc/codecs/rt711-sdca-sdw.h | 6 +- + sound/soc/codecs/rt711-sdca.c | 5 +- + sound/soc/codecs/rt711-sdw.c | 24 +- + sound/soc/codecs/rt711-sdw.h | 10 +- + sound/soc/codecs/rt711.c | 50 +- + sound/soc/codecs/rt712-sdca-dmic.c | 17 +- + sound/soc/codecs/rt712-sdca-dmic.h | 6 +- + sound/soc/codecs/rt712-sdca-sdw.c | 45 +- + sound/soc/codecs/rt712-sdca-sdw.h | 11 +- + sound/soc/codecs/rt712-sdca.c | 5 +- + sound/soc/codecs/rt715-sdca-sdw.h | 48 +- + sound/soc/codecs/rt715-sdw.h | 32 +- + sound/soc/codecs/rt721-sdca-sdw.c | 44 +- + sound/soc/codecs/rt721-sdca-sdw.h | 44 +- + sound/soc/codecs/rt721-sdca.c | 5 +- + sound/soc/codecs/rt722-sdca-sdw.c | 37 +- + sound/soc/codecs/rt722-sdca.c | 16 +- + sound/soc/codecs/rt766-sdca-sdw.c | 339 ++++ + sound/soc/codecs/rt766-sdca-sdw.h | 61 + + sound/soc/codecs/rt766-sdca.c | 1378 +++++++++++++ + sound/soc/codecs/rt766-sdca.h | 140 ++ + sound/soc/codecs/rt9120.c | 9 +- + sound/soc/codecs/sgtl5000.c | 2 +- + sound/soc/codecs/sigmadsp.c | 30 +- + sound/soc/codecs/sma1303.c | 2 + + sound/soc/codecs/sma1307.c | 6 +- + sound/soc/codecs/sta32x.c | 21 +- + sound/soc/codecs/sta350.c | 20 +- + sound/soc/codecs/sti-sas.c | 2 +- + sound/soc/codecs/tac5xx2-sdw.c | 90 +- + sound/soc/codecs/tas2552.c | 24 +- + sound/soc/codecs/tas2764.c | 2 +- + sound/soc/codecs/tas2780.c | 2 +- + sound/soc/codecs/tas2781-comlib-i2c.c | 5 +- + sound/soc/codecs/tas2781-fmwlib.c | 65 +- + sound/soc/codecs/tas2781-i2c.c | 253 ++- + sound/soc/codecs/tas2783-sdw.c | 316 +-- + sound/soc/codecs/tas5805m.c | 30 +- + sound/soc/codecs/tas675x.c | 18 +- + sound/soc/codecs/tlv320aic26.c | 6 + + sound/soc/codecs/tlv320aic31xx.c | 8 +- + sound/soc/codecs/tlv320aic32x4-clk.c | 68 +- + sound/soc/codecs/tlv320aic32x4-i2c.c | 21 +- + sound/soc/codecs/tlv320aic32x4-spi.c | 25 +- + sound/soc/codecs/tlv320aic32x4.c | 468 ++--- + sound/soc/codecs/tlv320aic32x4.h | 32 +- + sound/soc/codecs/tlv320dac33.c | 87 +- + sound/soc/codecs/tscs42xx.c | 61 +- + sound/soc/codecs/tscs454.c | 107 +- + sound/soc/codecs/twl6040.c | 5 +- + sound/soc/codecs/uda1342.c | 9 +- + sound/soc/codecs/wcd9335.c | 4 +- + sound/soc/codecs/wcd934x.c | 48 +- + sound/soc/codecs/wcd937x-sdw.c | 8 +- + sound/soc/codecs/wcd937x.c | 25 +- + sound/soc/codecs/wcd938x-sdw.c | 8 +- + sound/soc/codecs/wcd938x.c | 22 +- + sound/soc/codecs/wcd939x-sdw.c | 8 +- + sound/soc/codecs/wcd939x.c | 20 +- + sound/soc/codecs/wm0010.c | 86 +- + sound/soc/codecs/wm2000.c | 35 +- + sound/soc/codecs/wm2200.c | 10 +- + sound/soc/codecs/wm5100.c | 10 +- + sound/soc/codecs/wm5102.c | 23 +- + sound/soc/codecs/wm8731.c | 9 +- + sound/soc/codecs/wm8903.c | 9 +- + sound/soc/codecs/wm8940.c | 2 +- + sound/soc/codecs/wm8958-dsp2.c | 10 +- + sound/soc/codecs/wm8962.c | 22 +- + sound/soc/codecs/wm8994.c | 30 +- + sound/soc/codecs/wm9712.c | 5 +- + sound/soc/codecs/wm9713.c | 5 +- + sound/soc/codecs/wm_adsp.c | 77 +- + sound/soc/codecs/wsa881x.c | 8 +- + sound/soc/codecs/wsa883x.c | 19 +- + sound/soc/codecs/wsa884x.c | 18 +- + sound/soc/codecs/wsa885x.c | 1533 +++++++++++++++ + sound/soc/codecs/zl38060.c | 11 +- + sound/soc/dwc/dwc-i2s.c | 4 +- + sound/soc/fsl/fsl-asoc-card.c | 730 ++++--- + sound/soc/fsl/fsl_asrc.c | 12 +- + sound/soc/fsl/fsl_asrc.h | 6 +- + sound/soc/fsl/fsl_asrc_dma.c | 4 +- + sound/soc/fsl/fsl_asrc_m2m.c | 10 +- + sound/soc/fsl/fsl_audmix.c | 35 +- + sound/soc/fsl/fsl_dma.c | 68 +- + sound/soc/fsl/fsl_dma.h | 4 +- + sound/soc/fsl/fsl_easrc.c | 45 +- + sound/soc/fsl/fsl_easrc.h | 4 +- + sound/soc/fsl/fsl_esai.c | 16 +- + sound/soc/fsl/fsl_qmc_audio.c | 8 +- + sound/soc/fsl/fsl_spdif.c | 8 +- + sound/soc/fsl/fsl_ssi.c | 13 +- + sound/soc/fsl/fsl_xcvr.c | 39 +- + sound/soc/fsl/imx-audio-rpmsg.c | 25 +- + sound/soc/fsl/imx-card.c | 4 +- + sound/soc/fsl/imx-pcm-rpmsg.c | 75 +- + sound/soc/fsl/mpc5200_dma.c | 114 +- + sound/soc/fsl/mpc5200_psc_ac97.c | 38 +- + sound/soc/fsl/mpc5200_psc_i2s.c | 12 +- + sound/soc/fsl/p1022_ds.c | 14 +- + sound/soc/fsl/p1022_rdk.c | 14 +- + sound/soc/generic/audio-graph-card.c | 16 +- + sound/soc/generic/audio-graph-card2.c | 35 +- + sound/soc/generic/simple-card-utils.c | 82 +- + sound/soc/generic/simple-card.c | 127 +- + sound/soc/intel/atom/sst-atom-controls.c | 67 +- + sound/soc/intel/atom/sst-mfld-platform-pcm.c | 66 +- + sound/soc/intel/atom/sst/sst_ipc.c | 5 +- + sound/soc/intel/atom/sst/sst_pci.c | 4 +- + sound/soc/intel/atom/sst/sst_pvt.c | 9 +- + sound/soc/intel/avs/apl.c | 8 +- + sound/soc/intel/avs/avs.h | 5 +- + sound/soc/intel/avs/boards/da7219.c | 7 +- + sound/soc/intel/avs/boards/dmic.c | 6 +- + sound/soc/intel/avs/boards/es8336.c | 6 +- + sound/soc/intel/avs/boards/hdaudio.c | 6 +- + sound/soc/intel/avs/boards/i2s_test.c | 6 +- + sound/soc/intel/avs/boards/max98357a.c | 6 +- + sound/soc/intel/avs/boards/max98373.c | 6 +- + sound/soc/intel/avs/boards/max98927.c | 6 +- + sound/soc/intel/avs/boards/nau8825.c | 6 +- + sound/soc/intel/avs/boards/pcm3168a.c | 6 +- + sound/soc/intel/avs/boards/probe.c | 2 +- + sound/soc/intel/avs/boards/rt274.c | 2 +- + sound/soc/intel/avs/boards/rt286.c | 2 +- + sound/soc/intel/avs/boards/rt298.c | 2 +- + sound/soc/intel/avs/boards/rt5514.c | 2 +- + sound/soc/intel/avs/boards/rt5640.c | 2 +- + sound/soc/intel/avs/boards/rt5663.c | 2 +- + sound/soc/intel/avs/boards/rt5682.c | 2 +- + sound/soc/intel/avs/boards/ssm4567.c | 2 +- + sound/soc/intel/avs/control.c | 7 +- + sound/soc/intel/avs/core.c | 4 +- + sound/soc/intel/avs/debug.h | 10 +- + sound/soc/intel/avs/debugfs.c | 19 +- + sound/soc/intel/avs/ipc.c | 59 +- + sound/soc/intel/avs/loader.c | 15 +- + sound/soc/intel/avs/path.c | 30 +- + sound/soc/intel/avs/pcm.c | 19 +- + sound/soc/intel/avs/probes.c | 18 +- + sound/soc/intel/avs/topology.c | 3 +- + sound/soc/intel/avs/utils.c | 45 +- + sound/soc/intel/boards/sof_sdw.c | 16 +- + sound/soc/intel/catpt/core.h | 4 +- + sound/soc/intel/catpt/device.c | 33 +- + sound/soc/intel/catpt/loader.c | 148 +- + sound/soc/intel/catpt/pcm.c | 59 +- + sound/soc/intel/common/soc-acpi-intel-arl-match.c | 3 + + sound/soc/intel/common/soc-acpi-intel-lnl-match.c | 15 +- + sound/soc/intel/common/soc-acpi-intel-mtl-match.c | 18 +- + sound/soc/intel/common/soc-acpi-intel-ptl-match.c | 6 +- + .../soc/intel/common/soc-acpi-intel-sdca-quirks.c | 8 + + .../soc/intel/common/soc-acpi-intel-sdca-quirks.h | 1 + + sound/soc/intel/keembay/kmb_platform.c | 2 + + sound/soc/loongson/loongson_card.c | 171 +- + sound/soc/loongson/loongson_i2s_plat.c | 42 +- + sound/soc/mediatek/Kconfig | 2 +- + sound/soc/mediatek/common/mtk-dsp-sof-common.c | 7 +- + sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 +- + sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 4 +- + .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 4 +- + sound/soc/mediatek/mt8186/mt8186-mt6366.c | 2 +- + sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +- + sound/soc/mediatek/mt8189/mt8189-dai-adda.c | 2 - + sound/soc/mediatek/mt8189/mt8189-nau8825.c | 2 +- + .../mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 14 +- + sound/soc/mediatek/mt8195/mt8195-mt6359.c | 4 +- + sound/soc/mediatek/mt8196/mt8196-nau8825.c | 4 +- + sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 16 +- + sound/soc/mediatek/mt8365/mt8365-mt6357.c | 10 +- + sound/soc/meson/Makefile | 2 + + sound/soc/meson/aiu-encoder-i2s.c | 367 +++- + sound/soc/meson/aiu-formatter-i2s.c | 103 + + sound/soc/meson/aiu.c | 33 +- + sound/soc/meson/aiu.h | 4 + + sound/soc/meson/axg-card.c | 25 +- + sound/soc/meson/g12a-toacodec.c | 2 +- + sound/soc/meson/g12a-tohdmitx.c | 2 +- + sound/soc/meson/gx-card.c | 6 +- + sound/soc/meson/gx-formatter.c | 282 +++ + sound/soc/meson/gx-formatter.h | 56 + + sound/soc/meson/gx-interface.h | 42 + + sound/soc/meson/meson-card-utils.c | 39 +- + sound/soc/meson/meson-codec-glue.c | 2 +- + sound/soc/meson/t9015.c | 12 +- + sound/soc/mxs/mxs-saif.c | 21 +- + sound/soc/mxs/mxs-sgtl5000.c | 2 - + sound/soc/pxa/pxa-ssp.c | 7 +- + sound/soc/pxa/pxa2xx-ac97-lib.c | 4 +- + sound/soc/qcom/common.c | 164 +- + sound/soc/qcom/common.h | 16 +- + sound/soc/qcom/qdsp6/audioreach.c | 140 +- + sound/soc/qcom/qdsp6/audioreach.h | 90 + + sound/soc/qcom/qdsp6/q6afe-dai.c | 48 + + sound/soc/qcom/qdsp6/q6afe.c | 56 + + sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 228 ++- + sound/soc/qcom/qdsp6/q6apm.c | 12 +- + sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c | 2 +- + sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 5 + + sound/soc/qcom/qdsp6/q6prm-clocks.c | 35 + + sound/soc/qcom/qdsp6/q6prm.c | 16 +- + sound/soc/qcom/qdsp6/q6prm.h | 44 + + sound/soc/qcom/qdsp6/q6routing.c | 78 +- + sound/soc/qcom/qdsp6/topology.c | 107 +- + sound/soc/qcom/sc8280xp.c | 430 +++- + sound/soc/qcom/sdm845.c | 2 - + sound/soc/qcom/sm8250.c | 17 + + sound/soc/qcom/storm.c | 12 +- + sound/soc/renesas/fsi.c | 13 +- + sound/soc/renesas/rcar/adg.c | 8 +- + sound/soc/renesas/siu_dai.c | 4 +- + sound/soc/rockchip/rk3288_hdmi_analog.c | 16 +- + sound/soc/rockchip/rockchip_i2s.c | 30 +- + sound/soc/rockchip/rockchip_i2s_tdm.c | 15 +- + sound/soc/rockchip/rockchip_max98090.c | 5 +- + sound/soc/rockchip/rockchip_pdm.c | 8 +- + sound/soc/rockchip/rockchip_rt5645.c | 5 +- + sound/soc/rockchip/rockchip_sai.c | 15 +- + sound/soc/rockchip/rockchip_spdif.c | 4 +- + sound/soc/samsung/aries_wm8994.c | 1 + + sound/soc/samsung/i2s.c | 58 +- + sound/soc/samsung/smdk_spdif.c | 8 +- + sound/soc/samsung/spdif.c | 8 +- + sound/soc/sdca/sdca_asoc.c | 18 +- + sound/soc/sdca/sdca_class_function.c | 2 +- + sound/soc/sdca/sdca_fdl.c | 8 +- + sound/soc/sdca/sdca_function_device.c | 7 +- + sound/soc/sdca/sdca_functions.c | 187 +- + sound/soc/sdca/sdca_hid.c | 48 +- + sound/soc/sdca/sdca_interrupts.c | 6 + + sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c | 4 +- + sound/soc/sdw_utils/soc_sdw_utils.c | 72 +- + sound/soc/soc-component.c | 53 +- + sound/soc/soc-core.c | 44 +- + sound/soc/soc-dapm.c | 6 + + sound/soc/soc-generic-dmaengine-pcm.c | 58 +- + sound/soc/soc-topology-test.c | 133 +- + sound/soc/sof/amd/Kconfig | 11 + + sound/soc/sof/amd/Makefile | 2 + + sound/soc/sof/amd/acp-dsp-offset.h | 17 + + sound/soc/sof/amd/acp-ipc.c | 13 +- + sound/soc/sof/amd/acp-loader.c | 37 +- + sound/soc/sof/amd/acp.c | 267 ++- + sound/soc/sof/amd/acp.h | 20 + + sound/soc/sof/amd/acp7x.c | 185 ++ + sound/soc/sof/amd/pci-acp7x.c | 116 ++ + sound/soc/sof/fw-file-profile.c | 19 +- + sound/soc/sof/intel/hda-ctrl.c | 19 + + sound/soc/sof/intel/hda-dai-ops.c | 76 +- + sound/soc/sof/intel/hda-dai.c | 2 +- + sound/soc/sof/intel/hda-dsp.c | 6 +- + sound/soc/sof/intel/hda-loader.c | 11 +- + sound/soc/sof/intel/hda-mlink.c | 35 +- + sound/soc/sof/intel/hda-sdw-bpt.c | 2 +- + sound/soc/sof/intel/hda-stream.c | 18 +- + sound/soc/sof/intel/hda.c | 18 +- + sound/soc/sof/intel/hda.h | 31 +- + sound/soc/sof/intel/icl.c | 10 +- + sound/soc/sof/intel/mtl.c | 23 + + sound/soc/sof/ipc3-pcm.c | 6 + + sound/soc/sof/ipc3-topology.c | 39 +- + sound/soc/sof/ipc4-topology.c | 382 +++- + sound/soc/sof/ipc4-topology.h | 12 +- + sound/soc/sof/ipc4.c | 84 + + sound/soc/sof/nocodec.c | 16 +- + sound/soc/sof/pcm.c | 2 +- + sound/soc/sof/sof-audio.c | 5 +- + sound/soc/sof/sof-audio.h | 8 +- + sound/soc/sof/topology.c | 53 +- + sound/soc/sophgo/cv1800b-tdm.c | 16 +- + sound/soc/spacemit/k1_i2s.c | 47 +- + sound/soc/spear/spdif_in.c | 12 +- + sound/soc/spear/spdif_out.c | 2 +- + sound/soc/sprd/sprd-mcdt.c | 4 +- + sound/soc/sprd/sprd-pcm-dma.c | 2 - + sound/soc/starfive/jh7110_pwmdac.c | 15 +- + sound/soc/starfive/jh7110_tdm.c | 27 +- + sound/soc/stm/stm32_adfsdm.c | 5 +- + sound/soc/stm/stm32_i2s.c | 6 +- + sound/soc/stm/stm32_sai_sub.c | 8 +- + sound/soc/stm/stm32_spdifrx.c | 6 +- + sound/soc/sunxi/sun4i-codec.c | 93 +- + sound/soc/sunxi/sun4i-i2s.c | 28 +- + sound/soc/sunxi/sun4i-spdif.c | 23 +- + sound/soc/sunxi/sun50i-codec-analog.c | 11 +- + sound/soc/sunxi/sun8i-codec-analog.c | 11 +- + sound/soc/tegra/tegra20_das.c | 7 +- + sound/soc/tegra/tegra210_adx.c | 12 +- + sound/soc/tegra/tegra210_amx.c | 12 +- + sound/soc/tegra/tegra210_i2s.c | 18 +- + sound/soc/tegra/tegra210_mixer.c | 2 +- + sound/soc/ti/ams-delta.c | 8 +- + sound/soc/ti/davinci-evm.c | 3 +- + sound/soc/ti/j721e-evm.c | 11 +- + sound/soc/ti/omap-abe-twl6040.c | 15 +- + sound/soc/ti/omap-dmic.c | 7 +- + sound/soc/ti/omap-hdmi.c | 9 +- + sound/soc/ti/omap-twl4030.c | 168 +- + sound/soc/ti/rx51.c | 51 +- + sound/soc/uniphier/aio-cpu.c | 8 +- + sound/soc/uniphier/aio.h | 2 +- + sound/soc/ux500/mop500.c | 12 +- + sound/soc/ux500/mop500_ab8500.c | 2 +- + sound/soc/xilinx/xlnx_formatter_pcm.c | 16 +- + sound/soc/xilinx/xlnx_i2s.c | 30 +- + sound/soc/xilinx/xlnx_spdif.c | 39 +- + sound/soc/xtensa/xtfpga-i2s.c | 60 +- + sound/sparc/dbri.c | 2 + + sound/usb/6fire/comm.c | 9 +- + sound/usb/6fire/firmware.c | 24 +- + sound/usb/bcd2000/bcd2000.c | 11 +- + sound/usb/card.c | 72 +- + sound/usb/clock.c | 11 +- + sound/usb/endpoint.c | 7 +- + sound/usb/fcp.c | 42 +- + sound/usb/mixer.c | 6 + + sound/usb/mixer.h | 2 + + sound/usb/mixer_maps.c | 18 + + sound/usb/mixer_quirks.c | 20 + + sound/usb/mixer_scarlett2.c | 98 +- + sound/usb/quirks-table.h | 77 + + sound/usb/quirks.c | 29 +- + sound/usb/quirks.h | 3 - + sound/usb/usbaudio.h | 18 +- + sound/usb/usx2y/us144mkii_pcm.h | 6 +- + sound/usb/usx2y/usbusx2yaudio.c | 1 - + tools/testing/kunit/configs/all_tests.config | 1 + + tools/testing/kunit/configs/default.config | 1 + + .../testing/selftests/bpf/prog_tests/tp_btf_ids.c | 132 ++ + tools/testing/selftests/livepatch/functions.sh | 14 + + tools/testing/selftests/livepatch/test-ftrace.sh | 45 +- + tools/testing/selftests/lsm/common.c | 4 +- + .../selftests/verification/test.d/rv_deadline.tc | 23 + + .../test.d/rv_monitor_enable_disable.tc | 10 +- + .../verification/test.d/rv_monitor_reactor.tc | 4 +- + .../selftests/verification/test.d/rv_stall.tc | 33 + + .../verification/test.d/rv_wwnr_printk.tc | 32 +- + tools/tracing/rtla/src/cli.c | 42 +- + tools/tracing/rtla/src/cli_p.h | 497 +++-- + tools/tracing/rtla/tests/engine.sh | 39 +- + tools/tracing/rtla/tests/hwnoise.t | 3 + + tools/tracing/rtla/tests/osnoise.t | 39 +- + .../rtla/tests/scripts/check-osnoise-option.sh | 16 + + .../rtla/tests/scripts/check-tracefs-value.sh | 11 + + tools/tracing/rtla/tests/timerlat.t | 40 +- + tools/tracing/rtla/tests/unit/cli_opt_callback.c | 542 +++-- + tools/tracing/rtla/tests/unit/osnoise_hist_cli.c | 18 + + tools/tracing/rtla/tests/unit/osnoise_top_cli.c | 18 + + tools/tracing/rtla/tests/unit/timerlat_hist_cli.c | 18 + + tools/tracing/rtla/tests/unit/timerlat_top_cli.c | 18 + + tools/verification/models/rtapp/sleep.ltl | 11 +- + tools/verification/models/rtapp/wakeup.ltl | 5 + + tools/verification/rv/Makefile | 5 +- + tools/verification/rv/src/rv.c | 24 +- + tools/verification/rv/tests/rv_list.t | 48 + + tools/verification/rv/tests/rv_mon.t | 95 + + tools/verification/rvgen/Makefile | 5 + + tools/verification/rvgen/__main__.py | 22 +- + tools/verification/rvgen/rvgen/automata.py | 635 +++--- + tools/verification/rvgen/rvgen/dot2c.py | 10 +- + tools/verification/rvgen/rvgen/dot2k.py | 321 ++- + tools/verification/rvgen/rvgen/generator.py | 51 +- + tools/verification/rvgen/rvgen/kunit.py | 194 ++ + tools/verification/rvgen/rvgen/ltl2ba.py | 184 +- + tools/verification/rvgen/rvgen/ltl2k.py | 2 +- + .../rvgen/rvgen/templates/container/main.c | 2 +- + .../rvgen/rvgen/templates/dot2k/main.c | 2 +- + tools/verification/rvgen/rvgen/templates/kunit.c | 33 + + .../rvgen/rvgen/templates/ltl2k/main.c | 8 +- + .../rvgen/tests/golden/da_global/Kconfig | 9 + + .../rvgen/tests/golden/da_global/da_global.c | 95 + + .../rvgen/tests/golden/da_global/da_global.h | 47 + + .../rvgen/tests/golden/da_global/da_global_trace.h | 15 + + .../rvgen/tests/golden/da_perobj_parent/Kconfig | 11 + + .../golden/da_perobj_parent/da_perobj_parent.c | 119 ++ + .../golden/da_perobj_parent/da_perobj_parent.h | 64 + + .../da_perobj_parent/da_perobj_parent_trace.h | 15 + + .../rvgen/tests/golden/da_pertask_desc/Kconfig | 9 + + .../tests/golden/da_pertask_desc/da_pertask_desc.c | 105 + + .../tests/golden/da_pertask_desc/da_pertask_desc.h | 64 + + .../golden/da_pertask_desc/da_pertask_desc_trace.h | 15 + + .../rvgen/tests/golden/ha_percpu/Kconfig | 9 + + .../rvgen/tests/golden/ha_percpu/ha_percpu.c | 227 +++ + .../rvgen/tests/golden/ha_percpu/ha_percpu.h | 72 + + .../rvgen/tests/golden/ha_percpu/ha_percpu_trace.h | 19 + + .../rvgen/tests/golden/ltl_pertask/Kconfig | 9 + + .../rvgen/tests/golden/ltl_pertask/ltl_pertask.c | 107 + + .../rvgen/tests/golden/ltl_pertask/ltl_pertask.h | 108 + + .../tests/golden/ltl_pertask/ltl_pertask_trace.h | 14 + + .../rvgen/tests/golden/test_bak_kunit/Kconfig | 9 + + .../tests/golden/test_bak_kunit/test_bak_kunit.c | 107 + + .../tests/golden/test_bak_kunit/test_bak_kunit.h | 108 + + .../golden/test_bak_kunit/test_bak_kunit_kunit.c | 33 + + .../test_bak_kunit/test_bak_kunit_kunit.c.bak | 1 + + .../golden/test_bak_kunit/test_bak_kunit_kunit.h | 22 + + .../golden/test_bak_kunit/test_bak_kunit_trace.h | 14 + + .../rvgen/tests/golden/test_container/Kconfig | 5 + + .../tests/golden/test_container/test_container.c | 35 + + .../tests/golden/test_container/test_container.h | 3 + + .../rvgen/tests/golden/test_da/Kconfig | 9 + + .../rvgen/tests/golden/test_da/test_da.c | 95 + + .../rvgen/tests/golden/test_da/test_da.h | 47 + + .../rvgen/tests/golden/test_da/test_da_trace.h | 15 + + .../rvgen/tests/golden/test_da_kunit/Kconfig | 9 + + .../tests/golden/test_da_kunit/test_da_kunit.c | 107 + + .../tests/golden/test_da_kunit/test_da_kunit.h | 47 + + .../golden/test_da_kunit/test_da_kunit_kunit.c | 33 + + .../golden/test_da_kunit/test_da_kunit_kunit.h | 23 + + .../golden/test_da_kunit/test_da_kunit_trace.h | 15 + + .../rvgen/tests/golden/test_ha/Kconfig | 9 + + .../rvgen/tests/golden/test_ha/test_ha.c | 230 +++ + .../rvgen/tests/golden/test_ha/test_ha.h | 72 + + .../rvgen/tests/golden/test_ha/test_ha_trace.h | 19 + + .../rvgen/tests/golden/test_ha_kunit/Kconfig | 9 + + .../tests/golden/test_ha_kunit/test_ha_kunit.c | 243 +++ + .../tests/golden/test_ha_kunit/test_ha_kunit.h | 88 + + .../golden/test_ha_kunit/test_ha_kunit_kunit.c | 33 + + .../golden/test_ha_kunit/test_ha_kunit_kunit.h | 24 + + .../golden/test_ha_kunit/test_ha_kunit_trace.h | 19 + + .../rvgen/tests/golden/test_ltl/Kconfig | 11 + + .../rvgen/tests/golden/test_ltl/test_ltl.c | 108 + + .../rvgen/tests/golden/test_ltl/test_ltl.h | 108 + + .../rvgen/tests/golden/test_ltl/test_ltl_trace.h | 14 + + .../rvgen/tests/golden/test_ltl_kunit/Kconfig | 9 + + .../tests/golden/test_ltl_kunit/test_ltl_kunit.c | 107 + + .../tests/golden/test_ltl_kunit/test_ltl_kunit.h | 108 + + .../golden/test_ltl_kunit/test_ltl_kunit_kunit.c | 33 + + .../golden/test_ltl_kunit/test_ltl_kunit_kunit.h | 22 + + .../golden/test_ltl_kunit/test_ltl_kunit_trace.h | 14 + + tools/verification/rvgen/tests/rvgen_container.t | 20 + + tools/verification/rvgen/tests/rvgen_kunit.t | 41 + + tools/verification/rvgen/tests/rvgen_monitor.t | 87 + + tools/verification/rvgen/tests/specs/test_da.dot | 16 + + tools/verification/rvgen/tests/specs/test_da2.dot | 19 + + tools/verification/rvgen/tests/specs/test_ha.dot | 27 + + .../rvgen/tests/specs/test_invalid.dot | 8 + + .../rvgen/tests/specs/test_invalid.ltl | 1 + + .../rvgen/tests/specs/test_invalid_ha.dot | 16 + + tools/verification/rvgen/tests/specs/test_ltl.ltl | 1 + + tools/verification/tests/engine.sh | 175 ++ + 2416 files changed, 82891 insertions(+), 28683 deletions(-) + create mode 100644 Documentation/ABI/testing/sysfs-class-spi-master + create mode 100644 Documentation/ABI/testing/sysfs-firmware-sev-vulnerabilities + delete mode 100644 Documentation/devicetree/bindings/arm/omap/l4.txt + delete mode 100644 Documentation/devicetree/bindings/arm/xen.txt + create mode 100644 Documentation/devicetree/bindings/arm/xen.yaml + delete mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.txt + create mode 100644 Documentation/devicetree/bindings/bus/ti,da850-mstpri.yaml + create mode 100644 Documentation/devicetree/bindings/bus/ti,omap-l4.yaml + create mode 100644 Documentation/devicetree/bindings/gpio/realtek,rtd1625-gpio.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adt7470.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/adi,vt7505.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/silergy,sq24860.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/sensirion,sht30.yaml + create mode 100644 Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml + create mode 100644 Documentation/devicetree/bindings/i2c/altr,softip-i2c-v1.0.yaml + delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-altera.txt + delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-axxia.txt + create mode 100644 Documentation/devicetree/bindings/i2c/lsi,api2c.yaml + create mode 100644 Documentation/devicetree/bindings/i2c/qcom,sa8255p-geni-i2c.yaml + create mode 100644 Documentation/devicetree/bindings/input/imagis,isa1200.yaml + create mode 100644 Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml + delete mode 100644 Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt + delete mode 100644 Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt + create mode 100644 Documentation/devicetree/bindings/iommu/ti,omap-iommu.yaml + create mode 100644 Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml + create mode 100644 Documentation/devicetree/bindings/media/qcom,milos-iris.yaml + create mode 100644 Documentation/devicetree/bindings/media/ti,am437x-vpfe.yaml + delete mode 100644 Documentation/devicetree/bindings/media/ti,da850-vpif.txt + create mode 100644 Documentation/devicetree/bindings/media/ti,da850-vpif.yaml + delete mode 100644 Documentation/devicetree/bindings/media/ti-am437x-vpfe.txt + create mode 100644 Documentation/devicetree/bindings/power/renesas,r8a78000-mdlc.yaml + delete mode 100644 Documentation/devicetree/bindings/power/reset/keystone-reset.txt + create mode 100644 Documentation/devicetree/bindings/power/reset/ti,keystone-reset.yaml + create mode 100644 Documentation/devicetree/bindings/power/ti,smartreflex.yaml + delete mode 100644 Documentation/devicetree/bindings/power/ti-smartreflex.txt + create mode 100644 Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml + delete mode 100644 Documentation/devicetree/bindings/regulator/ltc3589.txt + delete mode 100644 Documentation/devicetree/bindings/regulator/pbias-regulator.txt + create mode 100644 Documentation/devicetree/bindings/regulator/rohm,pmic-states.yaml + create mode 100644 Documentation/devicetree/bindings/regulator/ti,pbias-omap.yaml + create mode 100644 Documentation/devicetree/bindings/regulator/ti,tps51632.yaml + delete mode 100644 Documentation/devicetree/bindings/regulator/tps51632-regulator.txt + create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs35l36.yaml + delete mode 100644 Documentation/devicetree/bindings/sound/cs35l36.txt + create mode 100644 Documentation/devicetree/bindings/sound/eukrea,asoc-tlv320.yaml + delete mode 100644 Documentation/devicetree/bindings/sound/eukrea-tlv320.txt + create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mtk-btcvsd-snd.yaml + delete mode 100644 Documentation/devicetree/bindings/sound/mtk-btcvsd-snd.txt + delete mode 100644 Documentation/devicetree/bindings/sound/omap-dmic.txt + create mode 100644 Documentation/devicetree/bindings/sound/qcom,wsa8855.yaml + create mode 100644 Documentation/devicetree/bindings/sound/ti,omap4-dmic.yaml + create mode 100644 Documentation/devicetree/bindings/spi/cavium,octeon-3010-spi.yaml + create mode 100644 Documentation/devicetree/bindings/spi/nuvoton,ma35d1-qspi.yaml + create mode 100644 Documentation/devicetree/bindings/spi/qcom,sa8255p-geni-spi.yaml + delete mode 100644 Documentation/devicetree/bindings/spi/spi-octeon.txt + delete mode 100644 Documentation/devicetree/bindings/watchdog/microchip,pic32-dmt.txt + delete mode 100644 Documentation/devicetree/bindings/watchdog/microchip,pic32-wdt.txt + create mode 100644 Documentation/devicetree/bindings/watchdog/microchip,pic32mzda-dmt.yaml + create mode 100644 Documentation/devicetree/bindings/watchdog/microchip,pic32mzda-wdt.yaml + create mode 100644 Documentation/devicetree/bindings/watchdog/nuvoton,ma35d1-wdt.yaml + create mode 100644 Documentation/hwmon/kb9002.rst + create mode 100644 Documentation/hwmon/mpq82d00.rst + create mode 100644 Documentation/hwmon/mpq8646.rst + create mode 100644 Documentation/hwmon/sq24860.rst + create mode 100644 Documentation/hwmon/tvs-mpfs.rst + create mode 100644 Documentation/hwmon/vt7505.rst + create mode 100644 Documentation/process/maintainer-devicetree.rst + create mode 100644 Documentation/spi/instantiating-devices.rst + create mode 100644 Documentation/userspace-api/media/v4l/metafmt-rppx1.rst + create mode 100644 Documentation/watchdog/npcm_wdt.rst + create mode 100644 drivers/base/test/swnode-devlink-test.c + rename drivers/{crypto => char/hw_random}/qcom-rng.c (53%) + delete mode 100644 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c + delete mode 100644 drivers/crypto/allwinner/sun8i-ss/sun8i-ss-prng.c + delete mode 100644 drivers/crypto/caam/caamprng.c + create mode 100644 drivers/gpio/gpio-rtd1625.c + create mode 100644 drivers/hid/hid-hyperx.c + create mode 100644 drivers/hid/hid-msi.c + create mode 100644 drivers/hid/hid-steelseries-arctis.c + create mode 100644 drivers/hid/i2c-hid/i2c-hid-acpi-prp0001.c + create mode 100644 drivers/hid/i2c-hid/i2c-hid-acpi.h + create mode 100644 drivers/hwmon/eic7700-pvt.c + create mode 100644 drivers/hwmon/eic7700-pvt.h + create mode 100644 drivers/hwmon/kb9002.c + create mode 100644 drivers/hwmon/pmbus/mpq82d00.c + create mode 100644 drivers/hwmon/pmbus/mpq8646.c + create mode 100644 drivers/hwmon/pmbus/sq24860.c + create mode 100644 drivers/hwmon/pmbus/vt7505.c + create mode 100644 drivers/hwmon/tvs-mpfs.c + delete mode 100644 drivers/input/keyboard/hpps2atkbd.h + create mode 100644 drivers/input/misc/amd_sfh_tabletmode.c + create mode 100644 drivers/input/misc/isa1200.c + create mode 100644 drivers/iommu/iommufd/hwpt_noiommu.c + create mode 100644 drivers/media/i2c/imx471.c + create mode 100644 drivers/media/i2c/imx678.c + create mode 100644 drivers/media/platform/dreamchip/Kconfig + create mode 100644 drivers/media/platform/dreamchip/Makefile + create mode 100644 drivers/media/platform/dreamchip/rppx1/Kconfig + create mode 100644 drivers/media/platform/dreamchip/rppx1/Makefile + create mode 100644 drivers/media/platform/dreamchip/rppx1/rpp_module.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rpp_module.h + create mode 100644 drivers/media/platform/dreamchip/rppx1/rpp_params.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rpp_stats.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1.h + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_acq.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_awbg.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_bd.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_bdrgb.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_bls.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_cac.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_ccor.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_db.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_dpcc.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_exm.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_ga.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_hist.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_hist256.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_is.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_lin.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_lsc.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_ltm.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_ltmmeas.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_outif.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_outregs.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_rmap.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_rmapmeas.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_shrp.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_wbmeas.c + create mode 100644 drivers/media/platform/dreamchip/rppx1/rppx1_xyz2luv.c + create mode 100644 drivers/media/platform/qcom/iris/iris_platform_milos.h + create mode 100644 drivers/media/platform/renesas/rcar-isp/core-io.c + create mode 100644 drivers/media/platform/renesas/rcar-isp/core.c + create mode 100644 drivers/media/platform/renesas/rcar-isp/risp-core.h + rename drivers/media/rc/keymaps/{rc-videomate-m1f.c => rc-videomate-k100.c} (97%) + create mode 100644 drivers/pmdomain/mediatek/mt6858-pm-domains.h + create mode 100644 drivers/pmdomain/renesas/r8a78000-mdlc.c + create mode 100644 drivers/regulator/sc2730-regulator.c + create mode 100644 drivers/spi/.kunitconfig + create mode 100644 drivers/spi/spi-ma35d1-qspi.c + create mode 100644 drivers/spi/tests/Makefile + create mode 100644 drivers/spi/tests/spi-dma-kunit.c + create mode 100644 drivers/watchdog/lenovo_se30g2_se60_wdt.c + create mode 100644 drivers/watchdog/ma35d1_wdt.c + create mode 100644 drivers/watchdog/pretimeout_dump.c + create mode 100644 include/dt-bindings/power/amlogic,a9-pwrc.h + create mode 100644 include/dt-bindings/power/mediatek,mt6858-power.h + create mode 100644 include/dt-bindings/power/renesas,r8a78000-mdlc.h + create mode 100644 include/dt-bindings/regulator/fcs,fan53555-regulator.h + create mode 100644 include/kunit/fwnode.h + delete mode 100644 include/linux/platform_data/omap-twl4030.h + create mode 100644 include/media/rppx1.h + create mode 100644 include/rv/kunit.h + create mode 100644 include/sound/aw88399.h + delete mode 100644 include/sound/tlv320aic32x4.h + create mode 100644 include/trace/events/qcom_geni_i2c.h + create mode 100644 include/trace/events/qcom_geni_se.h + create mode 100644 include/uapi/linux/media/dreamchip/rppx1-config.h + delete mode 100644 include/uapi/sound/skl-tplg-interface.h + delete mode 100644 include/uapi/sound/snd_sst_tokens.h + create mode 100644 kernel/trace/rv/monitors/nomiss/nomiss_kunit.c + create mode 100644 kernel/trace/rv/monitors/nomiss/nomiss_kunit.h + create mode 100644 kernel/trace/rv/monitors/opid/opid_kunit.c + create mode 100644 kernel/trace/rv/monitors/opid/opid_kunit.h + create mode 100644 kernel/trace/rv/monitors/pagefault/pagefault_kunit.c + create mode 100644 kernel/trace/rv/monitors/pagefault/pagefault_kunit.h + create mode 100644 kernel/trace/rv/monitors/sco/sco_kunit.c + create mode 100644 kernel/trace/rv/monitors/sco/sco_kunit.h + create mode 100644 kernel/trace/rv/monitors/sleep/sleep_kunit.c + create mode 100644 kernel/trace/rv/monitors/sleep/sleep_kunit.h + create mode 100644 kernel/trace/rv/monitors/sssw/sssw_kunit.c + create mode 100644 kernel/trace/rv/monitors/sssw/sssw_kunit.h + create mode 100644 kernel/trace/rv/monitors/sts/sts_kunit.c + create mode 100644 kernel/trace/rv/monitors/sts/sts_kunit.h + create mode 100644 kernel/trace/rv/monitors/wakeup/Kconfig + create mode 100644 kernel/trace/rv/monitors/wakeup/wakeup.c + create mode 100644 kernel/trace/rv/monitors/wakeup/wakeup.h + create mode 100644 kernel/trace/rv/monitors/wakeup/wakeup_trace.h + create mode 100644 kernel/trace/rv/rv_monitors_test.c + create mode 100644 lib/kunit/fwnode.c + delete mode 100644 rust/helpers/acpi.c + create mode 100644 rust/helpers/fwctl.c + create mode 100644 rust/helpers/serdev.c + create mode 100644 rust/kernel/fwctl.rs + create mode 100644 rust/kernel/serdev.rs + create mode 100644 samples/rust/rust_driver_serdev.rs + create mode 100644 scripts/coccinelle/hid/ff_race.cocci + create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-mixed-indent.dts + create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-property-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml + create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt + create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dts.txt + create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dts.txt + create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt + create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt + create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-prop-order-device-type.yaml.txt + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-child-name-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-dtc.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-preprocessor.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/dts-property-order.dts + create mode 100644 scripts/dtc/dt-style-selftest/good/soc.dtsi + create mode 100644 sound/hda/codecs/helpers/razer_blade16_2025.c + create mode 100644 sound/hda/codecs/side-codecs/aw88399_hda.c + create mode 100644 sound/hda/codecs/side-codecs/aw88399_hda.h + create mode 100644 sound/hda/codecs/side-codecs/aw88399_hda_i2c.c + create mode 100644 sound/soc/codecs/aw88399-lib.c + create mode 100644 sound/soc/codecs/rt766-sdca-sdw.c + create mode 100644 sound/soc/codecs/rt766-sdca-sdw.h + create mode 100644 sound/soc/codecs/rt766-sdca.c + create mode 100644 sound/soc/codecs/rt766-sdca.h + create mode 100644 sound/soc/codecs/wsa885x.c + create mode 100644 sound/soc/meson/aiu-formatter-i2s.c + create mode 100644 sound/soc/meson/gx-formatter.c + create mode 100644 sound/soc/meson/gx-formatter.h + create mode 100644 sound/soc/meson/gx-interface.h + create mode 100644 sound/soc/sof/amd/acp7x.c + create mode 100644 sound/soc/sof/amd/pci-acp7x.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/tp_btf_ids.c + create mode 100644 tools/testing/selftests/verification/test.d/rv_deadline.tc + create mode 100644 tools/testing/selftests/verification/test.d/rv_stall.tc + create mode 100755 tools/tracing/rtla/tests/scripts/check-osnoise-option.sh + create mode 100755 tools/tracing/rtla/tests/scripts/check-tracefs-value.sh + create mode 100644 tools/verification/models/rtapp/wakeup.ltl + create mode 100644 tools/verification/rv/tests/rv_list.t + create mode 100644 tools/verification/rv/tests/rv_mon.t + create mode 100644 tools/verification/rvgen/rvgen/kunit.py + create mode 100644 tools/verification/rvgen/rvgen/templates/kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/da_global/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/da_global/da_global.c + create mode 100644 tools/verification/rvgen/tests/golden/da_global/da_global.h + create mode 100644 tools/verification/rvgen/tests/golden/da_global/da_global_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/da_perobj_parent/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/da_perobj_parent/da_perobj_parent.c + create mode 100644 tools/verification/rvgen/tests/golden/da_perobj_parent/da_perobj_parent.h + create mode 100644 tools/verification/rvgen/tests/golden/da_perobj_parent/da_perobj_parent_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/da_pertask_desc/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/da_pertask_desc/da_pertask_desc.c + create mode 100644 tools/verification/rvgen/tests/golden/da_pertask_desc/da_pertask_desc.h + create mode 100644 tools/verification/rvgen/tests/golden/da_pertask_desc/da_pertask_desc_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/ha_percpu/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/ha_percpu/ha_percpu.c + create mode 100644 tools/verification/rvgen/tests/golden/ha_percpu/ha_percpu.h + create mode 100644 tools/verification/rvgen/tests/golden/ha_percpu/ha_percpu_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/ltl_pertask/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/ltl_pertask/ltl_pertask.c + create mode 100644 tools/verification/rvgen/tests/golden/ltl_pertask/ltl_pertask.h + create mode 100644 tools/verification/rvgen/tests/golden/ltl_pertask/ltl_pertask_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.bak + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_container/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_container/test_container.c + create mode 100644 tools/verification/rvgen/tests/golden/test_container/test_container.h + create mode 100644 tools/verification/rvgen/tests/golden/test_da/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_da/test_da.c + create mode 100644 tools/verification/rvgen/tests/golden/test_da/test_da.h + create mode 100644 tools/verification/rvgen/tests/golden/test_da/test_da_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/test_da_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/test_da_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/test_da_kunit_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/test_da_kunit_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_da_kunit/test_da_kunit_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ha/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_ha/test_ha.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ha/test_ha.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ha/test_ha_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/test_ha_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/test_ha_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/test_ha_kunit_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/test_ha_kunit_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ha_kunit/test_ha_kunit_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl/test_ltl.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl/test_ltl.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl/test_ltl_trace.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/Kconfig + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/test_ltl_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/test_ltl_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/test_ltl_kunit_kunit.c + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/test_ltl_kunit_kunit.h + create mode 100644 tools/verification/rvgen/tests/golden/test_ltl_kunit/test_ltl_kunit_trace.h + create mode 100644 tools/verification/rvgen/tests/rvgen_container.t + create mode 100644 tools/verification/rvgen/tests/rvgen_kunit.t + create mode 100644 tools/verification/rvgen/tests/rvgen_monitor.t + create mode 100644 tools/verification/rvgen/tests/specs/test_da.dot + create mode 100644 tools/verification/rvgen/tests/specs/test_da2.dot + create mode 100644 tools/verification/rvgen/tests/specs/test_ha.dot + create mode 100644 tools/verification/rvgen/tests/specs/test_invalid.dot + create mode 100644 tools/verification/rvgen/tests/specs/test_invalid.ltl + create mode 100644 tools/verification/rvgen/tests/specs/test_invalid_ha.dot + create mode 100644 tools/verification/rvgen/tests/specs/test_ltl.ltl + create mode 100644 tools/verification/tests/engine.sh +Merging ext4-fixes/fixes (981fcc5674e67 jbd2: fix deadlock in jbd2_journal_cancel_revoke()) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git ext4-fixes/fixes +Already up to date. +Merging vfs-brauner-fixes/vfs.fixes (b64a9f67e082e pid: reject allocations through dead ancestor pid namespaces) +$ git merge -m Merge branch 'vfs.fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs-brauner-fixes/vfs.fixes +Already up to date. +Merging fscrypt-current/for-current (cf6c993c0feca fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()) +$ git merge -m Merge branch 'for-current' of https://git.kernel.org/pub/scm/fs/fscrypt/linux.git fscrypt-current/for-current +Already up to date. +Merging fsverity-current/for-current (d2f96bcb89d36 fs,fsverity: remove check for fsverity being enabled in setattr_prepare()) +$ git merge -m Merge branch 'for-current' of https://git.kernel.org/pub/scm/fs/fsverity/linux.git fsverity-current/for-current +Already up to date. +Merging btrfs-fixes/next-fixes (af5534fe2fbc0 Merge branch 'misc-7.2' into next-fixes) +$ git merge -m Merge branch 'next-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git btrfs-fixes/next-fixes +Merge made by the 'ort' strategy. +Merging vfs-fixes/fixes (49c5d168a3a8f udf: fix nls leak on udf_fill_super() failure) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git vfs-fixes/fixes +Auto-merging fs/udf/super.c +Merge made by the 'ort' strategy. +Merging erofs-fixes/fixes (075b74841bd00 Linux 7.2-rc6) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git erofs-fixes/fixes +Already up to date. +Merging nfsd-fixes/nfsd-fixes (5c4851e4cdfc3 lockd: fix NLMv3 GRANTED_MSG handling) +$ git merge -m Merge branch 'nfsd-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux nfsd-fixes/nfsd-fixes +Already up to date. +Merging v9fs-fixes/fixes/next (028ef9c96e961 Linux 7.0) +$ git merge -m Merge branch 'fixes/next' of https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git v9fs-fixes/fixes/next +Already up to date. +Merging overlayfs-fixes/ovl-fixes (4549871118cf6 Linux 7.1-rc7) +$ git merge -m Merge branch 'ovl-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs.git overlayfs-fixes/ovl-fixes +Already up to date. +Merging fscrypt/for-next (7dd38d9dd7a05 blk-crypto: Update docs for blk-crypto-fallback motivation) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/fs/fscrypt/linux.git fscrypt/for-next +Already up to date. +Merging btrfs/for-next (f037522c036c0 Merge branch 'for-next-next-v7.2-20260808' into for-next-20260808) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git btrfs/for-next +Auto-merging fs/btrfs/direct-io.c +Auto-merging fs/btrfs/inode.c +Auto-merging fs/btrfs/ioctl.c +Auto-merging fs/btrfs/volumes.c +Auto-merging fs/btrfs/volumes.h +Merge made by the 'ort' strategy. + fs/btrfs/Kconfig | 1 + + fs/btrfs/acl.c | 4 + + fs/btrfs/block-group.c | 13 +- + fs/btrfs/block-group.h | 4 +- + fs/btrfs/compression.c | 14 +- + fs/btrfs/ctree.c | 36 ++- + fs/btrfs/ctree.h | 6 +- + fs/btrfs/defrag.c | 61 +++-- + fs/btrfs/delayed-inode.c | 12 +- + fs/btrfs/direct-io.c | 210 +++++++------- + fs/btrfs/disk-io.c | 153 +++++++---- + fs/btrfs/disk-io.h | 2 + + fs/btrfs/extent-io-tree.c | 21 ++ + fs/btrfs/extent-tree.c | 28 +- + fs/btrfs/extent_io.c | 637 ++++++++++++++++++++++++++++++++----------- + fs/btrfs/extent_io.h | 29 ++ + fs/btrfs/fiemap.c | 6 +- + fs/btrfs/file.c | 120 ++++---- + fs/btrfs/fs.c | 19 +- + fs/btrfs/fs.h | 6 +- + fs/btrfs/inode.c | 86 ++++-- + fs/btrfs/ioctl.c | 138 ++++++---- + fs/btrfs/messages.c | 10 +- + fs/btrfs/qgroup.c | 26 +- + fs/btrfs/raid56.c | 18 +- + fs/btrfs/raid56.h | 2 +- + fs/btrfs/reflink.c | 111 ++++---- + fs/btrfs/relocation.c | 97 +++++-- + fs/btrfs/root-tree.c | 6 +- + fs/btrfs/scrub.c | 234 +++++++--------- + fs/btrfs/send.c | 17 +- + fs/btrfs/space-info.c | 2 +- + fs/btrfs/subpage.c | 7 +- + fs/btrfs/subpage.h | 3 +- + fs/btrfs/super.c | 37 +-- + fs/btrfs/sysfs.c | 2 +- + fs/btrfs/transaction.c | 36 ++- + fs/btrfs/transaction.h | 25 +- + fs/btrfs/tree-log.c | 99 +++---- + fs/btrfs/verity.c | 18 +- + fs/btrfs/volumes.c | 64 ++--- + fs/btrfs/volumes.h | 10 +- + include/trace/events/btrfs.h | 4 +- + 43 files changed, 1448 insertions(+), 986 deletions(-) +Merging ceph/master (91880e4a7fac4 ceph: use the mount idmap for the owner checks in the SET_LAYOUT ioctls) +$ git merge -m Merge branch 'master' of https://github.com/ceph/ceph-client.git ceph/master +Already up to date. +Merging cifs/for-next (9ca668da8e4c9 smb/client: return EOPNOTSUPP for unsupported O_TMPFILE) +$ git merge -m Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6.git cifs/for-next +Auto-merging fs/smb/client/dir.c +Merge made by the 'ort' strategy. + fs/smb/client/dir.c | 2 ++ + 1 file changed, 2 insertions(+) +Merging configfs/configfs-next (6363844fdbbb7 samples: configfs: Constify struct configfs_item_operations and configfs_group_operations) +$ git merge -m Merge branch 'configfs-next' of https://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux.git configfs/configfs-next +Already up to date. +Merging ecryptfs/next (f81cb44f9a4b8 ecryptfs: ecryptfs_kernel.h: clean up kernel-doc comments) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git ecryptfs/next +Merge made by the 'ort' strategy. + fs/ecryptfs/crypto.c | 2 +- + fs/ecryptfs/ecryptfs_kernel.h | 15 ++++++++------- + fs/ecryptfs/keystore.c | 45 +++++++++++++++++++++++++++++++++++++------ + fs/ecryptfs/messaging.c | 11 ++++++++++- + fs/ecryptfs/miscdev.c | 5 +++-- + fs/ecryptfs/mmap.c | 30 +++++------------------------ + fs/ecryptfs/super.c | 7 +++++++ + 7 files changed, 73 insertions(+), 42 deletions(-) +Merging dlm/next (e61113cfcaf71 dlm: init per node debugfs before add to node hash) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git dlm/next +Already up to date. +Merging erofs/dev (988c3c186c730 erofs: fix unused pcluster_pools for higher page sizes) +$ git merge -m Merge branch 'dev' of https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git erofs/dev +Auto-merging fs/erofs/data.c +Auto-merging fs/erofs/super.c +Auto-merging fs/erofs/zdata.c +Auto-merging fs/erofs/zmap.c +Merge made by the 'ort' strategy. + Documentation/filesystems/erofs.rst | 17 ++++++ + fs/erofs/data.c | 28 +++------ + fs/erofs/decompressor.c | 1 + + fs/erofs/fileio.c | 21 +++++++ + fs/erofs/internal.h | 14 +++-- + fs/erofs/super.c | 112 ++++++++++++++++++++++++++++-------- + fs/erofs/zdata.c | 25 ++++---- + fs/erofs/zmap.c | 38 +++++++----- + 8 files changed, 182 insertions(+), 74 deletions(-) +Merging exfat/dev (490529f668016 exfat: replace truncate_lock with inode_lock) +$ git merge -m Merge branch 'dev' of https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat.git exfat/dev +Auto-merging MAINTAINERS +Auto-merging fs/exfat/iomap.c +Auto-merging fs/exfat/namei.c +Merge made by the 'ort' strategy. + MAINTAINERS | 2 +- + fs/exfat/balloc.c | 31 +++++---- + fs/exfat/dir.c | 10 ++- + fs/exfat/exfat_fs.h | 8 +-- + fs/exfat/file.c | 184 ++++++++++++++++++++++++++++++++++++++++------------ + fs/exfat/inode.c | 5 +- + fs/exfat/iomap.c | 11 +++- + fs/exfat/namei.c | 27 ++++++-- + fs/exfat/super.c | 1 - + 9 files changed, 207 insertions(+), 72 deletions(-) +Merging ext3/for_next (3d7e6f0b557da Merge fsnotify bitmask race fix.) +$ git merge -m Merge branch 'for_next' of https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git ext3/for_next +Auto-merging MAINTAINERS +Auto-merging arch/loongarch/configs/loongson32_defconfig +Auto-merging arch/loongarch/configs/loongson64_defconfig +Auto-merging fs/ext2/xattr.c +CONFLICT (content): Merge conflict in fs/ext2/xattr.c +Auto-merging fs/udf/inode.c +Auto-merging fs/udf/super.c +Auto-merging fs/udf/udfdecl.h +Resolved 'fs/ext2/xattr.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[fs-next 4a285d7cd9333] Merge branch 'for_next' of https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git +$ git diff -M --stat --summary HEAD^.. + MAINTAINERS | 1 - + arch/loongarch/configs/loongson32_defconfig | 1 - + arch/loongarch/configs/loongson64_defconfig | 1 - + arch/mips/configs/bigsur_defconfig | 1 - + arch/mips/configs/ip22_defconfig | 1 - + arch/mips/configs/loongson2k_defconfig | 1 - + drivers/tty/tty_io.c | 27 ----- + fs/ext2/xattr.c | 14 +-- + fs/isofs/compress.c | 7 +- + fs/isofs/dir.c | 31 +----- + fs/isofs/export.c | 10 +- + fs/isofs/isofs.h | 3 + + fs/isofs/namei.c | 59 +++++----- + fs/notify/fanotify/fanotify.c | 4 +- + fs/notify/fanotify/fanotify.h | 6 +- + fs/notify/fanotify/fanotify_user.c | 29 +++-- + fs/notify/inotify/inotify_user.c | 15 +-- + fs/quota/Kconfig | 10 -- + fs/quota/dquot.c | 81 +------------- + fs/udf/balloc.c | 12 ++- + fs/udf/inode.c | 162 +++++++++++++++++----------- + fs/udf/partition.c | 2 +- + fs/udf/super.c | 23 ++-- + fs/udf/symlink.c | 2 + + fs/udf/truncate.c | 2 +- + fs/udf/udfdecl.h | 3 +- + 26 files changed, 211 insertions(+), 297 deletions(-) +Merging ext4/dev (9091c97be3408 ext4: fix estimate extent index blocks in ext4_ext_index_trans_blocks()) +$ git merge -m Merge branch 'dev' of https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git ext4/dev +Auto-merging fs/buffer.c +Auto-merging fs/ext4/crypto.c +Auto-merging fs/ext4/ext4.h +Auto-merging fs/ext4/ext4_jbd2.c +Auto-merging fs/ext4/extents.c +Auto-merging fs/ext4/file.c +Auto-merging fs/ext4/inode.c +Auto-merging fs/ext4/namei.c +Auto-merging fs/ext4/super.c +Auto-merging include/linux/fs.h +Merge made by the 'ort' strategy. + Documentation/filesystems/ext4/group_descr.rst | 9 +- + fs/buffer.c | 3 + + fs/ext4/balloc.c | 4 + + fs/ext4/crypto.c | 40 ++--- + fs/ext4/dir.c | 20 ++- + fs/ext4/ext4.h | 40 +++-- + fs/ext4/ext4_jbd2.c | 34 ++-- + fs/ext4/ext4_jbd2.h | 6 +- + fs/ext4/extents.c | 184 +++++++++++++++++----- + fs/ext4/fast_commit.c | 37 ++--- + fs/ext4/file.c | 151 ++++++++++++------ + fs/ext4/ialloc.c | 4 + + fs/ext4/inline.c | 38 +++-- + fs/ext4/inode.c | 207 ++++++++++++++++++------- + fs/ext4/mballoc.c | 21 +-- + fs/ext4/migrate.c | 3 +- + fs/ext4/namei.c | 2 + + fs/ext4/orphan.c | 17 +- + fs/ext4/super.c | 32 +++- + fs/ext4/xattr.c | 178 +++++++++++---------- + fs/ext4/xattr.h | 9 +- + fs/jbd2/checkpoint.c | 28 ++-- + fs/jbd2/journal.c | 1 + + include/linux/fs.h | 15 ++ + include/linux/jbd2.h | 11 +- + 25 files changed, 734 insertions(+), 360 deletions(-) +Merging f2fs/dev (0a1703eba2370 f2fs: fix to avoid pinfile fragment on fragment:{block, segment} mode) +$ git merge -m Merge branch 'dev' of https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git f2fs/dev +Auto-merging Documentation/filesystems/f2fs.rst +Auto-merging fs/f2fs/data.c +Auto-merging fs/f2fs/f2fs.h +Auto-merging fs/f2fs/file.c +Auto-merging fs/f2fs/namei.c +Auto-merging fs/f2fs/segment.c +Auto-merging fs/f2fs/super.c +Merge made by the 'ort' strategy. + Documentation/ABI/testing/sysfs-fs-f2fs | 10 + + Documentation/filesystems/f2fs.rst | 35 +++ + fs/f2fs/checkpoint.c | 27 +- + fs/f2fs/data.c | 50 +++- + fs/f2fs/debug.c | 4 - + fs/f2fs/dir.c | 7 +- + fs/f2fs/extent_cache.c | 9 + + fs/f2fs/f2fs.h | 78 +++++- + fs/f2fs/file.c | 438 +++++++++++++++++++++++++++++--- + fs/f2fs/gc.c | 102 +++++--- + fs/f2fs/gc.h | 27 +- + fs/f2fs/inline.c | 2 +- + fs/f2fs/inode.c | 224 +++++++++++----- + fs/f2fs/iostat.c | 6 + + fs/f2fs/namei.c | 20 +- + fs/f2fs/node.c | 5 +- + fs/f2fs/recovery.c | 55 ++-- + fs/f2fs/segment.c | 252 +++++++++++++----- + fs/f2fs/segment.h | 36 ++- + fs/f2fs/shrinker.c | 3 +- + fs/f2fs/super.c | 59 ++++- + fs/f2fs/sysfs.c | 32 ++- + fs/f2fs/xattr.c | 2 +- + include/trace/events/f2fs.h | 20 +- + include/uapi/linux/f2fs.h | 7 + + 25 files changed, 1183 insertions(+), 327 deletions(-) +Merging fsverity/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/fs/fsverity/linux.git fsverity/for-next +Already up to date. +Merging fuse/for-next (d1dbc59200b54 fuse: wake one waiter per freed slot when raising max_background) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git fuse/for-next +Auto-merging drivers/block/ublk_drv.c +Auto-merging fs/fuse/dir.c +Auto-merging fs/fuse/file.c +Auto-merging fs/iomap/buffered-io.c +Auto-merging include/linux/iomap.h +Auto-merging io_uring/rsrc.c +Merge made by the 'ort' strategy. + Documentation/block/ublk.rst | 14 +- + Documentation/filesystems/fuse/fuse-io-uring.rst | 32 ++ + Documentation/filesystems/fuse/index.rst | 1 + + .../filesystems/fuse/uapi/fuse-uapi-io-uring.rst | 126 +++++ + drivers/block/ublk_drv.c | 22 +- + fs/fuse/args.h | 2 + + fs/fuse/cuse.c | 8 +- + fs/fuse/dev.c | 104 ++-- + fs/fuse/dev.h | 2 +- + fs/fuse/dev_uring.c | 608 ++++++++++++++++++--- + fs/fuse/dev_uring_i.h | 56 +- + fs/fuse/dir.c | 34 +- + fs/fuse/file.c | 6 +- + fs/fuse/fuse_dev_i.h | 5 + + fs/fuse/fuse_i.h | 2 + + fs/fuse/inode.c | 12 +- + fs/fuse/readdir.c | 2 +- + fs/fuse/req_timeout.c | 12 +- + include/linux/io_uring/cmd.h | 38 +- + include/linux/io_uring_types.h | 5 + + include/uapi/linux/fuse.h | 63 ++- + io_uring/io_uring.c | 2 +- + io_uring/rsrc.c | 131 +++-- + io_uring/rsrc.h | 5 - + 24 files changed, 1072 insertions(+), 220 deletions(-) + create mode 100644 Documentation/filesystems/fuse/uapi/fuse-uapi-io-uring.rst +Merging gfs2/for-next (4bb187d6f379c Merge tag 'gfs2-for-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git gfs2/for-next +Already up to date. +Merging jfs/jfs-next (dad98c5b2a05e jfs: avoid -Wtautological-constant-out-of-range-compare warning again) +$ git merge -m Merge branch 'jfs-next' of https://github.com/kleikamp/linux-shaggy.git jfs/jfs-next +Already up to date. +Merging ksmbd/ksmbd-for-next (4a5b945de8f67 MAINTAINERS: add myself as KSMBD reviewer) +$ git merge -m Merge branch 'ksmbd-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/smb.git ksmbd/ksmbd-for-next +Auto-merging MAINTAINERS +Auto-merging fs/smb/server/auth.c +Auto-merging fs/smb/server/mgmt/share_config.c +Auto-merging fs/smb/server/smb2pdu.c +Auto-merging fs/smb/server/vfs.c +Merge made by the 'ort' strategy. + MAINTAINERS | 2 + + fs/smb/client/smb2pdu.h | 24 - + fs/smb/common/fscc.h | 15 + + fs/smb/common/smb2pdu.h | 39 +- + fs/smb/common/smb2status.h | 1 + + fs/smb/common/smbfsctl.h | 1 + + fs/smb/common/smbglob.h | 1 + + fs/smb/server/Kconfig | 1 - + fs/smb/server/auth.c | 215 ++- + fs/smb/server/auth.h | 4 + + fs/smb/server/compress.c | 76 +- + fs/smb/server/compress.h | 1 + + fs/smb/server/connection.c | 223 ++- + fs/smb/server/connection.h | 47 +- + fs/smb/server/ksmbd_netlink.h | 8 +- + fs/smb/server/ksmbd_work.c | 5 + + fs/smb/server/ksmbd_work.h | 14 + + fs/smb/server/mgmt/share_config.c | 65 +- + fs/smb/server/mgmt/share_config.h | 25 + + fs/smb/server/mgmt/tree_connect.c | 2 + + fs/smb/server/mgmt/user_config.c | 18 +- + fs/smb/server/mgmt/user_session.c | 248 +-- + fs/smb/server/mgmt/user_session.h | 4 + + fs/smb/server/misc.h | 11 +- + fs/smb/server/oplock.c | 344 +++- + fs/smb/server/oplock.h | 8 +- + fs/smb/server/proc.c | 170 +- + fs/smb/server/server.c | 86 +- + fs/smb/server/server.h | 2 + + fs/smb/server/smb2misc.c | 79 + + fs/smb/server/smb2ops.c | 22 +- + fs/smb/server/smb2pdu.c | 3175 ++++++++++++++++++++++++++++++++----- + fs/smb/server/smb2pdu.h | 82 + + fs/smb/server/smb_common.c | 17 +- + fs/smb/server/smb_common.h | 2 +- + fs/smb/server/smbacl.c | 115 +- + fs/smb/server/smbacl.h | 3 +- + fs/smb/server/stats.h | 57 +- + fs/smb/server/transport_ipc.c | 27 +- + fs/smb/server/transport_rdma.c | 19 +- + fs/smb/server/transport_rdma.h | 2 + + fs/smb/server/transport_tcp.c | 31 +- + fs/smb/server/vfs.c | 559 ++++++- + fs/smb/server/vfs.h | 20 +- + fs/smb/server/vfs_cache.c | 280 +++- + fs/smb/server/vfs_cache.h | 43 +- + fs/smb/smbdirect/accept.c | 16 +- + fs/smb/smbdirect/connection.c | 13 +- + fs/smb/smbdirect/socket.c | 98 +- + 49 files changed, 5446 insertions(+), 874 deletions(-) +$ git am -3 ../patches/0001-ntfs3-Fix-up-merge-with-Linus.patch +Applying: ntfs3: Fix up merge with Linus +Using index info to reconstruct a base tree... +M fs/ntfs3/file.c +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging nfs/linux-next (265e3f27bb879 NFSv4.1: initialize referring call pointers before decoding) +$ git merge -m Merge branch 'linux-next' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git nfs/linux-next +Auto-merging fs/nfs/blocklayout/dev.c +Auto-merging fs/nfs/dir.c +Auto-merging fs/nfs/internal.h +Merge made by the 'ort' strategy. + fs/lockd/clntproc.c | 3 ++ + fs/nfs/blocklayout/dev.c | 21 +++++++--- + fs/nfs/callback_proc.c | 5 ++- + fs/nfs/callback_xdr.c | 1 + + fs/nfs/client.c | 14 ++++++- + fs/nfs/delegation.c | 20 ++++++--- + fs/nfs/dir.c | 17 ++++++++ + fs/nfs/filelayout/filelayoutdev.c | 2 +- + fs/nfs/flexfilelayout/flexfilelayout.c | 26 +++++++++++- + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 3 +- + fs/nfs/inode.c | 28 ++++++++++--- + fs/nfs/internal.h | 8 ++-- + fs/nfs/localio.c | 56 +++++++++++++++++++------ + fs/nfs/nfs4client.c | 23 +++++++---- + fs/nfs/nfs4file.c | 2 + + fs/nfs/nfs4proc.c | 69 ++++++++++++++++++++++++++++--- + fs/nfs/nfs4session.c | 21 ++++++---- + fs/nfs/nfs4session.h | 3 +- + fs/nfs/nfs4state.c | 40 ++++++++++++++---- + fs/nfs/nfs4trace.h | 58 +++++++++++++++++++++++++- + fs/nfs/nfs4xdr.c | 35 +++++++++++++++- + fs/nfs/nfstrace.h | 3 +- + fs/nfs/pnfs.c | 57 +++++++++++-------------- + fs/nfs/pnfs.h | 5 ++- + fs/nfs/pnfs_nfs.c | 14 ++++--- + fs/nfs/write.c | 13 +++--- + include/linux/nfs4.h | 9 ++++ + include/linux/nfs_fs.h | 4 ++ + include/linux/nfs_xdr.h | 8 +++- + include/linux/workqueue.h | 1 + + kernel/workqueue.c | 24 +++++++++++ + net/sunrpc/clnt.c | 22 +++++++--- + net/sunrpc/rpcb_clnt.c | 4 ++ + net/sunrpc/xprtsock.c | 32 +++++++++----- + 34 files changed, 516 insertions(+), 135 deletions(-) +Merging nfs-anna/linux-next (e053b624f5d36 NFSv4.2: fix nfs4_listxattr size accounting) +$ git merge -m Merge branch 'linux-next' of git://git.linux-nfs.org/projects/anna/linux-nfs.git nfs-anna/linux-next +Already up to date. +Merging nfsd/nfsd-next (46db3c8a1be96 nfsd: export NFSv4 callback op stats via netlink) +$ git merge -m Merge branch 'nfsd-next' of https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux nfsd/nfsd-next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging fs/nfs/callback_xdr.c +Auto-merging include/linux/nfs4.h +Merge made by the 'ort' strategy. + .../ABI/testing/procfs-nfsd-reply_cache_stats | 38 + + Documentation/admin-guide/kernel-parameters.txt | 20 +- + Documentation/netlink/specs/nfsd.yaml | 111 ++ + Documentation/sunrpc/xdr/nfs4_1.x | 258 +++- + fs/lockd/lockd.h | 2 +- + fs/lockd/nlm3xdr_gen.c | 30 +- + fs/lockd/nlm3xdr_gen.h | 4 +- + fs/lockd/nlm4xdr_gen.c | 75 +- + fs/lockd/nlm4xdr_gen.h | 4 +- + fs/lockd/share.h | 8 +- + fs/lockd/svc.c | 4 +- + fs/lockd/svc4proc.c | 55 +- + fs/lockd/svclock.c | 42 +- + fs/lockd/svcproc.c | 55 +- + fs/lockd/svcshare.c | 36 +- + fs/lockd/svcsubs.c | 107 +- + fs/nfs/callback.c | 4 +- + fs/nfs/callback_xdr.c | 6 - + fs/nfs_common/nfslocalio.c | 16 +- + fs/nfsd/attr4.h | 162 +++ + fs/nfsd/auth.c | 19 + + fs/nfsd/auth.h | 6 + + fs/nfsd/cache.h | 3 +- + fs/nfsd/filecache.c | 265 ++-- + fs/nfsd/filecache.h | 3 + + fs/nfsd/flexfilelayoutxdr.c | 20 +- + fs/nfsd/localio.c | 11 +- + fs/nfsd/lockd.c | 6 +- + fs/nfsd/netlink.c | 5 + + fs/nfsd/netlink.h | 2 + + fs/nfsd/netns.h | 47 +- + fs/nfsd/nfs2acl.c | 55 +- + fs/nfsd/nfs3acl.c | 20 +- + fs/nfsd/nfs3proc.c | 45 +- + fs/nfsd/nfs3xdr.c | 2 +- + fs/nfsd/nfs4callback.c | 229 +++- + fs/nfsd/nfs4idmap.c | 1 + + fs/nfsd/nfs4layouts.c | 45 +- + fs/nfsd/nfs4proc.c | 412 +++++-- + fs/nfsd/nfs4recover.c | 48 +- + fs/nfsd/nfs4state.c | 1281 ++++++++++++++++---- + fs/nfsd/nfs4xdr.c | 411 ++++++- + fs/nfsd/nfs4xdr_gen.c | 600 ++++++++- + fs/nfsd/nfs4xdr_gen.h | 20 +- + fs/nfsd/nfscache.c | 8 +- + fs/nfsd/nfsctl.c | 435 ++++++- + fs/nfsd/nfsd.h | 214 +--- + fs/nfsd/nfsfh.c | 44 +- + fs/nfsd/nfsfh.h | 3 + + fs/nfsd/nfsproc.c | 12 +- + fs/nfsd/nfssvc.c | 71 +- + fs/nfsd/nfsxdr.c | 34 +- + fs/nfsd/state.h | 97 +- + fs/nfsd/stats.c | 4 +- + fs/nfsd/stats.h | 86 +- + fs/nfsd/trace.h | 43 +- + fs/nfsd/vfs.c | 63 +- + fs/nfsd/vfs.h | 5 +- + fs/nfsd/xdr.h | 1 + + fs/nfsd/xdr3.h | 1 + + fs/nfsd/xdr4.h | 37 +- + fs/nfsd/xdr4cb.h | 12 + + include/linux/lockd/bind.h | 12 +- + include/linux/nfs4.h | 127 -- + include/linux/sunrpc/bc_xprt.h | 5 + + include/linux/sunrpc/stats.h | 6 + + include/linux/sunrpc/svc.h | 4 +- + include/linux/sunrpc/svc_rdma_pcl.h | 4 +- + include/linux/sunrpc/xdrgen/_builtins.h | 32 + + include/linux/sunrpc/xdrgen/_defs.h | 2 + + include/linux/sunrpc/xdrgen/nfs4_1.h | 290 ++++- + include/linux/sunrpc/xdrgen/nlm3.h | 2 +- + include/linux/sunrpc/xdrgen/nlm4.h | 2 +- + include/uapi/linux/nfs4.h | 2 - + include/uapi/linux/nfsd_netlink.h | 36 + + net/sunrpc/auth_gss/auth_gss.c | 6 +- + net/sunrpc/auth_gss/gss_krb5_unseal.c | 3 + + net/sunrpc/auth_gss/gss_krb5_wrap.c | 13 +- + net/sunrpc/auth_gss/gss_rpc_upcall.c | 6 - + net/sunrpc/auth_gss/gss_rpc_upcall.h | 1 - + net/sunrpc/auth_gss/gss_rpc_xdr.c | 15 +- + net/sunrpc/auth_gss/svcauth_gss.c | 8 +- + net/sunrpc/backchannel_rqst.c | 38 +- + net/sunrpc/cache.c | 7 +- + net/sunrpc/stats.c | 2 +- + net/sunrpc/sunrpc_syms.c | 1 + + net/sunrpc/svc.c | 495 ++++---- + net/sunrpc/svc_xprt.c | 6 +- + net/sunrpc/svcauth_unix.c | 4 +- + net/sunrpc/xdr.c | 2 +- + net/sunrpc/xprtrdma/ib_client.c | 42 +- + net/sunrpc/xprtrdma/svc_rdma_pcl.c | 63 +- + net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 24 +- + net/sunrpc/xprtrdma/svc_rdma_rw.c | 52 +- + net/sunrpc/xprtrdma/svc_rdma_sendto.c | 47 +- + net/sunrpc/xprtrdma/svc_rdma_transport.c | 69 +- + tools/net/sunrpc/xdrgen/generators/program.py | 8 + + tools/net/sunrpc/xdrgen/subcmds/declarations.py | 10 +- + tools/net/sunrpc/xdrgen/subcmds/definitions.py | 7 +- + tools/net/sunrpc/xdrgen/subcmds/lint.py | 7 +- + tools/net/sunrpc/xdrgen/subcmds/source.py | 7 +- + .../xdrgen/templates/C/enum/declaration/enum.j2 | 1 + + .../xdrgen/templates/C/pointer/encoder/string.j2 | 2 + + .../C/pointer/encoder/variable_length_opaque.j2 | 2 + + .../xdrgen/templates/C/program/decoder/argument.j2 | 4 - + .../xdrgen/templates/C/program/encoder/result.j2 | 4 - + .../xdrgen/templates/C/struct/encoder/string.j2 | 2 + + .../C/struct/encoder/variable_length_opaque.j2 | 2 + + .../xdrgen/templates/C/union/definition/close.j2 | 6 - + .../xdrgen/tests/bad-procedure-number-negative.x | 20 + + .../xdrgen/tests/bad-procedure-number-too-large.x | 20 + + .../xdrgen/tests/bad-program-number-negative.x | 19 + + .../xdrgen/tests/bad-program-number-too-large.x | 19 + + .../xdrgen/tests/bad-version-number-negative.x | 19 + + .../xdrgen/tests/bad-version-number-too-large.x | 19 + + tools/net/sunrpc/xdrgen/xdr_ast.py | 290 ++++- + tools/net/sunrpc/xdrgen/xdr_parse.py | 46 +- + 117 files changed, 5969 insertions(+), 1736 deletions(-) + create mode 100644 Documentation/ABI/testing/procfs-nfsd-reply_cache_stats + create mode 100644 fs/nfsd/attr4.h + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-procedure-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-procedure-number-too-large.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-program-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-program-number-too-large.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-version-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-version-number-too-large.x +$ git am -3 ../patches/0001-Revert-smb-client-implement-fileattr_get-to-support-.patch +Applying: Revert "smb: client: implement fileattr_get to support FS_IOC_GETFLAGS" +Using index info to reconstruct a base tree... +M fs/smb/client/cifsfs.c +M fs/smb/client/cifsfs.h +M fs/smb/client/inode.c +Falling back to patching base and 3-way merge... +Auto-merging fs/smb/client/inode.c +Auto-merging fs/smb/client/cifsfs.h +Auto-merging fs/smb/client/cifsfs.c +No changes -- Patch already applied. +Merging ntfs/ntfs-next (9969d58a9b041 ntfs: fix resource leak in ntfs_new_attr_flags) +$ git merge -m Merge branch 'ntfs-next' of https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs.git ntfs/ntfs-next +Auto-merging MAINTAINERS +Merge made by the 'ort' strategy. + MAINTAINERS | 2 +- + fs/ntfs/attrib.c | 36 ++++- + fs/ntfs/compress.c | 389 +++++++++++++++++++++++++++++------------------------ + fs/ntfs/dir.c | 5 +- + fs/ntfs/ea.c | 225 +++++++++++++++++++++++-------- + fs/ntfs/ea.h | 3 +- + fs/ntfs/file.c | 81 +++++++---- + fs/ntfs/index.c | 96 ++++++++++--- + fs/ntfs/inode.c | 85 ++++++++++-- + fs/ntfs/inode.h | 3 +- + fs/ntfs/iomap.c | 66 ++++----- + fs/ntfs/lcnalloc.c | 7 +- + fs/ntfs/mft.c | 15 ++- + fs/ntfs/namei.c | 10 +- + fs/ntfs/reparse.c | 13 +- + fs/ntfs/runlist.c | 29 ++++ + fs/ntfs/super.c | 12 +- + 17 files changed, 716 insertions(+), 361 deletions(-) +Merging ntfs3/master (c22f91d82cb9a fs/ntfs3: validate ef->size covers the record's name and value) +$ git merge -m Merge branch 'master' of https://github.com/Paragon-Software-Group/linux-ntfs3.git ntfs3/master +Auto-merging fs/ntfs3/inode.c +Auto-merging fs/ntfs3/namei.c +Merge made by the 'ort' strategy. + fs/ntfs3/attrib.c | 159 +++++++++++++++++----------- + fs/ntfs3/attrlist.c | 15 ++- + fs/ntfs3/dir.c | 132 ++++++++++++++++------- + fs/ntfs3/file.c | 66 ++++++++---- + fs/ntfs3/frecord.c | 199 +++++++++++++++++++++++++++++------ + fs/ntfs3/fslog.c | 68 +++++++++--- + fs/ntfs3/fsntfs.c | 34 ++++-- + fs/ntfs3/index.c | 8 +- + fs/ntfs3/inode.c | 298 +++++++++++++++++++++++++++++++++++++++++++++------- + fs/ntfs3/lznt.c | 4 +- + fs/ntfs3/namei.c | 64 +++++++---- + fs/ntfs3/ntfs.h | 3 +- + fs/ntfs3/ntfs_fs.h | 51 ++++++--- + fs/ntfs3/record.c | 34 +++++- + fs/ntfs3/run.c | 9 +- + fs/ntfs3/super.c | 38 +++++-- + fs/ntfs3/xattr.c | 26 ++--- + 17 files changed, 924 insertions(+), 284 deletions(-) +Merging orangefs/for-next (d410cd5303ec5 orangefs: skip leading spaces before parsing client debug masks) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git orangefs/for-next +Merge made by the 'ort' strategy. + fs/orangefs/devorangefs-req.c | 1 + + fs/orangefs/inode.c | 8 ++++---- + fs/orangefs/orangefs-debugfs.c | 1 + + fs/orangefs/xattr.c | 5 ----- + 4 files changed, 6 insertions(+), 9 deletions(-) +Merging overlayfs/overlayfs-next (1f6ee9be92f8d ovl: make fsync after metadata copy-up opt-in mount option) +$ git merge -m Merge branch 'overlayfs-next' of https://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs.git overlayfs/overlayfs-next +Already up to date. +Merging ubifs/next (a5e0055eac837 UBI: support per-device wear-leveling threshold) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs.git ubifs/next +Merge made by the 'ort' strategy. + drivers/mtd/ubi/attach.c | 4 ++-- + drivers/mtd/ubi/build.c | 48 +++++++++++++++++++++++++++++++-------- + drivers/mtd/ubi/cdev.c | 2 +- + drivers/mtd/ubi/fastmap-wl.c | 8 +++---- + drivers/mtd/ubi/fastmap.c | 6 +++-- + drivers/mtd/ubi/io.c | 11 +++++---- + drivers/mtd/ubi/ubi.h | 25 +++++++++++++++++--- + drivers/mtd/ubi/wl.c | 54 +++++++++++++++----------------------------- + fs/ubifs/auth.c | 2 +- + fs/ubifs/debug.h | 4 ++-- + fs/ubifs/key.h | 2 +- + fs/ubifs/ubifs.h | 20 +++++++++------- + include/uapi/mtd/ubi-user.h | 10 +++++++- + 13 files changed, 122 insertions(+), 74 deletions(-) +Merging v9fs/9p-next (aa88278693cbf 9p: Add missing read barrier in virtio zero-copy path) +$ git merge -m Merge branch '9p-next' of https://github.com/martinetd/linux v9fs/9p-next +Already up to date. +Merging v9fs-ericvh/ericvh/for-next (028ef9c96e961 Linux 7.0) +$ git merge -m Merge branch 'ericvh/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git v9fs-ericvh/ericvh/for-next +Already up to date. +Merging xfs/for-next (0877338ade31b Merge branch 'xfs-7.3-merge' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git xfs/for-next +Merge made by the 'ort' strategy. +Merging zonefs/for-next (3a8389d42bdf4 zonefs: handle integer overflow in zonefs_fname_to_fno) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs.git zonefs/for-next +Already up to date. +Merging vfs-brauner/vfs.all (c4463c3bf63d0 Merge branch 'vfs-7.3.sync' into vfs.all) +$ git merge -m Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs-brauner/vfs.all +Auto-merging fs/nilfs2/inode.c +Merge made by the 'ort' strategy. + fs/nilfs2/Kconfig | 2 +- + fs/nilfs2/Makefile | 2 +- + fs/nilfs2/file.c | 40 +++++++++++++++++++++++++++--- + fs/nilfs2/inode.c | 13 ---------- + fs/nilfs2/iomap.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/nilfs2/iomap.h | 13 ++++++++++ + 6 files changed, 123 insertions(+), 18 deletions(-) + create mode 100644 fs/nilfs2/iomap.c + create mode 100644 fs/nilfs2/iomap.h +$ git am -3 ../patches/0001-ksmbd-Fix-removal-of-type-parameter-from-vfs_path_pa.patch +Applying: ksmbd: Fix removal of type parameter from vfs_path_parent_lookup() +Using index info to reconstruct a base tree... +M fs/smb/server/vfs.c +Falling back to patching base and 3-way merge... +Auto-merging fs/smb/server/vfs.c +No changes -- Patch already applied. +Merging vfs/for-next (4dda01b67c866 Merge branches 'work.dcache', 'work.dcache-d_add' and 'work.configfs' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git vfs/for-next +Merge made by the 'ort' strategy. +Merging mm-hotfixes/mm-hotfixes-unstable (90c4f67f851fd MAINTAINERS: add Lance Yang as a hung task detector co-maintainer) +$ git merge -m Merge branch 'mm-hotfixes-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-hotfixes/mm-hotfixes-unstable +Auto-merging .mailmap +Auto-merging MAINTAINERS +Auto-merging mm/hugetlb.c +Merge made by the 'ort' strategy. + .mailmap | 3 + + Documentation/admin-guide/cgroup-v1/memory.rst | 49 ++---------- + MAINTAINERS | 5 +- + mm/hugetlb.c | 6 +- + mm/hugetlb_cgroup.c | 7 +- + mm/hugetlb_cma.c | 21 ++++- + mm/khugepaged.c | 6 -- + mm/madvise.c | 8 ++ + mm/memcontrol-v1.c | 43 ++++++----- + mm/memcontrol.c | 102 ++++++++++++++++++++----- + mm/migrate_device.c | 18 +++++ + mm/pagewalk.c | 6 +- + mm/swapfile.c | 9 ++- + mm/userfaultfd.c | 4 +- + mm/vmscan.c | 2 +- + 15 files changed, 189 insertions(+), 100 deletions(-) +Merging fs-current (f4acfec974657 Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git) +$ git merge -m Merge branch 'fs-current' of linux-next fs-current +Merge made by the 'ort' strategy. +Merging kbuild-current/kbuild-fixes-for-next (e5a259d98823a kbuild: rpm-pkg: Preserve BTF sections in kernel modules during debuginfo stripping) +$ git merge -m Merge branch 'kbuild-fixes-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-current/kbuild-fixes-for-next +Already up to date. +Merging clang-fixes/clang-fixes-for-next (175db11786bde Disable -Wattribute-alias for clang-23 and newer) +$ git merge -m Merge branch 'clang-fixes-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git clang-fixes/clang-fixes-for-next +Already up to date. +Merging arc-current/for-curr (1590cf0329716 Linux 7.2-rc4) +$ git merge -m Merge branch 'for-curr' of https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git arc-current/for-curr +Already up to date. +Merging arm-current/fixes (1039bffd6ae9c ARM: 9485/1: mm: acquire mmap write lock around show_pte() for user faults) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux.git arm-current/fixes +Auto-merging arch/arm/Kconfig +Merge made by the 'ort' strategy. + arch/arm/Kconfig | 3 ++- + arch/arm/kernel/hw_breakpoint.c | 11 ++++++----- + arch/arm/mm/fault.c | 22 ++++++++++++++++++++-- + 3 files changed, 28 insertions(+), 8 deletions(-) +Merging arm64-fixes/for-next/fixes (f73a8edc2ccc6 arm64: make huge_ptep_get handled unaligned addresses) +$ git merge -m Merge branch 'for-next/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux arm64-fixes/for-next/fixes +Already up to date. +Merging arm-soc-fixes/arm/fixes (e36c0670d5ebe Merge tag 'tegra-for-7.2-arm64-dt-fixes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes) +$ git merge -m Merge branch 'arm/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git arm-soc-fixes/arm/fixes +Already up to date. +Merging davinci-current/davinci/for-current (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'davinci/for-current' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git davinci-current/davinci/for-current +Already up to date. +Merging realtek-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/yu_chun/linux.git realtek-fixes/fixes +Already up to date. +Merging drivers-memory-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git drivers-memory-fixes/fixes +Already up to date. +Merging sophgo-fixes/fixes (19272b37aa4f8 Linux 6.16-rc1) +$ git merge -m Merge branch 'fixes' of https://github.com/sophgo/linux.git sophgo-fixes/fixes +Already up to date. +Merging sophgo-soc-fixes/soc-fixes (0af2f6be1b428 Linux 6.15-rc1) +$ git merge -m Merge branch 'soc-fixes' of https://github.com/sophgo/linux.git sophgo-soc-fixes/soc-fixes +Already up to date. +Merging m68k-current/for-linus (2f8e3cad53b5c m68k: nfcon: Do not call console_is_registered() in nfcon_device()) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git m68k-current/for-linus +Merge made by the 'ort' strategy. + arch/m68k/amiga/config.c | 4 +--- + arch/m68k/configs/amiga_defconfig | 5 ----- + arch/m68k/configs/apollo_defconfig | 5 ----- + arch/m68k/configs/atari_defconfig | 5 ----- + arch/m68k/configs/bvme6000_defconfig | 5 ----- + arch/m68k/configs/hp300_defconfig | 5 ----- + arch/m68k/configs/mac_defconfig | 5 ----- + arch/m68k/configs/multi_defconfig | 5 ----- + arch/m68k/configs/mvme147_defconfig | 5 ----- + arch/m68k/configs/mvme16x_defconfig | 5 ----- + arch/m68k/configs/q40_defconfig | 5 ----- + arch/m68k/configs/sun3_defconfig | 5 ----- + arch/m68k/configs/sun3x_defconfig | 5 ----- + arch/m68k/emu/nfcon.c | 2 +- + arch/m68k/kernel/traps.c | 4 ++-- + 15 files changed, 4 insertions(+), 66 deletions(-) +Merging powerpc-fixes/fixes (fb442a6673ff1 powerpc/pseries: lparcfg - fix kbuf[] underflow) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git powerpc-fixes/fixes +Already up to date. +Merging s390-fixes/fixes (eb36325447249 s390/zcrypt: Pad trailing CCA or EP11 message with zeros) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git s390-fixes/fixes +Already up to date. +Merging net/main (564973a259ec7 ipv6: use RCU iterator to dump route exceptions) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git net/main +Merge made by the 'ort' strategy. + drivers/dpll/dpll_core.c | 24 +++--- + drivers/dpll/dpll_netlink.c | 59 ++++++++++++-- + drivers/net/bonding/bond_netlink.c | 2 +- + drivers/net/dsa/b53/b53_common.c | 2 +- + drivers/net/dsa/mv88e6xxx/pcs-6352.c | 5 +- + drivers/net/dsa/realtek/rtl83xx.c | 4 +- + drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 9 ++- + drivers/net/ethernet/ibm/emac/mal.c | 13 +++- + drivers/net/ethernet/intel/ice/devlink/devlink.c | 32 ++------ + drivers/net/ethernet/intel/ice/ice_ethtool.c | 18 ++--- + drivers/net/ethernet/intel/ice/ice_lib.c | 3 + + drivers/net/ethernet/intel/ice/ice_nvm.c | 90 +++++++++++----------- + drivers/net/ethernet/intel/ice/ice_nvm.h | 2 +- + drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 38 ++++----- + drivers/net/ethernet/intel/idpf/idpf_txrx.c | 2 +- + .../net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 2 +- + drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 5 ++ + drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 + + drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 31 ++++---- + drivers/net/ethernet/realtek/8139cp.c | 2 +- + drivers/net/ethernet/renesas/ravb.h | 3 + + drivers/net/ethernet/renesas/ravb_main.c | 9 ++- + drivers/net/ethernet/renesas/ravb_ptp.c | 44 +++++++++-- + drivers/net/ipa/ipa_modem.c | 18 ++++- + drivers/net/ppp/pppox.c | 17 ++++ + drivers/net/thunderbolt/main.c | 12 +++ + drivers/net/tun.c | 21 +++-- + drivers/net/virtio_net.c | 14 ++++ + drivers/net/vxlan/vxlan_core.c | 11 +-- + drivers/net/vxlan/vxlan_mdb.c | 9 ++- + drivers/net/vxlan/vxlan_vnifilter.c | 6 +- + drivers/nfc/fdp/i2c.c | 27 +++++++ + drivers/nfc/microread/microread.c | 31 +++++++- + drivers/nfc/pn533/pn533.c | 22 ++++-- + drivers/nfc/st21nfca/dep.c | 3 + + drivers/ptp/ptp_netc.c | 3 + + drivers/ptp/ptp_vmclock.c | 6 ++ + include/net/af_vsock.h | 5 +- + include/net/ip_tunnels.h | 11 ++- + net/bridge/br_netlink_tunnel.c | 3 +- + net/bridge/br_vlan.c | 4 +- + net/core/dev.c | 60 ++++++++------- + net/core/page_pool.c | 64 +++++++-------- + net/hsr/hsr_device.c | 2 + + net/ipv4/ip_output.c | 4 + + net/ipv4/ip_tunnel.c | 2 +- + net/ipv4/ipmr.c | 3 + + net/ipv6/ip6_gre.c | 14 ++-- + net/ipv6/ip6_input.c | 1 + + net/ipv6/ip6_output.c | 2 + + net/ipv6/ip6_tunnel.c | 22 ++---- + net/ipv6/route.c | 2 +- + net/ipv6/sit.c | 2 +- + net/kcm/kcmsock.c | 3 + + net/mpls/af_mpls.c | 2 + + net/nfc/digital_core.c | 2 +- + net/nfc/digital_technology.c | 2 + + net/nfc/llcp_commands.c | 18 ++++- + net/nfc/llcp_core.c | 44 ++++++++--- + net/nfc/llcp_sock.c | 14 +++- + net/nfc/nci/data.c | 10 +-- + net/nfc/nci/ntf.c | 36 +++++++-- + net/nfc/nci/rsp.c | 42 +++++++++- + net/openvswitch/conntrack.c | 8 +- + net/openvswitch/datapath.c | 47 +++++------ + net/sctp/sm_sideeffect.c | 4 + + net/smc/af_smc.c | 5 +- + net/smc/smc_core.c | 13 ++-- + net/smc/smc_tx.h | 6 +- + net/tls/tls_strp.c | 16 ++-- + net/vmw_vsock/af_vsock.c | 62 +++++---------- + net/xdp/xsk.c | 30 +++++++- + 72 files changed, 779 insertions(+), 389 deletions(-) +Merging bpf/master (a13307e97d5c5 Merge tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/ bpf/master +Already up to date. +Merging ipsec/master (4e9442ce551eb xfrm: bound nat keepalive state collection) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git ipsec/master +Merge made by the 'ort' strategy. + net/ipv6/ah6.c | 29 ++++++++++++++--------- + net/ipv6/xfrm6_input.c | 2 +- + net/xfrm/espintcp.c | 9 +++++++- + net/xfrm/xfrm_nat_keepalive.c | 53 +++++++++++++++++++++++++++++++++++-------- + net/xfrm/xfrm_output.c | 4 +--- + net/xfrm/xfrm_user.c | 2 +- + 6 files changed, 73 insertions(+), 26 deletions(-) +Merging netfilter/main (7b53449540502 Merge tag 'nf-26-08-10' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git netfilter/main +Already up to date. +Merging ipvs/main (2c7c88a412aa6 Merge tag 'net-7.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git ipvs/main +Already up to date. +Merging wireless/for-next (2812e64e1575e Merge tag 'net-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git wireless/for-next +Already up to date. +Merging ath/for-current (2812e64e1575e Merge tag 'net-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net) +$ git merge -m Merge branch 'for-current' of https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git ath/for-current +Already up to date. +Merging iwlwifi/fixes (d13d5d299c11b wifi: iwlwifi: validate SEC_RT TLV minimum size) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git iwlwifi/fixes +Already up to date. +Merging wpan/master (8ce4f287524c7 net: libwx: fix firmware mailbox abnormal return) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan.git wpan/master +Already up to date. +Merging rdma-fixes/for-rc (31b7c70067083 RDMA/ipoib: Drain RCU callbacks during module teardown) +$ git merge -m Merge branch 'for-rc' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git rdma-fixes/for-rc +Merge made by the 'ort' strategy. + drivers/infiniband/core/device.c | 1 + + drivers/infiniband/hw/mlx5/main.c | 2 ++ + drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 ++ + 3 files changed, 5 insertions(+) +Merging sound-current/for-linus (2b366b833f52a ALSA: hda/conexant: Simplify headset plugin type handling) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git sound-current/for-linus +Merge made by the 'ort' strategy. + sound/hda/codecs/conexant.c | 8 +++----- + sound/hda/codecs/realtek/alc269.c | 16 ++++++++++++++++ + sound/pci/ice1712/ice1712.c | 7 ++++--- + sound/pci/pcxhr/pcxhr.c | 14 +++++++------- + sound/usb/quirks.c | 2 ++ + 5 files changed, 32 insertions(+), 15 deletions(-) +Merging sound-asoc-fixes/for-linus (079e27f52b929 ASoC: Intel: NVL: Add entry for HDMI-In capture support to non-I2S codec boards.) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git sound-asoc-fixes/for-linus +Already up to date. +Merging regmap-fixes/for-linus (00268f9452d2a regmap: sdw-mbq: don't call an unset readable_reg callback) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git regmap-fixes/for-linus +Already up to date. +Merging regulator-fixes/for-linus (bd2a0c2d8c49f Merge remote-tracking branch 'regulator/for-7.2' into regulator-linus) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git regulator-fixes/for-linus +Merge made by the 'ort' strategy. + drivers/regulator/tps65185.c | 6 ++++++ + 1 file changed, 6 insertions(+) +Merging spi-fixes/for-linus (11058bd3d47d5 spi: virtio: mark device ready before registering the controller) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git spi-fixes/for-linus +Already up to date. +Merging pci-current/for-linus (7678e81498e20 PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git pci-current/for-linus +Already up to date. +Merging driver-core.current/driver-core-linus (db2ddb8714351 Linux 7.2-rc7) +$ git merge -m Merge branch 'driver-core-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git driver-core.current/driver-core-linus +Already up to date. +Merging tty.current/tty-linus (440915499231e serial: amba-pl011: synchronize DMA teardown) +$ git merge -m Merge branch 'tty-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty.current/tty-linus +Already up to date. +Merging usb.current/usb-linus (db2ddb8714351 Linux 7.2-rc7) +$ git merge -m Merge branch 'usb-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb.current/usb-linus +Already up to date. +Merging usb-serial-fixes/usb-linus (d37186bd95a07 USB: serial: spcp8x5: drop broken carrier detect support) +$ git merge -m Merge branch 'usb-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-serial-fixes/usb-linus +Merge made by the 'ort' strategy. + drivers/usb/serial/digi_acceleport.c | 9 +++++++-- + drivers/usb/serial/spcp8x5.c | 13 ------------- + 2 files changed, 7 insertions(+), 15 deletions(-) +Merging phy/fixes (075b74841bd00 Linux 7.2-rc6) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git phy/fixes +Already up to date. +Merging staging.current/staging-linus (6829665d05098 staging: rtl8723bs: validate monitor transmit frame lengths) +$ git merge -m Merge branch 'staging-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging.current/staging-linus +Already up to date. +Merging iio-fixes/fixes-togreg (16989c88e98fb iio: frequency: adf4377: Make sure clk_init_data is fully initialized) +$ git merge -m Merge branch 'fixes-togreg' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git iio-fixes/fixes-togreg +Auto-merging drivers/iio/adc/ad4080.c +Auto-merging drivers/iio/adc/adi-axi-adc.c +Auto-merging drivers/iio/adc/max1363.c +Auto-merging drivers/iio/adc/rohm-bd79124.c +Auto-merging drivers/iio/chemical/atlas-sensor.c +Auto-merging drivers/iio/dac/ad3552r-hs.c +Auto-merging drivers/iio/dac/ad5446-i2c.c +Auto-merging drivers/iio/health/max30102.c +Auto-merging drivers/iio/light/gp2ap020a00f.c +Auto-merging drivers/iio/light/ltrf216a.c +Auto-merging drivers/iio/proximity/srf04.c +Auto-merging drivers/iio/proximity/sx9324.c +Auto-merging drivers/iio/temperature/hid-sensor-temperature.c +Merge made by the 'ort' strategy. + drivers/iio/accel/kionix-kx022a.c | 2 +- + drivers/iio/adc/Kconfig | 2 ++ + drivers/iio/adc/ad4080.c | 5 +++ + drivers/iio/adc/ade9000.c | 31 ++++++++--------- + drivers/iio/adc/adi-axi-adc.c | 34 +++++++++++++++++++ + drivers/iio/adc/max1363.c | 8 +++++ + drivers/iio/adc/pac1921.c | 2 +- + drivers/iio/adc/rohm-bd79124.c | 20 +++++++---- + drivers/iio/adc/ti-ads7138.c | 42 +++++++++++++++++++----- + drivers/iio/chemical/atlas-sensor.c | 19 ++++------- + drivers/iio/dac/Kconfig | 1 + + drivers/iio/dac/ad3552r-hs.c | 2 +- + drivers/iio/dac/ad5446-i2c.c | 2 +- + drivers/iio/dac/m62332.c | 17 +++++++--- + drivers/iio/dac/rohm-bd79703.c | 3 ++ + drivers/iio/frequency/adf4377.c | 2 +- + drivers/iio/gyro/mpu3050-core.c | 2 +- + drivers/iio/health/max30102.c | 12 +++++-- + drivers/iio/industrialio-buffer.c | 38 ++++++++++----------- + drivers/iio/light/apds9306.c | 8 ++--- + drivers/iio/light/gp2ap002.c | 24 +++++++++++--- + drivers/iio/light/gp2ap020a00f.c | 2 ++ + drivers/iio/light/ltrf216a.c | 3 +- + drivers/iio/light/opt4001.c | 37 +++++++-------------- + drivers/iio/light/opt4060.c | 9 +++-- + drivers/iio/light/rohm-bu27034.c | 2 +- + drivers/iio/pressure/bmp280-core.c | 2 +- + drivers/iio/pressure/dps310.c | 3 +- + drivers/iio/pressure/rohm-bm1390.c | 2 +- + drivers/iio/proximity/srf04.c | 1 + + drivers/iio/proximity/sx9324.c | 2 +- + drivers/iio/temperature/hid-sensor-temperature.c | 3 +- + 32 files changed, 218 insertions(+), 124 deletions(-) +Merging watchdog-fixes/watchdog (db2ddb8714351 Linux 7.2-rc7) +$ git merge -m Merge branch 'watchdog' of https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git watchdog-fixes/watchdog +Already up to date. +Merging counter-current/counter-current (f1a3a9946aab6 counter: microchip-tcb-capture: Fix DT channel validation) +$ git merge -m Merge branch 'counter-current' of https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter.git counter-current/counter-current +Already up to date. +Merging char-misc.current/char-misc-linus (db2ddb8714351 Linux 7.2-rc7) +$ git merge -m Merge branch 'char-misc-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc.current/char-misc-linus +Already up to date. +Merging soundwire-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git soundwire-fixes/fixes +Already up to date. +Merging thunderbolt-fixes/fixes (8d3ae59288f1e Linux 7.2) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git thunderbolt-fixes/fixes +Already up to date. +Merging input-current/for-linus (b4d85f863e5a6 Merge branch 'next' into for-linus) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git input-current/for-linus +Already up to date. +Merging crypto-current/master (7537036a2e6fe crypto: lskcipher - propagate errors from unaligned crypt) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git crypto-current/master +Already up to date. +Merging libcrypto-fixes/libcrypto-fixes (1590cf0329716 Linux 7.2-rc4) +$ git merge -m Merge branch 'libcrypto-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git libcrypto-fixes/libcrypto-fixes +Already up to date. +Merging vfio-fixes/for-linus (e242e974e812e vfio: selftests: Add luuid to libvfio.mk's list of libraries, not to the Makefile) +$ git merge -m Merge branch 'for-linus' of https://github.com/awilliam/linux-vfio.git vfio-fixes/for-linus +Already up to date. +Merging kselftest-fixes/fixes (c5c413534d40e selftests/tracing: Have trigger-hist-poll.tc use sched_process_exit) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kselftest-fixes/fixes +Already up to date. +Merging dmaengine-fixes/fixes (075b74841bd00 Linux 7.2-rc6) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git dmaengine-fixes/fixes +Already up to date. +Merging backlight-fixes/for-backlight-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'for-backlight-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git backlight-fixes/for-backlight-fixes +Already up to date. +Merging mtd-fixes/mtd/fixes (2b533e775aec5 Revert "mtd: maps: remove uclinux map driver") +$ git merge -m Merge branch 'mtd/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd-fixes/mtd/fixes +Already up to date. +Merging mfd-fixes/for-mfd-fixes (d5d2d7a8d8be1 MAINTAINERS: Add a mailing list entry to MFD) +$ git merge -m Merge branch 'for-mfd-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git mfd-fixes/for-mfd-fixes +Already up to date. +Merging v4l-dvb-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of git://linuxtv.org/media-ci/media-pending.git v4l-dvb-fixes/fixes +Already up to date. +Merging reset-fixes/reset/fixes (71827776667f4 reset: imx7: Correct polarity of MIPI CSI resets on i.MX8MQ) +$ git merge -m Merge branch 'reset/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/pza/linux reset-fixes/reset/fixes +Already up to date. +Merging mips-fixes/mips-fixes (a13c140cc289c Linux 7.2-rc3) +$ git merge -m Merge branch 'mips-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git mips-fixes/mips-fixes +Already up to date. +Merging at91-fixes/at91-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'at91-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git at91-fixes/at91-fixes +Already up to date. +Merging omap-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap.git omap-fixes/fixes +Already up to date. +Merging kvm-fixes/master (8d3ae59288f1e Linux 7.2) +$ git merge -m Merge branch 'master' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-fixes/master +Already up to date. +Merging kvms390-fixes/master (30300ec2780ef KVM: s390: Fix potential tiny kernel stack leak) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git kvms390-fixes/master +Merge made by the 'ort' strategy. + arch/s390/include/asm/nmi.h | 3 ++ + arch/s390/kernel/nmi.c | 5 +- + arch/s390/kvm/dat.c | 13 ++--- + arch/s390/kvm/guestdbg.c | 9 +++- + arch/s390/kvm/interrupt.c | 107 ++++++++++++++++++++------------------ + arch/s390/kvm/kvm-s390.c | 28 ++++++---- + arch/s390/kvm/pv.c | 4 ++ + arch/s390/kvm/vsie.c | 1 + + drivers/s390/crypto/vfio_ap_ops.c | 45 +++++++--------- + 9 files changed, 116 insertions(+), 99 deletions(-) +Merging kvm-arm-fixes/fixes (751a956c75a54 KVM: arm64: GICv2: Don't WARN on out-of-range INTID writes to GICV_DIR) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git kvm-arm-fixes/fixes +Merge made by the 'ort' strategy. + arch/arm64/kvm/vgic/vgic-v2.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) +Merging hwmon-fixes/hwmon (f7c9176d2326e hwmon: (emc1403) Drop hysteresis for low limit temperature) +$ git merge -m Merge branch 'hwmon' of https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-fixes/hwmon +Auto-merging drivers/hwmon/coretemp.c +Auto-merging drivers/hwmon/emc1403.c +Merge made by the 'ort' strategy. +Merging nvdimm-fixes/libnvdimm-fixes (a8aec14230322 nvdimm/bus: Fix potential use after free in asynchronous initialization) +$ git merge -m Merge branch 'libnvdimm-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git nvdimm-fixes/libnvdimm-fixes +Already up to date. +Merging cxl-fixes/fixes (d90f236f8b9e3 cxl/test: Update mock dev array before calling platform_device_add()) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git cxl-fixes/fixes +Already up to date. +Merging dma-mapping-fixes/dma-mapping-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'dma-mapping-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux.git dma-mapping-fixes/dma-mapping-fixes +Already up to date. +Merging drivers-x86-fixes/fixes (78bf392ba77dd platform/x86: asus-wmi: temporarily revert to setting a charge limit) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git drivers-x86-fixes/fixes +Already up to date. +Merging samsung-krzk-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git samsung-krzk-fixes/fixes +Already up to date. +Merging pinctrl-samsung-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git pinctrl-samsung-fixes/fixes +Already up to date. +Merging pinctrl-qcom-fixes/pinctrl-qcom/for-current (1e7b04c12c077 pinctrl: qcom: shikra: Fix intr_target_width for summary interrupt routing) +$ git merge -m Merge branch 'pinctrl-qcom/for-current' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git pinctrl-qcom-fixes/pinctrl-qcom/for-current +Merge made by the 'ort' strategy. + drivers/pinctrl/qcom/pinctrl-shikra.c | 1 + + 1 file changed, 1 insertion(+) +Merging devicetree-fixes/dt/linus (bba13ad17b1a1 of/address: Fix NULL bus dereference in of_pci_range_parser_one()) +$ git merge -m Merge branch 'dt/linus' of https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git devicetree-fixes/dt/linus +Already up to date. +Merging dt-krzk-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt.git dt-krzk-fixes/fixes +Already up to date. +Merging scsi-fixes/fixes (c4f6916a99cf1 scsi: scsi_debug: Negate wrapped memcmp() result) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git scsi-fixes/fixes +Already up to date. +Merging drm-fixes/drm-fixes (8d3ae59288f1e Linux 7.2) +$ git merge -m Merge branch 'drm-fixes' of https://gitlab.freedesktop.org/drm/kernel.git drm-fixes/drm-fixes +Already up to date. +Merging drm-intel-fixes/for-linux-next-fixes (266ebacffc580 drm/i915/lt_phy: program DDI_CLK_VALFREQ with DDI clock frequency) +$ git merge -m Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/i915/kernel.git drm-intel-fixes/for-linux-next-fixes +Merge made by the 'ort' strategy. + drivers/gpu/drm/i915/display/intel_cx0_phy.c | 5 +++-- + drivers/gpu/drm/i915/display/intel_ddi.c | 11 +++++++++++ + drivers/gpu/drm/i915/display/intel_ddi.h | 1 + + drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 ---- + drivers/gpu/drm/i915/display/intel_lt_phy.c | 6 ++++-- + 5 files changed, 19 insertions(+), 8 deletions(-) +Merging mmc-fixes/fixes (00179ed9fbe07 mmc: loongson2: Fix sg iteration in data reorder functions) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git mmc-fixes/fixes +Already up to date. +Merging rtc-fixes/rtc-fixes (254f49634ee16 Linux 7.1-rc1) +$ git merge -m Merge branch 'rtc-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-fixes/rtc-fixes +Already up to date. +Merging gnss-fixes/gnss-linus (a13c140cc289c Linux 7.2-rc3) +$ git merge -m Merge branch 'gnss-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git gnss-fixes/gnss-linus +Already up to date. +Merging hyperv-fixes/hyperv-fixes (0fd49f7bfb8f1 mshv_vtl: bounds-check cpu index in vtl mmap fault handler) +$ git merge -m Merge branch 'hyperv-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-fixes/hyperv-fixes +Merge made by the 'ort' strategy. +Merging risc-v-fixes/fixes (8d9d4fd2a15ff riscv: patch: skip fixmap mapping when kernel text is already writable) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git risc-v-fixes/fixes +Auto-merging MAINTAINERS +Auto-merging arch/riscv/Kconfig +Auto-merging arch/riscv/include/asm/acpi.h +CONFLICT (content): Merge conflict in arch/riscv/include/asm/acpi.h +Auto-merging arch/riscv/kernel/traps.c +Auto-merging arch/riscv/mm/init.c +Resolved 'arch/riscv/include/asm/acpi.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master cc4144d3d835f] Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git +$ git diff -M --stat --summary HEAD^.. + Documentation/arch/riscv/hwprobe.rst | 20 +++ + .../devicetree/bindings/riscv/extensions.yaml | 69 ++++++++++ + MAINTAINERS | 8 ++ + arch/riscv/Kconfig | 19 +++ + arch/riscv/Makefile | 10 +- + arch/riscv/boot/.gitignore | 1 - + arch/riscv/boot/Makefile | 3 +- + arch/riscv/include/asm/acpi.h | 21 +++ + arch/riscv/include/asm/cmpxchg.h | 14 +- + arch/riscv/include/asm/csr.h | 53 +++++++ + arch/riscv/include/asm/csr_indirect.h | 50 +++++++ + arch/riscv/include/asm/hwcap.h | 30 ++-- + arch/riscv/include/asm/hwprobe.h | 7 - + arch/riscv/include/asm/pgtable.h | 12 +- + arch/riscv/include/asm/processor.h | 3 + + arch/riscv/include/asm/qos.h | 74 ++++++++++ + arch/riscv/include/asm/switch_to.h | 7 +- + arch/riscv/include/asm/tlbflush.h | 23 ++++ + arch/riscv/include/asm/vdso.h | 6 + + arch/riscv/include/asm/vdso/arch_data.h | 6 - + arch/riscv/include/uapi/asm/hwprobe.h | 152 +++++++++++---------- + arch/riscv/kernel/Makefile | 2 + + arch/riscv/kernel/acpi.c | 5 + + arch/riscv/kernel/alternative.c | 33 +++-- + arch/riscv/kernel/cpufeature.c | 80 +++++++---- + arch/riscv/kernel/efi.c | 5 + + arch/riscv/kernel/patch.c | 2 + + arch/riscv/kernel/probes/decode-insn.c | 2 +- + arch/riscv/kernel/probes/simulate-insn.c | 7 + + arch/riscv/kernel/probes/simulate-insn.h | 1 + + arch/riscv/kernel/qos.c | 101 ++++++++++++++ + arch/riscv/kernel/reset.c | 9 +- + arch/riscv/kernel/setup.c | 2 + + arch/riscv/kernel/sys_hwprobe.c | 83 +++-------- + arch/riscv/kernel/tests/kprobes/test-kprobes-asm.S | 24 ++++ + arch/riscv/kernel/traps.c | 3 + + arch/riscv/kernel/unaligned_access_speed.c | 19 +-- + arch/riscv/kernel/usercfi.c | 4 +- + arch/riscv/kernel/vdso/Makefile | 7 +- + arch/riscv/kernel/vdso/hwprobe.c | 2 +- + arch/riscv/kernel/vdso/vdso.lds.S | 2 + + arch/riscv/kernel/vmlinux-xip.lds.S | 143 ------------------- + arch/riscv/kvm/isa.c | 16 +-- + arch/riscv/kvm/main.c | 2 +- + arch/riscv/kvm/vcpu_fp.c | 20 +-- + arch/riscv/kvm/vcpu_onereg.c | 6 +- + arch/riscv/kvm/vcpu_vector.c | 10 +- + arch/riscv/mm/init.c | 7 +- + arch/riscv/mm/tlbflush.c | 23 ---- + drivers/acpi/tables.c | 1 + + drivers/perf/riscv_pmu_sbi.c | 33 ++++- + 51 files changed, 801 insertions(+), 441 deletions(-) + create mode 100644 arch/riscv/include/asm/csr_indirect.h + create mode 100644 arch/riscv/include/asm/qos.h + create mode 100644 arch/riscv/kernel/qos.c + delete mode 100644 arch/riscv/kernel/vmlinux-xip.lds.S +Merging riscv-dt-fixes/riscv-dt-fixes (42c57c049054d riscv: dts: starfive: jh7110-common: fix jh7110 SoC boot from SD-card.) +$ git merge -m Merge branch 'riscv-dt-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git riscv-dt-fixes/riscv-dt-fixes +Merge made by the 'ort' strategy. + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 1 + + 1 file changed, 1 insertion(+) +Merging riscv-soc-fixes/riscv-soc-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'riscv-soc-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git riscv-soc-fixes/riscv-soc-fixes +Already up to date. +Merging fpga-fixes/fixes (19272b37aa4f8 Linux 6.16-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga.git fpga-fixes/fixes +Already up to date. +Merging spdx/spdx-linus (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'spdx-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx.git spdx/spdx-linus +Already up to date. +Merging gpio-brgl-fixes/gpio/for-current (44f3468a0aef1 gpio: sloppy-logic-analyzer: fix use-after-free via debugfs trigger on unbind) +$ git merge -m Merge branch 'gpio/for-current' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio-brgl-fixes/gpio/for-current +Already up to date. +Merging gpio-intel-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git gpio-intel-fixes/fixes +Already up to date. +Merging pinctrl-intel-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git pinctrl-intel-fixes/fixes +Already up to date. +Merging auxdisplay-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git auxdisplay-fixes/fixes +Already up to date. +Merging kunit-fixes/kunit-fixes (5142c56651578 bug: fix warning suppressions with kunit built as module) +$ git merge -m Merge branch 'kunit-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kunit-fixes/kunit-fixes +Already up to date. +Merging memblock-fixes/fixes (97090500d776c mm/mm_init: deferred_grow_zone(): fix out-of-range first_deferred_pfn) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git memblock-fixes/fixes +Already up to date. +Merging renesas-fixes/fixes (6fa6ee724d8da arm64: dts: renesas: ironhide: Describe inline ECC carveouts) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git renesas-fixes/fixes +Already up to date. +Merging perf-current/perf-tools (fac520e43a602 tools headers: Sync KVM headers with the kernel sources) +$ git merge -m Merge branch 'perf-tools' of https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git perf-current/perf-tools +Already up to date. +Merging efi-fixes/urgent (d8809f6931065 efi: sysfb_efi: Extend quirk to cover IdeaPad Duet 3 10IGL5-LTE) +$ git merge -m Merge branch 'urgent' of https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git efi-fixes/urgent +Already up to date. +Merging battery-fixes/fixes (160a783aa65b7 power: supply: bq25890: fix the -10 C NTC lookup entry) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git battery-fixes/fixes +Already up to date. +Merging iommufd-fixes/for-rc (075b74841bd00 Linux 7.2-rc6) +$ git merge -m Merge branch 'for-rc' of https://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git iommufd-fixes/for-rc +Already up to date. +Merging rust-fixes/rust-fixes (d24f5cdbeff8b Merge tag 'rust-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux) +$ git merge -m Merge branch 'rust-fixes' of https://github.com/Rust-for-Linux/linux.git rust-fixes/rust-fixes +Already up to date. +Merging w1-fixes/fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1.git w1-fixes/fixes +Already up to date. +Merging pmdomain-fixes/fixes (090a95dbe13df pmdomain: mediatek: mfg: initialize prev_o in mtk_mfg_attach_dev()) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git pmdomain-fixes/fixes +Already up to date. +Merging i2c-andi-fixes/i2c/i2c-fixes (abea5c349368a Merge tag 'i2c-7.3-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux) +$ git merge -m Merge branch 'i2c/i2c-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git i2c-andi-fixes/i2c/i2c-fixes +Already up to date. +Merging i2c-rust-fixes/rust-i2c-fixes (4eb422482ca5d rust: i2c: fix I2cAdapter refcounts double increment) +$ git merge -m Merge branch 'rust-i2c-fixes' of https://github.com/ikrtn/rust-for-linux i2c-rust-fixes/rust-i2c-fixes +Already up to date. +Merging sparc-fixes/for-linus (254f49634ee16 Linux 7.1-rc1) +$ git merge -m Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc.git sparc-fixes/for-linus +Already up to date. +Merging clk-fixes/clk-fixes (7ae8acad2d5c4 Merge tag 'qcom-clk-fixes-for-7.2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-fixes) +$ git merge -m Merge branch 'clk-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-fixes/clk-fixes +Already up to date. +Merging thead-clk-fixes/thead-clk-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'thead-clk-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git thead-clk-fixes/thead-clk-fixes +Already up to date. +Merging tenstorrent-clk-fixes/tenstorrent-clk-fixes (6de23f81a5e08 Linux 7.0-rc1) +$ git merge -m Merge branch 'tenstorrent-clk-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git tenstorrent-clk-fixes/tenstorrent-clk-fixes +Already up to date. +Merging fustini-config-fixes/riscv-config-fixes (254f49634ee16 Linux 7.1-rc1) +$ git merge -m Merge branch 'riscv-config-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git fustini-config-fixes/riscv-config-fixes +Already up to date. +Merging pwrseq-fixes/pwrseq/for-current (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'pwrseq/for-current' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git pwrseq-fixes/pwrseq/for-current +Already up to date. +Merging thead-dt-fixes/thead-dt-fixes (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'thead-dt-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git thead-dt-fixes/thead-dt-fixes +Already up to date. +Merging ftrace-fixes/ftrace/fixes (1650a1b6cb1ae fgraph: Check ftrace_pids_enabled on registration for early filtering) +$ git merge -m Merge branch 'ftrace/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git ftrace-fixes/ftrace/fixes +Already up to date. +Merging ring-buffer-fixes/ring-buffer/fixes (057caace5214d tracing: Create output file from cmd_check_undefined) +$ git merge -m Merge branch 'ring-buffer/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git ring-buffer-fixes/ring-buffer/fixes +Already up to date. +Merging trace-fixes/trace/fixes (c3730b8373bb5 tracing: Fix race between update_event_fields and, event_define_fields) +$ git merge -m Merge branch 'trace/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-fixes/trace/fixes +Already up to date. +Merging tracefs-fixes/tracefs/fixes (07004a8c4b572 eventfs: Hold eventfs_mutex and SRCU when remount walks events) +$ git merge -m Merge branch 'tracefs/fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git tracefs-fixes/tracefs/fixes +Already up to date. +Merging spacemit-fixes/fixes (eb525edd48907 clk: spacemit: k3: set hdma clock as critical) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux spacemit-fixes/fixes +Already up to date. +Merging tip-fixes/tip/urgent (57e0daeacc1da Merge branch into tip/master: 'locking/urgent') +$ git merge -m Merge branch 'tip/urgent' of https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tip-fixes/tip/urgent +Merge made by the 'ort' strategy. + drivers/irqchip/irq-ast2700-intc0.c | 4 +- + drivers/irqchip/irq-ast2700-intc1.c | 3 +- + drivers/irqchip/irq-renesas-rzg2l.c | 4 +- + fs/exec.c | 9 ++- + include/linux/futex.h | 8 +-- + include/linux/sched/mm.h | 10 +-- + kernel/exit.c | 2 +- + kernel/fork.c | 10 +-- + kernel/futex/core.c | 79 ++++++++++++++--------- + kernel/futex/pi.c | 125 +++++++++++++++++++++++++++--------- + kernel/time/timer.c | 1 + + 11 files changed, 170 insertions(+), 85 deletions(-) +Merging slab-fixes/slab/for-next-fixes (5ff172f6c94d2 slab: silence sparse warning with type-based partitioning) +$ git merge -m Merge branch 'slab/for-next-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git slab-fixes/slab/for-next-fixes +Already up to date. +Merging kexec-fixes/kexec-fixes (ada2e5a44e991 crash_dump: release keyring reference at the correct time) +$ git merge -m Merge branch 'kexec-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git kexec-fixes/kexec-fixes +Already up to date. +Merging liveupdate-fixes/fixes (3a0b8fa2eb36a kho: fix size calculation in kho_preserved_memory_reserve()) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git liveupdate-fixes/fixes +Already up to date. +Merging drm-msm-fixes/msm-fixes (e2332abed2a4d drm/msm: Only fini scheduler after successful init) +$ git merge -m Merge branch 'msm-fixes' of https://gitlab.freedesktop.org/drm/msm.git drm-msm-fixes/msm-fixes +Auto-merging drivers/gpu/drm/msm/adreno/a5xx_gpu.c +Auto-merging drivers/gpu/drm/msm/msm_ringbuffer.c +Merge made by the 'ort' strategy. + drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 36 ++++++++++++++++++++++++++- + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 ++++ + drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 +++- + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 ++++-- + drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 5 +++- + drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 12 +++++++++ + drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 +++- + drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 2 +- + drivers/gpu/drm/msm/dp/dp_panel.c | 4 ++- + drivers/gpu/drm/msm/dsi/dsi_host.c | 12 +++++++++ + drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 1 + + drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c | 18 ++++++++++++-- + drivers/gpu/drm/msm/msm_gpu.c | 8 ++++-- + drivers/gpu/drm/msm/msm_ringbuffer.c | 7 +++--- + drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + + drivers/gpu/drm/msm/registers/adreno/a3xx.xml | 2 ++ + 16 files changed, 116 insertions(+), 15 deletions(-) +Merging uml-fixes/fixes (af421e9aed392 um: vector: fix use-after-free in vector_mmsg_rx()) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git uml-fixes/fixes +Already up to date. +Merging fwctl-fixes/for-rc (075b74841bd00 Linux 7.2-rc6) +$ git merge -m Merge branch 'for-rc' of https://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl.git fwctl-fixes/for-rc +Already up to date. +Merging devsec-tsm-fixes/fixes (c3fd16c3b98ed virt: tdx-guest: Fix handling of host controlled 'quote' buffer length) +$ git merge -m Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git devsec-tsm-fixes/fixes +Already up to date. +Merging drm-rust-fixes/for-linux-next-fixes (8cdeaa50eae8d Linux 7.2-rc2) +$ git merge -m Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust-fixes/for-linux-next-fixes +Already up to date. +Merging tenstorrent-dt-fixes/tenstorrent-dt-fixes (6de23f81a5e08 Linux 7.0-rc1) +$ git merge -m Merge branch 'tenstorrent-dt-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git tenstorrent-dt-fixes/tenstorrent-dt-fixes +Already up to date. +Merging nfc-fixes/for-linus (be47ff78de05e selftests: nci: Correct pthread_create return value check) +$ git merge -m Merge branch 'for-linus' of https://codeberg.org/linux-nfc/linux.git nfc-fixes/for-linus +Auto-merging net/nfc/llcp_core.c +Merge made by the 'ort' strategy. + drivers/nfc/nfcmrvl/fw_dnld.c | 11 ++++++++--- + drivers/nfc/port100.c | 7 +++++++ + drivers/nfc/st21nfca/i2c.c | 29 +++++++++++++++++++---------- + net/nfc/llcp_core.c | 25 +++++++++++++++++++++++++ + tools/testing/selftests/nci/nci_dev.c | 12 +++++++----- + 5 files changed, 66 insertions(+), 18 deletions(-) +Merging drm-misc-fixes/for-linux-next-fixes (dc14753664240 accel/amdxdna: return early from a zero-length flush) +$ git merge -m Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-fixes/for-linux-next-fixes +Merge made by the 'ort' strategy. + drivers/accel/amdxdna/amdxdna_gem.c | 3 +++ + drivers/accel/qaic/qaic_control.c | 46 +++++++++++++++++--------------- + drivers/gpu/drm/virtio/virtgpu_display.c | 9 ++++--- + drivers/gpu/drm/virtio/virtgpu_drv.h | 21 +++++++++++++++ + drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + + drivers/gpu/drm/virtio/virtgpu_object.c | 2 +- + drivers/gpu/drm/virtio/virtgpu_vq.c | 21 ++++++++++++--- + 7 files changed, 74 insertions(+), 29 deletions(-) +Merging rust/rust-next (bd5f485f3f026 Merge tag 'soc-arm-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc) +$ git merge -m Merge branch 'rust-next' of https://github.com/Rust-for-Linux/linux.git rust/rust-next +Already up to date. +Merging rust-interop/interop-next (05f7e89ab9731 Linux 6.19) +$ git merge -m Merge branch 'interop-next' of https://github.com/Rust-for-Linux/linux.git rust-interop/interop-next +Already up to date. +Merging rust-alloc/alloc-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'alloc-next' of https://github.com/Rust-for-Linux/linux.git rust-alloc/alloc-next +Already up to date. +Merging rust-io/io-next (86731a2a651e5 Linux 6.16-rc3) +$ git merge -m Merge branch 'io-next' of https://github.com/Rust-for-Linux/linux.git rust-io/io-next +Already up to date. +Merging rust-pin-init/pin-init-next (1e26aea0355ad rust: pin-init: add `#[inline]` to small functions) +$ git merge -m Merge branch 'pin-init-next' of https://github.com/Rust-for-Linux/linux.git rust-pin-init/pin-init-next +Already up to date. +Merging rust-timekeeping/timekeeping-next (ddb1444d33351 hrtimer: add usage examples to documentation) +$ git merge -m Merge branch 'timekeeping-next' of https://github.com/Rust-for-Linux/linux.git rust-timekeeping/timekeeping-next +Already up to date. +Merging rust-xarray/xarray-next (c455f19bbe610 rust: xarray: add __rust_helper to helpers) +$ git merge -m Merge branch 'xarray-next' of https://github.com/Rust-for-Linux/linux.git rust-xarray/xarray-next +Already up to date. +Merging rust-analyzer/rust-analyzer-next (5f45afb8ab04d scripts: generate_rust_analyzer.py: pass cfg to macros crate) +$ git merge -m Merge branch 'rust-analyzer-next' of https://github.com/Rust-for-Linux/linux.git rust-analyzer/rust-analyzer-next +Auto-merging scripts/generate_rust_analyzer.py +Merge made by the 'ort' strategy. + scripts/generate_rust_analyzer.py | 1 + + 1 file changed, 1 insertion(+) +Merging mm-stable/mm-stable (08745c6235012 selftests/mm: thuge-gen: fix test_shmget() for PAGE_SIZE check) +$ git merge -m Merge branch 'mm-stable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-stable/mm-stable +Auto-merging CREDITS +Auto-merging MAINTAINERS +Auto-merging arch/arm64/Kconfig +Auto-merging arch/arm64/include/asm/pgtable.h +Auto-merging arch/loongarch/Kconfig +Auto-merging arch/mips/kernel/vdso.c +Auto-merging arch/riscv/Kconfig +CONFLICT (content): Merge conflict in arch/riscv/Kconfig +Auto-merging arch/riscv/include/asm/pgtable.h +Auto-merging arch/s390/Kconfig +Auto-merging arch/x86/Kconfig +Auto-merging arch/x86/events/intel/ds.c +Auto-merging arch/x86/include/asm/pgtable.h +Auto-merging arch/x86/include/asm/pgtable_types.h +Auto-merging arch/x86/kvm/vmx/vmx.c +Auto-merging arch/x86/mm/init_64.c +Auto-merging drivers/accel/amdxdna/aie2_ctx.c +Auto-merging drivers/base/arch_numa.c +Auto-merging drivers/gpu/drm/drm_gem_shmem_helper.c +Auto-merging drivers/gpu/drm/panthor/panthor_gem.c +Auto-merging drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c +Auto-merging drivers/gpu/drm/xe/xe_device.c +Auto-merging drivers/video/fbdev/core/fb_io_fops.c +Auto-merging fs/binfmt_elf.c +Auto-merging fs/hugetlbfs/inode.c +Auto-merging include/linux/cpuset.h +Auto-merging include/linux/memory_hotplug.h +Auto-merging include/linux/mmap_lock.h +Auto-merging include/linux/sched/mm.h +Auto-merging init/Kconfig +Auto-merging kernel/cgroup/cpuset.c +Auto-merging kernel/events/core.c +Auto-merging kernel/events/uprobes.c +Auto-merging kernel/liveupdate/kexec_handover.c +Auto-merging kernel/trace/ring_buffer.c +Auto-merging mm/damon/lru_sort.c +Auto-merging mm/damon/ops-common.c +Auto-merging mm/damon/paddr.c +Auto-merging mm/damon/reclaim.c +Auto-merging mm/damon/vaddr.c +Auto-merging mm/filemap.c +Auto-merging mm/huge_memory.c +Auto-merging mm/hugetlb.c +Auto-merging mm/hugetlb_cma.c +Auto-merging mm/khugepaged.c +Auto-merging mm/madvise.c +Auto-merging mm/memblock.c +Auto-merging mm/memcontrol-v1.c +Auto-merging mm/memcontrol.c +Auto-merging mm/memory.c +Auto-merging mm/memory_hotplug.c +Auto-merging mm/migrate_device.c +Auto-merging mm/mm_init.c +Auto-merging mm/page_table_check.c +Auto-merging mm/pagewalk.c +Auto-merging mm/shmem.c +Auto-merging mm/swapfile.c +Auto-merging mm/userfaultfd.c +Auto-merging mm/vmalloc.c +Auto-merging mm/vmscan.c +Auto-merging samples/damon/mtier.c +Auto-merging tools/testing/selftests/Makefile +Resolved 'arch/riscv/Kconfig' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master a6d8ab64d7efe] Merge branch 'mm-stable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm +$ git diff -M --stat --summary HEAD^.. + CREDITS | 4 + + Documentation/ABI/testing/sysfs-block-zram | 6 +- + Documentation/ABI/testing/sysfs-bus-dax | 24 + + Documentation/ABI/testing/sysfs-kernel-mm-damon | 75 +- + Documentation/admin-guide/blockdev/zram.rst | 40 +- + Documentation/admin-guide/cgroup-v1/cpusets.rst | 2 +- + Documentation/admin-guide/mm/damon/usage.rst | 19 +- + Documentation/admin-guide/mm/pagemap.rst | 13 +- + Documentation/admin-guide/mm/transhuge.rst | 2 +- + Documentation/admin-guide/mm/userfaultfd.rst | 269 +++++- + Documentation/admin-guide/sysctl/vm.rst | 83 +- + Documentation/core-api/mm-api.rst | 3 +- + Documentation/driver-api/basics.rst | 3 + + Documentation/filesystems/proc.rst | 1 + + Documentation/mm/damon/design.rst | 43 +- + Documentation/mm/hmm.rst | 81 +- + Documentation/mm/page_owner.rst | 78 +- + Documentation/mm/physical_memory.rst | 3 - + Documentation/mm/process_addrs.rst | 2 +- + Documentation/userspace-api/mseal.rst | 14 +- + MAINTAINERS | 34 +- + arch/arm/mm/fault-armv.c | 4 +- + arch/arm/mm/flush.c | 2 +- + arch/arm64/Kconfig | 3 +- + arch/arm64/include/asm/fixmap.h | 3 - + arch/arm64/include/asm/pgtable-prot.h | 8 +- + arch/arm64/include/asm/pgtable.h | 51 +- + arch/arm64/kernel/setup.c | 2 - + arch/csky/abiv1/inc/abi/cacheflush.h | 7 +- + arch/loongarch/Kconfig | 3 +- + arch/loongarch/include/asm/pgtable.h | 4 +- + arch/mips/kernel/vdso.c | 4 +- + arch/nios2/mm/cacheflush.c | 2 +- + arch/parisc/kernel/cache.c | 2 +- + arch/powerpc/include/asm/book3s/64/pgtable.h | 10 +- + arch/powerpc/mm/book3s64/radix_pgtable.c | 7 +- + arch/powerpc/mm/book3s64/slice.c | 6 +- + arch/powerpc/mm/hugetlbpage.c | 13 +- + arch/powerpc/platforms/Kconfig.cputype | 3 +- + arch/riscv/Kconfig | 3 +- + arch/riscv/include/asm/fixmap.h | 3 - + arch/riscv/include/asm/pgtable-bits.h | 12 +- + arch/riscv/include/asm/pgtable.h | 67 +- + arch/s390/Kconfig | 3 +- + arch/s390/include/asm/hugetlb.h | 12 +- + arch/s390/include/asm/pgtable.h | 6 +- + arch/s390/mm/vmem.c | 4 +- + arch/sparc/include/asm/pgtable_64.h | 4 - + arch/x86/Kconfig | 3 +- + arch/x86/events/intel/ds.c | 6 +- + arch/x86/include/asm/pgtable.h | 58 +- + arch/x86/include/asm/pgtable_types.h | 16 +- + arch/x86/kernel/cpu/sgx/virt.c | 3 +- + arch/x86/kvm/vmx/vmx.c | 2 +- + arch/x86/mm/init_64.c | 134 +-- + arch/x86/virt/hw.c | 2 +- + drivers/accel/amdxdna/aie2_ctx.c | 23 +- + drivers/base/memory.c | 9 + + drivers/block/zram/zram_drv.c | 26 +- + drivers/block/zram/zram_drv.h | 3 +- + drivers/dax/bus.h | 2 + + drivers/dax/kmem.c | 506 ++++++++-- + drivers/gpu/drm/drm_gem.c | 2 +- + drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- + drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- + drivers/gpu/drm/drm_gpusvm.c | 60 +- + drivers/gpu/drm/etnaviv/etnaviv_gem.c | 5 +- + drivers/gpu/drm/exynos/exynos_drm_gem.c | 6 +- + drivers/gpu/drm/gma500/gem.c | 2 +- + drivers/gpu/drm/i915/gem/i915_gem_mman.c | 12 +- + drivers/gpu/drm/msm/msm_gem.c | 5 +- + drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- + drivers/gpu/drm/nouveau/nouveau_svm.c | 20 +- + drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- + drivers/gpu/drm/omapdrm/omap_gem.c | 11 +- + drivers/gpu/drm/panthor/panthor_gem.c | 2 +- + drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- + drivers/gpu/drm/tegra/gem.c | 5 +- + drivers/gpu/drm/ttm/ttm_bo_vm.c | 7 +- + drivers/gpu/drm/virtio/virtgpu_vram.c | 2 +- + drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 2 +- + drivers/gpu/drm/xe/xe_device.c | 2 +- + drivers/gpu/drm/xe/xe_mmio_gem.c | 2 +- + drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- + drivers/hv/mshv_regions.c | 54 +- + drivers/infiniband/core/umem_odp.c | 18 +- + drivers/misc/sgi-xp/xpc_uv.c | 5 +- + drivers/net/ethernet/fungible/funeth/funeth_rx.c | 2 +- + drivers/vfio/pci/nvgrace-gpu/main.c | 3 +- + drivers/vfio/pci/vfio_pci_core.c | 3 +- + drivers/video/fbdev/core/fb_io_fops.c | 2 +- + fs/aio.c | 2 +- + fs/binfmt_elf.c | 7 +- + fs/dax.c | 2 +- + fs/hugetlbfs/inode.c | 23 +- + fs/proc/page.c | 56 +- + fs/proc/task_mmu.c | 119 ++- + include/asm-generic/fixmap.h | 4 +- + include/asm-generic/getorder.h | 4 +- + include/asm-generic/hugetlb.h | 18 +- + include/asm-generic/memory_model.h | 6 +- + include/asm-generic/mmu.h | 2 +- + include/asm-generic/pgtable-nop4d.h | 4 +- + include/asm-generic/pgtable-nopmd.h | 4 +- + include/asm-generic/pgtable-nopud.h | 4 +- + include/asm-generic/pgtable_uffd.h | 32 +- + include/linux/alloc_tag.h | 4 +- + include/linux/backing-dev.h | 2 - + include/linux/bootmem_info.h | 89 -- + include/linux/compaction.h | 3 +- + include/linux/cpuset.h | 4 +- + include/linux/damon.h | 177 ++-- + include/linux/gfp.h | 55 +- + include/linux/gfp_types.h | 12 +- + include/linux/hmm.h | 2 + + include/linux/huge_mm.h | 56 +- + include/linux/hugetlb.h | 57 +- + include/linux/hugetlb_cgroup.h | 2 +- + include/linux/leafops.h | 32 +- + include/linux/memfd.h | 6 +- + include/linux/memory.h | 27 + + include/linux/memory_hotplug.h | 14 + + include/linux/migrate.h | 8 +- + include/linux/migrate_mode.h | 1 + + include/linux/mm.h | 277 ++++-- + include/linux/mm_inline.h | 57 +- + include/linux/mm_types.h | 3 + + include/linux/mmap_lock.h | 8 + + include/linux/mmzone.h | 43 +- + include/linux/oom.h | 2 +- + include/linux/page-flags.h | 14 - + include/linux/page_owner.h | 7 +- + include/linux/pagemap.h | 35 +- + include/linux/percpu-defs.h | 4 +- + include/linux/percpu-refcount.h | 5 +- + include/linux/pfn.h | 2 +- + include/linux/pgtable.h | 71 +- + include/linux/radix-tree.h | 5 +- + include/linux/sched/mm.h | 13 +- + include/linux/skbuff.h | 2 +- + include/linux/swap.h | 83 +- + include/linux/swapops.h | 10 +- + include/linux/userfaultfd_k.h | 106 +- + include/linux/vmalloc.h | 4 +- + include/linux/vmpressure.h | 48 +- + include/linux/writeback.h | 2 +- + include/trace/events/damon.h | 8 +- + include/trace/events/huge_memory.h | 2 +- + include/trace/events/migrate.h | 11 +- + include/trace/events/mmflags.h | 17 +- + include/trace/events/pagemap.h | 8 + + include/uapi/linux/fs.h | 1 + + include/uapi/linux/mempolicy.h | 2 +- + include/uapi/linux/userfaultfd.h | 54 +- + init/Kconfig | 10 +- + ipc/shm.c | 3 +- + kernel/cgroup/cpuset.c | 15 +- + kernel/dma/coherent.c | 7 +- + kernel/dma/direct.c | 6 +- + kernel/dma/mapping.c | 8 +- + kernel/dma/ops_helpers.c | 4 +- + kernel/events/core.c | 20 +- + kernel/events/uprobes.c | 13 +- + kernel/kcov.c | 2 +- + kernel/liveupdate/kexec_handover.c | 3 +- + kernel/trace/ring_buffer.c | 3 +- + lib/Kconfig.debug | 28 - + lib/Makefile | 1 - + lib/maple_tree.c | 8 +- + lib/percpu-refcount.c | 2 +- + lib/test_hmm.c | 109 ++- + lib/test_hmm_uapi.h | 1 + + mm/Kconfig | 20 +- + mm/Kconfig.debug | 28 + + mm/Makefile | 4 +- + mm/alloc_tag.c | 1020 ++++++++++++++++++++ + mm/bootmem_info.c | 72 -- + mm/cma.c | 4 +- + mm/compaction.c | 106 +- + mm/damon/core.c | 662 ++++++++----- + mm/damon/lru_sort.c | 13 +- + mm/damon/ops-common.c | 9 +- + mm/damon/paddr.c | 38 +- + mm/damon/reclaim.c | 11 +- + mm/damon/stat.c | 2 +- + mm/damon/sysfs-schemes.c | 31 +- + mm/damon/sysfs.c | 200 ++-- + mm/damon/tests/core-kunit.h | 275 +++++- + mm/damon/tests/vaddr-kunit.h | 5 + + mm/damon/vaddr.c | 44 +- + mm/debug.c | 7 +- + mm/debug_vm_pgtable.c | 16 +- + mm/early_ioremap.c | 10 +- + mm/execmem.c | 1 + + mm/filemap.c | 50 +- + mm/{swap.c => folio.c} | 68 +- + mm/gup.c | 13 +- + mm/hmm.c | 280 ++++-- + mm/huge_memory.c | 227 +++-- + mm/hugetlb.c | 723 ++++++++------ + mm/hugetlb_cma.c | 44 +- + mm/hugetlb_cma.h | 8 +- + mm/hugetlb_vmemmap.c | 141 +-- + mm/hugetlb_vmemmap.h | 5 - + mm/internal.h | 612 +++--------- + mm/interval_tree.c | 111 ++- + mm/kasan/hw_tags.c | 2 +- + mm/khugepaged.c | 85 +- + mm/kmemleak.c | 91 +- + mm/kmsan/hooks.c | 1 + + mm/kmsan/init.c | 2 +- + mm/kmsan/shadow.c | 1 + + mm/ksm.c | 97 +- + mm/madvise.c | 16 +- + mm/mapping_dirty_helpers.c | 2 +- + mm/memblock.c | 1 + + mm/memcontrol-v1.c | 309 +++++- + mm/memcontrol-v1.h | 6 - + mm/memcontrol.c | 48 +- + mm/memfd.c | 16 +- + mm/memory-failure.c | 119 ++- + mm/memory.c | 332 +++++-- + mm/memory_hotplug.c | 166 +++- + mm/mempolicy.c | 32 +- + mm/migrate.c | 97 +- + mm/migrate_device.c | 42 +- + mm/mincore.c | 75 +- + mm/mlock.c | 101 +- + mm/mm_init.c | 90 +- + mm/mm_init.h | 120 +++ + mm/mm_slot.h | 11 + + mm/mmap.c | 205 ++-- + mm/mmu_notifier.c | 2 +- + mm/mmzone.c | 5 +- + mm/mprotect.c | 117 ++- + mm/mremap.c | 67 +- + mm/mseal.c | 170 ++-- + mm/msync.c | 4 +- + mm/nommu.c | 64 +- + mm/page-writeback.c | 10 - + mm/page_alloc.c | 504 ++++++---- + mm/page_alloc.h | 312 ++++++ + mm/page_frag_cache.c | 6 +- + mm/page_isolation.c | 1 + + mm/page_owner.c | 303 ++++-- + mm/page_reporting.c | 1 + + mm/page_table_check.c | 8 +- + mm/page_vma_mapped.c | 8 +- + mm/pagewalk.c | 4 +- + mm/percpu-km.c | 9 +- + mm/percpu-vm.c | 49 +- + mm/percpu.c | 20 +- + mm/rmap.c | 481 ++++----- + mm/secretmem.c | 2 +- + mm/shmem.c | 30 +- + mm/show_mem.c | 10 +- + mm/shuffle.c | 1 + + mm/slab.h | 2 +- + mm/slub.c | 17 +- + mm/sparse-vmemmap.c | 28 +- + mm/sparse.c | 53 +- + mm/sparse.h | 63 ++ + mm/swap.h | 6 +- + mm/swap_state.c | 52 +- + mm/swapfile.c | 31 +- + mm/userfaultfd.c | 393 +++++++- + mm/util.c | 14 +- + mm/vma.c | 309 ++++-- + mm/vma.h | 88 +- + mm/vma_exec.c | 32 +- + mm/vma_init.c | 6 +- + mm/vma_internal.h | 4 +- + mm/vmalloc.c | 32 +- + mm/vmalloc.h | 46 + + mm/vmpressure.c | 301 +----- + mm/vmscan.c | 89 +- + mm/vmstat.c | 3 +- + mm/zsmalloc.c | 243 ++++- + samples/damon/Kconfig | 2 +- + samples/damon/mtier.c | 9 +- + samples/damon/prcl.c | 9 +- + samples/damon/wsse.c | 9 +- + scripts/gdb/linux/page_owner.py | 4 +- + sound/core/memalloc.c | 2 +- + tools/include/linux/gfp_types.h | 7 - + tools/include/uapi/linux/fs.h | 1 + + tools/include/uapi/linux/userfaultfd.h | 54 +- + tools/mm/.gitignore | 1 + + tools/mm/Makefile | 4 +- + tools/mm/page_owner_filter.c | 310 ++++++ + tools/mm/page_owner_sort.c | 87 +- + tools/testing/memblock/internal.h | 20 - + tools/testing/memblock/mm_init.h | 24 + + tools/testing/selftests/Makefile | 1 + + tools/testing/selftests/damon/Makefile | 1 + + tools/testing/selftests/damon/_damon_sysfs.py | 23 +- + .../selftests/damon/damos_apply_interval.py | 2 +- + tools/testing/selftests/damon/damos_quota_goal.py | 2 +- + .../testing/selftests/damon/damos_tried_regions.py | 4 +- + .../selftests/damon/drgn_dump_damon_status.py | 3 +- + tools/testing/selftests/damon/sysfs.py | 35 +- + tools/testing/selftests/damon/sysfs.sh | 79 +- + tools/testing/selftests/damon/sysfs_refresh.py | 75 ++ + ..._update_schemes_tried_regions_wss_estimation.py | 2 +- + tools/testing/selftests/dax/Makefile | 6 + + tools/testing/selftests/dax/config | 4 + + tools/testing/selftests/dax/dax-kmem-hotplug.sh | 317 ++++++ + tools/testing/selftests/dax/settings | 1 + + tools/testing/selftests/mincore/mincore_selftest.c | 12 +- + tools/testing/selftests/mm/Makefile | 1 - + tools/testing/selftests/mm/gup_longterm.c | 2 +- + tools/testing/selftests/mm/hmm-tests.c | 792 +++++++-------- + tools/testing/selftests/mm/hugepage_settings.c | 2 +- + tools/testing/selftests/mm/hugetlb-vmemmap.c | 132 --- + tools/testing/selftests/mm/ksm_tests.c | 28 +- + tools/testing/selftests/mm/memory-failure.c | 44 +- + tools/testing/selftests/mm/mremap_dontunmap.c | 2 +- + tools/testing/selftests/mm/mseal_test.c | 106 +- + tools/testing/selftests/mm/pagemap_ioctl.c | 126 ++- + tools/testing/selftests/mm/pkey-helpers.h | 4 +- + tools/testing/selftests/mm/pkey-powerpc.h | 2 +- + tools/testing/selftests/mm/pkey_sighandler_tests.c | 115 ++- + tools/testing/selftests/mm/pkey_util.c | 90 ++ + tools/testing/selftests/mm/protection_keys.c | 99 +- + tools/testing/selftests/mm/rmap.c | 81 ++ + tools/testing/selftests/mm/run_vmtests.sh | 3 +- + tools/testing/selftests/mm/thuge-gen.c | 15 +- + tools/testing/selftests/mm/uffd-common.c | 9 +- + tools/testing/selftests/mm/uffd-unit-tests.c | 919 ++++++++++++++++++ + tools/testing/selftests/mm/vm_util.c | 26 +- + tools/testing/selftests/mm/vm_util.h | 1 + + tools/testing/vma/Makefile | 2 +- + tools/testing/vma/include/dup.h | 52 +- + tools/testing/vma/include/stubs.h | 16 +- + tools/testing/vma/shared.c | 9 - + tools/testing/vma/shared.h | 43 +- + tools/testing/vma/tests/merge.c | 40 +- + tools/testing/vma/vma_internal.h | 4 +- + virt/kvm/guest_memfd.c | 2 +- + 339 files changed, 12508 insertions(+), 6365 deletions(-) + delete mode 100644 include/linux/bootmem_info.h + create mode 100644 mm/alloc_tag.c + delete mode 100644 mm/bootmem_info.c + rename mm/{swap.c => folio.c} (95%) + create mode 100644 mm/mm_init.h + create mode 100644 mm/page_alloc.h + create mode 100644 mm/sparse.h + create mode 100644 mm/vmalloc.h + create mode 100644 tools/mm/page_owner_filter.c + create mode 100644 tools/testing/memblock/mm_init.h + create mode 100755 tools/testing/selftests/damon/sysfs_refresh.py + create mode 100644 tools/testing/selftests/dax/Makefile + create mode 100644 tools/testing/selftests/dax/config + create mode 100755 tools/testing/selftests/dax/dax-kmem-hotplug.sh + create mode 100644 tools/testing/selftests/dax/settings + delete mode 100644 tools/testing/selftests/mm/hugetlb-vmemmap.c +Merging mm-nonmm-stable/mm-nonmm-stable (eef628bce8e18 mailmap: fix bouncing address for Taniya Das) +$ git merge -m Merge branch 'mm-nonmm-stable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-nonmm-stable/mm-nonmm-stable +Auto-merging .mailmap +Auto-merging MAINTAINERS +Auto-merging fs/fat/inode.c +Auto-merging fs/fat/misc.c +Auto-merging fs/ocfs2/namei.c +Auto-merging include/linux/nmi.h +Auto-merging include/linux/sched.h +Auto-merging kernel/fork.c +Auto-merging kernel/kcov.c +Auto-merging lib/Kconfig.debug +Auto-merging lib/test_hmm.c +Auto-merging tools/mm/page_owner_sort.c +Merge made by the 'ort' strategy. + .get_maintainer.ignore | 1 + + .mailmap | 6 +- + MAINTAINERS | 2 + + drivers/gpu/drm/drm_modeset_lock.c | 4 - + drivers/infiniband/hw/cxgb4/mem.c | 10 +- + drivers/pps/clients/pps-gpio.c | 66 ++-- + drivers/pps/kc.c | 10 + + drivers/pps/pps.c | 10 +- + drivers/rapidio/devices/rio_mport_cdev.c | 10 +- + drivers/rapidio/rio-scan.c | 1 + + fs/fat/inode.c | 5 +- + fs/fat/misc.c | 4 + + fs/fat/nfs.c | 4 +- + fs/ocfs2/acl.c | 141 +++++--- + fs/ocfs2/acl.h | 19 +- + fs/ocfs2/cluster/heartbeat.c | 383 +++++++++++++++------ + fs/ocfs2/cluster/heartbeat.h | 5 + + fs/ocfs2/cluster/nodemanager.c | 29 +- + fs/ocfs2/cluster/nodemanager.h | 3 + + fs/ocfs2/cluster/tcp.c | 186 ++++++++-- + fs/ocfs2/cluster/tcp.h | 2 + + fs/ocfs2/dir.c | 93 ++++- + fs/ocfs2/dlm/dlmmaster.c | 6 + + fs/ocfs2/dlm/dlmrecovery.c | 9 + + fs/ocfs2/inode.c | 22 +- + fs/ocfs2/namei.c | 34 +- + fs/ocfs2/refcounttree.c | 47 ++- + fs/ocfs2/suballoc.c | 2 +- + fs/ocfs2/xattr.c | 324 ++++++++++++++--- + fs/ocfs2/xattr.h | 11 +- + fs/squashfs/cache.c | 116 ++++++- + fs/squashfs/squashfs_fs_sb.h | 9 + + include/linux/list.h | 15 +- + include/linux/llist.h | 2 +- + include/linux/nmi.h | 4 +- + include/linux/pps_kernel.h | 1 + + include/linux/rbtree.h | 2 +- + include/linux/rbtree_latch.h | 2 +- + include/linux/sched.h | 8 + + include/linux/stacktrace.h | 6 +- + include/linux/taskstats_kern.h | 1 - + ipc/ipc_sysctl.c | 2 +- + kernel/fork.c | 2 +- + kernel/kcov.c | 90 ++--- + kernel/params.c | 4 +- + kernel/resource.c | 2 +- + kernel/signal.c | 76 ++-- + kernel/sys.c | 2 +- + kernel/taskstats.c | 45 +-- + kernel/watchdog.c | 16 +- + lib/Kconfig | 6 - + lib/Kconfig.debug | 39 ++- + lib/interval_tree_test.c | 4 +- + lib/math/tests/Makefile | 1 + + lib/math/tests/polynomial_kunit.c | 270 +++++++++++++++ + lib/raid/Kconfig | 12 + + lib/raid/raid6/Makefile | 2 + + lib/raid/raid6/algos.c | 102 +++--- + lib/raid/raid6/tests/raid6_kunit.c | 66 +++- + lib/raid/xor/Makefile | 2 + + lib/raid/xor/tests/Makefile | 2 + + lib/raid/xor/tests/xor_kunit.c | 64 +++- + lib/raid/xor/xor-core.c | 55 ++- + lib/random32.c | 184 +--------- + lib/string.c | 3 +- + lib/test_hmm.c | 6 - + lib/tests/Makefile | 3 +- + lib/tests/random32_kunit.c | 182 ++++++++++ + lib/ucs2_string.c | 38 +- + lib/xz/xz_dec_bcj.c | 2 +- + lib/xz/xz_dec_lzma2.c | 63 ++-- + lib/xz/xz_dec_stream.c | 4 +- + lib/xz/xz_lzma2.h | 2 +- + scripts/checkpatch.pl | 7 + + tools/accounting/delaytop.c | 2 +- + tools/accounting/getdelays.c | 32 +- + tools/include/linux/compiler.h | 2 +- + tools/mm/page_owner_sort.c | 10 +- + tools/testing/selftests/acct/.gitignore | 1 + + tools/testing/selftests/acct/Makefile | 11 + + tools/testing/selftests/acct/cgroupstats.c | 231 +++++++++++++ + tools/testing/selftests/acct/netlink_helper.c | 116 +++++++ + tools/testing/selftests/acct/netlink_helper.h | 44 +++ + .../selftests/acct/taskstats_fill_stats_tgid.c | 134 +------ + tools/testing/selftests/ipc/msgque.c | 2 +- + .../selftests/prctl/set-anon-vma-name-test.c | 21 +- + 86 files changed, 2590 insertions(+), 989 deletions(-) + create mode 100644 lib/math/tests/polynomial_kunit.c + create mode 100644 lib/tests/random32_kunit.c + create mode 100644 tools/testing/selftests/acct/cgroupstats.c + create mode 100644 tools/testing/selftests/acct/netlink_helper.c + create mode 100644 tools/testing/selftests/acct/netlink_helper.h +Merging mm-unstable/mm-unstable (4b2ae13f3393e selftests/mm: check stat() return value in khugepaged get_finfo()) +$ git merge -m Merge branch 'mm-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable/mm-unstable +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging Documentation/filesystems/fscrypt.rst +Auto-merging Documentation/filesystems/locking.rst +Auto-merging Documentation/filesystems/vfs.rst +Auto-merging MAINTAINERS +Auto-merging arch/riscv/include/asm/pgtable.h +Auto-merging arch/sh/Kconfig +Auto-merging arch/sh/kernel/cpu/sh4a/setup-shx3.c +Auto-merging drivers/base/Kconfig +Auto-merging drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +Auto-merging drivers/gpu/drm/drm_gem_shmem_helper.c +Auto-merging drivers/gpu/drm/panthor/panthor_gem.c +Auto-merging drivers/gpu/drm/xe/xe_device.c +Auto-merging fs/smb/client/file.c +Auto-merging include/linux/fs.h +Auto-merging include/linux/sched.h +Auto-merging include/rv/da_monitor.h +Auto-merging init/Kconfig +Auto-merging kernel/events/uprobes.c +Auto-merging kernel/locking/lockdep.c +Auto-merging lib/Kconfig.debug +Auto-merging lib/test_hmm.c +Auto-merging mm/arch_numa.c +Auto-merging mm/hugetlb.c +Auto-merging mm/memory.c +Auto-merging mm/mm_init.c +Auto-merging mm/shmem.c +Auto-merging tools/testing/selftests/Makefile +Merge made by the 'ort' strategy. + Documentation/admin-guide/blockdev/zram.rst | 40 +- + Documentation/admin-guide/kernel-parameters.txt | 16 +- + Documentation/admin-guide/mm/transhuge.rst | 6 +- + Documentation/core-api/maple_tree.rst | 21 +- + Documentation/dev-tools/kmemleak.rst | 10 + + Documentation/filesystems/fscrypt.rst | 4 + + Documentation/filesystems/locking.rst | 8 +- + Documentation/filesystems/vfs.rst | 8 +- + Documentation/mm/allocation-profiling.rst | 16 + + Documentation/mm/ksm.rst | 4 +- + Documentation/mm/page_migration.rst | 6 +- + Documentation/translations/zh_CN/mm/ksm.rst | 4 +- + Documentation/userspace-api/ioctl/ioctl-number.rst | 2 + + MAINTAINERS | 6 + + arch/riscv/include/asm/cacheflush.h | 15 +- + arch/riscv/include/asm/pgtable.h | 9 +- + arch/riscv/kernel/entry.S | 11 +- + arch/s390/mm/gmap_helpers.c | 2 +- + arch/sh/Kconfig | 12 - + arch/sh/configs/migor_defconfig | 1 - + arch/sh/configs/sdk7786_defconfig | 1 - + arch/sh/configs/se7722_defconfig | 1 - + arch/sh/configs/shx3_defconfig | 1 - + arch/sh/configs/ul2_defconfig | 1 - + arch/sh/include/asm/mmu.h | 2 + + arch/sh/include/asm/mmzone.h | 42 -- + arch/sh/include/asm/setup.h | 3 + + arch/sh/include/asm/sparsemem.h | 12 - + arch/sh/include/asm/topology.h | 13 - + arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 5 - + arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 7 - + arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 1 - + arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 - + arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 5 - + arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 7 - + arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 5 - + arch/sh/kernel/cpu/sh4a/setup-shx3.c | 18 - + arch/sh/kernel/setup.c | 7 - + arch/sh/kernel/topology.c | 12 - + arch/sh/kernel/vmcore_info.c | 4 - + arch/sh/mm/Kconfig | 29 - + arch/sh/mm/Makefile | 1 - + arch/sh/mm/init.c | 24 - + arch/sh/mm/numa.c | 53 -- + arch/sh/mm/sram.c | 3 +- + drivers/base/Kconfig | 7 - + drivers/base/Makefile | 1 - + drivers/block/zram/backend_842.c | 10 + + drivers/block/zram/backend_deflate.c | 25 +- + drivers/block/zram/backend_lz4.c | 10 +- + drivers/block/zram/backend_lz4hc.c | 16 +- + drivers/block/zram/backend_lzo.c | 10 + + drivers/block/zram/backend_lzorle.c | 10 + + drivers/block/zram/backend_zstd.c | 11 +- + drivers/block/zram/zram_drv.c | 188 ++++--- + drivers/block/zram/zram_drv.h | 14 + + drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 +- + drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- + drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- + drivers/gpu/drm/panthor/panthor_gem.c | 2 +- + drivers/gpu/drm/ttm/ttm_backup.c | 2 +- + drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 +- + drivers/gpu/drm/xe/xe_device.c | 2 +- + fs/nfs/direct.c | 20 - + fs/nfs/file.c | 44 +- + fs/proc/task_mmu.c | 2 +- + fs/ramfs/file-nommu.c | 3 + + fs/smb/client/file.c | 65 ++- + include/linux/codetag.h | 2 + + include/linux/execmem.h | 2 +- + include/linux/fs.h | 1 - + include/linux/lockdep.h | 3 + + include/linux/lockdep_types.h | 3 +- + include/linux/maple_tree.h | 14 +- + include/linux/memcontrol.h | 21 +- + include/linux/mm.h | 136 ++++- + include/linux/mm_types.h | 40 +- + include/linux/mmzone.h | 16 +- + include/linux/nfs_fs.h | 1 - + include/linux/page_ext.h | 5 - + include/linux/pagemap.h | 40 +- + include/linux/percpu-defs.h | 7 +- + include/linux/rmap.h | 11 +- + include/linux/sched.h | 1 + + include/linux/shmem_fs.h | 5 +- + include/linux/swap.h | 30 +- + include/linux/swap_ops.h | 44 ++ + include/linux/swapops.h | 7 +- + include/linux/vm_event_item.h | 4 + + include/linux/vmalloc.h | 2 +- + include/linux/vmstat.h | 17 +- + include/rv/da_monitor.h | 2 +- + include/uapi/linux/alloc_tag.h | 99 ++++ + init/Kconfig | 7 - + kernel/events/uprobes.c | 2 +- + kernel/locking/lockdep.c | 58 +- + lib/Kconfig.debug | 15 - + lib/codetag.c | 18 + + lib/maple_tree.c | 366 +++++++++---- + lib/test_hmm.c | 5 +- + lib/xarray.c | 3 + + mm/Kconfig | 22 +- + mm/Kconfig.debug | 1 - + mm/Makefile | 1 + + mm/alloc_tag.c | 351 ++++++++++++- + {drivers/base => mm}/arch_numa.c | 12 + + mm/cma.c | 2 +- + mm/cma.h | 1 + + mm/debug_page_alloc.c | 8 +- + mm/folio-compat.c | 1 + + mm/folio.c | 115 ++-- + mm/gup.c | 23 +- + mm/gup_test.c | 94 ++-- + mm/hmm.c | 5 +- + mm/huge_memory.c | 46 +- + mm/hugetlb.c | 26 +- + mm/hugetlb_cma.c | 142 ++++- + mm/hugetlb_cma.h | 2 + + mm/internal.h | 77 ++- + mm/interval_tree.c | 4 +- + mm/kasan/quarantine.c | 12 +- + mm/khugepaged.c | 136 ++--- + mm/kmemleak.c | 105 +++- + mm/ksm.c | 16 +- + mm/madvise.c | 17 +- + mm/memcontrol-v1.c | 4 +- + mm/memcontrol-v1.h | 1 + + mm/memcontrol.c | 69 ++- + mm/memory-failure.c | 4 +- + mm/memory.c | 140 +++-- + mm/mempolicy.c | 23 +- + mm/migrate.c | 21 +- + mm/migrate_device.c | 15 +- + mm/mm_init.c | 1 - + mm/mmzone.c | 1 + + mm/mremap.c | 8 +- + mm/nommu.c | 4 + + mm/page-writeback.c | 5 + + mm/page_alloc.c | 28 +- + mm/page_ext.c | 9 - + mm/page_io.c | 583 ++++++++++----------- + mm/page_reporting.c | 28 +- + mm/page_vma_mapped.c | 6 +- + mm/pgalloc-track.h | 3 + + mm/rmap.c | 43 +- + mm/shmem.c | 29 +- + mm/show_mem.c | 12 +- + mm/shuffle.h | 2 + + mm/sparse.c | 18 +- + mm/sparse.h | 6 + + mm/swap.h | 67 ++- + mm/swap_state.c | 54 +- + mm/swapfile.c | 24 +- + mm/userfaultfd.c | 4 +- + mm/vma.c | 113 ++-- + mm/vma.h | 93 ++-- + mm/vma_exec.c | 2 +- + mm/vma_init.c | 1 + + mm/vmalloc.c | 71 ++- + mm/vmalloc.h | 2 + + mm/vmscan.c | 227 +++++--- + mm/vmstat.c | 19 +- + mm/workingset.c | 5 - + mm/zsmalloc.c | 11 +- + mm/zswap.c | 46 +- + tools/testing/radix-tree/maple.c | 4 +- + tools/testing/selftests/Makefile | 1 + + tools/testing/selftests/alloc_tag/Makefile | 8 + + .../selftests/alloc_tag/allocinfo_ioctl_test.c | 548 +++++++++++++++++++ + .../selftests/cgroup/lib/include/cgroup_util.h | 1 + + tools/testing/selftests/cgroup/test_zswap.c | 13 +- + tools/testing/selftests/mm/.gitignore | 76 +-- + tools/testing/selftests/mm/Makefile | 7 +- + tools/testing/selftests/mm/check_config.sh | 2 +- + tools/testing/selftests/mm/compaction_test.c | 38 +- + tools/testing/selftests/mm/cow.c | 11 +- + tools/testing/selftests/mm/folio_split_race_test.c | 2 +- + tools/testing/selftests/mm/guard-regions.c | 10 +- + tools/testing/selftests/mm/gup_longterm.c | 2 +- + tools/testing/selftests/mm/khugepaged.c | 204 +++++-- + .../testing/selftests/mm/ksft_kmemleak_confirm.sh | 130 +++++ + tools/testing/selftests/mm/memory-failure.c | 14 +- + tools/testing/selftests/mm/merge.c | 57 ++ + tools/testing/selftests/mm/migration.c | 37 +- + tools/testing/selftests/mm/mseal_test.c | 3 +- + tools/testing/selftests/mm/pagemap_ioctl.c | 8 +- + tools/testing/selftests/mm/prctl_thp_disable.c | 2 +- + tools/testing/selftests/mm/run_vmtests.sh | 2 + + tools/testing/selftests/mm/soft-dirty.c | 5 +- + tools/testing/selftests/mm/split_huge_page_test.c | 139 +---- + tools/testing/selftests/mm/uffd-common.c | 4 +- + tools/testing/selftests/mm/vm_util.c | 231 +++++++- + tools/testing/selftests/mm/vm_util.h | 8 +- + tools/testing/selftests/proc/proc-maps-race.c | 3 +- + tools/testing/vma/include/dup.h | 64 ++- + tools/testing/vma/shared.c | 3 +- + tools/testing/vma/tests/merge.c | 49 +- + tools/testing/vma/tests/vma.c | 50 +- + tools/testing/vma/vma_internal.h | 1 + + 199 files changed, 4583 insertions(+), 2073 deletions(-) + delete mode 100644 arch/sh/include/asm/mmzone.h + delete mode 100644 arch/sh/include/asm/sparsemem.h + delete mode 100644 arch/sh/mm/numa.c + create mode 100644 include/linux/swap_ops.h + create mode 100644 include/uapi/linux/alloc_tag.h + rename {drivers/base => mm}/arch_numa.c (95%) + create mode 100644 tools/testing/selftests/alloc_tag/Makefile + create mode 100644 tools/testing/selftests/alloc_tag/allocinfo_ioctl_test.c + create mode 100755 tools/testing/selftests/mm/ksft_kmemleak_confirm.sh +$ git am -3 ../patches/0001-mm-Fix-up-build-for-uninitialised-pte.patch +Applying: mm: Fix up build for uninitialised pte +Using index info to reconstruct a base tree... +M mm/khugepaged.c +Falling back to patching base and 3-way merge... +Auto-merging mm/khugepaged.c +No changes -- Patch already applied. +Merging mm-nonmm-unstable/mm-nonmm-unstable (775c0f72566e8 checkpatch: skip CamelCase cache for --no-tree without root) +$ git merge -m Merge branch 'mm-nonmm-unstable' of https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-nonmm-unstable/mm-nonmm-unstable +Merge made by the 'ort' strategy. + drivers/media/v4l2-core/v4l2-vp9.c | 30 +++++++++++++++--------------- + kernel/taskstats.c | 4 ++++ + scripts/checkpatch.pl | 2 ++ + 3 files changed, 21 insertions(+), 15 deletions(-) +Merging kbuild/kbuild-for-next (d900723d78ade modpost: use mod_warn() and mod_error(), clean up logging) +$ git merge -m Merge branch 'kbuild-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild/kbuild-for-next +Already up to date. +Merging clang-format/clang-format (8f0b4cce4481f Linux 6.19-rc1) +$ git merge -m Merge branch 'clang-format' of https://github.com/ojeda/linux.git clang-format/clang-format +Already up to date. +Merging perf/perf-tools-next (9453bc6a69ef4 perf vendor events arm64: Fix Tegra410 Olympus event 0x0197) +$ git merge -m Merge branch 'perf-tools-next' of https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf/perf-tools-next +Merge made by the 'ort' strategy. + Documentation/trace/hisi-ptt.rst | 28 +- + tools/bpf/resolve_btfids/Makefile | 3 - + tools/build/Makefile.feature | 2 - + tools/build/feature/Makefile | 14 - + tools/lib/api/Makefile | 4 - + tools/lib/api/fd/array.c | 17 +- + tools/lib/bpf/Makefile | 8 +- + tools/lib/subcmd/Makefile | 4 - + tools/lib/symbol/Makefile | 4 - + tools/perf/.clang-format | 9 +- + tools/perf/Documentation/perf-c2c.txt | 71 + + tools/perf/Documentation/perf-sched.txt | 6 + + tools/perf/Documentation/perf-stat.txt | 3 + + tools/perf/Documentation/perf-test.txt | 6 +- + tools/perf/Documentation/perf-trace.txt | 4 + + tools/perf/Documentation/topdown.txt | 4 +- + tools/perf/Makefile.perf | 37 +- + tools/perf/arch/arm/util/cs-etm.c | 10 +- + tools/perf/arch/arm64/util/arm-spe.c | 8 +- + tools/perf/arch/arm64/util/hisi-ptt.c | 2 +- + tools/perf/arch/x86/tests/amd-ibs-period.c | 20 +- + tools/perf/arch/x86/tests/hybrid.c | 22 +- + tools/perf/arch/x86/tests/topdown.c | 4 +- + tools/perf/arch/x86/util/auxtrace.c | 2 +- + tools/perf/arch/x86/util/intel-bts.c | 6 +- + tools/perf/arch/x86/util/intel-pt.c | 9 +- + tools/perf/arch/x86/util/iostat.c | 14 +- + tools/perf/bench/evlist-open-close.c | 29 +- + tools/perf/builtin-annotate.c | 7 +- + tools/perf/builtin-c2c.c | 221 +- + tools/perf/builtin-ftrace.c | 32 +- + tools/perf/builtin-inject.c | 9 +- + tools/perf/builtin-kvm.c | 130 +- + tools/perf/builtin-kwork.c | 8 +- + tools/perf/builtin-lock.c | 4 +- + tools/perf/builtin-record.c | 148 +- + tools/perf/builtin-report.c | 13 +- + tools/perf/builtin-sched.c | 404 ++- + tools/perf/builtin-script.c | 16 +- + tools/perf/builtin-stat.c | 124 +- + tools/perf/builtin-timechart.c | 212 +- + tools/perf/builtin-top.c | 106 +- + tools/perf/builtin-trace.c | 202 +- + .../pmu-events/arch/arm64/nvidia/t410/metrics.json | 28 +- + .../pmu-events/arch/arm64/nvidia/t410/misc.json | 6 +- + .../arch/common/common/legacy-hardware.json | 2 +- + .../pmu-events/arch/x86/alderlake/adl-metrics.json | 80 +- + .../perf/pmu-events/arch/x86/alderlake/cache.json | 36 + + .../arch/x86/alderlake/metricgroups.json | 2 +- + .../pmu-events/arch/x86/alderlake/pipeline.json | 6 +- + .../perf/pmu-events/arch/x86/alderlaken/cache.json | 32 + + .../arch/x86/amdzen5/floating-point.json | 160 +- + .../pmu-events/arch/x86/amdzen5/load-store.json | 8 +- + .../arch/x86/amdzen6/floating-point.json | 34 +- + .../pmu-events/arch/x86/arrowlake/arl-metrics.json | 152 +- + .../perf/pmu-events/arch/x86/arrowlake/cache.json | 30 +- + .../arch/x86/arrowlake/floating-point.json | 45 + + .../perf/pmu-events/arch/x86/arrowlake/memory.json | 18 + + .../arch/x86/arrowlake/metricgroups.json | 2 +- + .../pmu-events/arch/x86/arrowlake/pipeline.json | 131 +- + .../arch/x86/arrowlake/uncore-memory.json | 84 +- + .../arch/x86/clearwaterforest/memory.json | 33 + + .../arch/x86/clearwaterforest/pipeline.json | 19 + + .../x86/clearwaterforest/uncore-interconnect.json | 10 + + .../arch/x86/clearwaterforest/uncore-memory.json | 2 +- + .../pmu-events/arch/x86/emeraldrapids/cache.json | 9 + + .../arch/x86/emeraldrapids/emr-metrics.json | 135 +- + .../arch/x86/emeraldrapids/metricgroups.json | 2 +- + .../perf/pmu-events/arch/x86/grandridge/cache.json | 25 + + .../pmu-events/arch/x86/grandridge/counter.json | 42 - + .../arch/x86/grandridge/floating-point.json | 56 + + .../pmu-events/arch/x86/grandridge/memory.json | 57 + + .../pmu-events/arch/x86/grandridge/pipeline.json | 140 ++ + .../arch/x86/grandridge/uncore-memory.json | 2 +- + .../arch/x86/grandridge/virtual-memory.json | 8 + + .../arch/x86/graniterapids/gnr-metrics.json | 102 +- + .../arch/x86/graniterapids/metricgroups.json | 2 +- + .../arch/x86/graniterapids/pipeline.json | 2 +- + .../x86/graniterapids/uncore-interconnect.json | 10 + + .../arch/x86/graniterapids/uncore-memory.json | 2 +- + .../perf/pmu-events/arch/x86/lunarlake/cache.json | 2 +- + .../pmu-events/arch/x86/lunarlake/lnl-metrics.json | 142 +- + .../arch/x86/lunarlake/metricgroups.json | 2 +- + .../pmu-events/arch/x86/lunarlake/pipeline.json | 29 +- + .../arch/x86/lunarlake/uncore-memory.json | 208 +- + tools/perf/pmu-events/arch/x86/mapfile.csv | 25 +- + .../perf/pmu-events/arch/x86/meteorlake/cache.json | 11 +- + .../arch/x86/meteorlake/metricgroups.json | 2 +- + .../arch/x86/meteorlake/mtl-metrics.json | 88 +- + .../pmu-events/arch/x86/meteorlake/pipeline.json | 4 +- + .../arch/x86/meteorlake/uncore-memory.json | 84 +- + tools/perf/pmu-events/arch/x86/novalake/cache.json | 749 ++++++ + .../perf/pmu-events/arch/x86/novalake/counter.json | 17 + + .../arch/x86/novalake/floating-point.json | 452 ++++ + .../pmu-events/arch/x86/novalake/frontend.json | 600 +++++ + .../perf/pmu-events/arch/x86/novalake/memory.json | 299 +++ + tools/perf/pmu-events/arch/x86/novalake/other.json | 144 ++ + .../pmu-events/arch/x86/novalake/pipeline.json | 1976 +++++++++++++++ + .../arch/x86/novalake/uncore-memory.json | 42 + + .../arch/x86/novalake/virtual-memory.json | 338 +++ + .../pmu-events/arch/x86/pantherlake/counter.json | 5 + + .../pmu-events/arch/x86/pantherlake/pipeline.json | 31 +- + .../arch/x86/pantherlake/uncore-interconnect.json | 10 + + .../arch/x86/pantherlake/uncore-memory.json | 221 +- + .../pmu-events/arch/x86/sierraforest/counter.json | 77 - + .../arch/x86/sierraforest/uncore-interconnect.json | 10 + + .../arch/x86/sierraforest/uncore-memory.json | 2 +- + tools/perf/pmu-events/empty-pmu-events.c | 362 +-- + tools/perf/pmu-events/jevents.py | 122 +- + tools/perf/pmu-events/metric.py | 23 +- + tools/perf/python/perf.pyi | 672 +++++ + tools/perf/python/perf_live.py | 59 + + tools/perf/scripts/install-build-deps.sh | 603 +++++ + tools/perf/scripts/python/arm-cs-trace-disasm.py | 9 +- + tools/perf/scripts/python/powerpc-hcalls.py | 137 +- + tools/perf/tests/backward-ring-buffer.c | 26 +- + tools/perf/tests/builtin-test.c | 192 +- + tools/perf/tests/code-reading.c | 14 +- + tools/perf/tests/event-times.c | 6 +- + tools/perf/tests/event_update.c | 4 +- + tools/perf/tests/evsel-roundtrip-name.c | 8 +- + tools/perf/tests/evsel-tp-sched.c | 4 +- + tools/perf/tests/expand-cgroup.c | 15 +- + tools/perf/tests/hists_cumulate.c | 2 +- + tools/perf/tests/hists_filter.c | 2 +- + tools/perf/tests/hists_link.c | 2 +- + tools/perf/tests/hists_output.c | 2 +- + tools/perf/tests/hwmon_pmu.c | 7 +- + tools/perf/tests/keep-tracking.c | 10 +- + tools/perf/tests/mmap-basic.c | 24 +- + tools/perf/tests/openat-syscall-all-cpus.c | 6 +- + tools/perf/tests/openat-syscall-tp-fields.c | 26 +- + tools/perf/tests/openat-syscall.c | 6 +- + tools/perf/tests/parse-events.c | 150 +- + tools/perf/tests/parse-metric.c | 11 +- + tools/perf/tests/parse-no-sample-id-all.c | 2 +- + tools/perf/tests/perf-record.c | 38 +- + tools/perf/tests/perf-time-to-tsc.c | 12 +- + tools/perf/tests/pfm.c | 12 +- + tools/perf/tests/pmu-events.c | 21 +- + tools/perf/tests/pmu.c | 4 +- + tools/perf/tests/sample-parsing.c | 84 +- + tools/perf/tests/shell/coresight/callchain.sh | 172 ++ + .../shell/coresight/test_arm_coresight_disasm.sh | 4 +- + tools/perf/tests/shell/inject_aslr.sh | 10 +- + tools/perf/tests/shell/jitdump-python.sh | 69 +- + tools/perf/tests/shell/kvm.sh | 71 +- + .../perf/tests/shell/lib/perf_metric_validation.py | 11 +- + tools/perf/tests/shell/lib/perf_record.sh | 58 + + tools/perf/tests/shell/lib/setup_python.sh | 13 + + tools/perf/tests/shell/lock_contention.sh | 33 +- + tools/perf/tests/shell/pipe_test.sh | 4 +- + .../shell/record+zstd_comp_decomp_multi_record.sh | 63 + + tools/perf/tests/shell/record.sh | 216 +- + tools/perf/tests/shell/record_lbr.sh | 50 +- + tools/perf/tests/shell/record_offcpu.sh | 14 +- + tools/perf/tests/shell/sched.sh | 29 + + tools/perf/tests/shell/stat.sh | 58 + + tools/perf/tests/shell/stat_all_metrics.sh | 77 +- + tools/perf/tests/shell/stat_bpf_counters.sh | 28 +- + tools/perf/tests/shell/stat_bpf_counters_cgrp.sh | 15 + + tools/perf/tests/shell/stat_metrics_values.sh | 9 +- + tools/perf/tests/shell/test_brstack.sh | 99 +- + .../tests/shell/test_dwarf_unwind_multithreaded.sh | 65 + + tools/perf/tests/shell/timechart.sh | 24 +- + tools/perf/tests/shell/trace_record_replay.sh | 38 +- + tools/perf/tests/sw-clock.c | 20 +- + tools/perf/tests/switch-tracking.c | 11 +- + tools/perf/tests/task-exit.c | 20 +- + tools/perf/tests/tests.h | 1 + + tools/perf/tests/time-utils-test.c | 14 +- + tools/perf/tests/tool_pmu.c | 7 +- + tools/perf/tests/topology.c | 4 +- + tools/perf/tests/uncore-event-sorting.c | 6 +- + tools/perf/tests/workloads/Build | 2 + + tools/perf/tests/workloads/callchain.c | 33 + + tools/perf/tests/workloads/noploop.c | 17 +- + tools/perf/tests/workloads/thloop.c | 16 +- + tools/perf/ui/browsers/Build | 1 + + tools/perf/ui/browsers/annotate.c | 4 +- + tools/perf/ui/browsers/c2c-function.c | 209 ++ + tools/perf/ui/browsers/hists.c | 201 +- + tools/perf/util/Build | 3 +- + tools/perf/util/amd-sample-raw.c | 2 +- + tools/perf/util/annotate-data.c | 2 +- + tools/perf/util/annotate.c | 61 +- + tools/perf/util/annotate.h | 3 +- + tools/perf/util/arm-spe.c | 4 + + tools/perf/util/aslr.c | 1 + + tools/perf/util/auxtrace.c | 29 +- + tools/perf/util/block-info.c | 4 +- + tools/perf/util/bpf-event.c | 3 +- + tools/perf/util/bpf-filter.c | 22 +- + tools/perf/util/bpf_counter.c | 2 +- + tools/perf/util/bpf_counter_cgroup.c | 14 +- + tools/perf/util/bpf_ftrace.c | 9 +- + tools/perf/util/bpf_lock_contention.c | 12 +- + tools/perf/util/bpf_off_cpu.c | 44 +- + .../util/bpf_skel/augmented_raw_syscalls.bpf.c | 155 +- + tools/perf/util/bpf_trace_augment.c | 8 +- + tools/perf/util/c2c-function.c | 1642 ++++++++++++ + tools/perf/util/c2c.c | 21 + + tools/perf/util/c2c.h | 135 + + tools/perf/util/cap.c | 4 +- + tools/perf/util/cap.h | 3 +- + tools/perf/util/capstone.c | 62 +- + tools/perf/util/cgroup.c | 26 +- + tools/perf/util/compress.h | 6 +- + tools/perf/util/cs-etm.c | 418 ++-- + tools/perf/util/data-convert-bt.c | 2 +- + tools/perf/util/data-convert-json.c | 1 + + tools/perf/util/data.c | 27 +- + tools/perf/util/data.h | 4 +- + tools/perf/util/disasm.c | 8 +- + tools/perf/util/dso.c | 48 +- + tools/perf/util/dso.h | 57 +- + tools/perf/util/evlist.c | 509 ++-- + tools/perf/util/evlist.h | 273 +- + tools/perf/util/evsel.c | 163 +- + tools/perf/util/evsel.h | 61 +- + tools/perf/util/expr.c | 2 +- + tools/perf/util/find-map.c | 10 +- + tools/perf/util/header.c | 74 +- + tools/perf/util/header.h | 2 +- + .../util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c | 63 +- + .../util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.h | 14 +- + tools/perf/util/hisi-ptt.c | 24 +- + tools/perf/util/hist.c | 1 + + tools/perf/util/intel-bts.c | 2 +- + tools/perf/util/intel-pt.c | 10 +- + tools/perf/util/intel-tpebs.c | 7 +- + tools/perf/util/iostat.c | 2 +- + tools/perf/util/iostat.h | 2 +- + tools/perf/util/kvm-stat-arch/book3s_hv_exits.h | 4 +- + tools/perf/util/kvm-stat-arch/kvm-stat-powerpc.c | 31 +- + tools/perf/util/kvm-stat-arch/kvm-stat-x86.c | 35 +- + tools/perf/util/kvm-stat.c | 41 + + tools/perf/util/kvm-stat.h | 20 +- + tools/perf/util/libbfd.c | 27 +- + tools/perf/util/libdw.c | 32 +- + tools/perf/util/machine.c | 43 +- + tools/perf/util/map.h | 9 +- + tools/perf/util/metricgroup.c | 45 +- + tools/perf/util/metricgroup.h | 4 +- + tools/perf/util/parse-events.c | 40 +- + tools/perf/util/parse-events.h | 17 +- + tools/perf/util/parse-events.y | 2 +- + tools/perf/util/perf_api_probe.c | 20 +- + tools/perf/util/pfm.c | 4 +- + tools/perf/util/pmu.c | 6 +- + tools/perf/util/pmus.c | 2 + + tools/perf/util/print-events.c | 2 +- + tools/perf/util/probe-file.c | 2 + + tools/perf/util/python.c | 2636 +++++++++++++++++--- + tools/perf/util/record.c | 11 +- + tools/perf/util/s390-sample-raw.c | 22 +- + tools/perf/util/sample-raw.c | 4 +- + tools/perf/util/sample.c | 19 +- + tools/perf/util/session.c | 69 +- + tools/perf/util/session.h | 2 + + tools/perf/util/setup.py | 245 +- + tools/perf/util/sideband_evlist.c | 54 +- + tools/perf/util/sort.c | 78 +- + tools/perf/util/stat-display.c | 9 +- + tools/perf/util/stat-shadow.c | 24 +- + tools/perf/util/stat.c | 22 +- + tools/perf/util/stat.h | 1 + + tools/perf/util/stream.c | 4 +- + tools/perf/util/symbol-elf.c | 11 +- + tools/perf/util/symbol.c | 7 +- + tools/perf/util/symbol.h | 12 + + tools/perf/util/synthetic-events.c | 328 ++- + tools/perf/util/thread-stack.c | 2 +- + tools/perf/util/time-utils.c | 12 +- + tools/perf/util/top.c | 4 +- + tools/perf/util/trace-event-read.c | 54 +- + tools/perf/util/trace-event.c | 11 +- + tools/perf/util/unwind-libdw.c | 24 +- + tools/perf/util/util.c | 12 +- + tools/perf/util/zstd.c | 25 +- + tools/scripts/Makefile.arch | 8 +- + tools/scripts/Makefile.include | 85 +- + tools/testing/selftests/bpf/Makefile | 1 - + 283 files changed, 17987 insertions(+), 3799 deletions(-) + delete mode 100644 tools/perf/pmu-events/arch/x86/grandridge/counter.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/cache.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/counter.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/floating-point.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/frontend.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/memory.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/other.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/pipeline.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/uncore-memory.json + create mode 100644 tools/perf/pmu-events/arch/x86/novalake/virtual-memory.json + create mode 100644 tools/perf/pmu-events/arch/x86/pantherlake/uncore-interconnect.json + delete mode 100644 tools/perf/pmu-events/arch/x86/sierraforest/counter.json + create mode 100644 tools/perf/python/perf.pyi + create mode 100755 tools/perf/python/perf_live.py + create mode 100755 tools/perf/scripts/install-build-deps.sh + create mode 100755 tools/perf/tests/shell/coresight/callchain.sh + create mode 100644 tools/perf/tests/shell/lib/perf_record.sh + create mode 100755 tools/perf/tests/shell/record+zstd_comp_decomp_multi_record.sh + create mode 100755 tools/perf/tests/shell/test_dwarf_unwind_multithreaded.sh + create mode 100644 tools/perf/tests/workloads/callchain.c + create mode 100644 tools/perf/ui/browsers/c2c-function.c + create mode 100644 tools/perf/util/c2c-function.c + create mode 100644 tools/perf/util/c2c.c + create mode 100644 tools/perf/util/c2c.h +Merging compiler-attributes/compiler-attributes (8f0b4cce4481f Linux 6.19-rc1) +$ git merge -m Merge branch 'compiler-attributes' of https://github.com/ojeda/linux.git compiler-attributes/compiler-attributes +Already up to date. +Merging dma-mapping/dma-mapping-for-next (42311aa29e20f Merge branch 'dma-mapping-coco' into dma-mapping-for-next) +$ git merge -m Merge branch 'dma-mapping-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux.git dma-mapping/dma-mapping-for-next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging MAINTAINERS +Auto-merging arch/arm64/mm/init.c +Auto-merging arch/s390/Kconfig +Auto-merging drivers/iommu/dma-iommu.c +Auto-merging kernel/dma/coherent.c +Auto-merging kernel/dma/direct.c +Auto-merging kernel/dma/mapping.c +Merge made by the 'ort' strategy. + Documentation/admin-guide/kernel-parameters.txt | 4 +- + Documentation/core-api/dma-attributes.rst | 29 ++ + Documentation/core-api/swiotlb.rst | 7 +- + MAINTAINERS | 3 +- + arch/arm64/mm/init.c | 5 +- + arch/powerpc/platforms/pseries/cc_platform.c | 1 + + arch/powerpc/platforms/pseries/svm.c | 2 +- + arch/s390/Kconfig | 1 + + arch/s390/mm/init.c | 17 +- + arch/x86/kernel/amd_gart_64.c | 30 +- + arch/x86/kernel/pci-dma.c | 4 +- + drivers/iommu/dma-iommu.c | 89 +++-- + drivers/xen/swiotlb-xen.c | 8 +- + include/linux/dma-direct.h | 20 +- + include/linux/dma-map-ops.h | 3 +- + include/linux/dma-mapping.h | 8 + + include/linux/swiotlb.h | 41 ++- + include/trace/events/dma.h | 3 +- + kernel/dma/Kconfig | 22 ++ + kernel/dma/coherent.c | 10 +- + kernel/dma/direct.c | 331 +++++++++++++----- + kernel/dma/direct.h | 56 +-- + kernel/dma/mapping.c | 25 +- + kernel/dma/pool.c | 237 +++++++++---- + kernel/dma/swiotlb.c | 445 +++++++++++++++++------- + 25 files changed, 980 insertions(+), 421 deletions(-) +Merging asm-generic/master (adbbd9714f805 scripts: headers_install.sh: Remove config leak ignore machinery) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic asm-generic/master +Already up to date. +Merging alpha/alpha-next (d58041d2c63e0 MAINTAINERS: Add Magnus Lindholm as maintainer for alpha port) +$ git merge -m Merge branch 'alpha-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha.git alpha/alpha-next +Already up to date. +Merging arm/for-next (1345e9968d318 Merge branches 'fixes' and 'misc' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux.git arm/for-next +Merge made by the 'ort' strategy. + arch/arm/kernel/entry-armv.S | 13 ++++++++++--- + arch/arm/mm/proc-arm920.S | 2 -- + arch/arm/mm/proc-arm922.S | 2 -- + arch/arm/mm/proc-arm925.S | 2 -- + arch/arm/mm/proc-arm926.S | 2 -- + arch/arm/probes/kprobes/test-core.c | 14 +++----------- + 6 files changed, 13 insertions(+), 22 deletions(-) +Merging arm64/for-next/core (26b77009ee74f Merge branch 'for-next/uapi' into for-next/core) +$ git merge -m Merge branch 'for-next/core' of https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux arm64/for-next/core +Already up to date. +Merging arm-perf/for-next/perf (5936245125f78 perf/arm-cmn: Fix DVM node events) +$ git merge -m Merge branch 'for-next/perf' of https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git arm-perf/for-next/perf +Already up to date. +Merging arm-soc/for-next (ae77d827fb0e6 soc: document merges) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git arm-soc/for-next +Merge made by the 'ort' strategy. + arch/arm/arm-soc-for-next-contents.txt | 175 +++++++++++++++++++++++++++++++++ + 1 file changed, 175 insertions(+) + create mode 100644 arch/arm/arm-soc-for-next-contents.txt +Merging amlogic/for-next (544455a3a844e Merge branch 'v7.3/arm64-dt' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git amlogic/for-next +Merge made by the 'ort' strategy. +Merging asahi-soc/asahi-soc/for-next (8776c12e06211 Merge branch 'apple-soc/dt-7.3' into asahi-soc/for-next) +$ git merge -m Merge branch 'asahi-soc/for-next' of https://github.com/AsahiLinux/linux.git asahi-soc/asahi-soc/for-next +Merge made by the 'ort' strategy. +Merging at91/at91-next (d6e7bce8d4392 Merge branch 'microchip-dt64' into at91-next) +$ git merge -m Merge branch 'at91-next' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git at91/at91-next +Merge made by the 'ort' strategy. + drivers/clk/at91/dt-compat.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) +Merging bmc/for-next (cd7d1ef7d74ed Merge branches 'aspeed/drivers', 'aspeed/arm/dt', 'aspeed/fixes/drivers', 'aspeed/maintainers', 'nuvoton/arm/dt', 'nuvoton/arm/fixes' and 'nuvoton/arm64/dt' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git bmc/for-next +Merge made by the 'ort' strategy. +Merging broadcom/next (fca5276165993 ARM: dts: BCM5301X: panamera: add phy-mode to switch) +$ git merge -m Merge branch 'next' of https://github.com/Broadcom/stblinux.git broadcom/next +Auto-merging arch/arm/boot/dts/broadcom/bcm-ns.dtsi +Auto-merging arch/arm/boot/dts/broadcom/bcm4709-linksys-ea9200.dts +Auto-merging arch/arm/boot/dts/broadcom/bcm47094-linksys-panamera.dts +Merge made by the 'ort' strategy. + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 13 +++++ + .../dts/broadcom/bcm4708-linksys-ea6300-v1.dts | 4 ++ + .../boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts | 18 +++++++ + .../boot/dts/broadcom/bcm4709-linksys-ea9200.dts | 57 ++++++++++++++++++++++ + .../boot/dts/broadcom/bcm4709-netgear-r8000.dts | 12 +++++ + .../boot/dts/broadcom/bcm47094-dlink-dir-890l.dts | 6 ++- + .../dts/broadcom/bcm47094-linksys-panamera.dts | 1 + + arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts | 20 ++++++++ + arch/arm/boot/dts/broadcom/bcm7445.dtsi | 2 +- + 9 files changed, 131 insertions(+), 2 deletions(-) +Merging cix/for-next (a0cffbd8878c5 Merge remote-tracking branch 'cix/dt' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/cix.git cix/for-next +Merge made by the 'ort' strategy. +Merging davinci/davinci/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'davinci/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git davinci/davinci/for-next +Already up to date. +Merging drivers-memory/for-next (96aa6902ff2bf memory: jz4780-nemc: Use dev_err_probe() for clock error) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git drivers-memory/for-next +Already up to date. +Merging fsl/soc_fsl (e14b8d3938809 bus: fsl-mc: drop unused assignment of acpi_device_id::driver_data) +$ git merge -m Merge branch 'soc_fsl' of https://git.kernel.org/pub/scm/linux/kernel/git/chleroy/linux.git fsl/soc_fsl +Already up to date. +Merging imx-mxs/for-next (9400c5b6aa357 Merge branch 'imx/dt64' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/frank.li/linux.git imx-mxs/for-next +Merge made by the 'ort' strategy. +Merging mediatek/for-next (f5be25e697e03 Merge branch 'v7.2-next/dts32' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux.git mediatek/for-next +Auto-merging drivers/soc/mediatek/mt8167-mmsys.h +CONFLICT (content): Merge conflict in drivers/soc/mediatek/mt8167-mmsys.h +Resolved 'drivers/soc/mediatek/mt8167-mmsys.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 03d649eddc396] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux.git +$ git diff -M --stat --summary HEAD^.. + drivers/soc/mediatek/mt8167-mmsys.h | 5 ----- + 1 file changed, 5 deletions(-) +$ git am -3 ../patches/0001-mediatek-Take-the-other-branch.patch +Applying: mediatek: Take the other branch +$ git reset HEAD^ +Unstaged changes after reset: +M drivers/soc/mediatek/mt8167-mmsys.h +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master 31025e1080b93] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux.git + Date: Thu Aug 20 13:35:53 2026 +0100 +Merging mvebu/for-next (5acccc8f8d731 Merge branch 'mvebu/dt64' into mvebu/for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu.git mvebu/for-next +Merge made by the 'ort' strategy. +Merging omap/for-next (ba251bb5ce2db Merge branch 'omap-for-v7.3/drivers' into tmp/omap-next-20260706.114259) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap.git omap/for-next +Merge made by the 'ort' strategy. +Merging qcom/for-next (ed2647532a225 Merge branches 'arm32-for-7.3', 'arm64-defconfig-for-7.3', 'arm64-fixes-for-7.2', 'arm64-for-7.3', 'clk-fixes-for-7.2', 'clk-for-7.3' and 'drivers-for-7.3' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git qcom/for-next +Auto-merging Documentation/devicetree/bindings/clock/qcom,gcc-mdm9607.yaml +Auto-merging Documentation/devicetree/bindings/clock/qcom,qcm2290-gpucc.yaml +Auto-merging drivers/clk/qcom/cambistmclkcc-kaanapali.c +Auto-merging drivers/clk/qcom/cambistmclkcc-sm8750.c +Auto-merging drivers/clk/qcom/camcc-sc8280xp.c +Auto-merging drivers/clk/qcom/camcc-x1p42100.c +Auto-merging drivers/clk/qcom/dispcc-qcm2290.c +Auto-merging drivers/clk/qcom/dispcc-sm8450.c +Auto-merging drivers/clk/qcom/gcc-eliza.c +Auto-merging drivers/clk/qcom/gcc-glymur.c +Auto-merging drivers/clk/qcom/gcc-hawi.c +Auto-merging drivers/clk/qcom/gcc-kaanapali.c +Auto-merging drivers/clk/qcom/gcc-nord.c +Auto-merging drivers/clk/qcom/gcc-qcs8300.c +Auto-merging drivers/clk/qcom/gpucc-glymur.c +Auto-merging drivers/clk/qcom/gpucc-kaanapali.c +Auto-merging drivers/clk/qcom/gpucc-qcm2290.c +Auto-merging drivers/clk/qcom/gxclkctl-kaanapali.c +Auto-merging drivers/clk/qcom/negcc-nord.c +Auto-merging drivers/clk/qcom/nwgcc-nord.c +Auto-merging drivers/clk/qcom/tcsrcc-glymur.c +CONFLICT (content): Merge conflict in drivers/clk/qcom/tcsrcc-glymur.c +Auto-merging drivers/clk/qcom/videocc-glymur.c +Auto-merging drivers/clk/qcom/videocc-x1p42100.c +Resolved 'drivers/clk/qcom/tcsrcc-glymur.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 6f063c6141633] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git +$ git diff -M --stat --summary HEAD^.. + .../devicetree/bindings/clock/qcom,a53pll.yaml | 1 + + .../bindings/clock/qcom,gcc-mdm9607.yaml | 18 +- + .../devicetree/bindings/clock/qcom,glymur-gcc.yaml | 8 + + .../bindings/clock/qcom,glymur-tcsr.yaml | 146 + + .../devicetree/bindings/clock/qcom,hawi-gcc.yaml | 11 +- + .../devicetree/bindings/clock/qcom,hawi-gpucc.yaml | 80 + + .../bindings/clock/qcom,kaanapali-gxclkctl.yaml | 23 +- + .../bindings/clock/qcom,milos-camcc.yaml | 39 +- + .../bindings/clock/qcom,milos-videocc.yaml | 29 +- + .../bindings/clock/qcom,qcm2290-dispcc.yaml | 15 +- + .../bindings/clock/qcom,qcm2290-gpucc.yaml | 4 +- + .../devicetree/bindings/clock/qcom,rpmhcc.yaml | 65 +- + .../bindings/clock/qcom,shikra-audiocorecc.yaml | 55 + + .../bindings/clock/qcom,sm8450-camcc.yaml | 14 +- + .../bindings/clock/qcom,sm8450-gpucc.yaml | 7 + + .../bindings/clock/qcom,sm8450-videocc.yaml | 19 +- + .../bindings/clock/qcom,sm8550-dispcc.yaml | 3 + + .../bindings/clock/qcom,sm8550-tcsr.yaml | 34 +- + .../bindings/reset/qcom,shikra-audiocore-csr.yaml | 42 + + drivers/clk/qcom/Kconfig | 339 +- + drivers/clk/qcom/Makefile | 15 + + drivers/clk/qcom/apss-ipq-pll.c | 19 + + drivers/clk/qcom/audiocorecc-shikra.c | 810 ++++ + drivers/clk/qcom/cambistmclkcc-eliza.c | 464 ++ + drivers/clk/qcom/cambistmclkcc-kaanapali.c | 7 + + drivers/clk/qcom/cambistmclkcc-sm8750.c | 7 + + drivers/clk/qcom/camcc-eliza.c | 2803 +++++++++++++ + drivers/clk/qcom/camcc-glymur.c | 2286 ++++++++++ + drivers/clk/qcom/camcc-nord.c | 2941 +++++++++++++ + drivers/clk/qcom/camcc-sc8280xp.c | 19 - + drivers/clk/qcom/camcc-x1p42100.c | 6 +- + drivers/clk/qcom/clk-alpha-pll.c | 9 + + drivers/clk/qcom/clk-hfpll.c | 4 +- + drivers/clk/qcom/clk-krait.c | 2 +- + drivers/clk/qcom/clk-rcg.c | 4 +- + drivers/clk/qcom/clk-rcg2.c | 2 +- + drivers/clk/qcom/clk-ref.c | 205 + + drivers/clk/qcom/clk-smd-rpm.c | 5 + + drivers/clk/qcom/common.c | 6 +- + drivers/clk/qcom/dispcc-qcm2290.c | 44 +- + drivers/clk/qcom/dispcc-sm8450.c | 40 +- + drivers/clk/qcom/dispcc0-nord.c | 2004 +++++++++ + drivers/clk/qcom/dispcc1-nord.c | 2004 +++++++++ + drivers/clk/qcom/evacc-glymur.c | 454 ++ + drivers/clk/qcom/gcc-eliza.c | 6 +- + drivers/clk/qcom/gcc-glymur.c | 33 +- + drivers/clk/qcom/gcc-hawi.c | 207 +- + drivers/clk/qcom/gcc-ipq5424.c | 11 - + drivers/clk/qcom/gcc-ipq9650.c | 89 + + drivers/clk/qcom/gcc-kaanapali.c | 6 +- + drivers/clk/qcom/gcc-mdm9607.c | 193 +- + drivers/clk/qcom/gcc-msm8916.c | 5 +- + drivers/clk/qcom/gcc-msm8939.c | 9 +- + drivers/clk/qcom/gcc-nord.c | 45 +- + drivers/clk/qcom/gcc-qcm2290.c | 131 +- + drivers/clk/qcom/gcc-qcs8300.c | 111 +- + drivers/clk/qcom/gcc-shikra.c | 4432 ++++++++++++++++++++ + drivers/clk/qcom/gcc-sm6115.c | 7 +- + drivers/clk/qcom/gdsc.c | 47 +- + drivers/clk/qcom/gdsc.h | 1 + + drivers/clk/qcom/gpu2cc-nord.c | 545 +++ + drivers/clk/qcom/gpucc-eliza.c | 606 +++ + drivers/clk/qcom/gpucc-glymur.c | 2 +- + drivers/clk/qcom/gpucc-hawi.c | 477 +++ + drivers/clk/qcom/gpucc-kaanapali.c | 2 +- + drivers/clk/qcom/gpucc-nord.c | 593 +++ + drivers/clk/qcom/gpucc-qcm2290.c | 102 +- + drivers/clk/qcom/gxclkctl-kaanapali.c | 12 +- + drivers/clk/qcom/negcc-nord.c | 75 +- + drivers/clk/qcom/nwgcc-nord.c | 3 + + drivers/clk/qcom/tcsrcc-glymur.c | 477 +-- + drivers/clk/qcom/videocc-eliza.c | 404 ++ + drivers/clk/qcom/videocc-glymur.c | 38 + + drivers/clk/qcom/videocc-hawi.c | 839 ++++ + drivers/clk/qcom/videocc-maili.c | 660 +++ + drivers/clk/qcom/videocc-x1p42100.c | 4 +- + .../dt-bindings/clock/qcom,eliza-cambistmclkcc.h | 32 + + include/dt-bindings/clock/qcom,eliza-camcc.h | 151 + + include/dt-bindings/clock/qcom,eliza-gpucc.h | 51 + + include/dt-bindings/clock/qcom,eliza-videocc.h | 37 + + include/dt-bindings/clock/qcom,gcc-mdm9607.h | 1 - + include/dt-bindings/clock/qcom,hawi-gpucc.h | 47 + + include/dt-bindings/clock/qcom,hawi-videocc.h | 64 + + include/dt-bindings/clock/qcom,ipq9650-gcc.h | 5 + + include/dt-bindings/clock/qcom,maili-gcc.h | 21 + + include/dt-bindings/clock/qcom,maili-videocc.h | 50 + + include/dt-bindings/clock/qcom,nord-camcc.h | 167 + + include/dt-bindings/clock/qcom,nord-dispcc.h | 115 + + include/dt-bindings/clock/qcom,nord-gpu2cc.h | 47 + + include/dt-bindings/clock/qcom,nord-gpucc.h | 48 + + include/dt-bindings/clock/qcom,nord-nwgcc.h | 3 + + include/dt-bindings/clock/qcom,qcs8300-gcc.h | 6 + + .../dt-bindings/clock/qcom,shikra-audiocorecc.h | 49 + + include/linux/clk/qcom.h | 67 + + 94 files changed, 25356 insertions(+), 889 deletions(-) + create mode 100644 Documentation/devicetree/bindings/clock/qcom,glymur-tcsr.yaml + create mode 100644 Documentation/devicetree/bindings/clock/qcom,hawi-gpucc.yaml + create mode 100644 Documentation/devicetree/bindings/clock/qcom,shikra-audiocorecc.yaml + create mode 100644 Documentation/devicetree/bindings/reset/qcom,shikra-audiocore-csr.yaml + create mode 100644 drivers/clk/qcom/audiocorecc-shikra.c + create mode 100644 drivers/clk/qcom/cambistmclkcc-eliza.c + create mode 100644 drivers/clk/qcom/camcc-eliza.c + create mode 100644 drivers/clk/qcom/camcc-glymur.c + create mode 100644 drivers/clk/qcom/camcc-nord.c + create mode 100644 drivers/clk/qcom/clk-ref.c + create mode 100644 drivers/clk/qcom/dispcc0-nord.c + create mode 100644 drivers/clk/qcom/dispcc1-nord.c + create mode 100644 drivers/clk/qcom/evacc-glymur.c + create mode 100644 drivers/clk/qcom/gcc-shikra.c + create mode 100644 drivers/clk/qcom/gpu2cc-nord.c + create mode 100644 drivers/clk/qcom/gpucc-eliza.c + create mode 100644 drivers/clk/qcom/gpucc-hawi.c + create mode 100644 drivers/clk/qcom/gpucc-nord.c + create mode 100644 drivers/clk/qcom/videocc-eliza.c + create mode 100644 drivers/clk/qcom/videocc-hawi.c + create mode 100644 drivers/clk/qcom/videocc-maili.c + create mode 100644 include/dt-bindings/clock/qcom,eliza-cambistmclkcc.h + create mode 100644 include/dt-bindings/clock/qcom,eliza-camcc.h + create mode 100644 include/dt-bindings/clock/qcom,eliza-gpucc.h + create mode 100644 include/dt-bindings/clock/qcom,eliza-videocc.h + create mode 100644 include/dt-bindings/clock/qcom,hawi-gpucc.h + create mode 100644 include/dt-bindings/clock/qcom,hawi-videocc.h + create mode 100644 include/dt-bindings/clock/qcom,maili-gcc.h + create mode 100644 include/dt-bindings/clock/qcom,maili-videocc.h + create mode 100644 include/dt-bindings/clock/qcom,nord-camcc.h + create mode 100644 include/dt-bindings/clock/qcom,nord-dispcc.h + create mode 100644 include/dt-bindings/clock/qcom,nord-gpu2cc.h + create mode 100644 include/dt-bindings/clock/qcom,nord-gpucc.h + create mode 100644 include/dt-bindings/clock/qcom,shikra-audiocorecc.h + create mode 100644 include/linux/clk/qcom.h +Merging realtek/for-next (3c778f0c9fa36 arm64: dts: realtek: Add GPIO support for RTD1625) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/yu_chun/linux.git realtek/for-next +Already up to date. +Merging renesas/next (f9592c355314c Merge branches 'renesas-arm-soc-for-v7.3', 'renesas-drivers-for-v7.3' and 'renesas-dts-for-v7.3' into renesas-next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git renesas/next +Merge made by the 'ort' strategy. +Merging reset/reset/next (d373605cd5148 Merge tag 'reset-fixes-for-v7.0-2' into reset/next) +$ git merge -m Merge branch 'reset/next' of https://git.kernel.org/pub/scm/linux/kernel/git/pza/linux reset/reset/next +Already up to date. +Merging rockchip/for-next (2d578cd590adc Merge branch 'v7.3-clk/next' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git rockchip/for-next +Merge made by the 'ort' strategy. + .../bindings/clock/rockchip,rv1106-cru.yaml | 60 ++ + drivers/clk/rockchip/Kconfig | 7 + + drivers/clk/rockchip/Makefile | 1 + + drivers/clk/rockchip/clk-pll.c | 16 +- + drivers/clk/rockchip/clk-rk3576.c | 15 +- + drivers/clk/rockchip/clk-rk3588.c | 6 +- + drivers/clk/rockchip/clk-rv1106.c | 1099 ++++++++++++++++++++ + drivers/clk/rockchip/clk.h | 8 +- + include/dt-bindings/clock/rockchip,rv1106-cru.h | 306 ++++++ + 9 files changed, 1500 insertions(+), 18 deletions(-) + create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml + create mode 100644 drivers/clk/rockchip/clk-rv1106.c + create mode 100644 include/dt-bindings/clock/rockchip,rv1106-cru.h +Merging samsung-krzk/for-next (acde40ba506aa Merge branch 'next/dt64' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git samsung-krzk/for-next +Auto-merging drivers/clk/samsung/clk-exynos990.c +Auto-merging drivers/clk/samsung/clk.c +Merge made by the 'ort' strategy. + drivers/clk/samsung/clk-cpu.c | 34 +++++++--------- + drivers/clk/samsung/clk-exynos990.c | 24 +++++++----- + drivers/clk/samsung/clk-pll.c | 56 +++++++++++++-------------- + drivers/clk/samsung/clk.c | 11 +++--- + drivers/clk/samsung/clk.h | 4 +- + include/dt-bindings/clock/samsung,exynos990.h | 1 + + 6 files changed, 63 insertions(+), 67 deletions(-) +Merging scmi/for-linux-next (8703affc72639 Merge tag 'scmi-updates-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux) +$ git merge -m Merge branch 'for-linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git scmi/for-linux-next +Merge made by the 'ort' strategy. +Merging sophgo/for-next (76acfee87c74d Merge branch 'dt/arm' into for-next) +$ git merge -m Merge branch 'for-next' of https://github.com/sophgo/linux.git sophgo/for-next +Merge made by the 'ort' strategy. +Merging sophgo-soc/soc-for-next (c8754c7deab4c soc: sophgo: cv1800: rtcsys: New driver (handling RTC only)) +$ git merge -m Merge branch 'soc-for-next' of https://github.com/sophgo/linux.git sophgo-soc/soc-for-next +Already up to date. +Merging spacemit/for-next (3fca3cbc0516b Merge branch 'spacemit-dt-for-next' into spacemit-for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux spacemit/for-next +Merge made by the 'ort' strategy. + drivers/clk/spacemit/ccu-k3.c | 41 +++++++++++++++++--------- + include/dt-bindings/clock/spacemit,k3-clocks.h | 4 +++ + include/soc/spacemit/k3-syscon.h | 3 +- + 3 files changed, 33 insertions(+), 15 deletions(-) +Merging stm32/stm32-next (90d4d470d4d47 arm64: dts: st: Add I/O sync to eth1 pinctrl in stm32mp25-pinctrl.dtsi) +$ git merge -m Merge branch 'stm32-next' of https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32/stm32-next +Auto-merging arch/arm/boot/dts/st/stm32mp135f-dk.dts +Auto-merging arch/arm64/boot/dts/st/stm32mp257f-ev1.dts +Merge made by the 'ort' strategy. + arch/arm/boot/dts/st/stm32mp131.dtsi | 24 ++++++++++ + arch/arm/boot/dts/st/stm32mp135.dtsi | 44 ++++++++--------- + arch/arm/boot/dts/st/stm32mp135f-dk.dts | 16 ++++++- + arch/arm/boot/dts/st/stm32mp15-pinctrl.dtsi | 34 +++++++++++++ + arch/arm/boot/dts/st/stm32mp151.dtsi | 20 ++++---- + .../arm/boot/dts/st/stm32mp153c-lxa-fairytux2.dtsi | 2 +- + arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts | 8 ++-- + arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts | 8 ++-- + arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts | 8 ++-- + arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts | 8 ++-- + arch/arm/boot/dts/st/stm32mp157c-ev1.dts | 8 ++-- + arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts | 2 +- + arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi | 2 +- + arch/arm/boot/dts/st/stm32mp15xx-dkx.dtsi | 34 +++++++++++-- + arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi | 2 + + arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 56 +++++++++++----------- + 16 files changed, 187 insertions(+), 89 deletions(-) +Merging sunxi/sunxi/for-next (859c0e1925332 Merge branch 'sunxi/dt-for-7.3' into sunxi/for-next) +$ git merge -m Merge branch 'sunxi/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/sunxi/for-next +Merge made by the 'ort' strategy. + .../bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 13 +++ + drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 127 +++++++++++++++------ + drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 3 +- + drivers/clk/sunxi-ng/ccu_common.c | 12 +- + drivers/clk/sunxi-ng/ccu_common.h | 1 + + drivers/clk/sunxi-ng/ccu_div.c | 31 ++++- + drivers/clk/sunxi-ng/ccu_div.h | 1 + + drivers/clk/sunxi-ng/ccu_mux.c | 58 +++++----- + include/dt-bindings/clock/sun6i-rtc.h | 4 + + 9 files changed, 176 insertions(+), 74 deletions(-) +Merging tee/next (a3067938fd192 Merge branches 'qcomtee_for_v7.3', 'optee_fix_for_v7.2' and 'jw-korg' into next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee.git tee/next +Merge made by the 'ort' strategy. +Merging tegra/for-next (48713e5ff96a2 Merge branch for-7.3/arm64/dt into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git tegra/for-next +Merge made by the 'ort' strategy. +Merging tenstorrent-dt/tenstorrent-dt-for-next (33583baeb1ba7 dt-bindings: iommu: riscv: Add bindings for Tenstorrent RISC-V IOMMU) +$ git merge -m Merge branch 'tenstorrent-dt-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git tenstorrent-dt/tenstorrent-dt-for-next +Already up to date. +Merging fustini-config/riscv-config-for-next (020e209272bee riscv: defconfig: thead: enable PCA953X GPIO driver) +$ git merge -m Merge branch 'riscv-config-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git fustini-config/riscv-config-for-next +Already up to date. +Merging thead-dt/thead-dt-for-next (15d32aaf6300b riscv: dts: thead: Add remaining Lichee Pi 4A IO expansions) +$ git merge -m Merge branch 'thead-dt-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git thead-dt/thead-dt-for-next +Already up to date. +Merging ti/ti-next (61831b50771af Merge branch 'ti-k3-dts-next' into ti-next) +$ git merge -m Merge branch 'ti-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git ti/ti-next +Auto-merging MAINTAINERS +Merge made by the 'ort' strategy. + MAINTAINERS | 1 + + 1 file changed, 1 insertion(+) +Merging xilinx/for-next (a4ff2be345d0a Merge tag 'v7.3-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6) +$ git merge -m Merge branch 'for-next' of https://github.com/Xilinx/linux-xlnx.git xilinx/for-next +Already up to date. +Merging socfpga/for-next (ff98c9832fd43 arm64: dts: socfpga: use consistent QSPI boot partition label) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git socfpga/for-next +Already up to date. +Merging clk/clk-next (69ea2faeb7831 Merge branch 'clk-pile' into clk-next) +$ git merge -m Merge branch 'clk-next' of https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk/clk-next +Auto-merging CREDITS +Auto-merging MAINTAINERS +Auto-merging arch/arm64/boot/dts/cix/sky1.dtsi +Auto-merging drivers/clk/imx/clk-imx8qxp.c +Auto-merging drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c +Merge made by the 'ort' strategy. + CREDITS | 4 + + .../bindings/clock/amlogic,a9-aoclkc.yaml | 76 + + .../clock/amlogic,a9-peripherals-clkc.yaml | 164 ++ + .../bindings/clock/eswin,eic7700-hspcrg.yaml | 63 + + .../devicetree/bindings/clock/keystone-gate.txt | 27 - + .../bindings/clock/mediatek,mt8173-mfgtop.yaml | 70 + + .../bindings/clock/mediatek,pericfg.yaml | 2 +- + .../bindings/clock/renesas,r8a78000-cpg.yaml | 55 + + .../bindings/clock/renesas,rzv2h-cpg.yaml | 6 + + .../bindings/clock/renesas,versaclock7.yaml | 2 +- + .../devicetree/bindings/clock/silabs,si544.yaml | 10 +- + .../bindings/clock/st,stm32mp21-rcc.yaml | 140 +- + .../bindings/clock/st,stm32mp25-rcc.yaml | 160 +- + .../bindings/clock/ti,keystone,psc-clock.yaml | 60 + + .../devicetree/bindings/clock/ti/apll.txt | 43 - + .../devicetree/bindings/clock/ti/clockdomain.txt | 25 - + .../bindings/clock/ti/ti,apll-clock.yaml | 89 + + .../bindings/clock/ti/ti,clockdomain.yaml | 44 + + .../bindings/clock/ti/ti,gate-clock.yaml | 2 +- + .../bindings/clock/ultrarisc,dp1000-clk.yaml | 60 + + .../bindings/clock/xlnx,clocking-wizard.yaml | 2 +- + .../bindings/remoteproc/ti,keystone-rproc.txt | 2 +- + .../bindings/soc/cix/cix,sky1-audss-cru.yaml | 92 + + .../bindings/soc/mobileye/mobileye,eyeq7h-olb.yaml | 192 ++ + Documentation/driver-api/clk.rst | 58 +- + Documentation/driver-api/driver-model/devres.rst | 1 + + MAINTAINERS | 23 +- + arch/arm64/boot/dts/cix/sky1.dtsi | 18 + + drivers/clk/.kunitconfig | 1 + + drivers/clk/Kconfig | 18 +- + drivers/clk/Makefile | 22 +- + drivers/clk/aspeed/clk-ast2700.c | 10 + + drivers/clk/bcm/clk-kona.c | 3 +- + drivers/clk/cix/Kconfig | 16 + + drivers/clk/cix/Makefile | 3 + + drivers/clk/cix/clk-sky1-audss.c | 1206 +++++++++++ + drivers/clk/clk-bd718x7.c | 12 +- + drivers/clk/clk-cdce706.c | 2 +- + drivers/clk/clk-cdce925.c | 8 +- + drivers/clk/clk-composite.c | 1 + + drivers/clk/clk-conf.c | 76 + + drivers/clk/clk-cs2000-cp.c | 10 +- + drivers/clk/clk-devres.c | 19 +- + drivers/clk/clk-divider.c | 25 +- + drivers/clk/clk-divider_test.c | 153 ++ + drivers/clk/clk-en7523.c | 43 +- + drivers/clk/clk-eyeq.c | 1268 ++++++++---- + drivers/clk/clk-fixed-factor.c | 78 +- + drivers/clk/clk-k230.c | 4 + + drivers/clk/clk-lmk04832.c | 39 +- + drivers/clk/clk-max77686.c | 8 +- + drivers/clk/clk-moxart.c | 14 - + drivers/clk/clk-palmas.c | 24 +- + drivers/clk/clk-renesas-pcie.c | 6 +- + drivers/clk/clk-rp1.c | 8 +- + drivers/clk/clk-s2mps11.c | 12 +- + drivers/clk/clk-scmi-oem.c | 108 + + drivers/clk/clk-scmi.c | 44 +- + drivers/clk/clk-scmi.h | 51 + + drivers/clk/clk-scpi.c | 14 +- + drivers/clk/clk-si514.c | 2 +- + drivers/clk/clk-si521xx.c | 6 +- + drivers/clk/clk-si5341.c | 10 +- + drivers/clk/clk-si5351.c | 8 +- + drivers/clk/clk-si544.c | 82 +- + drivers/clk/clk-si570.c | 8 +- + drivers/clk/clk-versaclock5.c | 16 +- + drivers/clk/clk-versaclock7.c | 6 +- + drivers/clk/clk.c | 112 +- + drivers/clk/clk_test.c | 214 +- + drivers/clk/eswin/Kconfig | 13 + + drivers/clk/eswin/Makefile | 1 + + drivers/clk/eswin/clk-eic7700-hsp.c | 345 ++++ + drivers/clk/eswin/clk-eic7700.c | 3 +- + drivers/clk/eswin/clk.c | 4 +- + drivers/clk/hisilicon/Kconfig | 14 + + drivers/clk/hisilicon/clk-hi3660-stub.c | 22 +- + drivers/clk/hisilicon/reset.c | 2 +- + drivers/clk/imx/clk-imx8mm.c | 6 + + drivers/clk/imx/clk-imx8qxp-lpcg.c | 1 + + drivers/clk/imx/clk-imx8qxp.c | 1 + + drivers/clk/imx/clk-imx95-blk-ctl.c | 21 +- + drivers/clk/imx/clk-pll14xx.c | 119 +- + drivers/clk/imx/clk-scu.c | 24 +- + drivers/clk/imx/clk.h | 1 + + drivers/clk/kunit_clk_assigned_rates.h | 10 + + .../clk/kunit_clk_assigned_rates_u64_multiple.dtso | 6 + + ...t_clk_assigned_rates_u64_multiple_consumer.dtso | 6 + + drivers/clk/kunit_clk_assigned_rates_u64_one.dtso | 3 + + .../kunit_clk_assigned_rates_u64_one_consumer.dtso | 3 + + drivers/clk/kunit_clk_assigned_sscs_multiple.dtso | 20 + + .../kunit_clk_assigned_sscs_multiple_consumer.dtso | 24 + + drivers/clk/kunit_clk_assigned_sscs_null.dtso | 16 + + .../clk/kunit_clk_assigned_sscs_null_consumer.dtso | 20 + + drivers/clk/kunit_clk_assigned_sscs_one.dtso | 16 + + .../clk/kunit_clk_assigned_sscs_one_consumer.dtso | 20 + + drivers/clk/kunit_clk_assigned_sscs_without.dtso | 15 + + .../kunit_clk_assigned_sscs_without_consumer.dtso | 19 + + drivers/clk/kunit_clk_assigned_sscs_zero.dtso | 12 + + .../clk/kunit_clk_assigned_sscs_zero_consumer.dtso | 16 + + drivers/clk/mediatek/Kconfig | 11 + + drivers/clk/mediatek/Makefile | 1 + + drivers/clk/mediatek/clk-mt6735-apmixedsys.c | 5 +- + drivers/clk/mediatek/clk-mt6735-vdecsys.c | 1 + + drivers/clk/mediatek/clk-mt6735-vencsys.c | 1 + + drivers/clk/mediatek/clk-mt8135.c | 5 +- + drivers/clk/mediatek/clk-mt8173-mfgtop.c | 242 +++ + drivers/clk/mediatek/clk-mt8196-vlpckgen.c | 1 - + drivers/clk/mediatek/clk-pllfh.c | 98 +- + drivers/clk/meson/Kconfig | 27 + + drivers/clk/meson/Makefile | 2 + + drivers/clk/meson/a9-aoclk.c | 489 +++++ + drivers/clk/meson/a9-peripherals.c | 2089 ++++++++++++++++++++ + drivers/clk/meson/gxbb.c | 2 +- + drivers/clk/microchip/clk-mpfs.c | 2 +- + drivers/clk/mmp/clk-pxa1908-apbc.c | 2 +- + drivers/clk/mmp/clk-pxa1908-apbcp.c | 2 +- + drivers/clk/mvebu/clk-cpu.c | 2 +- + drivers/clk/mvebu/kirkwood.c | 21 +- + drivers/clk/nuvoton/clk-ma35d1-pll.c | 42 +- + drivers/clk/qcom/clk-rpm.c | 15 +- + drivers/clk/qcom/clk-rpmh.c | 8 +- + drivers/clk/qcom/clk-smd-rpm.c | 13 +- + drivers/clk/renesas/Kconfig | 10 + + drivers/clk/renesas/Makefile | 2 + + drivers/clk/renesas/r8a78000-cpg.c | 166 ++ + drivers/clk/renesas/r9a08g045-cpg.c | 9 + + drivers/clk/renesas/r9a08g046-cpg.c | 130 ++ + drivers/clk/renesas/r9a09g047-cpg.c | 123 +- + drivers/clk/renesas/r9a09g077-cpg.c | 375 +++- + drivers/clk/renesas/renesas-cpg-mssr.c | 20 +- + drivers/clk/renesas/rzg2l-cpg.c | 8 +- + drivers/clk/renesas/rzv2h-cpg-lib.c | 217 ++ + drivers/clk/renesas/rzv2h-cpg.c | 203 -- + drivers/clk/samsung/clk-acpm.c | 18 +- + drivers/clk/samsung/clk.h | 2 +- + drivers/clk/sprd/pll.c | 8 +- + drivers/clk/st/clkgen-pll.c | 20 +- + drivers/clk/stm32/clk-stm32mp21.c | 1 + + drivers/clk/stm32/clk-stm32mp25.c | 1 + + drivers/clk/tegra/clk-bpmp.c | 10 +- + drivers/clk/tegra/clk-pll.c | 1 + + drivers/clk/tegra/clk-tegra114.c | 39 +- + drivers/clk/tegra/clk-tegra124-emc.c | 1 + + drivers/clk/tegra/clk-tegra210.c | 2 +- + drivers/clk/ti/adpll.c | 4 +- + drivers/clk/ti/composite.c | 26 +- + drivers/clk/ti/divider.c | 2 +- + drivers/clk/ti/mux.c | 22 +- + drivers/clk/ultrarisc/Kconfig | 18 + + drivers/clk/ultrarisc/Makefile | 4 + + drivers/clk/ultrarisc/clk-dp1000.c | 154 ++ + drivers/clk/ultrarisc/clk-ultrarisc.c | 399 ++++ + drivers/clk/ultrarisc/clk-ultrarisc.h | 71 + + drivers/clk/visconti/clkc.c | 2 +- + drivers/clk/x86/clk-pmc-atom.c | 3 + + drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 146 +- + drivers/clk/zynq/clkc.c | 8 + + drivers/clk/zynq/pll.c | 8 +- + drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c | 8 +- + drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c | 8 +- + drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c | 23 +- + drivers/reset/Kconfig | 24 + + drivers/reset/Makefile | 2 + + drivers/reset/reset-eic7700-hsp.c | 113 ++ + drivers/reset/reset-eyeq.c | 271 ++- + drivers/reset/reset-sky1-audss.c | 127 ++ + include/dt-bindings/clock/amlogic,a9-aoclkc.h | 76 + + .../clock/amlogic,a9-peripherals-clkc.h | 351 ++++ + include/dt-bindings/clock/aspeed,ast2700-scu.h | 2 + + include/dt-bindings/clock/cix,sky1-audss-cru.h | 60 + + include/dt-bindings/clock/clock.h | 14 + + include/dt-bindings/clock/eswin,eic7700-hspcrg.h | 33 + + include/dt-bindings/clock/mobileye,eyeq7h-clk.h | 119 ++ + include/dt-bindings/clock/mt8173-clk.h | 7 + + include/dt-bindings/clock/renesas,r8a78000-cpg.h | 14 + + .../dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h | 2 + + .../dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h | 2 + + include/dt-bindings/clock/ultrarisc,dp1000-clk.h | 27 + + include/dt-bindings/reset/airoha,en7581-reset.h | 4 + + include/dt-bindings/reset/cix,sky1-audss-cru.h | 25 + + include/dt-bindings/reset/eswin,eic7700-hspcrg.h | 21 + + include/linux/clk-provider.h | 134 +- + include/linux/clk.h | 27 +- + include/linux/clk/renesas.h | 34 +- + 185 files changed, 11331 insertions(+), 1554 deletions(-) + create mode 100644 Documentation/devicetree/bindings/clock/amlogic,a9-aoclkc.yaml + create mode 100644 Documentation/devicetree/bindings/clock/amlogic,a9-peripherals-clkc.yaml + create mode 100644 Documentation/devicetree/bindings/clock/eswin,eic7700-hspcrg.yaml + delete mode 100644 Documentation/devicetree/bindings/clock/keystone-gate.txt + create mode 100644 Documentation/devicetree/bindings/clock/mediatek,mt8173-mfgtop.yaml + create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a78000-cpg.yaml + create mode 100644 Documentation/devicetree/bindings/clock/ti,keystone,psc-clock.yaml + delete mode 100644 Documentation/devicetree/bindings/clock/ti/apll.txt + delete mode 100644 Documentation/devicetree/bindings/clock/ti/clockdomain.txt + create mode 100644 Documentation/devicetree/bindings/clock/ti/ti,apll-clock.yaml + create mode 100644 Documentation/devicetree/bindings/clock/ti/ti,clockdomain.yaml + create mode 100644 Documentation/devicetree/bindings/clock/ultrarisc,dp1000-clk.yaml + create mode 100644 Documentation/devicetree/bindings/soc/cix/cix,sky1-audss-cru.yaml + create mode 100644 Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq7h-olb.yaml + create mode 100644 drivers/clk/cix/Kconfig + create mode 100644 drivers/clk/cix/Makefile + create mode 100644 drivers/clk/cix/clk-sky1-audss.c + create mode 100644 drivers/clk/clk-divider_test.c + create mode 100644 drivers/clk/clk-scmi-oem.c + create mode 100644 drivers/clk/clk-scmi.h + create mode 100644 drivers/clk/eswin/clk-eic7700-hsp.c + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_multiple.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_multiple_consumer.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_null.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_null_consumer.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_one.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_one_consumer.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_without.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_without_consumer.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_zero.dtso + create mode 100644 drivers/clk/kunit_clk_assigned_sscs_zero_consumer.dtso + create mode 100644 drivers/clk/mediatek/clk-mt8173-mfgtop.c + create mode 100644 drivers/clk/meson/a9-aoclk.c + create mode 100644 drivers/clk/meson/a9-peripherals.c + create mode 100644 drivers/clk/renesas/r8a78000-cpg.c + create mode 100644 drivers/clk/renesas/rzv2h-cpg-lib.c + create mode 100644 drivers/clk/ultrarisc/Kconfig + create mode 100644 drivers/clk/ultrarisc/Makefile + create mode 100644 drivers/clk/ultrarisc/clk-dp1000.c + create mode 100644 drivers/clk/ultrarisc/clk-ultrarisc.c + create mode 100644 drivers/clk/ultrarisc/clk-ultrarisc.h + create mode 100644 drivers/reset/reset-eic7700-hsp.c + create mode 100644 drivers/reset/reset-sky1-audss.c + create mode 100644 include/dt-bindings/clock/amlogic,a9-aoclkc.h + create mode 100644 include/dt-bindings/clock/amlogic,a9-peripherals-clkc.h + create mode 100644 include/dt-bindings/clock/cix,sky1-audss-cru.h + create mode 100644 include/dt-bindings/clock/clock.h + create mode 100644 include/dt-bindings/clock/eswin,eic7700-hspcrg.h + create mode 100644 include/dt-bindings/clock/mobileye,eyeq7h-clk.h + create mode 100644 include/dt-bindings/clock/renesas,r8a78000-cpg.h + create mode 100644 include/dt-bindings/clock/ultrarisc,dp1000-clk.h + create mode 100644 include/dt-bindings/reset/cix,sky1-audss-cru.h + create mode 100644 include/dt-bindings/reset/eswin,eic7700-hspcrg.h +Merging clk-imx/for-next (39ec460b56b26 clk: imx95-blk-ctl: Fix REFCLK rise-fall mismatch on i.MX95) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git clk-imx/for-next +Already up to date. +Merging clk-renesas/renesas-clk (0fb9083a6e56f clk: renesas: Add R-Car X5H CPG driver) +$ git merge -m Merge branch 'renesas-clk' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git clk-renesas/renesas-clk +Already up to date. +Merging thead-clk/thead-clk-for-next (b2ee00d0bf4cc clk: thead: allow COMPILE_TEST builds) +$ git merge -m Merge branch 'thead-clk-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux.git thead-clk/thead-clk-for-next +Already up to date. +Merging tenstorrent-clk/tenstorrent-clk-for-next (23c8ebc952849 clk: tenstorrent: Add Atlantis clock controller driver) +$ git merge -m Merge branch 'tenstorrent-clk-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tenstorrent/linux.git tenstorrent-clk/tenstorrent-clk-for-next +Already up to date. +Merging csky/linux-next (abb81e5ce7d99 csky: Fix a4/a5 restoration in syscall trace path) +$ git merge -m Merge branch 'linux-next' of https://github.com/c-sky/csky-linux.git csky/linux-next +Already up to date. +Merging loongarch/loongarch-next (e2a8488684418 Merge branch 'loongarch-kvm' into loongarch-next) +$ git merge -m Merge branch 'loongarch-next' of https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git loongarch/loongarch-next +Auto-merging arch/loongarch/include/asm/pgtable.h +Merge made by the 'ort' strategy. + arch/loongarch/include/asm/inst.h | 25 +++ + arch/loongarch/include/asm/pgtable.h | 9 +- + arch/loongarch/include/asm/ptrace.h | 6 +- + arch/loongarch/kernel/acpi.c | 3 +- + arch/loongarch/kernel/module-sections.c | 6 +- + arch/loongarch/kvm/exit.c | 19 +- + arch/loongarch/kvm/intc/dmsintc.c | 18 +- + arch/loongarch/kvm/intc/eiointc.c | 32 ++-- + arch/loongarch/kvm/intc/ipi.c | 77 ++++---- + arch/loongarch/kvm/intc/pch_pic.c | 12 +- + arch/loongarch/kvm/timer.c | 14 ++ + arch/loongarch/kvm/vcpu.c | 7 +- + arch/loongarch/kvm/vm.c | 4 + + arch/loongarch/mm/init.c | 17 +- + arch/loongarch/net/Makefile | 2 +- + arch/loongarch/net/bpf_jit.c | 197 +++++++++++++-------- + arch/loongarch/net/bpf_jit.h | 2 +- + arch/loongarch/net/bpf_timed_may_goto.S | 47 +++++ + .../selftests/bpf/prog_tests/kptr_xchg_inline.c | 3 +- + tools/testing/selftests/kvm/Makefile.kvm | 3 +- + .../selftests/kvm/include/loongarch/processor.h | 18 ++ + .../selftests/kvm/lib/loongarch/processor.c | 11 +- + tools/testing/selftests/kvm/loongarch/fpu_test.c | 137 ++++++++++++++ + 23 files changed, 494 insertions(+), 175 deletions(-) + create mode 100644 arch/loongarch/net/bpf_timed_may_goto.S + create mode 100644 tools/testing/selftests/kvm/loongarch/fpu_test.c +Merging m68k/for-next (2f8e3cad53b5c m68k: nfcon: Do not call console_is_registered() in nfcon_device()) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git m68k/for-next +Already up to date. +Merging m68knommu/for-next (de0dab22cbf69 m68k: coldfire/5441x: register mcf-rcm-reset platform device) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git m68knommu/for-next +Merge made by the 'ort' strategy. + arch/m68k/coldfire/device.c | 2 +- + arch/m68k/coldfire/m5441x.c | 25 +++++++++++++++++ + arch/m68k/configs/m5235evb_defconfig | 52 ++++++++++++++++++++++++++++++++++++ + arch/m68k/configs/m5282evb_defconfig | 51 +++++++++++++++++++++++++++++++++++ + arch/m68k/include/asm/mcfgpio.h | 2 +- + 5 files changed, 130 insertions(+), 2 deletions(-) + create mode 100644 arch/m68k/configs/m5235evb_defconfig + create mode 100644 arch/m68k/configs/m5282evb_defconfig +Merging microblaze/next (8d3ae59288f1e Linux 7.2) +$ git merge -m Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze.git microblaze/next +Already up to date. +Merging mips/mips-next (3b7711be02612 mips: dts: econet: Describe dual-VPE 34Kc processor) +$ git merge -m Merge branch 'mips-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git mips/mips-next +Auto-merging arch/mips/Kconfig +Auto-merging arch/mips/kernel/ptrace.c +Merge made by the 'ort' strategy. + arch/mips/Kconfig | 1 - + arch/mips/bcm47xx/buttons.c | 444 ++++++++++++++++++-------------- + arch/mips/boot/dts/econet/en751221.dtsi | 7 + + arch/mips/econet/Kconfig | 4 +- + arch/mips/econet/init.c | 42 ++- + arch/mips/include/asm/gio_device.h | 1 - + arch/mips/include/asm/txx9/generic.h | 9 +- + arch/mips/include/asm/txx9/tx4938.h | 1 - + arch/mips/include/asm/txx9pio.h | 3 +- + arch/mips/kernel/gpio_txx9.c | 5 +- + arch/mips/kernel/proc.c | 4 +- + arch/mips/kernel/ptrace.c | 6 +- + arch/mips/txx9/Kconfig | 1 - + arch/mips/txx9/generic/setup.c | 45 ++-- + arch/mips/txx9/generic/setup_tx4938.c | 6 - + arch/mips/txx9/rbtx4927/setup.c | 41 ++- + drivers/bcma/driver_gpio.c | 43 +++- + drivers/ssb/driver_gpio.c | 48 +++- + include/linux/bcma/bcma.h | 2 + + include/linux/ssb/ssb.h | 2 + + 20 files changed, 447 insertions(+), 268 deletions(-) +Merging openrisc/for-next (6620f5e8c11c4 openrisc: drop unneeded semicolon) +$ git merge -m Merge branch 'for-next' of https://github.com/openrisc/linux.git openrisc/for-next +Merge made by the 'ort' strategy. + arch/openrisc/mm/tlb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) +Merging parisc-hd/for-next (8b585431a16cf parisc: eisa: Fix infinite loop when parsing invalid IRQ value) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git parisc-hd/for-next +Merge made by the 'ort' strategy. + arch/parisc/include/asm/serial.h | 8 -------- + arch/parisc/kernel/head.S | 1 + + drivers/parisc/eisa.c | 5 +++++ + drivers/parisc/eisa_eeprom.c | 1 + + drivers/parisc/sba_iommu.c | 21 --------------------- + drivers/parisc/superio.c | 2 +- + include/uapi/linux/personality.h | 1 - + 7 files changed, 8 insertions(+), 31 deletions(-) + delete mode 100644 arch/parisc/include/asm/serial.h +Merging powerpc/next (1304643a1c20b powerpc/pseries/iommu: switch to Default DMA window during kdump) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git powerpc/next +Already up to date. +Merging risc-v/for-next (8da45c93dfa98 RISC-V: hwprobe: Use BIT macro to avoid warnings) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git risc-v/for-next +Already up to date. +Merging riscv-dt/riscv-dt-for-next (82ab962ef6c2a Merge branch 'k230-basic' into riscv-dt-for-next) +$ git merge -m Merge branch 'riscv-dt-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git riscv-dt/riscv-dt-for-next +Already up to date. +Merging riscv-soc/riscv-soc-for-next (8cdeaa50eae8d Linux 7.2-rc2) +$ git merge -m Merge branch 'riscv-soc-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git riscv-soc/riscv-soc-for-next +Already up to date. +Merging s390/for-next (53158917ea1a0 Merge branch 'features' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git s390/for-next +Auto-merging MAINTAINERS +Auto-merging arch/s390/Kconfig +Auto-merging arch/s390/include/asm/hugetlb.h +Auto-merging arch/s390/kernel/syscall.c +Auto-merging arch/s390/kvm/kvm-s390.c +Auto-merging arch/s390/kvm/pv.c +Auto-merging arch/s390/kvm/vsie.c +Auto-merging arch/s390/mm/gmap_helpers.c +Auto-merging arch/s390/mm/init.c +CONFLICT (content): Merge conflict in arch/s390/mm/init.c +Auto-merging include/linux/tick.h +Resolved 'arch/s390/mm/init.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 70d50ed0e6a74] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git +$ git diff -M --stat --summary HEAD^.. + MAINTAINERS | 8 + + arch/s390/Kconfig | 10 ++ + arch/s390/appldata/Makefile | 2 + + arch/s390/configs/debug_defconfig | 4 +- + arch/s390/configs/defconfig | 2 + + arch/s390/crypto/paes_s390.c | 44 +---- + arch/s390/crypto/phmac_s390.c | 25 +-- + arch/s390/hypfs/Makefile | 2 + + arch/s390/include/asm/ap.h | 4 +- + arch/s390/include/asm/asm-extable.h | 4 + + arch/s390/include/asm/cfi.h | 7 + + arch/s390/include/asm/hugetlb.h | 4 +- + arch/s390/include/asm/irqflags.h | 20 ++- + arch/s390/include/asm/percpu.h | 4 +- + arch/s390/include/asm/pkey.h | 16 ++ + arch/s390/include/asm/processor.h | 4 - + arch/s390/include/asm/ptrace.h | 4 +- + arch/s390/include/asm/sclp.h | 3 + + arch/s390/include/asm/thread_info.h | 1 + + arch/s390/include/asm/uv.h | 18 +- + arch/s390/include/asm/word-at-a-time.h | 22 +++ + arch/s390/include/uapi/asm/Kbuild | 1 - + arch/s390/kernel/Makefile | 3 + + arch/s390/kernel/debug.c | 10 +- + arch/s390/kernel/entry.S | 9 +- + arch/s390/kernel/entry.h | 10 +- + arch/s390/kernel/idle.c | 1 - + arch/s390/kernel/ipl.c | 58 ++++--- + arch/s390/kernel/irq.c | 4 - + arch/s390/kernel/irqflags.c | 28 ++++ + arch/s390/kernel/mcount.S | 9 +- + arch/s390/kernel/perf_cpum_cf.c | 222 ++++++++++++++++--------- + arch/s390/kernel/smp.c | 6 +- + arch/s390/kernel/syscall.c | 4 +- + arch/s390/kernel/sysinfo.c | 2 + + arch/s390/kernel/text_amode31.S | 13 +- + arch/s390/kernel/traps.c | 45 ++++- + arch/s390/kernel/uv.c | 67 +++++++- + arch/s390/kernel/vdso/Makefile | 3 +- + arch/s390/kernel/vdso/vdso.lds.S | 11 +- + arch/s390/kvm/gaccess.c | 8 +- + arch/s390/kvm/gmap.c | 4 - + arch/s390/kvm/kvm-s390.c | 1 - + arch/s390/kvm/pv.c | 17 +- + arch/s390/kvm/vsie.c | 1 - + arch/s390/lib/Makefile | 2 + + arch/s390/lib/spinlock.c | 3 + + arch/s390/mm/Makefile | 2 + + arch/s390/mm/cmm.c | 2 - + arch/s390/mm/extable.c | 18 ++ + arch/s390/mm/fault.c | 36 ++-- + arch/s390/mm/gmap_helpers.c | 4 +- + arch/s390/mm/hugetlbpage.c | 10 +- + arch/s390/mm/init.c | 2 +- + arch/s390/mm/maccess.c | 2 +- + arch/s390/mm/pageattr.c | 5 - + arch/s390/mm/pgalloc.c | 1 - + arch/s390/net/Makefile | 3 + + arch/s390/net/bpf_jit_comp.c | 28 +++- + arch/s390/pci/Makefile | 2 + + arch/s390/pci/pci.c | 4 +- + arch/s390/pci/pci_event.c | 205 ++++++++++++----------- + arch/s390/purgatory/Makefile | 2 + + arch/s390/tools/relocs.c | 158 +++++++++++++++++- + drivers/cpuidle/Kconfig | 5 + + drivers/cpuidle/Kconfig.s390 | 11 ++ + drivers/cpuidle/Makefile | 4 + + drivers/cpuidle/cpuidle-s390.c | 115 +++++++++++++ + drivers/s390/char/Makefile | 2 + + drivers/s390/char/con3215.c | 1 + + drivers/s390/char/sclp_pci.c | 3 + + drivers/s390/char/uvdevice.c | 6 +- + drivers/s390/cio/Makefile | 2 + + drivers/s390/cio/css.c | 8 - + drivers/s390/cio/vfio_ccw_drv.c | 1 + + drivers/s390/cio/vfio_ccw_private.h | 3 +- + drivers/s390/crypto/ap_bus.c | 4 +- + drivers/s390/crypto/ap_bus.h | 2 +- + drivers/s390/crypto/ap_card.c | 2 +- + drivers/s390/crypto/pkey_api.c | 290 ++++++++++++++++++--------------- + drivers/s390/virtio/Makefile | 2 + + include/linux/tick.h | 3 - + kernel/time/tick-sched.c | 7 +- + 83 files changed, 1159 insertions(+), 546 deletions(-) + create mode 100644 arch/s390/include/asm/cfi.h + create mode 100644 arch/s390/kernel/irqflags.c + create mode 100644 drivers/cpuidle/Kconfig.s390 + create mode 100644 drivers/cpuidle/cpuidle-s390.c +Merging sh/for-next (b0aa5e4b087b6 sh: Fix fallout from ZERO_PAGE consolidation) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux.git sh/for-next +Already up to date. +Merging sparc/for-next (5b2a3b1a98fb4 sparc: Remove remaining defconfig references to the pktcdvd driver) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc.git sparc/for-next +Already up to date. +Merging uml/next (1590cf0329716 Linux 7.2-rc4) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git uml/next +Already up to date. +Merging xtensa/xtensa-for-next (a7c958e8721eb xtensa: correct CONFIG_XTENSA_CALIBRATE_CCOUNT macro name in comment) +$ git merge -m Merge branch 'xtensa-for-next' of https://github.com/jcmvbkbc/linux-xtensa.git xtensa/xtensa-for-next +Merge made by the 'ort' strategy. + arch/xtensa/include/asm/platform.h | 2 +- + arch/xtensa/platforms/iss/console.c | 5 +++-- + 2 files changed, 4 insertions(+), 3 deletions(-) +Merging fs-next (e928ee2ede92f Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git) +$ git merge -m Merge branch 'fs-next' of linux-next fs-next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging MAINTAINERS +Auto-merging include/linux/fs.h +Auto-merging include/linux/nfs_fs.h +Merge made by the 'ort' strategy. + .../ABI/testing/procfs-nfsd-reply_cache_stats | 38 + + Documentation/ABI/testing/sysfs-fs-f2fs | 10 + + Documentation/admin-guide/kernel-parameters.txt | 20 +- + Documentation/block/ublk.rst | 14 +- + Documentation/filesystems/erofs.rst | 17 + + Documentation/filesystems/ext4/group_descr.rst | 9 +- + Documentation/filesystems/f2fs.rst | 35 + + Documentation/filesystems/fuse/fuse-io-uring.rst | 32 + + Documentation/filesystems/fuse/index.rst | 1 + + .../filesystems/fuse/uapi/fuse-uapi-io-uring.rst | 126 + + Documentation/netlink/specs/nfsd.yaml | 111 + + Documentation/sunrpc/xdr/nfs4_1.x | 258 +- + MAINTAINERS | 7 +- + arch/loongarch/configs/loongson32_defconfig | 1 - + arch/loongarch/configs/loongson64_defconfig | 1 - + arch/mips/configs/bigsur_defconfig | 1 - + arch/mips/configs/ip22_defconfig | 1 - + arch/mips/configs/loongson2k_defconfig | 1 - + drivers/block/ublk_drv.c | 22 +- + drivers/mtd/ubi/attach.c | 4 +- + drivers/mtd/ubi/build.c | 48 +- + drivers/mtd/ubi/cdev.c | 2 +- + drivers/mtd/ubi/fastmap-wl.c | 8 +- + drivers/mtd/ubi/fastmap.c | 6 +- + drivers/mtd/ubi/io.c | 11 +- + drivers/mtd/ubi/ubi.h | 25 +- + drivers/mtd/ubi/wl.c | 54 +- + drivers/tty/tty_io.c | 27 - + fs/btrfs/Kconfig | 1 + + fs/btrfs/acl.c | 4 + + fs/btrfs/block-group.c | 13 +- + fs/btrfs/block-group.h | 4 +- + fs/btrfs/compression.c | 14 +- + fs/btrfs/ctree.c | 36 +- + fs/btrfs/ctree.h | 6 +- + fs/btrfs/defrag.c | 61 +- + fs/btrfs/delayed-inode.c | 12 +- + fs/btrfs/direct-io.c | 210 +- + fs/btrfs/disk-io.c | 153 +- + fs/btrfs/disk-io.h | 2 + + fs/btrfs/extent-io-tree.c | 21 + + fs/btrfs/extent-tree.c | 28 +- + fs/btrfs/extent_io.c | 637 +++- + fs/btrfs/extent_io.h | 29 + + fs/btrfs/fiemap.c | 6 +- + fs/btrfs/file.c | 120 +- + fs/btrfs/fs.c | 19 +- + fs/btrfs/fs.h | 6 +- + fs/btrfs/inode.c | 86 +- + fs/btrfs/ioctl.c | 138 +- + fs/btrfs/messages.c | 10 +- + fs/btrfs/qgroup.c | 26 +- + fs/btrfs/raid56.c | 18 +- + fs/btrfs/raid56.h | 2 +- + fs/btrfs/reflink.c | 111 +- + fs/btrfs/relocation.c | 97 +- + fs/btrfs/root-tree.c | 6 +- + fs/btrfs/scrub.c | 234 +- + fs/btrfs/send.c | 17 +- + fs/btrfs/space-info.c | 2 +- + fs/btrfs/subpage.c | 7 +- + fs/btrfs/subpage.h | 3 +- + fs/btrfs/super.c | 37 +- + fs/btrfs/sysfs.c | 2 +- + fs/btrfs/transaction.c | 36 +- + fs/btrfs/transaction.h | 25 +- + fs/btrfs/tree-log.c | 99 +- + fs/btrfs/verity.c | 18 +- + fs/btrfs/volumes.c | 64 +- + fs/btrfs/volumes.h | 10 +- + fs/buffer.c | 3 + + fs/ecryptfs/crypto.c | 2 +- + fs/ecryptfs/ecryptfs_kernel.h | 15 +- + fs/ecryptfs/keystore.c | 45 +- + fs/ecryptfs/messaging.c | 11 +- + fs/ecryptfs/miscdev.c | 5 +- + fs/ecryptfs/mmap.c | 30 +- + fs/ecryptfs/super.c | 7 + + fs/erofs/data.c | 28 +- + fs/erofs/decompressor.c | 1 + + fs/erofs/fileio.c | 21 + + fs/erofs/internal.h | 14 +- + fs/erofs/super.c | 112 +- + fs/erofs/zdata.c | 25 +- + fs/erofs/zmap.c | 38 +- + fs/exfat/balloc.c | 31 +- + fs/exfat/dir.c | 10 +- + fs/exfat/exfat_fs.h | 8 +- + fs/exfat/file.c | 184 +- + fs/exfat/inode.c | 5 +- + fs/exfat/iomap.c | 11 +- + fs/exfat/namei.c | 27 +- + fs/exfat/super.c | 1 - + fs/ext2/xattr.c | 14 +- + fs/ext4/balloc.c | 4 + + fs/ext4/crypto.c | 40 +- + fs/ext4/dir.c | 20 +- + fs/ext4/ext4.h | 40 +- + fs/ext4/ext4_jbd2.c | 34 +- + fs/ext4/ext4_jbd2.h | 6 +- + fs/ext4/extents.c | 184 +- + fs/ext4/fast_commit.c | 37 +- + fs/ext4/file.c | 151 +- + fs/ext4/ialloc.c | 4 + + fs/ext4/inline.c | 38 +- + fs/ext4/inode.c | 207 +- + fs/ext4/mballoc.c | 21 +- + fs/ext4/migrate.c | 3 +- + fs/ext4/namei.c | 2 + + fs/ext4/orphan.c | 17 +- + fs/ext4/super.c | 32 +- + fs/ext4/xattr.c | 178 +- + fs/ext4/xattr.h | 9 +- + fs/f2fs/checkpoint.c | 27 +- + fs/f2fs/data.c | 50 +- + fs/f2fs/debug.c | 4 - + fs/f2fs/dir.c | 7 +- + fs/f2fs/extent_cache.c | 9 + + fs/f2fs/f2fs.h | 78 +- + fs/f2fs/file.c | 438 ++- + fs/f2fs/gc.c | 102 +- + fs/f2fs/gc.h | 27 +- + fs/f2fs/inline.c | 2 +- + fs/f2fs/inode.c | 224 +- + fs/f2fs/iostat.c | 6 + + fs/f2fs/namei.c | 20 +- + fs/f2fs/node.c | 5 +- + fs/f2fs/recovery.c | 55 +- + fs/f2fs/segment.c | 252 +- + fs/f2fs/segment.h | 36 +- + fs/f2fs/shrinker.c | 3 +- + fs/f2fs/super.c | 59 +- + fs/f2fs/sysfs.c | 32 +- + fs/f2fs/xattr.c | 2 +- + fs/fuse/args.h | 2 + + fs/fuse/cuse.c | 8 +- + fs/fuse/dev.c | 104 +- + fs/fuse/dev.h | 2 +- + fs/fuse/dev_uring.c | 608 +++- + fs/fuse/dev_uring_i.h | 56 +- + fs/fuse/dir.c | 34 +- + fs/fuse/file.c | 6 +- + fs/fuse/fuse_dev_i.h | 5 + + fs/fuse/fuse_i.h | 2 + + fs/fuse/inode.c | 12 +- + fs/fuse/readdir.c | 2 +- + fs/fuse/req_timeout.c | 12 +- + fs/isofs/compress.c | 7 +- + fs/isofs/dir.c | 31 +- + fs/isofs/export.c | 10 +- + fs/isofs/isofs.h | 3 + + fs/isofs/namei.c | 59 +- + fs/jbd2/checkpoint.c | 28 +- + fs/jbd2/journal.c | 1 + + fs/lockd/clntproc.c | 3 + + fs/lockd/lockd.h | 2 +- + fs/lockd/nlm3xdr_gen.c | 30 +- + fs/lockd/nlm3xdr_gen.h | 4 +- + fs/lockd/nlm4xdr_gen.c | 75 +- + fs/lockd/nlm4xdr_gen.h | 4 +- + fs/lockd/share.h | 8 +- + fs/lockd/svc.c | 4 +- + fs/lockd/svc4proc.c | 55 +- + fs/lockd/svclock.c | 42 +- + fs/lockd/svcproc.c | 55 +- + fs/lockd/svcshare.c | 36 +- + fs/lockd/svcsubs.c | 107 +- + fs/nfs/blocklayout/dev.c | 21 +- + fs/nfs/callback.c | 4 +- + fs/nfs/callback_proc.c | 5 +- + fs/nfs/callback_xdr.c | 7 +- + fs/nfs/client.c | 14 +- + fs/nfs/delegation.c | 20 +- + fs/nfs/dir.c | 17 + + fs/nfs/filelayout/filelayoutdev.c | 2 +- + fs/nfs/flexfilelayout/flexfilelayout.c | 26 +- + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 3 +- + fs/nfs/inode.c | 28 +- + fs/nfs/internal.h | 8 +- + fs/nfs/localio.c | 56 +- + fs/nfs/nfs4client.c | 23 +- + fs/nfs/nfs4file.c | 2 + + fs/nfs/nfs4proc.c | 69 +- + fs/nfs/nfs4session.c | 21 +- + fs/nfs/nfs4session.h | 3 +- + fs/nfs/nfs4state.c | 40 +- + fs/nfs/nfs4trace.h | 58 +- + fs/nfs/nfs4xdr.c | 35 +- + fs/nfs/nfstrace.h | 3 +- + fs/nfs/pnfs.c | 57 +- + fs/nfs/pnfs.h | 5 +- + fs/nfs/pnfs_nfs.c | 14 +- + fs/nfs/write.c | 13 +- + fs/nfs_common/nfslocalio.c | 16 +- + fs/nfsd/attr4.h | 162 + + fs/nfsd/auth.c | 19 + + fs/nfsd/auth.h | 6 + + fs/nfsd/cache.h | 3 +- + fs/nfsd/filecache.c | 265 +- + fs/nfsd/filecache.h | 3 + + fs/nfsd/flexfilelayoutxdr.c | 20 +- + fs/nfsd/localio.c | 11 +- + fs/nfsd/lockd.c | 6 +- + fs/nfsd/netlink.c | 5 + + fs/nfsd/netlink.h | 2 + + fs/nfsd/netns.h | 47 +- + fs/nfsd/nfs2acl.c | 55 +- + fs/nfsd/nfs3acl.c | 20 +- + fs/nfsd/nfs3proc.c | 45 +- + fs/nfsd/nfs3xdr.c | 2 +- + fs/nfsd/nfs4callback.c | 229 +- + fs/nfsd/nfs4idmap.c | 1 + + fs/nfsd/nfs4layouts.c | 45 +- + fs/nfsd/nfs4proc.c | 412 ++- + fs/nfsd/nfs4recover.c | 48 +- + fs/nfsd/nfs4state.c | 1281 ++++++-- + fs/nfsd/nfs4xdr.c | 411 ++- + fs/nfsd/nfs4xdr_gen.c | 600 +++- + fs/nfsd/nfs4xdr_gen.h | 20 +- + fs/nfsd/nfscache.c | 8 +- + fs/nfsd/nfsctl.c | 435 ++- + fs/nfsd/nfsd.h | 214 +- + fs/nfsd/nfsfh.c | 44 +- + fs/nfsd/nfsfh.h | 3 + + fs/nfsd/nfsproc.c | 12 +- + fs/nfsd/nfssvc.c | 71 +- + fs/nfsd/nfsxdr.c | 34 +- + fs/nfsd/state.h | 97 +- + fs/nfsd/stats.c | 4 +- + fs/nfsd/stats.h | 86 +- + fs/nfsd/trace.h | 43 +- + fs/nfsd/vfs.c | 63 +- + fs/nfsd/vfs.h | 5 +- + fs/nfsd/xdr.h | 1 + + fs/nfsd/xdr3.h | 1 + + fs/nfsd/xdr4.h | 37 +- + fs/nfsd/xdr4cb.h | 12 + + fs/nilfs2/Kconfig | 2 +- + fs/nilfs2/Makefile | 2 +- + fs/nilfs2/file.c | 40 +- + fs/nilfs2/inode.c | 13 - + fs/nilfs2/iomap.c | 71 + + fs/nilfs2/iomap.h | 13 + + fs/notify/fanotify/fanotify.c | 4 +- + fs/notify/fanotify/fanotify.h | 6 +- + fs/notify/fanotify/fanotify_user.c | 29 +- + fs/notify/inotify/inotify_user.c | 15 +- + fs/ntfs/attrib.c | 36 +- + fs/ntfs/compress.c | 389 +-- + fs/ntfs/dir.c | 5 +- + fs/ntfs/ea.c | 225 +- + fs/ntfs/ea.h | 3 +- + fs/ntfs/file.c | 81 +- + fs/ntfs/index.c | 96 +- + fs/ntfs/inode.c | 85 +- + fs/ntfs/inode.h | 3 +- + fs/ntfs/iomap.c | 66 +- + fs/ntfs/lcnalloc.c | 7 +- + fs/ntfs/mft.c | 15 +- + fs/ntfs/namei.c | 10 +- + fs/ntfs/reparse.c | 13 +- + fs/ntfs/runlist.c | 29 + + fs/ntfs/super.c | 12 +- + fs/ntfs3/attrib.c | 159 +- + fs/ntfs3/attrlist.c | 15 +- + fs/ntfs3/dir.c | 132 +- + fs/ntfs3/file.c | 66 +- + fs/ntfs3/frecord.c | 199 +- + fs/ntfs3/fslog.c | 68 +- + fs/ntfs3/fsntfs.c | 34 +- + fs/ntfs3/index.c | 8 +- + fs/ntfs3/inode.c | 298 +- + fs/ntfs3/lznt.c | 4 +- + fs/ntfs3/namei.c | 64 +- + fs/ntfs3/ntfs.h | 3 +- + fs/ntfs3/ntfs_fs.h | 51 +- + fs/ntfs3/record.c | 34 +- + fs/ntfs3/run.c | 9 +- + fs/ntfs3/super.c | 38 +- + fs/ntfs3/xattr.c | 26 +- + fs/orangefs/devorangefs-req.c | 1 + + fs/orangefs/inode.c | 8 +- + fs/orangefs/orangefs-debugfs.c | 1 + + fs/orangefs/xattr.c | 5 - + fs/quota/Kconfig | 10 - + fs/quota/dquot.c | 81 +- + fs/smb/client/dir.c | 2 + + fs/smb/client/smb2pdu.h | 24 - + fs/smb/common/fscc.h | 15 + + fs/smb/common/smb2pdu.h | 39 +- + fs/smb/common/smb2status.h | 1 + + fs/smb/common/smbfsctl.h | 1 + + fs/smb/common/smbglob.h | 1 + + fs/smb/server/Kconfig | 1 - + fs/smb/server/auth.c | 215 +- + fs/smb/server/auth.h | 4 + + fs/smb/server/compress.c | 76 +- + fs/smb/server/compress.h | 1 + + fs/smb/server/connection.c | 223 +- + fs/smb/server/connection.h | 47 +- + fs/smb/server/ksmbd_netlink.h | 8 +- + fs/smb/server/ksmbd_work.c | 5 + + fs/smb/server/ksmbd_work.h | 14 + + fs/smb/server/mgmt/share_config.c | 65 +- + fs/smb/server/mgmt/share_config.h | 25 + + fs/smb/server/mgmt/tree_connect.c | 2 + + fs/smb/server/mgmt/user_config.c | 18 +- + fs/smb/server/mgmt/user_session.c | 248 +- + fs/smb/server/mgmt/user_session.h | 4 + + fs/smb/server/misc.h | 11 +- + fs/smb/server/oplock.c | 344 ++- + fs/smb/server/oplock.h | 8 +- + fs/smb/server/proc.c | 170 +- + fs/smb/server/server.c | 86 +- + fs/smb/server/server.h | 2 + + fs/smb/server/smb2misc.c | 79 + + fs/smb/server/smb2ops.c | 22 +- + fs/smb/server/smb2pdu.c | 3175 +++++++++++++++++--- + fs/smb/server/smb2pdu.h | 82 + + fs/smb/server/smb_common.c | 17 +- + fs/smb/server/smb_common.h | 2 +- + fs/smb/server/smbacl.c | 115 +- + fs/smb/server/smbacl.h | 3 +- + fs/smb/server/stats.h | 57 +- + fs/smb/server/transport_ipc.c | 27 +- + fs/smb/server/transport_rdma.c | 19 +- + fs/smb/server/transport_rdma.h | 2 + + fs/smb/server/transport_tcp.c | 31 +- + fs/smb/server/vfs.c | 559 +++- + fs/smb/server/vfs.h | 20 +- + fs/smb/server/vfs_cache.c | 280 +- + fs/smb/server/vfs_cache.h | 43 +- + fs/smb/smbdirect/accept.c | 16 +- + fs/smb/smbdirect/connection.c | 13 +- + fs/smb/smbdirect/socket.c | 98 +- + fs/ubifs/auth.c | 2 +- + fs/ubifs/debug.h | 4 +- + fs/ubifs/key.h | 2 +- + fs/ubifs/ubifs.h | 20 +- + fs/udf/balloc.c | 12 +- + fs/udf/inode.c | 162 +- + fs/udf/partition.c | 2 +- + fs/udf/super.c | 23 +- + fs/udf/symlink.c | 2 + + fs/udf/truncate.c | 2 +- + fs/udf/udfdecl.h | 3 +- + include/linux/fs.h | 15 + + include/linux/io_uring/cmd.h | 38 +- + include/linux/io_uring_types.h | 5 + + include/linux/jbd2.h | 11 +- + include/linux/lockd/bind.h | 12 +- + include/linux/nfs4.h | 136 +- + include/linux/nfs_fs.h | 4 + + include/linux/nfs_xdr.h | 8 +- + include/linux/sunrpc/bc_xprt.h | 5 + + include/linux/sunrpc/stats.h | 6 + + include/linux/sunrpc/svc.h | 4 +- + include/linux/sunrpc/svc_rdma_pcl.h | 4 +- + include/linux/sunrpc/xdrgen/_builtins.h | 32 + + include/linux/sunrpc/xdrgen/_defs.h | 2 + + include/linux/sunrpc/xdrgen/nfs4_1.h | 290 +- + include/linux/sunrpc/xdrgen/nlm3.h | 2 +- + include/linux/sunrpc/xdrgen/nlm4.h | 2 +- + include/linux/workqueue.h | 1 + + include/trace/events/btrfs.h | 4 +- + include/trace/events/f2fs.h | 20 +- + include/uapi/linux/f2fs.h | 7 + + include/uapi/linux/fuse.h | 63 +- + include/uapi/linux/nfs4.h | 2 - + include/uapi/linux/nfsd_netlink.h | 36 + + include/uapi/mtd/ubi-user.h | 10 +- + io_uring/io_uring.c | 2 +- + io_uring/rsrc.c | 131 +- + io_uring/rsrc.h | 5 - + kernel/workqueue.c | 24 + + net/sunrpc/auth_gss/auth_gss.c | 6 +- + net/sunrpc/auth_gss/gss_krb5_unseal.c | 3 + + net/sunrpc/auth_gss/gss_krb5_wrap.c | 13 +- + net/sunrpc/auth_gss/gss_rpc_upcall.c | 6 - + net/sunrpc/auth_gss/gss_rpc_upcall.h | 1 - + net/sunrpc/auth_gss/gss_rpc_xdr.c | 15 +- + net/sunrpc/auth_gss/svcauth_gss.c | 8 +- + net/sunrpc/backchannel_rqst.c | 38 +- + net/sunrpc/cache.c | 7 +- + net/sunrpc/clnt.c | 22 +- + net/sunrpc/rpcb_clnt.c | 4 + + net/sunrpc/stats.c | 2 +- + net/sunrpc/sunrpc_syms.c | 1 + + net/sunrpc/svc.c | 495 +-- + net/sunrpc/svc_xprt.c | 6 +- + net/sunrpc/svcauth_unix.c | 4 +- + net/sunrpc/xdr.c | 2 +- + net/sunrpc/xprtrdma/ib_client.c | 42 +- + net/sunrpc/xprtrdma/svc_rdma_pcl.c | 63 +- + net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 24 +- + net/sunrpc/xprtrdma/svc_rdma_rw.c | 52 +- + net/sunrpc/xprtrdma/svc_rdma_sendto.c | 47 +- + net/sunrpc/xprtrdma/svc_rdma_transport.c | 69 +- + net/sunrpc/xprtsock.c | 32 +- + tools/net/sunrpc/xdrgen/generators/program.py | 8 + + tools/net/sunrpc/xdrgen/subcmds/declarations.py | 10 +- + tools/net/sunrpc/xdrgen/subcmds/definitions.py | 7 +- + tools/net/sunrpc/xdrgen/subcmds/lint.py | 7 +- + tools/net/sunrpc/xdrgen/subcmds/source.py | 7 +- + .../xdrgen/templates/C/enum/declaration/enum.j2 | 1 + + .../xdrgen/templates/C/pointer/encoder/string.j2 | 2 + + .../C/pointer/encoder/variable_length_opaque.j2 | 2 + + .../xdrgen/templates/C/program/decoder/argument.j2 | 4 - + .../xdrgen/templates/C/program/encoder/result.j2 | 4 - + .../xdrgen/templates/C/struct/encoder/string.j2 | 2 + + .../C/struct/encoder/variable_length_opaque.j2 | 2 + + .../xdrgen/templates/C/union/definition/close.j2 | 6 - + .../xdrgen/tests/bad-procedure-number-negative.x | 20 + + .../xdrgen/tests/bad-procedure-number-too-large.x | 20 + + .../xdrgen/tests/bad-program-number-negative.x | 19 + + .../xdrgen/tests/bad-program-number-too-large.x | 19 + + .../xdrgen/tests/bad-version-number-negative.x | 19 + + .../xdrgen/tests/bad-version-number-too-large.x | 19 + + tools/net/sunrpc/xdrgen/xdr_ast.py | 290 +- + tools/net/sunrpc/xdrgen/xdr_parse.py | 46 +- + 420 files changed, 18934 insertions(+), 5869 deletions(-) + create mode 100644 Documentation/ABI/testing/procfs-nfsd-reply_cache_stats + create mode 100644 Documentation/filesystems/fuse/uapi/fuse-uapi-io-uring.rst + create mode 100644 fs/nfsd/attr4.h + create mode 100644 fs/nilfs2/iomap.c + create mode 100644 fs/nilfs2/iomap.h + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-procedure-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-procedure-number-too-large.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-program-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-program-number-too-large.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-version-number-negative.x + create mode 100644 tools/net/sunrpc/xdrgen/tests/bad-version-number-too-large.x +Merging printk/for-next (703a9d76a45dd Merge branch 'for-7.3-console-registration-cleanup' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git printk/for-next +Merge made by the 'ort' strategy. + kernel/printk/printk.c | 30 +++++++++++++++++------------- + lib/tests/test_ratelimit.c | 29 +++++++++++++++++++---------- + lib/vsprintf.c | 4 ++++ + 3 files changed, 40 insertions(+), 23 deletions(-) +Merging pci/next (115c7e572e505 Merge branch 'pci/misc') +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git pci/next +Auto-merging Documentation/arch/arm64/silicon-errata.rst +Auto-merging MAINTAINERS +Auto-merging arch/arm64/Kconfig +CONFLICT (content): Merge conflict in arch/arm64/Kconfig +Auto-merging drivers/dma/switchtec_dma.c +Auto-merging drivers/irqchip/irq-gic-v3-its.c +Auto-merging drivers/pci/controller/dwc/pci-imx6.c +Auto-merging drivers/pci/controller/dwc/pci-meson.c +Auto-merging drivers/pci/controller/dwc/pcie-keembay.c +Auto-merging drivers/pci/controller/dwc/pcie-spacemit-k1.c +Auto-merging drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c +Auto-merging include/linux/pci.h +Auto-merging include/linux/pci_ids.h +Auto-merging include/linux/pcie-dwc.h +Resolved 'arch/arm64/Kconfig' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 315e1c2a5ca9a] Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git +$ git diff -M --stat --summary HEAD^.. + Documentation/ABI/testing/debugfs-cdns-pcie | 5 + + Documentation/ABI/testing/sysfs-bus-pci | 2 +- + Documentation/PCI/controller/index.rst | 1 + + .../PCI/controller/pci-controller-drivers.rst | 402 ++++++++++++++++++ + Documentation/arch/arm64/silicon-errata.rst | 1 + + .../bindings/pci/airoha,en7581-pcie.yaml | 244 +++++++++++ + .../devicetree/bindings/pci/brcm,stb-pcie.yaml | 2 +- + .../devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 25 ++ + .../bindings/pci/mediatek-pcie-gen3.yaml | 81 +--- + .../bindings/pci/nvidia,tegra264-pcie.yaml | 109 +++-- + .../devicetree/bindings/pci/qcom,hawi-pcie.yaml | 201 +++++++++ + .../devicetree/bindings/pci/qcom,pcie-ipq9574.yaml | 15 + + .../bindings/pci/rcar-gen4-pci-host.yaml | 3 + + .../bindings/pci/renesas,pci-rcar-gen2.yaml | 2 +- + .../bindings/pci/renesas,r9a08g045-pcie.yaml | 34 +- + .../devicetree/bindings/pci/ti,am65-pci-ep.yaml | 8 +- + .../devicetree/bindings/pci/ti,am65-pci-host.yaml | 12 +- + .../devicetree/bindings/pci/toshiba,tc9563.yaml | 21 +- + .../bindings/pci/ultrarisc,dp1000-pcie.yaml | 16 + + MAINTAINERS | 7 +- + arch/alpha/kernel/pci-sysfs.c | 32 +- + arch/arm64/Kconfig | 9 + + arch/powerpc/kernel/pci-common.c | 9 +- + drivers/ata/ata_generic.c | 6 +- + drivers/char/agp/amd-k7-agp.c | 26 +- + drivers/char/agp/via-agp.c | 308 ++++---------- + drivers/dma/switchtec_dma.c | 1 + + drivers/ipack/carriers/tpci200.c | 1 - + drivers/ipack/carriers/tpci200.h | 1 - + drivers/irqchip/irq-gic-v3-its.c | 24 +- + drivers/misc/pci_endpoint_test.c | 38 +- + drivers/net/ethernet/mellanox/mlxsw/pci.c | 11 +- + drivers/pci/controller/Kconfig | 12 +- + drivers/pci/controller/Makefile | 1 + + drivers/pci/controller/cadence/Kconfig | 13 +- + drivers/pci/controller/cadence/Makefile | 1 + + drivers/pci/controller/cadence/pci-j721e.c | 4 +- + drivers/pci/controller/cadence/pci-sky1.c | 5 + + .../pci/controller/cadence/pcie-cadence-debugfs.c | 263 ++++++++++++ + drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 + + .../controller/cadence/pcie-cadence-host-common.c | 6 +- + .../pci/controller/cadence/pcie-cadence-host-hpa.c | 21 +- + drivers/pci/controller/cadence/pcie-cadence-host.c | 9 +- + .../pci/controller/cadence/pcie-cadence-lga-regs.h | 5 - + drivers/pci/controller/cadence/pcie-cadence-plat.c | 1 + + drivers/pci/controller/cadence/pcie-cadence.h | 198 +++++++++ + drivers/pci/controller/dwc/Kconfig | 7 +- + drivers/pci/controller/dwc/pci-dra7xx.c | 4 +- + drivers/pci/controller/dwc/pci-imx6.c | 72 ++-- + drivers/pci/controller/dwc/pci-keystone.c | 10 +- + drivers/pci/controller/dwc/pci-layerscape-ep.c | 6 +- + drivers/pci/controller/dwc/pci-meson.c | 4 +- + drivers/pci/controller/dwc/pcie-artpec6.c | 4 +- + drivers/pci/controller/dwc/pcie-designware-ep.c | 33 +- + drivers/pci/controller/dwc/pcie-designware-host.c | 10 +- + drivers/pci/controller/dwc/pcie-designware.c | 28 +- + drivers/pci/controller/dwc/pcie-designware.h | 5 +- + drivers/pci/controller/dwc/pcie-dw-rockchip.c | 138 +++++- + drivers/pci/controller/dwc/pcie-keembay.c | 4 +- + drivers/pci/controller/dwc/pcie-qcom.c | 194 ++++++++- + drivers/pci/controller/dwc/pcie-rcar-gen4.c | 124 +++++- + drivers/pci/controller/dwc/pcie-spacemit-k1.c | 1 + + drivers/pci/controller/dwc/pcie-tegra194.c | 16 +- + drivers/pci/controller/dwc/pcie-ultrarisc.c | 87 +++- + drivers/pci/controller/mobiveil/pcie-mobiveil.c | 4 +- + drivers/pci/controller/mobiveil/pcie-mobiveil.h | 5 - + drivers/pci/controller/pci-aardvark.c | 9 +- + drivers/pci/controller/pci-host-common.c | 64 +-- + drivers/pci/controller/pci-host-common.h | 1 + + drivers/pci/controller/pci-host-generic.c | 11 +- + drivers/pci/controller/pci-tegra.c | 3 +- + drivers/pci/controller/pci-xgene.c | 5 +- + drivers/pci/controller/pcie-aspeed.c | 8 +- + drivers/pci/controller/pcie-mediatek-gen3.c | 113 ++++- + drivers/pci/controller/pcie-mediatek.c | 154 +++++++ + drivers/pci/controller/pcie-rockchip.c | 4 +- + drivers/pci/controller/pcie-rzg3s-host.c | 233 +++++++++- + drivers/pci/controller/pcie-tegra264.c | 467 +++++++++++++++++++++ + drivers/pci/controller/pcie-xilinx-nwl.c | 9 +- + drivers/pci/controller/plda/pcie-plda-host.c | 52 ++- + drivers/pci/controller/plda/pcie-starfive.c | 32 +- + drivers/pci/controller/vmd.c | 203 +++++++-- + drivers/pci/doe.c | 4 +- + drivers/pci/ecam.c | 13 + + drivers/pci/hotplug/acpiphp_ibm.c | 3 +- + drivers/pci/hotplug/pnv_php.c | 2 +- + drivers/pci/hotplug/rpaphp_slot.c | 2 +- + drivers/pci/msi/msi.c | 10 + + drivers/pci/of.c | 79 ++++ + drivers/pci/p2pdma.c | 5 + + drivers/pci/pci-acpi.c | 4 +- + drivers/pci/pci-driver.c | 192 +++++---- + drivers/pci/pci-sysfs.c | 177 +++++--- + drivers/pci/pci.c | 66 ++- + drivers/pci/pci.h | 70 ++- + drivers/pci/pcie/aer.c | 275 +++++++++--- + drivers/pci/pcie/aspm.c | 275 +++++++----- + drivers/pci/pcie/bwctrl.c | 22 - + drivers/pci/pcie/err.c | 6 +- + drivers/pci/pcie/portdrv.c | 30 +- + drivers/pci/probe.c | 2 + + drivers/pci/proc.c | 16 +- + drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 144 ++++--- + drivers/pci/quirks.c | 10 +- + drivers/pci/remove.c | 1 + + drivers/pci/search.c | 8 +- + drivers/pci/setup-bus.c | 2 +- + drivers/pci/slot.c | 50 ++- + drivers/pci/switch/switchtec.c | 1 + + drivers/scsi/nsp32.c | 8 +- + drivers/scsi/nsp32.h | 8 +- + include/linux/of_pci.h | 6 + + include/linux/pci-ecam.h | 3 + + include/linux/pci.h | 12 +- + include/linux/pci_ids.h | 1 + + include/linux/pcie-dwc.h | 4 + + 116 files changed, 4670 insertions(+), 1164 deletions(-) + create mode 100644 Documentation/ABI/testing/debugfs-cdns-pcie + create mode 100644 Documentation/PCI/controller/pci-controller-drivers.rst + create mode 100644 Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml + create mode 100644 Documentation/devicetree/bindings/pci/qcom,hawi-pcie.yaml + create mode 100644 drivers/pci/controller/cadence/pcie-cadence-debugfs.c + create mode 100644 drivers/pci/controller/pcie-tegra264.c +Merging pstore/for-next/pstore (24b8f8dcb9a13 pstore/ftrace: Factor KASLR offset in the core kernel instruction addresses) +$ git merge -m Merge branch 'for-next/pstore' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git pstore/for-next/pstore +Already up to date. +Merging hid/for-next (a8fcb3dbf9024 Merge branch 'for-7.2/upstream-fixes' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git hid/for-next +Merge made by the 'ort' strategy. +Merging i2c/i2c/for-next (8cd9520d35a6c Linux 7.1) +$ git merge -m Merge branch 'i2c/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/i2c/for-next +Already up to date. +$ git am -3 ../patches/0001-i2c-Fix-up-the-rest-of-the-merge.patch +Applying: i2c: Fix up the rest of the merge +Using index info to reconstruct a base tree... +M drivers/i2c/i2c-core-base.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/i2c/i2c-core-base.c +No changes -- Patch already applied. +Merging i2c-andi/i2c/i2c-next (b0e590bb83a9e Merge branch 'i2c/i2c' into i2c/i2c-next) +$ git merge -m Merge branch 'i2c/i2c-next' of https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git i2c-andi/i2c/i2c-next +Merge made by the 'ort' strategy. + drivers/i2c/busses/i2c-amd-asf-plat.c | 4 +-- + drivers/i2c/busses/i2c-bcm-iproc.c | 3 +-- + drivers/i2c/busses/i2c-gxp.c | 2 +- + drivers/i2c/busses/i2c-hisi.c | 2 +- + drivers/i2c/busses/i2c-imx-lpi2c.c | 40 +++++++++++++++++++++--------- + drivers/i2c/busses/i2c-imx.c | 2 +- + drivers/i2c/busses/i2c-k1.c | 4 +-- + drivers/i2c/busses/i2c-ls2x.c | 2 +- + drivers/i2c/busses/i2c-microchip-corei2c.c | 3 +-- + drivers/i2c/busses/i2c-mlxbf.c | 2 +- + drivers/i2c/busses/i2c-mxs.c | 5 +--- + drivers/i2c/busses/i2c-nomadik.c | 3 +-- + drivers/i2c/busses/i2c-ocores.c | 6 ++++- + drivers/i2c/busses/i2c-qcom-geni.c | 3 +-- + drivers/i2c/busses/i2c-rcar.c | 27 +++++++++----------- + drivers/i2c/busses/i2c-riic.c | 3 +-- + drivers/i2c/busses/i2c-rzv2m.c | 2 +- + drivers/i2c/busses/i2c-sprd.c | 4 +-- + drivers/i2c/busses/i2c-st.c | 3 +-- + drivers/i2c/busses/i2c-stm32f4.c | 6 ++--- + drivers/i2c/busses/i2c-stm32f7.c | 4 +-- + drivers/i2c/busses/i2c-sun6i-p2wi.c | 4 +-- + drivers/i2c/busses/i2c-synquacer.c | 2 +- + drivers/i2c/busses/i2c-uniphier-f.c | 2 +- + drivers/i2c/busses/i2c-uniphier.c | 2 +- + drivers/i2c/busses/i2c-viai2c-wmt.c | 3 +-- + drivers/i2c/busses/i2c-viai2c-zhaoxin.c | 3 +-- + drivers/i2c/busses/i2c-xlp9xx.c | 2 +- + drivers/i2c/muxes/i2c-demux-pinctrl.c | 1 + + 29 files changed, 75 insertions(+), 74 deletions(-) +Merging i2c-rust/rust-i2c-next (61ddec70c9bcc i2c: rust: mark I2cAdapter methods as inline) +$ git merge -m Merge branch 'rust-i2c-next' of https://github.com/ikrtn/rust-for-linux i2c-rust/rust-i2c-next +Auto-merging rust/kernel/i2c.rs +Merge made by the 'ort' strategy. + rust/kernel/i2c.rs | 3 +++ + 1 file changed, 3 insertions(+) +Merging i3c/i3c/next (cab40cfc9e116 i3c: dw: reduce do_daa time if there's no client) +$ git merge -m Merge branch 'i3c/next' of https://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git i3c/i3c/next +Auto-merging MAINTAINERS +Auto-merging drivers/hwmon/Kconfig +Merge made by the 'ort' strategy. + .../devicetree/bindings/i3c/cdns,i3c-master.yaml | 1 + + Documentation/devicetree/bindings/i3c/i3c.yaml | 36 +- + .../bindings/i3c/snps,dw-i3c-master.yaml | 3 + + .../devicetree/bindings/i3c/xlnx,axi-i3c-1.0.yaml | 58 + + MAINTAINERS | 8 + + drivers/hwmon/Kconfig | 9 +- + drivers/hwmon/spd5118.c | 119 +-- + drivers/i3c/device.c | 13 +- + drivers/i3c/internals.h | 5 + + drivers/i3c/master.c | 632 +++++++++-- + drivers/i3c/master/Kconfig | 15 + + drivers/i3c/master/Makefile | 1 + + drivers/i3c/master/adi-i3c-master.c | 19 +- + drivers/i3c/master/amd-i3c-master.c | 1124 ++++++++++++++++++++ + drivers/i3c/master/dw-i3c-master.c | 188 +++- + drivers/i3c/master/dw-i3c-master.h | 1 + + drivers/i3c/master/i3c-master-cdns.c | 3 + + drivers/i3c/master/mipi-i3c-hci/core.c | 30 +- + drivers/i3c/master/mipi-i3c-hci/dma.c | 15 +- + drivers/i3c/master/mipi-i3c-hci/hci.h | 7 + + drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 32 +- + drivers/i3c/master/mipi-i3c-hci/pio.c | 74 +- + drivers/i3c/master/renesas-i3c.c | 390 +++++-- + drivers/i3c/master/svc-i3c-master.c | 22 +- + include/dt-bindings/i3c/i3c.h | 4 + + include/linux/i3c/ccc.h | 12 +- + include/linux/i3c/master.h | 27 +- + 27 files changed, 2470 insertions(+), 378 deletions(-) + create mode 100644 Documentation/devicetree/bindings/i3c/xlnx,axi-i3c-1.0.yaml + create mode 100644 drivers/i3c/master/amd-i3c-master.c +Merging dmi/dmi-for-next (1afafbaf749d8 firmware/dmi: Include product_family info to modalias) +$ git merge -m Merge branch 'dmi-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging.git dmi/dmi-for-next +Already up to date. +Merging hwmon-staging/hwmon-next (75f2c0b369070 hwmon: (emc1403) Drop hysteresis for low limit temperature) +$ git merge -m Merge branch 'hwmon-next' of https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-staging/hwmon-next +Already up to date. +Merging jc_docs/docs-next (791e420360669 Doc: admin-guide: pm: Remove unnecessary backticks and fix a spell) +$ git merge -m Merge branch 'docs-next' of git://git.lwn.net/linux.git jc_docs/docs-next +Auto-merging CREDITS +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging Documentation/admin-guide/mm/pagemap.rst +Auto-merging Documentation/admin-guide/pm/amd-pstate.rst +Auto-merging Documentation/filesystems/overlayfs.rst +Auto-merging Documentation/filesystems/proc.rst +Auto-merging Documentation/process/coding-assistants.rst +CONFLICT (content): Merge conflict in Documentation/process/coding-assistants.rst +Auto-merging MAINTAINERS +Auto-merging scripts/checkpatch.pl +Resolved 'Documentation/process/coding-assistants.rst' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 1ad65af3862e2] Merge branch 'docs-next' of git://git.lwn.net/linux.git +$ git diff -M --stat --summary HEAD^.. + CREDITS | 4 + + Documentation/ABI/README | 2 +- + Documentation/ABI/testing/sysfs-edac-memory-repair | 2 +- + Documentation/admin-guide/kernel-parameters.txt | 34 +- + Documentation/admin-guide/media/bttv.rst | 2 +- + Documentation/admin-guide/mm/pagemap.rst | 8 +- + Documentation/admin-guide/pm/amd-pstate.rst | 2 +- + Documentation/conf.py | 6 +- + Documentation/core-api/SMP.rst | 11 + + Documentation/core-api/dma-api.rst | 2 +- + Documentation/core-api/errseq.rst | 2 +- + Documentation/core-api/index.rst | 1 + + Documentation/core-api/list.rst | 2 +- + Documentation/core-api/min_heap.rst | 13 - + Documentation/core-api/packing.rst | 4 +- + Documentation/core-api/real-time/hardware.rst | 104 +++ + Documentation/core-api/real-time/index.rst | 1 + + .../core-api/real-time/kernel-configuration.rst | 307 +++++++++ + Documentation/dev-tools/container.rst | 6 +- + Documentation/driver-api/ipmi.rst | 2 +- + .../driver-api/usb/writing_usb_driver.rst | 3 - + Documentation/filesystems/overlayfs.rst | 3 +- + Documentation/filesystems/proc.rst | 2 +- + Documentation/index.rst | 8 + + Documentation/kernel-hacking/locking.rst | 8 +- + Documentation/process/coding-assistants.rst | 12 +- + Documentation/process/generated-content.rst | 7 + + Documentation/process/submitting-patches.rst | 14 +- + Documentation/scheduler/sched-energy.rst | 2 +- + Documentation/scheduler/sched-pelt.c | 3 +- + Documentation/sphinx-static/custom.css | 24 +- + Documentation/sphinx/maintainers_include.py | 7 +- + .../it_IT/doc-guide/checktransupdate.rst | 59 ++ + .../translations/it_IT/doc-guide/contributing.rst | 319 ++++++++++ + .../translations/it_IT/doc-guide/index.rst | 13 +- + .../translations/it_IT/doc-guide/kernel-doc.rst | 88 ++- + .../it_IT/doc-guide/maintainer-profile.rst | 60 ++ + .../translations/it_IT/doc-guide/parse-headers.rst | 242 +++---- + .../translations/it_IT/doc-guide/sphinx.rst | 178 ++++-- + .../translations/it_IT/process/changes.rst | 118 ++-- + .../ja_JP/process/submitting-patches.rst | 225 ++++--- + Documentation/translations/pt_BR/index.rst | 13 +- + .../translations/pt_BR/process/4.Coding.rst | 440 +++++++++++++ + .../translations/pt_BR/process/5.Posting.rst | 376 +++++++++++ + .../translations/pt_BR/process/6.Followthrough.rst | 220 +++++++ + .../pt_BR/process/7.AdvancedTopics.rst | 201 ++++++ + .../translations/pt_BR/process/8.Conclusion.rst | 73 +++ + .../translations/pt_BR/process/adding-syscalls.rst | 700 +++++++++++++++++++++ + .../pt_BR/process/applying-patches.rst | 447 +++++++++++++ + .../translations/pt_BR/process/backporting.rst | 598 ++++++++++++++++++ + .../pt_BR/process/botching-up-ioctls.rst | 256 ++++++++ + .../process/code-of-conduct-interpretation.rst | 257 ++++++++ + .../translations/pt_BR/process/code-of-conduct.rst | 88 +++ + .../pt_BR/process/contribution-maturity-model.rst | 111 ++++ + Documentation/translations/pt_BR/process/cve.rst | 125 ++++ + .../translations/pt_BR/process/deprecated.rst | 422 +++++++++++++ + .../pt_BR/process/development-process.rst | 5 + + .../translations/pt_BR/process/email-clients.rst | 368 +++++++++++ + Documentation/translations/pt_BR/process/index.rst | 102 +++ + .../pt_BR/process/kernel-driver-statement.rst | 205 ++++++ + .../pt_BR/process/maintainer-netdev.rst | 23 +- + .../pt_BR/process/management-style.rst | 265 ++++++++ + .../translations/pt_BR/process/security-bugs.rst | 368 +++++++++++ + .../pt_BR/process/submit-checklist.rst | 145 +++++ + .../translations/zh_CN/accounting/psi.rst | 2 +- + .../translations/zh_CN/admin-guide/index.rst | 206 ++++-- + .../zh_CN/admin-guide/module-signing.rst | 250 ++++++++ + .../translations/zh_CN/dev-tools/kasan.rst | 2 +- + Documentation/translations/zh_CN/how-to.rst | 149 +++-- + .../translations/zh_CN/rust/arch-support.rst | 1 + + .../zh_CN/rust/general-information.rst | 82 ++- + .../translations/zh_CN/rust/quick-start.rst | 48 +- + Documentation/translations/zh_CN/rust/testing.rst | 4 + + .../translations/zh_CN/scheduler/sched-energy.rst | 2 +- + .../zh_CN/security/self-protection.rst | 2 +- + .../zh_TW/process/stable-api-nonsense.rst | 62 +- + MAINTAINERS | 7 +- + README | 18 +- + scripts/checkpatch.pl | 7 +- + tools/docs/documentation-file-ref-check | 2 +- + tools/docs/sphinx-build-wrapper | 13 +- + tools/lib/python/abi/abi_regex.py | 11 +- + tools/lib/python/kdoc/kdoc_output.py | 2 +- + tools/lib/python/kdoc/kdoc_parser.py | 58 +- + tools/lib/python/kdoc/xforms_lists.py | 1 + + 85 files changed, 8031 insertions(+), 616 deletions(-) + create mode 100644 Documentation/core-api/SMP.rst + create mode 100644 Documentation/core-api/real-time/kernel-configuration.rst + create mode 100644 Documentation/translations/it_IT/doc-guide/checktransupdate.rst + create mode 100644 Documentation/translations/it_IT/doc-guide/contributing.rst + create mode 100644 Documentation/translations/it_IT/doc-guide/maintainer-profile.rst + create mode 100644 Documentation/translations/pt_BR/process/4.Coding.rst + create mode 100644 Documentation/translations/pt_BR/process/5.Posting.rst + create mode 100644 Documentation/translations/pt_BR/process/6.Followthrough.rst + create mode 100644 Documentation/translations/pt_BR/process/7.AdvancedTopics.rst + create mode 100644 Documentation/translations/pt_BR/process/8.Conclusion.rst + create mode 100644 Documentation/translations/pt_BR/process/adding-syscalls.rst + create mode 100644 Documentation/translations/pt_BR/process/applying-patches.rst + create mode 100644 Documentation/translations/pt_BR/process/backporting.rst + create mode 100644 Documentation/translations/pt_BR/process/botching-up-ioctls.rst + create mode 100644 Documentation/translations/pt_BR/process/code-of-conduct-interpretation.rst + create mode 100644 Documentation/translations/pt_BR/process/code-of-conduct.rst + create mode 100644 Documentation/translations/pt_BR/process/contribution-maturity-model.rst + create mode 100644 Documentation/translations/pt_BR/process/cve.rst + create mode 100644 Documentation/translations/pt_BR/process/deprecated.rst + create mode 100644 Documentation/translations/pt_BR/process/email-clients.rst + create mode 100644 Documentation/translations/pt_BR/process/index.rst + create mode 100644 Documentation/translations/pt_BR/process/kernel-driver-statement.rst + create mode 100644 Documentation/translations/pt_BR/process/management-style.rst + create mode 100644 Documentation/translations/pt_BR/process/security-bugs.rst + create mode 100644 Documentation/translations/pt_BR/process/submit-checklist.rst + create mode 100644 Documentation/translations/zh_CN/admin-guide/module-signing.rst +Merging v4l-dvb/next (4900cad020c05 media: ipu-bridge: check all DMI entries when overriding sensor rotation) +$ git merge -m Merge branch 'next' of git://linuxtv.org/media-ci/media-pending.git v4l-dvb/next +Already up to date. +Merging v4l-dvb-next/master (adc218676eef2 Linux 6.12) +$ git merge -m Merge branch 'master' of git://linuxtv.org/mchehab/media-next.git v4l-dvb-next/master +Already up to date. +Merging pm/linux-next (a091e6870b6c7 Merge branch 'thermal' into linux-next) +$ git merge -m Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git pm/linux-next +Auto-merging drivers/acpi/bus.c +Auto-merging drivers/acpi/scan.c +Auto-merging include/acpi/acpi_bus.h +CONFLICT (content): Merge conflict in include/acpi/acpi_bus.h +Resolved 'include/acpi/acpi_bus.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master f70da784689b3] Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git +$ git diff -M --stat --summary HEAD^.. + .../bindings/arm/airoha,en7581-chip-scu.yaml | 14 + + .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 + + .../bindings/thermal/mediatek,lvts-thermal.yaml | 13 +- + .../bindings/thermal/qcom,pm8775-mbg-tm.yaml | 72 ++++ + .../devicetree/bindings/thermal/qcom-tsens.yaml | 1 + + drivers/acpi/acpi_apd.c | 35 +- + drivers/acpi/acpi_platform.c | 16 +- + drivers/acpi/battery.c | 147 ++++--- + drivers/acpi/bus.c | 54 ++- + drivers/acpi/scan.c | 33 +- + drivers/cpufreq/intel_pstate.c | 126 +++--- + drivers/iio/adc/qcom-spmi-adc5-gen3.c | 69 +--- + drivers/thermal/airoha_thermal.c | 382 ++++++++++++++---- + drivers/thermal/armada_thermal.c | 105 +++-- + drivers/thermal/broadcom/brcmstb_thermal.c | 3 +- + drivers/thermal/db8500_thermal.c | 8 +- + drivers/thermal/hisi_thermal.c | 4 +- + drivers/thermal/imx91_thermal.c | 2 +- + drivers/thermal/imx_thermal.c | 13 +- + drivers/thermal/loongson2_thermal.c | 2 +- + drivers/thermal/max77620_thermal.c | 8 +- + drivers/thermal/mediatek/lvts_thermal.c | 17 +- + drivers/thermal/qcom/Kconfig | 23 ++ + drivers/thermal/qcom/Makefile | 2 + + drivers/thermal/qcom/lmh.c | 1 - + drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c | 434 +++++++++++++++++++++ + drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 3 - + drivers/thermal/qcom/qcom-spmi-mbg-tm.c | 256 ++++++++++++ + drivers/thermal/qcom/tsens.c | 5 +- + drivers/thermal/qoriq_thermal.c | 13 +- + drivers/thermal/renesas/rcar_thermal.c | 19 +- + drivers/thermal/renesas/rzg3e_thermal.c | 4 +- + drivers/thermal/rockchip_thermal.c | 3 +- + drivers/thermal/samsung/exynos_tmu.c | 4 +- + drivers/thermal/spacemit/k1_tsensor.c | 80 +++- + drivers/thermal/st/st_thermal_memmap.c | 4 +- + drivers/thermal/st/stm_thermal.c | 5 +- + drivers/thermal/sun8i_thermal.c | 1 - + drivers/thermal/tegra/soctherm.c | 8 +- + drivers/thermal/tegra/tegra30-tsensor.c | 3 +- + drivers/thermal/thermal-fw.c | 12 + + drivers/thermal/thermal_fw.c | 97 +++++ + drivers/thermal/thermal_of.c | 2 +- + include/acpi/acpi_bus.h | 6 + + include/linux/iio/adc/qcom-adc5-gen3-common.h | 2 - + kernel/sched/cpufreq_schedutil.c | 15 +- + tools/lib/thermal/include/thermal.h | 4 +- + 47 files changed, 1694 insertions(+), 440 deletions(-) + create mode 100644 Documentation/devicetree/bindings/thermal/qcom,pm8775-mbg-tm.yaml + create mode 100644 drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c + create mode 100644 drivers/thermal/qcom/qcom-spmi-mbg-tm.c + create mode 100644 drivers/thermal/thermal-fw.c + create mode 100644 drivers/thermal/thermal_fw.c +Merging cpufreq-arm/cpufreq/arm/linux-next (8c3afcf27fa45 cpufreq: imx6q: fix out-of-bounds write when probed more than once) +$ git merge -m Merge branch 'cpufreq/arm/linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq-arm/cpufreq/arm/linux-next +Already up to date. +Merging cpupower/cpupower (adfe0057326ff cpupower: remove conditional return with no effect) +$ git merge -m Merge branch 'cpupower' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git cpupower/cpupower +Already up to date. +Merging devfreq/devfreq-next (c096be11c2a9d PM / devfreq: Fix governor_store() failing when device has no current governor) +$ git merge -m Merge branch 'devfreq-next' of https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq/devfreq-next +Merge made by the 'ort' strategy. + drivers/devfreq/devfreq.c | 50 +++++++----------------------------- + drivers/devfreq/event/rockchip-dfi.c | 4 ++- + 2 files changed, 12 insertions(+), 42 deletions(-) +Merging pmdomain/next (3ca7b513aec1d pmdomain: Merge branch fixes into next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git pmdomain/next +Already up to date. +Merging opp/opp/linux-next (84f05af0975c9 opp: Use clk_get_optional() to avoid leaving opp_table->clk as an error pointer) +$ git merge -m Merge branch 'opp/linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/opp/linux-next +Already up to date. +Merging thermal/thermal/linux-next (b115930d716de thermal/drivers/armada: Fix missing bitfields include) +$ git merge -m Merge branch 'thermal/linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git thermal/thermal/linux-next +Already up to date. +Merging rdma/for-next (60a42d510113f RDMA/uverbs: Guard legacy bundles without method_elm) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git rdma/for-next +Auto-merging Documentation/admin-guide/cgroup-v1/rdma.rst +Auto-merging Documentation/admin-guide/cgroup-v2.rst +Auto-merging drivers/infiniband/hw/cxgb4/mem.c +Auto-merging fs/smb/smbdirect/accept.c +Auto-merging fs/smb/smbdirect/connection.c +Auto-merging include/linux/mlx5/mlx5_ifc.h +Auto-merging net/rds/ib.c +Auto-merging net/rds/ib_cm.c +Auto-merging net/sunrpc/xprtrdma/svc_rdma_transport.c +Merge made by the 'ort' strategy. + Documentation/ABI/testing/configfs-rdma_cm | 4 + + Documentation/admin-guide/cgroup-v1/rdma.rst | 8 + + Documentation/admin-guide/cgroup-v2.rst | 15 +- + Documentation/infiniband/user_mad.rst | 2 +- + drivers/infiniband/core/Makefile | 1 + + drivers/infiniband/core/addr.c | 2 +- + drivers/infiniband/core/cgroup.c | 1 + + drivers/infiniband/core/cma.c | 8 +- + drivers/infiniband/core/cma_configfs.c | 4 + + drivers/infiniband/core/core_priv.h | 3 +- + drivers/infiniband/core/counters.c | 5 +- + drivers/infiniband/core/cq.c | 5 +- + drivers/infiniband/core/device.c | 254 ++++++++++++-- + drivers/infiniband/core/ib_core_uverbs.c | 3 + + drivers/infiniband/core/iwpm_msg.c | 2 +- + drivers/infiniband/core/nldev.c | 69 +++- + drivers/infiniband/core/rdma_core.h | 1 + + drivers/infiniband/core/restrack.c | 169 ++++++++-- + drivers/infiniband/core/restrack.h | 3 + + drivers/infiniband/core/security.c | 6 + + drivers/infiniband/core/ucma.c | 14 +- + drivers/infiniband/core/umem.c | 8 +- + drivers/infiniband/core/umem_dmabuf.c | 4 +- + drivers/infiniband/core/uverbs_main.c | 1 + + .../infiniband/core/uverbs_std_types_comp_cntr.c | 172 ++++++++++ + drivers/infiniband/core/uverbs_std_types_device.c | 51 ++- + drivers/infiniband/core/uverbs_std_types_dmah.c | 7 +- + drivers/infiniband/core/uverbs_std_types_mr.c | 6 +- + drivers/infiniband/core/uverbs_std_types_qp.c | 67 +++- + drivers/infiniband/core/uverbs_std_types_srq.c | 2 + + drivers/infiniband/core/uverbs_uapi.c | 1 + + drivers/infiniband/core/verbs.c | 40 ++- + drivers/infiniband/hw/bng_re/bng_fw.c | 10 +- + drivers/infiniband/hw/bnxt_re/bnxt_re.h | 6 - + drivers/infiniband/hw/bnxt_re/debugfs.c | 31 +- + drivers/infiniband/hw/bnxt_re/ib_verbs.c | 191 +++++++---- + drivers/infiniband/hw/bnxt_re/ib_verbs.h | 8 +- + drivers/infiniband/hw/bnxt_re/main.c | 4 - + drivers/infiniband/hw/bnxt_re/uapi.c | 181 ++++++---- + drivers/infiniband/hw/cxgb4/device.c | 8 +- + drivers/infiniband/hw/cxgb4/mem.c | 54 ++- + drivers/infiniband/hw/cxgb4/provider.c | 4 +- + drivers/infiniband/hw/efa/Makefile | 4 +- + drivers/infiniband/hw/efa/efa.h | 20 +- + drivers/infiniband/hw/efa/efa_admin_cmds_defs.h | 296 ++++++++++++----- + drivers/infiniband/hw/efa/efa_admin_defs.h | 33 +- + drivers/infiniband/hw/efa/efa_ah_cache.c | 135 ++++++++ + drivers/infiniband/hw/efa/efa_ah_cache.h | 39 +++ + drivers/infiniband/hw/efa/efa_com.c | 206 ++++++++---- + drivers/infiniband/hw/efa/efa_com.h | 19 +- + drivers/infiniband/hw/efa/efa_com_cmd.c | 329 ++++++++++++------ + drivers/infiniband/hw/efa/efa_com_cmd.h | 48 +++ + drivers/infiniband/hw/efa/efa_io_defs.h | 32 +- + drivers/infiniband/hw/efa/efa_main.c | 10 +- + drivers/infiniband/hw/efa/efa_verbs.c | 272 ++++++++++++++- + drivers/infiniband/hw/erdma/Kconfig | 2 +- + drivers/infiniband/hw/erdma/erdma_cm.c | 6 +- + drivers/infiniband/hw/erdma/erdma_eq.c | 10 +- + drivers/infiniband/hw/erdma/erdma_verbs.c | 45 ++- + drivers/infiniband/hw/erdma/erdma_verbs.h | 40 ++- + drivers/infiniband/hw/hfi1/chip.c | 21 +- + drivers/infiniband/hw/hfi1/chip.h | 2 +- + drivers/infiniband/hw/hfi1/device.c | 32 +- + drivers/infiniband/hw/hfi1/device.h | 1 - + drivers/infiniband/hw/hfi1/file_ops.c | 2 +- + drivers/infiniband/hw/hfi1/hfi.h | 4 +- + drivers/infiniband/hw/hfi1/init.c | 196 +++++------ + drivers/infiniband/hw/hfi1/pcie.c | 32 +- + drivers/infiniband/hw/hfi1/user_sdma.c | 13 +- + drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- + drivers/infiniband/hw/hns/hns_roce_main.c | 6 +- + drivers/infiniband/hw/ionic/ionic_controlpath.c | 72 ++++ + drivers/infiniband/hw/ionic/ionic_datapath.c | 43 +-- + drivers/infiniband/hw/ionic/ionic_fw.h | 12 +- + drivers/infiniband/hw/ionic/ionic_hw_stats.c | 95 +++--- + drivers/infiniband/hw/ionic/ionic_ibdev.c | 5 +- + drivers/infiniband/hw/ionic/ionic_ibdev.h | 14 +- + drivers/infiniband/hw/ionic/ionic_lif_cfg.c | 4 +- + drivers/infiniband/hw/ionic/ionic_lif_cfg.h | 1 + + drivers/infiniband/hw/irdma/i40iw_hw.c | 4 +- + drivers/infiniband/hw/irdma/icrdma_hw.c | 2 + + drivers/infiniband/hw/irdma/icrdma_hw.h | 2 + + drivers/infiniband/hw/irdma/icrdma_if.c | 8 +- + drivers/infiniband/hw/irdma/irdma.h | 2 + + drivers/infiniband/hw/irdma/utils.c | 6 + + drivers/infiniband/hw/irdma/verbs.c | 368 +++++++++++++-------- + drivers/infiniband/hw/irdma/verbs.h | 3 + + drivers/infiniband/hw/mana/cq.c | 8 +- + drivers/infiniband/hw/mana/device.c | 1 + + drivers/infiniband/hw/mana/main.c | 129 ++++++-- + drivers/infiniband/hw/mana/mana_ib.h | 83 ++++- + drivers/infiniband/hw/mana/mr.c | 13 + + drivers/infiniband/hw/mana/qp.c | 229 +++++++++---- + drivers/infiniband/hw/mana/wq.c | 12 + + drivers/infiniband/hw/mlx4/cm.c | 120 +++++-- + drivers/infiniband/hw/mlx4/main.c | 2 - + drivers/infiniband/hw/mlx4/mr.c | 6 +- + drivers/infiniband/hw/mlx5/cong.c | 24 +- + drivers/infiniband/hw/mlx5/counters.c | 11 +- + drivers/infiniband/hw/mlx5/main.c | 16 +- + drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 + + drivers/infiniband/hw/mlx5/mr.c | 6 +- + drivers/infiniband/hw/mlx5/odp.c | 6 +- + drivers/infiniband/hw/mlx5/qp.c | 37 ++- + drivers/infiniband/hw/mlx5/srq.c | 25 +- + drivers/infiniband/hw/mlx5/umr.c | 13 +- + drivers/infiniband/hw/mthca/mthca_allocator.c | 6 +- + drivers/infiniband/hw/mthca/mthca_provider.c | 10 +- + drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 26 +- + drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 5 +- + drivers/infiniband/hw/qedr/verbs.c | 8 +- + drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 5 +- + drivers/infiniband/hw/usnic/usnic_uiom.c | 4 +- + drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 4 +- + drivers/infiniband/sw/rdmavt/qp.c | 8 +- + drivers/infiniband/sw/rdmavt/vt.c | 8 +- + drivers/infiniband/sw/rxe/rxe_mmap.c | 35 +- + drivers/infiniband/sw/rxe/rxe_mw.c | 20 +- + drivers/infiniband/sw/rxe/rxe_odp.c | 12 +- + drivers/infiniband/sw/rxe/rxe_qp.c | 40 ++- + drivers/infiniband/sw/rxe/rxe_req.c | 15 + + drivers/infiniband/sw/rxe/rxe_resp.c | 9 +- + drivers/infiniband/sw/rxe/rxe_srq.c | 16 +- + drivers/infiniband/sw/rxe/rxe_verbs.c | 9 +- + drivers/infiniband/sw/siw/siw_cm.c | 2 +- + drivers/infiniband/sw/siw/siw_verbs.c | 6 +- + drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 +- + drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 3 +- + drivers/infiniband/ulp/iser/iser_verbs.c | 5 +- + drivers/infiniband/ulp/isert/ib_isert.c | 92 ++++-- + drivers/infiniband/ulp/isert/ib_isert.h | 1 + + drivers/infiniband/ulp/rtrs/rtrs-clt.c | 11 +- + drivers/infiniband/ulp/rtrs/rtrs-srv.c | 11 +- + drivers/infiniband/ulp/srp/ib_srp.c | 63 +++- + drivers/infiniband/ulp/srpt/ib_srpt.c | 30 +- + drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 12 +- + .../ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 6 +- + .../net/ethernet/pensando/ionic/ionic_ethtool.c | 12 +- + drivers/net/ethernet/pensando/ionic/ionic_if.h | 1 + + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 5 +- + drivers/net/ethernet/pensando/ionic/ionic_lif.h | 3 +- + drivers/net/ethernet/pensando/ionic/ionic_phc.c | 63 +++- + drivers/nvme/host/rdma.c | 8 +- + drivers/nvme/target/rdma.c | 26 +- + fs/smb/smbdirect/accept.c | 5 +- + fs/smb/smbdirect/connect.c | 5 +- + fs/smb/smbdirect/connection.c | 8 +- + include/linux/cgroup_rdma.h | 1 + + include/linux/mlx5/device.h | 1 + + include/linux/mlx5/mlx5_ifc.h | 41 +-- + include/linux/sunrpc/svc_rdma.h | 4 +- + include/net/mana/gdma.h | 6 +- + include/rdma/ib_umem.h | 2 +- + include/rdma/ib_verbs.h | 102 ++++-- + include/rdma/restrack.h | 6 +- + include/rdma/uverbs_ioctl.h | 20 ++ + include/uapi/rdma/bnxt_re-abi.h | 3 + + include/uapi/rdma/efa-abi.h | 11 +- + include/uapi/rdma/ib_user_ioctl_cmds.h | 44 +++ + include/uapi/rdma/ib_user_ioctl_verbs.h | 19 ++ + include/uapi/rdma/ib_user_mad.h | 95 +++--- + include/uapi/rdma/ib_user_verbs.h | 33 ++ + include/uapi/rdma/ionic-abi.h | 1 + + include/uapi/rdma/irdma-abi.h | 1 + + include/uapi/rdma/mana-abi.h | 35 +- + include/uapi/rdma/mlx5-abi.h | 15 +- + include/uapi/rdma/mlx5_user_ioctl_cmds.h | 4 + + include/uapi/rdma/rdma_netlink.h | 10 +- + kernel/cgroup/rdma.c | 71 +++- + net/rds/ib.c | 10 +- + net/rds/ib_cm.c | 10 +- + net/smc/smc_pnet.c | 20 +- + net/sunrpc/xprtrdma/frwr_ops.c | 7 +- + net/sunrpc/xprtrdma/svc_rdma_transport.c | 5 +- + net/sunrpc/xprtrdma/verbs.c | 2 +- + tools/testing/selftests/rdma/Makefile | 3 +- + tools/testing/selftests/rdma/config | 2 + + tools/testing/selftests/rdma/rxe_netns_names.sh | 334 +++++++++++++++++++ + 178 files changed, 4604 insertions(+), 1617 deletions(-) + create mode 100644 drivers/infiniband/core/uverbs_std_types_comp_cntr.c + create mode 100644 drivers/infiniband/hw/efa/efa_ah_cache.c + create mode 100644 drivers/infiniband/hw/efa/efa_ah_cache.h + create mode 100755 tools/testing/selftests/rdma/rxe_netns_names.sh +Merging net-next/main (61eb236c41c2a Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git net-next/main +Auto-merging Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml +Auto-merging Documentation/devicetree/bindings/vendor-prefixes.yaml +Auto-merging MAINTAINERS +CONFLICT (content): Merge conflict in MAINTAINERS +Auto-merging drivers/net/ethernet/pensando/ionic/ionic_lif.c +Auto-merging drivers/net/wireless/mediatek/mt76/mt7921/regd.c +CONFLICT (content): Merge conflict in drivers/net/wireless/mediatek/mt76/mt7921/regd.c +Auto-merging drivers/net/wireless/mediatek/mt76/mt7921/regd.h +Auto-merging drivers/nfc/port100.c +Auto-merging drivers/nfc/st21nfca/i2c.c +Auto-merging drivers/pci/controller/dwc/pcie-spacemit-k1.c +Auto-merging include/linux/net.h +Auto-merging include/linux/pci_ids.h +CONFLICT (content): Merge conflict in include/linux/pci_ids.h +Auto-merging include/linux/skbuff.h +Auto-merging include/net/mana/gdma.h +Auto-merging kernel/irq/manage.c +Auto-merging net/bluetooth/smp.c +Auto-merging net/ipv6/route.c +Auto-merging net/unix/af_unix.c +Auto-merging net/xfrm/xfrm_nat_keepalive.c +Resolved 'MAINTAINERS' using previous resolution. +Resolved 'drivers/net/wireless/mediatek/mt76/mt7921/regd.c' using previous resolution. +Resolved 'include/linux/pci_ids.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master f5ef7414ea687] Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git +$ git diff -M --stat --summary HEAD^.. + .../ABI/testing/sysfs-bus-pci-drivers-btintel_pcie | 15 + + .../bindings/dpll/microchip,zl30731.yaml | 19 +- + .../devicetree/bindings/net/adi,ad3306.yaml | 71 + + .../bindings/net/altr,gmii-to-sgmii-2.0.yaml | 2 +- + .../bindings/net/altr,socfpga-stmmac.yaml | 2 +- + .../bindings/net/can/rockchip,rk3568v2-canfd.yaml | 4 +- + .../bindings/net/can/ti,am3517-hecc.yaml | 64 + + .../devicetree/bindings/net/can/ti_hecc.txt | 32 - + .../devicetree/bindings/net/can/xilinx,can.yaml | 5 +- + .../devicetree/bindings/net/dptel,dap8211r.yaml | 62 + + .../bindings/net/dsa/mediatek,mt7530.yaml | 5 + + .../bindings/net/dsa/mediatek,mt7628-esw.yaml | 96 + + .../devicetree/bindings/net/eswin,eic7700-eth.yaml | 74 +- + .../devicetree/bindings/net/fsl,gianfar.yaml | 2 +- + .../devicetree/bindings/net/microchip,lan7800.yaml | 89 + + .../devicetree/bindings/net/microchip,lan78xx.txt | 53 - + .../devicetree/bindings/net/microchip,lan95xx.yaml | 2 +- + .../bindings/net/microchip,lan966x-switch.yaml | 4 +- + .../bindings/net/microchip,sparx5-switch.yaml | 6 +- + .../bindings/net/pse-pd/realtek,pse-mcu-gen1.yaml | 182 + + .../bindings/net/renesas,rzv2h-gbeth.yaml | 8 +- + .../devicetree/bindings/vendor-prefixes.yaml | 2 + + Documentation/driver-api/dpll.rst | 18 +- + Documentation/netlink/specs/devlink.yaml | 30 +- + Documentation/netlink/specs/dpll.yaml | 19 + + Documentation/netlink/specs/netdev.yaml | 19 + + Documentation/netlink/specs/nl80211.yaml | 4 +- + Documentation/netlink/specs/rt-addr.yaml | 4 + + Documentation/netlink/specs/rt-link.yaml | 5 + + Documentation/netlink/specs/rt-route.yaml | 85 +- + .../device_drivers/can/ctu/fsm_txt_buffer_user.svg | 4 +- + .../device_drivers/ethernet/amd/pds_core.rst | 89 + + .../networking/device_drivers/ethernet/index.rst | 1 + + .../device_drivers/ethernet/intel/ixd.rst | 39 + + .../networking/devlink/devlink-params.rst | 6 + + Documentation/networking/devlink/devlink-port.rst | 11 + + Documentation/networking/devlink/index.rst | 9 +- + Documentation/networking/devlink/ixd.rst | 30 + + Documentation/networking/devlink/mlx5.rst | 40 +- + .../net_cachelines/netns_ipv4_sysctl.rst | 1 + + Documentation/networking/netdevices.rst | 7 + + Documentation/networking/oa-tc6-framework.rst | 3 +- + Documentation/networking/tuntap.rst | 32 + + Documentation/process/maintainer-netdev.rst | 20 + + MAINTAINERS | 76 +- + arch/alpha/include/uapi/asm/socket.h | 2 + + arch/mips/configs/mtx1_defconfig | 1 - + arch/mips/include/uapi/asm/socket.h | 2 + + arch/parisc/include/uapi/asm/socket.h | 2 + + arch/powerpc/configs/ppc64_defconfig | 1 - + arch/powerpc/configs/ppc6xx_defconfig | 1 - + arch/powerpc/mm/mem.c | 6 - + arch/sparc/include/uapi/asm/socket.h | 2 + + drivers/bluetooth/Makefile | 2 + + drivers/bluetooth/bfusb.c | 37 +- + drivers/bluetooth/btintel.c | 200 +- + drivers/bluetooth/btintel.h | 18 + + drivers/bluetooth/btintel_pcie.c | 299 +- + drivers/bluetooth/btintel_pcie.h | 12 +- + drivers/bluetooth/btmrvl_main.c | 20 + + drivers/bluetooth/btmrvl_sdio.c | 2 +- + drivers/bluetooth/btmtksdio.c | 3 + + drivers/bluetooth/btnxpuart.c | 52 +- + drivers/bluetooth/btqca.c | 25 +- + drivers/bluetooth/btrsi.c | 3 +- + drivers/bluetooth/btusb.c | 137 +- + drivers/bluetooth/hci_aml.c | 18 +- + drivers/bluetooth/hci_bcm.c | 336 +- + drivers/bluetooth/hci_bcsp.c | 5 +- + drivers/bluetooth/hci_h5.c | 6 +- + drivers/bluetooth/hci_intel.c | 4 +- + drivers/bluetooth/hci_ldisc.c | 10 +- + drivers/bluetooth/hci_nokia.c | 20 + + drivers/bluetooth/hci_qca.c | 16 +- + drivers/bluetooth/virtio_bt.c | 8 +- + drivers/cxl/core/core.h | 2 + + drivers/cxl/core/mbox.c | 51 +- + drivers/cxl/core/memdev.c | 67 + + drivers/cxl/core/pci.c | 1 + + drivers/cxl/core/port.c | 1 + + drivers/cxl/core/regs.c | 1 + + drivers/cxl/cxlpci.h | 12 - + drivers/cxl/pci.c | 1 + + drivers/dpll/dpll_core.c | 6 +- + drivers/dpll/dpll_netlink.c | 235 +- + drivers/dpll/dpll_nl.c | 2 +- + drivers/dpll/zl3073x/Kconfig | 6 +- + drivers/dpll/zl3073x/chan.c | 449 +- + drivers/dpll/zl3073x/chan.h | 80 + + drivers/dpll/zl3073x/core.c | 62 +- + drivers/dpll/zl3073x/core.h | 35 +- + drivers/dpll/zl3073x/dpll.c | 984 ++- + drivers/dpll/zl3073x/dpll.h | 9 + + drivers/dpll/zl3073x/out.c | 8 +- + drivers/dpll/zl3073x/regs.h | 63 + + drivers/infiniband/core/lag.c | 2 +- + drivers/infiniband/sw/rxe/rxe_net.c | 4 +- + drivers/mmc/core/quirks.h | 3 + + drivers/net/amt.c | 52 +- + drivers/net/bareudp.c | 45 +- + drivers/net/bonding/bond_3ad.c | 24 +- + drivers/net/bonding/bond_main.c | 10 +- + drivers/net/bonding/bond_netlink.c | 111 +- + drivers/net/bonding/bond_options.c | 8 +- + drivers/net/can/m_can/m_can.c | 2 +- + drivers/net/can/m_can/m_can_pci.c | 6 +- + drivers/net/can/m_can/tcan4x5x-core.c | 31 +- + drivers/net/can/rockchip/rockchip_canfd-core.c | 17 + + drivers/net/can/rockchip/rockchip_canfd-rx.c | 5 +- + drivers/net/can/rockchip/rockchip_canfd.h | 14 +- + drivers/net/can/usb/gs_usb.c | 2 +- + drivers/net/can/vxcan.c | 26 +- + drivers/net/dsa/Kconfig | 10 + + drivers/net/dsa/Makefile | 1 + + drivers/net/dsa/b53/b53_priv.h | 3 +- + drivers/net/dsa/microchip/ksz8.c | 742 +- + drivers/net/dsa/microchip/ksz8_reg.h | 1 + + drivers/net/dsa/microchip/ksz9477.c | 164 +- + drivers/net/dsa/microchip/ksz9477.h | 4 +- + drivers/net/dsa/microchip/ksz_common.c | 611 +- + drivers/net/dsa/microchip/ksz_common.h | 91 +- + drivers/net/dsa/microchip/ksz_ptp.c | 277 +- + drivers/net/dsa/microchip/ksz_ptp.h | 16 + + drivers/net/dsa/microchip/ksz_ptp_reg.h | 10 + + drivers/net/dsa/microchip/lan937x_main.c | 6 +- + drivers/net/dsa/mt7530-mmio.c | 1 + + drivers/net/dsa/mt7530.c | 144 +- + drivers/net/dsa/mt7530.h | 1 + + drivers/net/dsa/mt7628.c | 652 ++ + drivers/net/dsa/qca/qca8k-leds.c | 3 + + drivers/net/dsa/realtek/rtl8365mb_main.c | 619 +- + drivers/net/dsa/realtek/rtl8366rb.c | 267 +- + drivers/net/dsa/realtek/rtl83xx.c | 26 +- + drivers/net/dsa/yt921x.h | 2 +- + drivers/net/ethernet/Kconfig | 1 + + drivers/net/ethernet/Makefile | 1 + + drivers/net/ethernet/adi/Kconfig | 12 + + drivers/net/ethernet/adi/Makefile | 1 + + drivers/net/ethernet/adi/adin1140.c | 791 +++ + drivers/net/ethernet/agere/et131x.c | 2 +- + drivers/net/ethernet/airoha/airoha_eth.c | 265 +- + drivers/net/ethernet/airoha/airoha_eth.h | 33 +- + drivers/net/ethernet/airoha/airoha_npu.c | 10 +- + drivers/net/ethernet/airoha/airoha_ppe.c | 36 +- + drivers/net/ethernet/airoha/airoha_regs.h | 1 + + drivers/net/ethernet/allwinner/sun4i-emac.c | 2 +- + drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +- + drivers/net/ethernet/amd/Kconfig | 1 + + drivers/net/ethernet/amd/pds_core/core.c | 173 + + drivers/net/ethernet/amd/pds_core/core.h | 54 +- + drivers/net/ethernet/amd/pds_core/debugfs.c | 45 + + drivers/net/ethernet/amd/pds_core/dev.c | 144 +- + drivers/net/ethernet/amd/pds_core/devlink.c | 149 +- + drivers/net/ethernet/amd/pds_core/fw.c | 796 ++- + drivers/net/ethernet/amd/pds_core/main.c | 7 + + drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +- + drivers/net/ethernet/aquantia/atlantic/aq_macsec.c | 6 +- + drivers/net/ethernet/broadcom/bnge/bnge_netdev.c | 132 +- + drivers/net/ethernet/broadcom/bnge/bnge_netdev.h | 6 + + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 8 +- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 6 +- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 138 +- + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 11 +- + drivers/net/ethernet/brocade/bna/bnad.c | 2 +- + drivers/net/ethernet/cadence/macb.h | 26 +- + drivers/net/ethernet/cadence/macb_main.c | 969 +-- + drivers/net/ethernet/cadence/macb_pci.c | 46 +- + drivers/net/ethernet/cadence/macb_ptp.c | 18 +- + drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +- + drivers/net/ethernet/cisco/enic/Makefile | 3 +- + drivers/net/ethernet/cisco/enic/enic.h | 41 +- + drivers/net/ethernet/cisco/enic/enic_admin.c | 667 ++ + drivers/net/ethernet/cisco/enic/enic_admin.h | 27 + + drivers/net/ethernet/cisco/enic/enic_main.c | 431 +- + drivers/net/ethernet/cisco/enic/enic_mbox.c | 647 ++ + drivers/net/ethernet/cisco/enic/enic_mbox.h | 95 + + drivers/net/ethernet/cisco/enic/enic_pp.c | 5 + + drivers/net/ethernet/cisco/enic/enic_res.c | 4 +- + drivers/net/ethernet/cisco/enic/vnic_cq.h | 9 + + drivers/net/ethernet/cisco/enic/vnic_devcmd.h | 13 + + drivers/net/ethernet/cisco/enic/vnic_enet.h | 4 +- + drivers/net/ethernet/dec/tulip/Kconfig | 16 +- + drivers/net/ethernet/dec/tulip/Makefile | 1 - + drivers/net/ethernet/dec/tulip/xircom_cb.c | 1172 ---- + drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 12 +- + .../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 935 ++- + .../net/ethernet/freescale/dpaa2/dpaa2-switch.h | 42 +- + drivers/net/ethernet/freescale/dpaa2/dpsw-cmd.h | 18 +- + drivers/net/ethernet/freescale/dpaa2/dpsw.c | 60 + + drivers/net/ethernet/freescale/dpaa2/dpsw.h | 30 + + drivers/net/ethernet/freescale/enetc/enetc.h | 4 +- + .../net/ethernet/freescale/enetc/enetc4_debugfs.c | 42 +- + drivers/net/ethernet/freescale/enetc/enetc4_hw.h | 6 +- + drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 471 +- + .../net/ethernet/freescale/enetc/enetc_ethtool.c | 2 +- + drivers/net/ethernet/freescale/enetc/enetc_hw.h | 12 +- + drivers/net/ethernet/freescale/enetc/enetc_pf.c | 94 +- + drivers/net/ethernet/freescale/enetc/enetc_pf.h | 6 - + .../net/ethernet/freescale/enetc/enetc_pf_common.c | 150 +- + .../net/ethernet/freescale/enetc/enetc_pf_common.h | 5 + + drivers/net/ethernet/freescale/enetc/enetc_qos.c | 4 +- + drivers/net/ethernet/freescale/enetc/enetc_vf.c | 9 +- + drivers/net/ethernet/freescale/gianfar.c | 6 +- + drivers/net/ethernet/google/gve/gve_adminq.c | 89 +- + drivers/net/ethernet/google/gve/gve_adminq.h | 11 +- + drivers/net/ethernet/google/gve/gve_main.c | 111 +- + drivers/net/ethernet/google/gve/gve_rx_dqo.c | 15 +- + drivers/net/ethernet/hisilicon/hibmcge/hbg_txrx.c | 1 + + drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 4 +- + drivers/net/ethernet/hisilicon/hns3/hnae3.h | 14 + + .../hisilicon/hns3/hns3_common/hclge_comm_cmd.h | 3 + + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 48 +- + drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 + + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 9 + + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 3 +- + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 172 + + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 7 + + drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 5 +- + drivers/net/ethernet/ibm/Kconfig | 9 - + drivers/net/ethernet/ibm/Makefile | 1 - + drivers/net/ethernet/ibm/ehea/Makefile | 7 - + drivers/net/ethernet/ibm/ehea/ehea.h | 477 -- + drivers/net/ethernet/ibm/ehea/ehea_ethtool.c | 277 - + drivers/net/ethernet/ibm/ehea/ehea_hw.h | 253 - + drivers/net/ethernet/ibm/ehea/ehea_main.c | 3581 ---------- + drivers/net/ethernet/ibm/ehea/ehea_phyp.c | 612 -- + drivers/net/ethernet/ibm/ehea/ehea_phyp.h | 433 -- + drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 999 --- + drivers/net/ethernet/ibm/ehea/ehea_qmr.h | 390 -- + drivers/net/ethernet/intel/Kconfig | 2 + + drivers/net/ethernet/intel/Makefile | 1 + + drivers/net/ethernet/intel/i40e/i40e.h | 2 +- + drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +- + drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +- + drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 +- + drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +- + drivers/net/ethernet/intel/iavf/iavf.h | 2 +- + drivers/net/ethernet/intel/iavf/iavf_common.c | 2 +- + drivers/net/ethernet/intel/iavf/iavf_prototype.h | 3 +- + drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- + drivers/net/ethernet/intel/iavf/iavf_types.h | 4 +- + drivers/net/ethernet/intel/ice/ice.h | 2 +- + drivers/net/ethernet/intel/ice/ice_common.h | 2 +- + drivers/net/ethernet/intel/ice/ice_gnss.c | 5 +- + drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- + drivers/net/ethernet/intel/ice/ice_vf_lib.h | 2 +- + drivers/net/ethernet/intel/ice/virt/virtchnl.h | 2 +- + drivers/net/ethernet/intel/idpf/Kconfig | 1 + + drivers/net/ethernet/intel/idpf/Makefile | 2 - + drivers/net/ethernet/intel/idpf/idpf.h | 99 +- + drivers/net/ethernet/intel/idpf/idpf_controlq.c | 621 -- + drivers/net/ethernet/intel/idpf/idpf_controlq.h | 144 - + .../net/ethernet/intel/idpf/idpf_controlq_api.h | 177 - + .../net/ethernet/intel/idpf/idpf_controlq_setup.c | 169 - + drivers/net/ethernet/intel/idpf/idpf_dev.c | 97 +- + drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 28 +- + drivers/net/ethernet/intel/idpf/idpf_idc.c | 32 +- + drivers/net/ethernet/intel/idpf/idpf_lib.c | 69 +- + drivers/net/ethernet/intel/idpf/idpf_main.c | 115 +- + drivers/net/ethernet/intel/idpf/idpf_mem.h | 20 - + drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 +- + drivers/net/ethernet/intel/idpf/idpf_txrx.h | 4 +- + drivers/net/ethernet/intel/idpf/idpf_vf_dev.c | 92 +- + drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 1969 +++--- + drivers/net/ethernet/intel/idpf/idpf_virtchnl.h | 127 +- + .../net/ethernet/intel/idpf/idpf_virtchnl_ptp.c | 310 +- + drivers/net/ethernet/intel/igb/e1000_82575.h | 21 + + drivers/net/ethernet/intel/igb/e1000_i210.c | 6 +- + drivers/net/ethernet/intel/igb/igb.h | 3 + + drivers/net/ethernet/intel/igb/igb_ethtool.c | 89 +- + drivers/net/ethernet/intel/igb/igb_main.c | 25 +- + drivers/net/ethernet/intel/igc/igc.h | 3 + + drivers/net/ethernet/intel/igc/igc_base.c | 33 +- + drivers/net/ethernet/intel/igc/igc_defines.h | 9 +- + drivers/net/ethernet/intel/igc/igc_ethtool.c | 279 +- + drivers/net/ethernet/intel/igc/igc_hw.h | 10 +- + drivers/net/ethernet/intel/igc/igc_mac.c | 35 +- + drivers/net/ethernet/intel/igc/igc_main.c | 10 +- + drivers/net/ethernet/intel/igc/igc_phy.c | 71 +- + drivers/net/ethernet/intel/igc/igc_phy.h | 1 + + drivers/net/ethernet/intel/igc/igc_tsn.c | 8 +- + drivers/net/ethernet/intel/ixd/Kconfig | 14 + + drivers/net/ethernet/intel/ixd/Makefile | 13 + + drivers/net/ethernet/intel/ixd/ixd.h | 67 + + drivers/net/ethernet/intel/ixd/ixd_ctlq.c | 141 + + drivers/net/ethernet/intel/ixd/ixd_ctlq.h | 34 + + drivers/net/ethernet/intel/ixd/ixd_dev.c | 89 + + drivers/net/ethernet/intel/ixd/ixd_devlink.c | 99 + + drivers/net/ethernet/intel/ixd/ixd_devlink.h | 50 + + drivers/net/ethernet/intel/ixd/ixd_lan_regs.h | 68 + + drivers/net/ethernet/intel/ixd/ixd_lib.c | 173 + + drivers/net/ethernet/intel/ixd/ixd_main.c | 144 + + drivers/net/ethernet/intel/ixd/ixd_virtchnl.c | 190 + + drivers/net/ethernet/intel/ixd/ixd_virtchnl.h | 12 + + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 +- + drivers/net/ethernet/intel/libeth/rx.c | 12 +- + drivers/net/ethernet/intel/libie/Kconfig | 14 + + drivers/net/ethernet/intel/libie/Makefile | 8 + + drivers/net/ethernet/intel/libie/controlq.c | 1295 ++++ + drivers/net/ethernet/intel/libie/pci.c | 229 + + drivers/net/ethernet/marvell/mvneta.c | 18 + + drivers/net/ethernet/marvell/mvneta_bm.c | 87 +- + drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 9 +- + drivers/net/ethernet/marvell/octeontx2/af/npc.h | 4 +- + drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 +- + .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 52 +- + .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 80 +- + .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 7 +- + drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c | 1 + + .../ethernet/marvell/octeontx2/nic/otx2_common.c | 2 +- + .../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 2 +- + .../ethernet/marvell/prestera/prestera_router.c | 6 +- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 + + drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 17 +- + drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 139 +- + drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 1 + + .../ethernet/mellanox/mlx5/core/diag/rsc_dump.c | 12 +- + drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- + drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 7 +- + .../net/ethernet/mellanox/mlx5/core/en/health.c | 2 +- + .../net/ethernet/mellanox/mlx5/core/en/params.c | 4 +- + .../mellanox/mlx5/core/en_accel/en_accel.h | 19 +- + .../net/ethernet/mellanox/mlx5/core/en_accel/psp.c | 1059 ++- + .../net/ethernet/mellanox/mlx5/core/en_accel/psp.h | 18 +- + .../mellanox/mlx5/core/en_accel/psp_rxtx.c | 13 +- + .../mellanox/mlx5/core/en_accel/psp_rxtx.h | 3 +- + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 29 +- + drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 8 +- + drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 10 +- + .../net/ethernet/mellanox/mlx5/core/en_selftest.c | 2 +- + .../mellanox/mlx5/core/esw/acl/egress_ofld.c | 105 +- + .../ethernet/mellanox/mlx5/core/esw/devlink_port.c | 8 +- + drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 605 +- + drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h | 3 - + drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 27 +- + drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 18 +- + .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c | 22 +- + .../net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h | 5 +- + .../net/ethernet/mellanox/mlx5/core/lib/nv_param.c | 125 +- + drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c | 75 +- + drivers/net/ethernet/mellanox/mlx5/core/lib/sd.h | 1 + + drivers/net/ethernet/mellanox/mlx5/core/main.c | 11 +- + .../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 2 + + .../ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 15 +- + .../mellanox/mlx5/core/steering/hws/send.c | 67 +- + drivers/net/ethernet/mellanox/mlx5/core/vport.c | 6 +- + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 8 +- + .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c | 2 +- + .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.h | 2 +- + .../net/ethernet/mellanox/mlxsw/spectrum_ethtool.c | 2 + + drivers/net/ethernet/microchip/lan743x_main.c | 35 +- + drivers/net/ethernet/microchip/lan743x_main.h | 6 + + drivers/net/ethernet/microchip/lan865x/lan865x.c | 2 +- + .../microchip/sparx5/lan969x/lan969x_regs.c | 3 + + .../ethernet/microchip/sparx5/sparx5_main_regs.h | 12 + + .../net/ethernet/microchip/sparx5/sparx5_port.c | 4 + + drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 49 + + drivers/net/ethernet/microchip/sparx5/sparx5_qos.h | 1 + + .../net/ethernet/microchip/sparx5/sparx5_regs.c | 3 + + .../net/ethernet/microchip/sparx5/sparx5_regs.h | 3 + + drivers/net/ethernet/microchip/vcap/vcap_api.c | 9 +- + drivers/net/ethernet/microsoft/Kconfig | 1 + + drivers/net/ethernet/microsoft/mana/gdma_main.c | 272 +- + drivers/net/ethernet/microsoft/mana/hw_channel.c | 2 +- + drivers/net/ethernet/microsoft/mana/mana_en.c | 353 +- + drivers/net/ethernet/microsoft/mana/mana_ethtool.c | 383 +- + drivers/net/ethernet/oa_tc6.c | 263 +- + .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 2 +- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 +- + .../net/ethernet/pensando/ionic/ionic_rx_filter.c | 7 +- + drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 7 +- + drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 7 +- + .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 13 +- + drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 2 +- + .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 6 +- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 2 +- + drivers/net/ethernet/qualcomm/ppe/ppe.c | 1 - + drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 7 +- + drivers/net/ethernet/qualcomm/ppe/ppe_config.h | 2 +- + drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 3 +- + drivers/net/ethernet/realtek/r8169.h | 2 +- + drivers/net/ethernet/realtek/r8169_leds.c | 11 +- + drivers/net/ethernet/renesas/rtsn.c | 7 +- + .../net/ethernet/samsung/sxgbe/sxgbe_platform.c | 3 +- + drivers/net/ethernet/sfc/Kconfig | 9 + + drivers/net/ethernet/sfc/Makefile | 1 + + drivers/net/ethernet/sfc/ef10.c | 41 +- + drivers/net/ethernet/sfc/efx.c | 18 +- + drivers/net/ethernet/sfc/efx_cxl.c | 105 + + drivers/net/ethernet/sfc/efx_cxl.h | 32 + + drivers/net/ethernet/sfc/falcon/net_driver.h | 2 +- + drivers/net/ethernet/sfc/falcon/selftest.c | 4 +- + drivers/net/ethernet/sfc/falcon/tx.c | 16 +- + drivers/net/ethernet/sfc/mcdi.c | 7 +- + drivers/net/ethernet/sfc/net_driver.h | 10 + + drivers/net/ethernet/sfc/nic.h | 3 + + drivers/net/ethernet/sfc/selftest.c | 4 +- + drivers/net/ethernet/sfc/siena/mcdi.c | 7 +- + drivers/net/ethernet/sfc/siena/selftest.c | 4 +- + drivers/net/ethernet/sfc/siena/tx.c | 12 +- + drivers/net/ethernet/sfc/tc_encap_actions.c | 2 +- + drivers/net/ethernet/sgi/ioc3-eth.c | 9 +- + drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 9 +- + .../net/ethernet/stmicro/stmmac/dwmac-eic7700.c | 117 +- + drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 + + drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 + + drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 10 + + drivers/net/ethernet/stmicro/stmmac/hwif.c | 12 - + drivers/net/ethernet/stmicro/stmmac/ring_mode.c | 15 +- + .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 7 +- + drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c | 14 +- + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 25 +- + .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 121 +- + drivers/net/ethernet/sun/niu.c | 6 +- + drivers/net/ethernet/sun/niu.h | 2 +- + drivers/net/ethernet/ti/cpsw_priv.c | 2 +- + drivers/net/ethernet/wangxun/libwx/Makefile | 2 +- + drivers/net/ethernet/wangxun/libwx/wx_err.c | 332 + + drivers/net/ethernet/wangxun/libwx/wx_err.h | 18 + + drivers/net/ethernet/wangxun/libwx/wx_ethtool.c | 70 +- + drivers/net/ethernet/wangxun/libwx/wx_hw.c | 17 +- + drivers/net/ethernet/wangxun/libwx/wx_lib.c | 92 +- + drivers/net/ethernet/wangxun/libwx/wx_lib.h | 5 +- + drivers/net/ethernet/wangxun/libwx/wx_ptp.c | 27 + + drivers/net/ethernet/wangxun/libwx/wx_ptp.h | 1 + + drivers/net/ethernet/wangxun/libwx/wx_type.h | 24 +- + drivers/net/ethernet/wangxun/libwx/wx_vf.h | 1 - + drivers/net/ethernet/wangxun/libwx/wx_vf_common.c | 4 +- + drivers/net/ethernet/wangxun/libwx/wx_vf_common.h | 2 + + drivers/net/ethernet/wangxun/libwx/wx_vf_lib.c | 13 +- + drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c | 1 - + drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 84 +- + drivers/net/ethernet/wangxun/ngbe/ngbe_type.h | 1 + + drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 64 +- + drivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 2 +- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 +- + drivers/net/ethernet/zte/Kconfig | 20 + + drivers/net/ethernet/zte/Makefile | 6 + + drivers/net/ethernet/zte/dinghai/Kconfig | 34 + + drivers/net/ethernet/zte/dinghai/Makefile | 7 + + drivers/net/ethernet/zte/dinghai/dh_queue.h | 56 + + drivers/net/ethernet/zte/dinghai/en_pf.c | 449 ++ + drivers/net/ethernet/zte/dinghai/en_pf.h | 75 + + drivers/net/fjes/fjes_main.c | 9 +- + drivers/net/geneve.c | 549 +- + drivers/net/ipvlan/ipvlan.h | 12 +- + drivers/net/ipvlan/ipvlan_main.c | 147 +- + drivers/net/ipvlan/ipvtap.c | 25 +- + drivers/net/macsec.c | 78 +- + drivers/net/macvlan.c | 138 +- + drivers/net/mctp/Kconfig | 16 + + drivers/net/mctp/Makefile | 1 + + drivers/net/mctp/mctp-usb.c | 360 +- + drivers/net/mctp/mctp-usblib-test.c | 412 ++ + drivers/net/mctp/mctp-usblib.c | 625 ++ + drivers/net/mdio/Kconfig | 9 +- + drivers/net/netconsole.c | 594 +- + drivers/net/netdevsim/bus.c | 3 - + drivers/net/netdevsim/dev.c | 81 +- + drivers/net/netdevsim/netdevsim.h | 3 +- + drivers/net/netdevsim/psample.c | 2 +- + drivers/net/netdevsim/psp.c | 8 +- + drivers/net/pcs/pcs-mtk-lynxi.c | 7 +- + drivers/net/pfcp.c | 32 +- + drivers/net/phy/Kconfig | 15 + + drivers/net/phy/Makefile | 2 + + drivers/net/phy/adin1140-phy.c | 72 + + drivers/net/phy/dap8211r.c | 220 + + drivers/net/phy/dp83640.c | 131 +- + drivers/net/phy/mdio_device.c | 1 - + drivers/net/phy/mediatek/Kconfig | 19 +- + drivers/net/phy/mediatek/Makefile | 1 + + drivers/net/phy/mediatek/mtk-fe-soc.c | 52 + + drivers/net/phy/mediatek/mtk-ge-soc.c | 35 + + drivers/net/phy/micrel.c | 60 + + drivers/net/phy/microchip_t1.c | 6 +- + drivers/net/phy/microchip_t1s.c | 32 +- + drivers/net/phy/motorcomm.c | 13 + + drivers/net/phy/nxp-tja11xx.c | 9 + + drivers/net/phy/phy-c45.c | 125 + + drivers/net/phy/phy_device.c | 25 + + drivers/net/phy/phy_package.c | 23 + + drivers/net/phy/phylib.h | 2 + + drivers/net/phy/phylink.c | 26 +- + drivers/net/phy/qcom/at803x.c | 2 +- + drivers/net/phy/realtek/realtek_main.c | 411 ++ + drivers/net/phy/sfp.c | 45 +- + drivers/net/phy/sfp.h | 1 + + drivers/net/ppp/ppp_async.c | 2 - + drivers/net/ppp/ppp_generic.c | 153 +- + drivers/net/ppp/ppp_synctty.c | 2 - + drivers/net/ppp/pppoe.c | 20 +- + drivers/net/ppp/pptp.c | 8 +- + drivers/net/pse-pd/Kconfig | 28 + + drivers/net/pse-pd/Makefile | 3 + + drivers/net/pse-pd/realtek-pse-mcu-core.c | 998 +++ + drivers/net/pse-pd/realtek-pse-mcu-i2c.c | 148 + + drivers/net/pse-pd/realtek-pse-mcu-uart.c | 164 + + drivers/net/pse-pd/realtek-pse-mcu.h | 94 + + drivers/net/pse-pd/tps23881.c | 6 +- + drivers/net/tap.c | 5 +- + drivers/net/team/team_core.c | 4 +- + drivers/net/tun.c | 242 +- + drivers/net/tun_vnet.h | 8 +- + drivers/net/usb/cdc_ether.c | 16 + + drivers/net/usb/lg-vl600.c | 2 +- + drivers/net/usb/qmi_wwan.c | 1 + + drivers/net/usb/rndis_host.c | 6 +- + drivers/net/usb/rtl8150.c | 4 +- + drivers/net/veth.c | 34 +- + drivers/net/vrf.c | 4 +- + drivers/net/vxlan/vxlan_core.c | 44 +- + drivers/net/wan/lapbether.c | 8 +- + drivers/net/wan/wanxl.c | 17 - + drivers/net/wireguard/receive.c | 2 +- + drivers/net/wireless/Kconfig | 2 + + drivers/net/wireless/Makefile | 2 + + drivers/net/wireless/ath/ath10k/ahb.c | 12 +- + drivers/net/wireless/ath/ath10k/htt_rx.c | 6 +- + drivers/net/wireless/ath/ath10k/snoc.c | 9 +- + drivers/net/wireless/ath/ath10k/testmode.c | 14 + + drivers/net/wireless/ath/ath11k/ahb.c | 79 +- + drivers/net/wireless/ath/ath11k/core.c | 4 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 32 +- + drivers/net/wireless/ath/ath11k/wmi.c | 46 +- + drivers/net/wireless/ath/ath12k/Kconfig | 2 +- + drivers/net/wireless/ath/ath12k/ahb.c | 244 +- + drivers/net/wireless/ath/ath12k/ahb.h | 36 +- + drivers/net/wireless/ath/ath12k/core.c | 41 +- + drivers/net/wireless/ath/ath12k/core.h | 24 +- + drivers/net/wireless/ath/ath12k/debugfs.c | 14 +- + drivers/net/wireless/ath/ath12k/dp.c | 16 +- + drivers/net/wireless/ath/ath12k/dp.h | 8 +- + drivers/net/wireless/ath/ath12k/dp_mon.c | 70 +- + drivers/net/wireless/ath/ath12k/dp_mon.h | 4 +- + drivers/net/wireless/ath/ath12k/dp_tx.c | 46 + + drivers/net/wireless/ath/ath12k/dp_tx.h | 2 + + drivers/net/wireless/ath/ath12k/hal.c | 42 +- + drivers/net/wireless/ath/ath12k/hal.h | 15 +- + drivers/net/wireless/ath/ath12k/hw.h | 2 +- + drivers/net/wireless/ath/ath12k/mac.c | 104 +- + drivers/net/wireless/ath/ath12k/pci.c | 15 +- + drivers/net/wireless/ath/ath12k/peer.c | 132 +- + drivers/net/wireless/ath/ath12k/peer.h | 14 +- + drivers/net/wireless/ath/ath12k/qmi.c | 437 +- + drivers/net/wireless/ath/ath12k/qmi.h | 48 +- + drivers/net/wireless/ath/ath12k/wifi7/ahb.c | 90 +- + drivers/net/wireless/ath/ath12k/wifi7/dp.c | 2 +- + drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c | 66 +- + drivers/net/wireless/ath/ath12k/wifi7/dp_tx.c | 64 +- + .../net/wireless/ath/ath12k/wifi7/hal_qcc2072.c | 4 +- + .../net/wireless/ath/ath12k/wifi7/hal_qcn9274.c | 13 +- + .../net/wireless/ath/ath12k/wifi7/hal_rx_desc.h | 34 +- + .../net/wireless/ath/ath12k/wifi7/hal_wcn7850.c | 13 +- + drivers/net/wireless/ath/ath12k/wifi7/hw.c | 76 +- + drivers/net/wireless/ath/ath12k/wmi.c | 197 +- + drivers/net/wireless/ath/ath12k/wmi.h | 26 + + drivers/net/wireless/ath/ath6kl/cfg80211.c | 29 +- + drivers/net/wireless/ath/ath6kl/core.h | 5 +- + drivers/net/wireless/ath/ath6kl/init.c | 2 +- + drivers/net/wireless/ath/ath6kl/main.c | 1 + + drivers/net/wireless/ath/ath6kl/txrx.c | 1 + + drivers/net/wireless/ath/ath6kl/wmi.c | 19 +- + drivers/net/wireless/ath/ath6kl/wmi.h | 1 + + drivers/net/wireless/ath/carl9170/carl9170.h | 1 + + drivers/net/wireless/ath/carl9170/cmd.c | 4 +- + drivers/net/wireless/ath/carl9170/debug.c | 2 + + drivers/net/wireless/ath/carl9170/main.c | 8 +- + drivers/net/wireless/ath/carl9170/rx.c | 4 +- + drivers/net/wireless/ath/wil6210/cfg80211.c | 20 +- + drivers/net/wireless/ath/wil6210/debugfs.c | 2 +- + drivers/net/wireless/ath/wil6210/p2p.c | 6 +- + drivers/net/wireless/ath/wil6210/wil6210.h | 4 +- + drivers/net/wireless/broadcom/b43/debugfs.c | 12 +- + drivers/net/wireless/broadcom/b43legacy/debugfs.c | 12 +- + .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 161 +- + .../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +- + .../broadcom/brcm80211/brcmfmac/cyw/core.c | 8 +- + .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 47 +- + .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 68 +- + .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h | 2 +- + .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 +- + .../broadcom/brcm80211/include/brcmu_wifi.h | 2 + + drivers/net/wireless/intel/iwlwifi/cfg/bz.c | 2 +- + drivers/net/wireless/intel/iwlwifi/cfg/dr.c | 2 +- + drivers/net/wireless/intel/iwlwifi/cfg/sc.c | 2 +- + drivers/net/wireless/intel/iwlwifi/dvm/main.c | 4 +- + drivers/net/wireless/intel/iwlwifi/dvm/tx.c | 4 +- + drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 7 +- + drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 5 +- + .../net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 51 +- + drivers/net/wireless/intel/iwlwifi/fw/dump.c | 2 +- + drivers/net/wireless/intel/iwlwifi/fw/error-dump.h | 2 +- + drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 +- + drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 6 + + drivers/net/wireless/intel/iwlwifi/fw/regulatory.h | 3 +- + drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 13 +- + drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 28 +- + drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 4 +- + drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 8 +- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 33 +- + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h | 22 +- + drivers/net/wireless/intel/iwlwifi/mei/main.c | 28 +- + drivers/net/wireless/intel/iwlwifi/mld/agg.c | 9 +- + drivers/net/wireless/intel/iwlwifi/mld/d3.c | 136 +- + .../net/wireless/intel/iwlwifi/mld/ftm-initiator.c | 21 + + .../net/wireless/intel/iwlwifi/mld/ftm-initiator.h | 1 + + drivers/net/wireless/intel/iwlwifi/mld/hcmd.h | 9 +- + drivers/net/wireless/intel/iwlwifi/mld/mac80211.c | 19 +- + drivers/net/wireless/intel/iwlwifi/mld/mac80211.h | 2 + + drivers/net/wireless/intel/iwlwifi/mld/mcc.c | 26 +- + drivers/net/wireless/intel/iwlwifi/mld/mld.c | 7 +- + drivers/net/wireless/intel/iwlwifi/mld/mld.h | 2 - + drivers/net/wireless/intel/iwlwifi/mld/notif.c | 5 +- + .../net/wireless/intel/iwlwifi/mld/regulatory.c | 90 +- + drivers/net/wireless/intel/iwlwifi/mld/scan.c | 3 +- + drivers/net/wireless/intel/iwlwifi/mld/sta.c | 5 +- + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 36 + + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 +- + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 23 +- + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 10 +- + drivers/net/wireless/intel/iwlwifi/mvm/time-sync.h | 4 + + drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 54 +- + drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 + + .../wireless/intel/iwlwifi/pcie/gen1_2/tx-gen2.c | 2 + + .../net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c | 11 +- + drivers/net/wireless/intersil/p54/Kconfig | 6 +- + drivers/net/wireless/intersil/p54/fwio.c | 4 +- + drivers/net/wireless/intersil/p54/p54usb.c | 2 +- + drivers/net/wireless/marvell/libertas/debugfs.c | 39 +- + drivers/net/wireless/marvell/mwifiex/cfg80211.c | 26 +- + drivers/net/wireless/marvell/mwifiex/debugfs.c | 62 +- + drivers/net/wireless/marvell/mwifiex/main.c | 4 +- + drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 12 + + drivers/net/wireless/mediatek/mt76/channel.c | 98 +- + drivers/net/wireless/mediatek/mt76/dma.c | 48 +- + drivers/net/wireless/mediatek/mt76/dma.h | 112 +- + drivers/net/wireless/mediatek/mt76/mac80211.c | 20 +- + drivers/net/wireless/mediatek/mt76/mcu.c | 12 +- + drivers/net/wireless/mediatek/mt76/mmio.c | 18 +- + drivers/net/wireless/mediatek/mt76/mt76.h | 11 + + drivers/net/wireless/mediatek/mt76/mt7603/beacon.c | 2 + + drivers/net/wireless/mediatek/mt76/mt7603/dma.c | 2 +- + drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c | 1 + + drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 73 +- + drivers/net/wireless/mediatek/mt76/mt7603/main.c | 89 +- + drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 4 + + drivers/net/wireless/mediatek/mt76/mt7615/main.c | 5 +- + .../net/wireless/mediatek/mt76/mt7615/pci_mac.c | 5 +- + .../net/wireless/mediatek/mt76/mt7615/usb_sdio.c | 5 +- + drivers/net/wireless/mediatek/mt76/mt76_connac.h | 16 +- + .../net/wireless/mediatek/mt76/mt76_connac3_mac.h | 42 + + .../net/wireless/mediatek/mt76/mt76_connac_mac.c | 8 +- + .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 267 +- + .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 47 + + drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 5 +- + .../net/wireless/mediatek/mt76/mt7915/debugfs.c | 17 +- + drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 2 +- + drivers/net/wireless/mediatek/mt76/mt7915/init.c | 41 +- + drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 34 +- + drivers/net/wireless/mediatek/mt76/mt7915/main.c | 25 +- + drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 43 +- + drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 15 +- + drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 3 +- + drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 20 + + drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 9 +- + drivers/net/wireless/mediatek/mt76/mt7915/regs.h | 1 + + drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 2 +- + .../net/wireless/mediatek/mt76/mt7915/testmode.c | 5 +- + drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 5 +- + drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 35 +- + drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 112 +- + .../net/wireless/mediatek/mt76/mt7921/pci_mac.c | 3 +- + drivers/net/wireless/mediatek/mt76/mt7921/regd.c | 194 +- + drivers/net/wireless/mediatek/mt76/mt7921/regd.h | 55 +- + drivers/net/wireless/mediatek/mt76/mt7921/regs.h | 5 + + drivers/net/wireless/mediatek/mt76/mt7925/Makefile | 2 +- + drivers/net/wireless/mediatek/mt76/mt7925/init.c | 37 + + drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 241 +- + drivers/net/wireless/mediatek/mt76/mt7925/mac.h | 9 +- + drivers/net/wireless/mediatek/mt76/mt7925/main.c | 279 +- + drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 267 +- + drivers/net/wireless/mediatek/mt76/mt7925/mcu.h | 43 + + drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h | 9 + + drivers/net/wireless/mediatek/mt76/mt7925/nan.c | 1098 +++ + drivers/net/wireless/mediatek/mt76/mt7925/nan.h | 421 ++ + drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 305 +- + .../net/wireless/mediatek/mt76/mt7925/pci_mac.c | 8 +- + .../net/wireless/mediatek/mt76/mt7925/pci_mcu.c | 2 +- + drivers/net/wireless/mediatek/mt76/mt7925/regd.c | 250 +- + drivers/net/wireless/mediatek/mt76/mt7925/regd.h | 57 + + drivers/net/wireless/mediatek/mt76/mt7925/regs.h | 67 +- + drivers/net/wireless/mediatek/mt76/mt7925/usb.c | 8 + + drivers/net/wireless/mediatek/mt76/mt792x.h | 85 +- + drivers/net/wireless/mediatek/mt76/mt792x_core.c | 146 +- + drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 124 +- + drivers/net/wireless/mediatek/mt76/mt792x_regs.h | 25 +- + drivers/net/wireless/mediatek/mt76/mt792x_usb.c | 138 +- + drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c | 6 + + drivers/net/wireless/mediatek/mt76/mt7996/init.c | 30 +- + drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 96 +- + drivers/net/wireless/mediatek/mt76/mt7996/main.c | 75 +- + drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 205 +- + drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 42 +- + drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 93 +- + drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h | 9 +- + drivers/net/wireless/mediatek/mt76/mt7996/regs.h | 24 +- + drivers/net/wireless/mediatek/mt76/scan.c | 26 +- + drivers/net/wireless/mediatek/mt76/sdio.c | 11 +- + drivers/net/wireless/mediatek/mt76/tx.c | 102 +- + drivers/net/wireless/mediatek/mt76/usb.c | 75 +- + drivers/net/wireless/mediatek/mt76/wed.c | 7 +- + drivers/net/wireless/microchip/wilc1000/cfg80211.c | 19 +- + drivers/net/wireless/microchip/wilc1000/mon.c | 30 +- + drivers/net/wireless/morsemicro/Kconfig | 15 + + drivers/net/wireless/morsemicro/Makefile | 2 + + drivers/net/wireless/morsemicro/mm81x/Kconfig | 26 + + drivers/net/wireless/morsemicro/mm81x/Makefile | 21 + + drivers/net/wireless/morsemicro/mm81x/bus.h | 99 + + drivers/net/wireless/morsemicro/mm81x/command.c | 563 ++ + drivers/net/wireless/morsemicro/mm81x/command.h | 85 + + .../net/wireless/morsemicro/mm81x/command_defs.h | 1658 +++++ + drivers/net/wireless/morsemicro/mm81x/core.c | 138 + + drivers/net/wireless/morsemicro/mm81x/core.h | 456 ++ + drivers/net/wireless/morsemicro/mm81x/fw.c | 752 +++ + drivers/net/wireless/morsemicro/mm81x/fw.h | 143 + + drivers/net/wireless/morsemicro/mm81x/hif.h | 117 + + drivers/net/wireless/morsemicro/mm81x/hw.c | 367 + + drivers/net/wireless/morsemicro/mm81x/hw.h | 159 + + drivers/net/wireless/morsemicro/mm81x/mac.c | 2443 +++++++ + drivers/net/wireless/morsemicro/mm81x/mac.h | 63 + + drivers/net/wireless/morsemicro/mm81x/mmrc.c | 1354 ++++ + drivers/net/wireless/morsemicro/mm81x/mmrc.h | 193 + + drivers/net/wireless/morsemicro/mm81x/ps.c | 120 + + drivers/net/wireless/morsemicro/mm81x/ps.h | 22 + + drivers/net/wireless/morsemicro/mm81x/rate_code.h | 177 + + drivers/net/wireless/morsemicro/mm81x/rc.c | 494 ++ + drivers/net/wireless/morsemicro/mm81x/rc.h | 51 + + drivers/net/wireless/morsemicro/mm81x/sdio.c | 613 ++ + drivers/net/wireless/morsemicro/mm81x/skbq.c | 1064 +++ + drivers/net/wireless/morsemicro/mm81x/skbq.h | 218 + + drivers/net/wireless/morsemicro/mm81x/usb.c | 943 +++ + drivers/net/wireless/morsemicro/mm81x/yaps.c | 704 ++ + drivers/net/wireless/morsemicro/mm81x/yaps.h | 77 + + drivers/net/wireless/morsemicro/mm81x/yaps_hw.c | 702 ++ + drivers/net/wireless/morsemicro/mm81x/yaps_hw.h | 52 + + drivers/net/wireless/nxp/Kconfig | 17 + + drivers/net/wireless/nxp/Makefile | 3 + + drivers/net/wireless/nxp/nxpwifi/11ac.c | 280 + + drivers/net/wireless/nxp/nxpwifi/11ac.h | 33 + + drivers/net/wireless/nxp/nxpwifi/11ax.c | 597 ++ + drivers/net/wireless/nxp/nxpwifi/11ax.h | 73 + + drivers/net/wireless/nxp/nxpwifi/11h.c | 339 + + drivers/net/wireless/nxp/nxpwifi/11n.c | 838 +++ + drivers/net/wireless/nxp/nxpwifi/11n.h | 158 + + drivers/net/wireless/nxp/nxpwifi/11n_aggr.c | 251 + + drivers/net/wireless/nxp/nxpwifi/11n_aggr.h | 21 + + drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c | 815 +++ + drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h | 71 + + drivers/net/wireless/nxp/nxpwifi/Kconfig | 23 + + drivers/net/wireless/nxp/nxpwifi/Makefile | 39 + + drivers/net/wireless/nxp/nxpwifi/cfg.h | 1019 +++ + drivers/net/wireless/nxp/nxpwifi/cfg80211.c | 3935 +++++++++++ + drivers/net/wireless/nxp/nxpwifi/cfg80211.h | 18 + + drivers/net/wireless/nxp/nxpwifi/cfp.c | 478 ++ + drivers/net/wireless/nxp/nxpwifi/cmdevt.c | 1310 ++++ + drivers/net/wireless/nxp/nxpwifi/cmdevt.h | 122 + + drivers/net/wireless/nxp/nxpwifi/debugfs.c | 1094 +++ + drivers/net/wireless/nxp/nxpwifi/ethtool.c | 58 + + drivers/net/wireless/nxp/nxpwifi/fw.h | 2475 +++++++ + drivers/net/wireless/nxp/nxpwifi/ie.c | 480 ++ + drivers/net/wireless/nxp/nxpwifi/init.c | 607 ++ + drivers/net/wireless/nxp/nxpwifi/join.c | 787 +++ + drivers/net/wireless/nxp/nxpwifi/main.c | 1673 +++++ + drivers/net/wireless/nxp/nxpwifi/main.h | 1436 ++++ + drivers/net/wireless/nxp/nxpwifi/scan.c | 2698 ++++++++ + drivers/net/wireless/nxp/nxpwifi/sdio.c | 2328 +++++++ + drivers/net/wireless/nxp/nxpwifi/sdio.h | 340 + + drivers/net/wireless/nxp/nxpwifi/sta_cfg.c | 1177 ++++ + drivers/net/wireless/nxp/nxpwifi/sta_cmd.c | 3393 ++++++++++ + drivers/net/wireless/nxp/nxpwifi/sta_event.c | 862 +++ + drivers/net/wireless/nxp/nxpwifi/sta_rx.c | 242 + + drivers/net/wireless/nxp/nxpwifi/sta_tx.c | 190 + + drivers/net/wireless/nxp/nxpwifi/txrx.c | 352 + + drivers/net/wireless/nxp/nxpwifi/uap_cmd.c | 1256 ++++ + drivers/net/wireless/nxp/nxpwifi/uap_event.c | 506 ++ + drivers/net/wireless/nxp/nxpwifi/uap_txrx.c | 478 ++ + drivers/net/wireless/nxp/nxpwifi/util.c | 1380 ++++ + drivers/net/wireless/nxp/nxpwifi/util.h | 155 + + drivers/net/wireless/nxp/nxpwifi/wmm.c | 1318 ++++ + drivers/net/wireless/nxp/nxpwifi/wmm.h | 77 + + drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 4 +- + drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c | 2 +- + drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 2 +- + drivers/net/wireless/realtek/rtl8xxxu/8723b.c | 11 +- + drivers/net/wireless/realtek/rtl8xxxu/core.c | 20 +- + drivers/net/wireless/realtek/rtlwifi/pci.c | 49 +- + .../wireless/realtek/rtlwifi/rtl8192d/hw_common.c | 21 +- + .../net/wireless/realtek/rtlwifi/rtl8192du/sw.c | 12 +- + .../net/wireless/realtek/rtlwifi/rtl8192du/trx.c | 3 +- + .../net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 6 - + .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 7 +- + drivers/net/wireless/realtek/rtw88/bf.c | 6 +- + drivers/net/wireless/realtek/rtw88/mac80211.c | 8 +- + drivers/net/wireless/realtek/rtw88/main.h | 1 + + drivers/net/wireless/realtek/rtw88/pci.c | 14 +- + drivers/net/wireless/realtek/rtw88/rtw8723x.c | 3 +- + drivers/net/wireless/realtek/rtw88/rtw8814a.c | 3 +- + drivers/net/wireless/realtek/rtw88/rtw8821c.c | 4 +- + drivers/net/wireless/realtek/rtw88/rtw8821c.h | 3 +- + drivers/net/wireless/realtek/rtw88/rtw8822b.c | 9 +- + drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 +- + drivers/net/wireless/realtek/rtw88/rtw88xxa.c | 3 +- + drivers/net/wireless/realtek/rtw88/tx.c | 1 + + drivers/net/wireless/realtek/rtw89/Kconfig | 29 + + drivers/net/wireless/realtek/rtw89/Makefile | 9 + + drivers/net/wireless/realtek/rtw89/coex.c | 7136 ++++++++++++-------- + drivers/net/wireless/realtek/rtw89/coex.h | 155 +- + drivers/net/wireless/realtek/rtw89/core.c | 131 +- + drivers/net/wireless/realtek/rtw89/core.h | 1397 +++- + drivers/net/wireless/realtek/rtw89/debug.c | 124 +- + drivers/net/wireless/realtek/rtw89/debug.h | 1 + + drivers/net/wireless/realtek/rtw89/efuse.h | 7 + + drivers/net/wireless/realtek/rtw89/efuse_be.c | 117 +- + drivers/net/wireless/realtek/rtw89/fw.c | 1526 ++++- + drivers/net/wireless/realtek/rtw89/fw.h | 366 +- + drivers/net/wireless/realtek/rtw89/led.c | 139 + + drivers/net/wireless/realtek/rtw89/led.h | 37 + + drivers/net/wireless/realtek/rtw89/led_mc.c | 81 + + drivers/net/wireless/realtek/rtw89/mac.c | 71 +- + drivers/net/wireless/realtek/rtw89/mac.h | 52 +- + drivers/net/wireless/realtek/rtw89/mac80211.c | 38 +- + drivers/net/wireless/realtek/rtw89/mac_be.c | 87 +- + drivers/net/wireless/realtek/rtw89/pci.c | 17 + + drivers/net/wireless/realtek/rtw89/pci.h | 6 +- + drivers/net/wireless/realtek/rtw89/pci_be.c | 11 +- + drivers/net/wireless/realtek/rtw89/phy.c | 95 +- + drivers/net/wireless/realtek/rtw89/phy.h | 28 +- + drivers/net/wireless/realtek/rtw89/phy_be.c | 53 +- + drivers/net/wireless/realtek/rtw89/reg.h | 100 +- + drivers/net/wireless/realtek/rtw89/rtw8851b.c | 146 +- + drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c | 22 +- + .../net/wireless/realtek/rtw89/rtw8851b_table.c | 23 +- + .../net/wireless/realtek/rtw89/rtw8851b_table.h | 2 +- + drivers/net/wireless/realtek/rtw89/rtw8851be.c | 2 + + drivers/net/wireless/realtek/rtw89/rtw8851bu.c | 1 + + drivers/net/wireless/realtek/rtw89/rtw8852a.c | 91 +- + drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 36 +- + .../net/wireless/realtek/rtw89/rtw8852a_table.c | 27 +- + .../net/wireless/realtek/rtw89/rtw8852a_table.h | 2 +- + drivers/net/wireless/realtek/rtw89/rtw8852ae.c | 2 + + drivers/net/wireless/realtek/rtw89/rtw8852au.c | 1 + + drivers/net/wireless/realtek/rtw89/rtw8852b.c | 80 +- + .../net/wireless/realtek/rtw89/rtw8852b_common.c | 7 +- + drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c | 36 +- + .../net/wireless/realtek/rtw89/rtw8852b_table.c | 31 +- + .../net/wireless/realtek/rtw89/rtw8852b_table.h | 2 +- + drivers/net/wireless/realtek/rtw89/rtw8852be.c | 2 + + drivers/net/wireless/realtek/rtw89/rtw8852bt.c | 80 +- + drivers/net/wireless/realtek/rtw89/rtw8852bte.c | 2 + + drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 1 + + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 87 +- + drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c | 101 +- + .../net/wireless/realtek/rtw89/rtw8852c_table.c | 39 +- + .../net/wireless/realtek/rtw89/rtw8852c_table.h | 2 +- + drivers/net/wireless/realtek/rtw89/rtw8852ce.c | 2 + + drivers/net/wireless/realtek/rtw89/rtw8852cu.c | 57 +- + drivers/net/wireless/realtek/rtw89/rtw8922a.c | 142 +- + drivers/net/wireless/realtek/rtw89/rtw8922ae.c | 3 + + drivers/net/wireless/realtek/rtw89/rtw8922au.c | 1 + + drivers/net/wireless/realtek/rtw89/rtw8922d.c | 521 +- + drivers/net/wireless/realtek/rtw89/rtw8922de.c | 3 + + drivers/net/wireless/realtek/rtw89/wow.c | 27 +- + drivers/net/wireless/rsi/rsi_91x_coex.c | 3 +- + drivers/net/wireless/rsi/rsi_91x_main.c | 7 +- + drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 3 +- + drivers/net/wireless/rsi/rsi_91x_usb_ops.c | 7 +- + drivers/net/wireless/rsi/rsi_common.h | 2 +- + drivers/net/wireless/rsi/rsi_sdio.h | 2 +- + drivers/net/wireless/rsi/rsi_usb.h | 2 +- + drivers/net/wireless/ti/wlcore/main.c | 14 +- + drivers/net/wireless/virtual/mac80211_hwsim_main.c | 69 +- + drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 8 + + drivers/net/wwan/wwan_core.c | 27 +- + drivers/nfc/fdp/i2c.c | 4 +- + drivers/nfc/microread/mei.c | 10 +- + drivers/nfc/nfcmrvl/i2c.c | 6 +- + drivers/nfc/nfcmrvl/spi.c | 12 +- + drivers/nfc/nfcmrvl/usb.c | 1 - + drivers/nfc/nxp-nci/i2c.c | 14 +- + drivers/nfc/pn533/i2c.c | 10 +- + drivers/nfc/pn533/pn533.c | 10 +- + drivers/nfc/pn533/uart.c | 4 +- + drivers/nfc/pn544/i2c.c | 14 +- + drivers/nfc/pn544/mei.c | 10 +- + drivers/nfc/port100.c | 4 +- + drivers/nfc/s3fwrn5/i2c.c | 6 +- + drivers/nfc/s3fwrn5/uart.c | 4 +- + drivers/nfc/st-nci/i2c.c | 18 +- + drivers/nfc/st-nci/spi.c | 18 +- + drivers/nfc/st21nfca/i2c.c | 14 +- + drivers/nfc/st95hf/core.c | 14 +- + drivers/nfc/trf7970a.c | 14 +- + drivers/pci/controller/dwc/pcie-spacemit-k1.c | 3 - + drivers/ptp/Kconfig | 1 + + drivers/ptp/ptp_clock.c | 14 +- + drivers/ptp/ptp_fc3.c | 18 +- + drivers/s390/net/Makefile | 2 + + drivers/s390/net/ctcm_fsms.c | 20 +- + drivers/s390/net/ctcm_mpc.c | 6 +- + drivers/s390/net/fsm.h | 152 +- + drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 7 +- + drivers/usb/atm/cxacru.c | 10 +- + drivers/usb/atm/ueagle-atm.c | 3 +- + drivers/vhost/net.c | 21 +- + include/cxl/cxl.h | 2 + + include/cxl/pci.h | 22 + + include/linux/atmdev.h | 3 - + include/linux/fsl/ntmp.h | 2 + + include/linux/ieee80211-eht.h | 92 + + include/linux/ieee80211-uhr.h | 44 +- + include/linux/ieee80211.h | 12 + + include/linux/if_tun.h | 4 + + include/linux/mdio.h | 6 +- + include/linux/mlx5/driver.h | 8 +- + include/linux/mlx5/vport.h | 3 +- + include/linux/mmc/sdio_ids.h | 4 + + include/linux/net.h | 23 + + include/linux/net/intel/libie/controlq.h | 436 ++ + include/linux/net/intel/libie/pci.h | 56 + + include/linux/{avf => net/intel}/virtchnl.h | 0 + .../idpf => include/linux/net/intel}/virtchnl2.h | 0 + .../linux/net/intel}/virtchnl2_lan_desc.h | 0 + include/linux/netdevice.h | 52 +- + include/linux/netfilter.h | 7 + + include/linux/netfilter/nf_conntrack_amanda.h | 1 + + include/linux/netfilter/nf_conntrack_ftp.h | 1 + + include/linux/netfilter/nf_conntrack_h323.h | 2 - + include/linux/netfilter/nf_conntrack_irc.h | 1 + + include/linux/netfilter/nf_conntrack_pptp.h | 2 - + include/linux/netfilter/nf_conntrack_sane.h | 2 - + include/linux/netfilter/nf_conntrack_tftp.h | 3 +- + include/linux/netpoll.h | 23 +- + include/linux/oa_tc6.h | 73 +- + include/linux/pci_ids.h | 4 + + include/linux/pds/pds_core_if.h | 469 ++ + include/linux/phy.h | 9 + + include/linux/phylink.h | 1 + + include/linux/ptr_ring.h | 26 +- + include/linux/rfkill.h | 9 +- + include/linux/rtnetlink.h | 8 + + include/linux/skbuff.h | 1 + + include/linux/sonet.h | 20 - + include/linux/tcp.h | 2 +- + include/linux/udp.h | 27 + + include/linux/usb/mctp-usb.h | 88 +- + include/net/af_unix.h | 1 + + include/net/bluetooth/coredump.h | 14 + + include/net/bluetooth/hci.h | 64 + + include/net/bluetooth/hci_core.h | 33 +- + include/net/bluetooth/hci_sync.h | 5 +- + include/net/bluetooth/mgmt.h | 29 + + include/net/bond_3ad.h | 4 +- + include/net/bonding.h | 8 +- + include/net/cfg80211.h | 61 +- + include/net/devlink.h | 19 +- + include/net/dsa.h | 4 + + include/net/fib_rules.h | 4 +- + include/net/geneve.h | 5 - + include/net/gre.h | 2 - + include/net/ieee80211_radiotap.h | 190 + + include/net/ip6_fib.h | 5 +- + include/net/ip6_route.h | 2 + + include/net/ip_fib.h | 3 +- + include/net/ip_tunnels.h | 1 - + include/net/ip_vs.h | 4 +- + include/net/libeth/rx.h | 4 +- + include/net/mac80211.h | 27 +- + include/net/mana/gdma.h | 45 +- + include/net/mana/mana.h | 109 +- + include/net/mptcp.h | 4 - + include/net/ndisc.h | 2 + + include/net/net_namespace.h | 8 +- + include/net/net_shaper.h | 52 +- + include/net/netfilter/nf_conntrack_expect.h | 3 + + include/net/netfilter/nf_conntrack_helper.h | 11 +- + include/net/netfilter/nf_flow_table.h | 10 +- + include/net/netns/ipv4.h | 1 + + include/net/nexthop.h | 6 +- + include/net/scm.h | 13 +- + include/net/sctp/auth.h | 6 +- + include/net/udp.h | 2 +- + include/net/vxlan.h | 8 +- + include/trace/events/icmp.h | 2 +- + include/trace/events/mptcp.h | 6 +- + include/uapi/asm-generic/socket.h | 2 + + include/uapi/linux/batadv_packet.h | 16 +- + include/uapi/linux/devlink.h | 2 + + include/uapi/linux/dpll.h | 8 + + include/uapi/linux/ethtool.h | 6 + + include/uapi/linux/if_addr.h | 1 + + include/uapi/linux/if_tun.h | 4 + + include/uapi/linux/mdio.h | 5 + + include/uapi/linux/netdev.h | 1 + + include/uapi/linux/nexthop.h | 3 + + include/uapi/linux/nl80211.h | 46 +- + include/uapi/linux/openvswitch.h | 31 +- + include/uapi/linux/rtnetlink.h | 25 + + include/uapi/linux/seg6_iptunnel.h | 1 + + kernel/irq/manage.c | 1 + + lib/tests/blackhole_dev_kunit.c | 2 +- + net/6lowpan/nhc_udp.c | 10 +- + net/atm/atm_misc.c | 79 - + net/batman-adv/bat_algo.c | 16 +- + net/batman-adv/bat_iv_ogm.c | 331 +- + net/batman-adv/bat_iv_ogm.h | 1 + + net/batman-adv/bat_v.c | 100 +- + net/batman-adv/bat_v.h | 5 + + net/batman-adv/bat_v_elp.c | 28 +- + net/batman-adv/bat_v_ogm.c | 67 +- + net/batman-adv/bitarray.c | 9 +- + net/batman-adv/bridge_loop_avoidance.c | 122 +- + net/batman-adv/distributed-arp-table.c | 239 +- + net/batman-adv/fragmentation.c | 35 +- + net/batman-adv/gateway_client.c | 48 +- + net/batman-adv/gateway_common.c | 6 +- + net/batman-adv/hard-interface.c | 259 +- + net/batman-adv/hard-interface.h | 10 +- + net/batman-adv/hash.c | 5 +- + net/batman-adv/hash.h | 42 +- + net/batman-adv/log.h | 16 +- + net/batman-adv/main.c | 113 +- + net/batman-adv/main.h | 3 - + net/batman-adv/mesh-interface.c | 126 +- + net/batman-adv/multicast.c | 43 +- + net/batman-adv/multicast_forw.c | 26 +- + net/batman-adv/netlink.c | 26 +- + net/batman-adv/netlink.h | 2 +- + net/batman-adv/originator.c | 68 +- + net/batman-adv/routing.c | 123 +- + net/batman-adv/send.c | 13 +- + net/batman-adv/tp_meter.c | 256 +- + net/batman-adv/translation-table.c | 385 +- + net/batman-adv/tvlv.c | 130 +- + net/batman-adv/types.h | 32 +- + net/bluetooth/6lowpan.c | 2 + + net/bluetooth/Kconfig | 2 +- + net/bluetooth/Makefile | 2 + + net/bluetooth/af_bluetooth.c | 7 +- + net/bluetooth/bnep/Kconfig | 2 +- + net/bluetooth/bnep/Makefile | 2 + + net/bluetooth/coredump.c | 54 +- + net/bluetooth/hci_conn.c | 20 +- + net/bluetooth/hci_core.c | 12 +- + net/bluetooth/hci_debugfs.c | 12 +- + net/bluetooth/hci_event.c | 122 +- + net/bluetooth/hci_sync.c | 267 +- + net/bluetooth/hidp/Kconfig | 2 +- + net/bluetooth/hidp/Makefile | 2 + + net/bluetooth/iso.c | 32 +- + net/bluetooth/l2cap_core.c | 32 +- + net/bluetooth/l2cap_sock.c | 1 + + net/bluetooth/mgmt.c | 169 +- + net/bluetooth/msft.c | 5 + + net/bluetooth/rfcomm/Kconfig | 2 +- + net/bluetooth/rfcomm/Makefile | 2 + + net/bluetooth/rfcomm/core.c | 24 +- + net/bluetooth/rfcomm/sock.c | 1 + + net/bluetooth/smp.c | 7 +- + net/bluetooth/smp.h | 6 +- + net/bridge/br_arp_nd_proxy.c | 55 +- + net/bridge/br_device.c | 4 +- + net/bridge/br_input.c | 4 +- + net/bridge/br_multicast.c | 105 +- + net/bridge/br_private.h | 6 +- + net/bridge/netfilter/ebtables.c | 12 +- + net/compat.c | 4 +- + net/core/dev.c | 281 +- + net/core/devmem.c | 37 +- + net/core/devmem.h | 13 +- + net/core/failover.c | 4 +- + net/core/fib_rules.c | 83 +- + net/core/lock_debug.c | 4 +- + net/core/net-sysfs.c | 2 +- + net/core/net_namespace.c | 4 + + net/core/netdev-genl-gen.c | 11 +- + net/core/netdev-genl-gen.h | 1 + + net/core/netdev-genl.c | 30 +- + net/core/netpoll.c | 259 +- + net/core/pktgen.c | 29 +- + net/core/rtnetlink.c | 96 +- + net/core/scm.c | 40 +- + net/core/selftests.c | 4 +- + net/core/skbuff.c | 16 +- + net/core/sysctl_net_core.c | 38 +- + net/core/tso.c | 3 +- + net/devlink/core.c | 20 +- + net/devlink/dev.c | 16 +- + net/devlink/devl_internal.h | 20 + + net/devlink/dpipe.c | 14 +- + net/devlink/health.c | 12 +- + net/devlink/linecard.c | 4 +- + net/devlink/netlink.c | 82 +- + net/devlink/netlink_gen.c | 24 +- + net/devlink/netlink_gen.h | 8 + + net/devlink/param.c | 9 +- + net/devlink/port.c | 26 +- + net/devlink/rate.c | 329 +- + net/devlink/region.c | 6 +- + net/devlink/resource.c | 14 +- + net/devlink/sb.c | 22 +- + net/devlink/trap.c | 12 +- + net/dns_resolver/dns_key.c | 3 +- + net/dns_resolver/dns_query.c | 2 +- + net/dsa/Kconfig | 6 + + net/dsa/Makefile | 1 + + net/dsa/dsa.c | 22 +- + net/dsa/tag_ksz.c | 237 +- + net/dsa/tag_mt7628.c | 93 + + net/dsa/user.c | 24 +- + net/ethtool/tsconfig.c | 12 +- + net/hsr/hsr_device.c | 44 +- + net/hsr/hsr_forward.c | 46 +- + net/hsr/hsr_framereg.c | 27 +- + net/hsr/hsr_framereg.h | 2 + + net/hsr/hsr_main.h | 2 +- + net/hsr/hsr_netlink.c | 8 +- + net/ieee802154/socket.c | 38 +- + net/ipv4/devinet.c | 10 +- + net/ipv4/esp4.c | 2 +- + net/ipv4/fib_frontend.c | 69 +- + net/ipv4/fib_rules.c | 20 +- + net/ipv4/fib_trie.c | 3 +- + net/ipv4/fou_core.c | 2 +- + net/ipv4/igmp.c | 2 + + net/ipv4/ip_gre.c | 89 +- + net/ipv4/ip_tunnel.c | 17 +- + net/ipv4/ipconfig.c | 6 +- + net/ipv4/ipip.c | 18 +- + net/ipv4/netfilter/nf_nat_snmp_basic_main.c | 6 +- + net/ipv4/netfilter/nf_reject_ipv4.c | 6 +- + net/ipv4/nexthop.c | 34 +- + net/ipv4/raw.c | 41 +- + net/ipv4/route.c | 35 +- + net/ipv4/sysctl_net_ipv4.c | 54 +- + net/ipv4/tcp_minisocks.c | 4 +- + net/ipv4/tcp_output.c | 8 +- + net/ipv4/tcp_timer.c | 2 +- + net/ipv4/udp.c | 52 +- + net/ipv4/udp_offload.c | 49 +- + net/ipv4/udp_tunnel_core.c | 2 +- + net/ipv4/xfrm4_policy.c | 22 +- + net/ipv6/Makefile | 2 +- + net/ipv6/addrconf.c | 28 +- + net/ipv6/esp6.c | 5 +- + net/ipv6/fib6_rules.c | 17 +- + net/ipv6/fou6.c | 2 +- + net/ipv6/icmp.c | 2 +- + net/ipv6/ip6_fib.c | 14 +- + net/ipv6/ip6_gre.c | 5 +- + net/ipv6/ip6_tunnel.c | 35 +- + net/ipv6/ip6_udp_tunnel.c | 2 +- + net/ipv6/mcast.c | 1 + + net/ipv6/ndisc.c | 5 +- + net/ipv6/ndisc_snoop.c | 190 + + net/ipv6/netfilter/nf_reject_ipv6.c | 8 +- + net/ipv6/raw.c | 29 +- + net/ipv6/route.c | 77 +- + net/ipv6/seg6_iptunnel.c | 132 +- + net/ipv6/sysctl_net_ipv6.c | 2 +- + net/ipv6/udp.c | 32 +- + net/ipv6/udp_offload.c | 2 +- + net/ipv6/xfrm6_policy.c | 22 +- + net/l2tp/l2tp_core.c | 2 +- + net/l2tp/l2tp_netlink.c | 7 +- + net/mac80211/airtime.c | 87 +- + net/mac80211/cfg.c | 141 +- + net/mac80211/chan.c | 6 +- + net/mac80211/debugfs.c | 32 +- + net/mac80211/ibss.c | 4 +- + net/mac80211/ieee80211_i.h | 26 +- + net/mac80211/link.c | 3 +- + net/mac80211/main.c | 5 +- + net/mac80211/mlme.c | 182 +- + net/mac80211/offchannel.c | 27 +- + net/mac80211/parse.c | 4 +- + net/mac80211/s1g.c | 2 +- + net/mac80211/spectmgmt.c | 11 +- + net/mac80211/sta_info.c | 66 +- + net/mac80211/sta_info.h | 3 +- + net/mac80211/status.c | 10 +- + net/mac80211/tdls.c | 2 +- + net/mac80211/tx.c | 111 +- + net/mac80211/util.c | 24 +- + net/mptcp/mib.c | 10 + + net/mptcp/mib.h | 10 + + net/mptcp/options.c | 32 +- + net/mptcp/pm.c | 44 +- + net/mptcp/pm_userspace.c | 7 +- + net/mptcp/protocol.c | 313 +- + net/mptcp/protocol.h | 16 +- + net/mptcp/subflow.c | 10 + + net/netfilter/ipvs/ip_vs_core.c | 9 +- + net/netfilter/ipvs/ip_vs_ctl.c | 6 +- + net/netfilter/ipvs/ip_vs_est.c | 2 +- + net/netfilter/ipvs/ip_vs_nfct.c | 2 +- + net/netfilter/ipvs/ip_vs_xmit.c | 2 +- + net/netfilter/nf_conncount.c | 2 + + net/netfilter/nf_conntrack_amanda.c | 8 +- + net/netfilter/nf_conntrack_broadcast.c | 8 +- + net/netfilter/nf_conntrack_core.c | 2 +- + net/netfilter/nf_conntrack_ecache.c | 7 +- + net/netfilter/nf_conntrack_expect.c | 11 + + net/netfilter/nf_conntrack_ftp.c | 34 +- + net/netfilter/nf_conntrack_h323_main.c | 12 +- + net/netfilter/nf_conntrack_helper.c | 91 +- + net/netfilter/nf_conntrack_irc.c | 29 +- + net/netfilter/nf_conntrack_netbios_ns.c | 2 - + net/netfilter/nf_conntrack_netlink.c | 5 + + net/netfilter/nf_conntrack_ovs.c | 6 +- + net/netfilter/nf_conntrack_pptp.c | 2 +- + net/netfilter/nf_conntrack_proto_tcp.c | 6 +- + net/netfilter/nf_conntrack_proto_udp.c | 15 +- + net/netfilter/nf_conntrack_sane.c | 34 +- + net/netfilter/nf_conntrack_sip.c | 45 +- + net/netfilter/nf_conntrack_snmp.c | 4 +- + net/netfilter/nf_conntrack_standalone.c | 2 +- + net/netfilter/nf_conntrack_tftp.c | 35 +- + net/netfilter/nf_flow_table_core.c | 2 + + net/netfilter/nf_flow_table_ip.c | 175 +- + net/netfilter/nf_flow_table_path.c | 118 +- + net/netfilter/nf_hooks_lwtunnel.c | 4 +- + net/netfilter/nf_log_syslog.c | 2 +- + net/netfilter/nf_nat_amanda.c | 7 +- + net/netfilter/nf_nat_core.c | 6 - + net/netfilter/nf_nat_ftp.c | 4 +- + net/netfilter/nf_nat_helper.c | 2 +- + net/netfilter/nf_nat_irc.c | 2 +- + net/netfilter/nf_nat_proto.c | 8 + + net/netfilter/nf_nat_sip.c | 5 + + net/netfilter/nf_nat_tftp.c | 5 +- + net/netfilter/nfnetlink_cthelper.c | 21 +- + net/netfilter/nfnetlink_cttimeout.c | 2 +- + net/netfilter/nfnetlink_hook.c | 37 +- + net/netfilter/nft_ct.c | 168 +- + net/netfilter/nft_meta.c | 6 +- + net/netfilter/nft_rt.c | 6 +- + net/netfilter/nft_set_rbtree.c | 3 +- + net/netfilter/nft_xfrm.c | 9 +- + net/netfilter/x_tables.c | 30 +- + net/netfilter/xt_TCPOPTSTRIP.c | 8 +- + net/netfilter/xt_dscp.c | 12 + + net/netfilter/xt_recent.c | 2 +- + net/netfilter/xt_tcpmss.c | 14 + + net/netlink/af_netlink.c | 2 +- + net/openvswitch/Kconfig | 35 - + net/openvswitch/Makefile | 4 - + net/openvswitch/conntrack.c | 12 +- + net/openvswitch/datapath.c | 28 +- + net/openvswitch/vport-geneve.c | 143 - + net/openvswitch/vport-gre.c | 106 - + net/openvswitch/vport-netdev.c | 29 +- + net/openvswitch/vport-netdev.h | 2 - + net/openvswitch/vport-vxlan.c | 172 - + net/openvswitch/vport.c | 81 +- + net/openvswitch/vport.h | 23 +- + net/phonet/pep.c | 36 +- + net/psp/psp_main.c | 2 +- + net/psp/psp_nl.c | 3 +- + net/psp/psp_sock.c | 2 +- + net/rds/ib_rdma.c | 4 +- + net/rds/info.c | 23 +- + net/rds/loop.c | 6 +- + net/rds/message.c | 26 + + net/rds/rdma.c | 63 +- + net/rds/rds.h | 15 +- + net/rds/recv.c | 3 + + net/rds/send.c | 33 +- + net/sched/act_csum.c | 4 +- + net/sched/act_ct.c | 10 +- + net/sched/cls_api.c | 18 +- + net/sched/sch_mqprio.c | 4 +- + net/sched/sch_mqprio_lib.c | 10 +- + net/sched/sch_taprio.c | 35 +- + net/sctp/associola.c | 4 + + net/sctp/auth.c | 10 +- + net/sctp/endpointola.c | 4 + + net/sctp/output.c | 12 +- + net/sctp/sm_statefuns.c | 9 +- + net/sctp/sysctl.c | 2 +- + net/smc/smc_sysctl.c | 26 +- + net/sysctl_net.c | 23 +- + net/tls/tls_main.c | 80 +- + net/unix/af_unix.c | 24 +- + net/unix/sysctl_net_unix.c | 21 +- + net/vmw_vsock/af_vsock.c | 25 +- + net/vmw_vsock/virtio_transport_common.c | 49 +- + net/wireless/core.c | 3 + + net/wireless/core.h | 7 +- + net/wireless/mlme.c | 2 +- + net/wireless/nl80211.c | 546 +- + net/wireless/rdev-ops.h | 24 +- + net/wireless/reg.c | 3 +- + net/wireless/scan.c | 93 +- + net/wireless/tests/scan.c | 121 +- + net/wireless/trace.h | 2 +- + net/wireless/util.c | 107 +- + net/wireless/wext-compat.c | 3 +- + net/wireless/wext-core.c | 6 +- + net/xdp/xsk_queue.c | 12 +- + net/xfrm/xfrm_nat_keepalive.c | 2 +- + net/xfrm/xfrm_sysctl.c | 2 +- + tools/include/uapi/linux/if_tun.h | 4 + + tools/include/uapi/linux/netdev.h | 1 + + tools/net/ynl/Makefile.deps | 1 + + tools/net/ynl/pyynl/__init__.py | 9 + + tools/net/ynl/pyynl/cli.py | 56 +- + tools/net/ynl/pyynl/lib/__init__.py | 3 +- + tools/net/ynl/pyynl/lib/nlspec.py | 22 +- + tools/net/ynl/pyynl/lib/specdir.py | 51 + + tools/net/ynl/pyynl/lib/ynl.py | 19 +- + tools/net/ynl/pyynl/ynl_gen_c.py | 35 +- + tools/net/ynl/tests/ethtool.py | 7 +- + tools/testing/selftests/bpf/prog_tests/test_xsk.c | 4 +- + .../drivers/net/bonding/bond_topo_2d1c.sh | 10 +- + tools/testing/selftests/drivers/net/config | 5 + + tools/testing/selftests/drivers/net/hw/Makefile | 6 +- + tools/testing/selftests/drivers/net/hw/config | 2 + + tools/testing/selftests/drivers/net/hw/csum.py | 2 +- + .../drivers/net/hw/devlink_rate_cross_esw.py | 296 + + tools/testing/selftests/drivers/net/hw/devmem.py | 11 +- + .../testing/selftests/drivers/net/hw/devmem_lib.py | 114 +- + .../selftests/drivers/net/hw/ethtool_rmon.sh | 2 + + .../selftests/drivers/net/hw/ethtool_std_stats.sh | 6 +- + tools/testing/selftests/drivers/net/hw/ncdevmem.c | 38 +- + .../testing/selftests/drivers/net/hw/nk_devmem.py | 10 +- + tools/testing/selftests/drivers/net/hw/rss_ctx.py | 11 +- + tools/testing/selftests/drivers/net/hw/toeplitz.py | 22 + + tools/testing/selftests/drivers/net/hw/tso.py | 2 +- + tools/testing/selftests/drivers/net/lib/py/env.py | 59 +- + .../selftests/drivers/net/netconsole/Makefile | 1 + + .../drivers/net/netconsole/netcons_userdata.sh | 229 + + .../drivers/net/netdevsim/ethtool-coalesce.sh | 10 +- + .../testing/selftests/drivers/net/ring_reconfig.py | 255 +- + tools/testing/selftests/drivers/net/shaper.py | 1065 ++- + tools/testing/selftests/drivers/net/so_txtime.py | 21 +- + tools/testing/selftests/drivers/net/xdp.py | 94 +- + tools/testing/selftests/net/Makefile | 5 +- + tools/testing/selftests/net/af_unix/.gitignore | 2 + + tools/testing/selftests/net/af_unix/Makefile | 8 + + tools/testing/selftests/net/af_unix/config | 7 + + .../net/af_unix/scm_rights_denial_lsm.bpf.c | 36 + + .../selftests/net/af_unix/scm_rights_denial_lsm.c | 292 + + tools/testing/selftests/net/big_tcp_tunnels.sh | 188 + + tools/testing/selftests/net/config | 6 +- + tools/testing/selftests/net/fib_nexthops.sh | 83 + + tools/testing/selftests/net/fin_ack_lat.c | 2 +- + tools/testing/selftests/net/forwarding/lib.sh | 15 + + tools/testing/selftests/net/fou_mcast_encap.sh | 172 + + tools/testing/selftests/net/getsockopt_iter.c | 336 + + tools/testing/selftests/net/hsr/Makefile | 1 + + tools/testing/selftests/net/hsr/hsr_prp_redbox.sh | 99 + + tools/testing/selftests/net/ipv6_flowlabel.sh | 3 - + tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 576 +- + tools/testing/selftests/net/lib/py/__init__.py | 4 +- + tools/testing/selftests/net/lib/py/ynl.py | 7 +- + tools/testing/selftests/net/mptcp/mptcp_connect.c | 4 +- + tools/testing/selftests/net/mptcp/mptcp_connect.sh | 8 +- + tools/testing/selftests/net/mptcp/mptcp_diag.c | 3 +- + tools/testing/selftests/net/mptcp/mptcp_join.sh | 95 +- + tools/testing/selftests/net/mptcp/simult_flows.sh | 11 +- + .../selftests/net/netfilter/conntrack_dump_flush.c | 31 +- + tools/testing/selftests/net/openvswitch/config | 4 +- + .../selftests/net/openvswitch/openvswitch.sh | 296 +- + .../testing/selftests/net/openvswitch/ovs-dpctl.py | 122 +- + tools/testing/selftests/net/psock_snd.c | 237 +- + tools/testing/selftests/net/psock_snd.sh | 15 + + tools/testing/selftests/net/reuseport_bpf_numa.c | 24 + + tools/testing/selftests/net/rtnetlink.py | 286 +- + .../selftests/net/srv6_encap_lookup_l3vpn_test.sh | 1027 +++ + .../selftests/net/srv6_end_dt46_l3vpn_test.sh | 10 + + tools/testing/selftests/net/tcp_mmap.c | 10 +- + tools/testing/selftests/net/test_vxlan_nh.sh | 40 +- + .../tc-testing/tc-tests/infra/qdiscs.json | 164 + + 1387 files changed, 110662 insertions(+), 28564 deletions(-) + create mode 100644 Documentation/ABI/testing/sysfs-bus-pci-drivers-btintel_pcie + create mode 100644 Documentation/devicetree/bindings/net/adi,ad3306.yaml + create mode 100644 Documentation/devicetree/bindings/net/can/ti,am3517-hecc.yaml + delete mode 100644 Documentation/devicetree/bindings/net/can/ti_hecc.txt + create mode 100644 Documentation/devicetree/bindings/net/dptel,dap8211r.yaml + create mode 100644 Documentation/devicetree/bindings/net/dsa/mediatek,mt7628-esw.yaml + create mode 100644 Documentation/devicetree/bindings/net/microchip,lan7800.yaml + delete mode 100644 Documentation/devicetree/bindings/net/microchip,lan78xx.txt + create mode 100644 Documentation/devicetree/bindings/net/pse-pd/realtek,pse-mcu-gen1.yaml + create mode 100644 Documentation/networking/device_drivers/ethernet/intel/ixd.rst + create mode 100644 Documentation/networking/devlink/ixd.rst + create mode 100644 drivers/net/dsa/mt7628.c + create mode 100644 drivers/net/ethernet/adi/adin1140.c + create mode 100644 drivers/net/ethernet/cisco/enic/enic_admin.c + create mode 100644 drivers/net/ethernet/cisco/enic/enic_admin.h + create mode 100644 drivers/net/ethernet/cisco/enic/enic_mbox.c + create mode 100644 drivers/net/ethernet/cisco/enic/enic_mbox.h + delete mode 100644 drivers/net/ethernet/dec/tulip/xircom_cb.c + delete mode 100644 drivers/net/ethernet/ibm/ehea/Makefile + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea.h + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_ethtool.c + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_hw.h + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_main.c + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_phyp.c + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_phyp.h + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_qmr.c + delete mode 100644 drivers/net/ethernet/ibm/ehea/ehea_qmr.h + delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq.c + delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq.h + delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq_api.h + delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_controlq_setup.c + delete mode 100644 drivers/net/ethernet/intel/idpf/idpf_mem.h + create mode 100644 drivers/net/ethernet/intel/ixd/Kconfig + create mode 100644 drivers/net/ethernet/intel/ixd/Makefile + create mode 100644 drivers/net/ethernet/intel/ixd/ixd.h + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_ctlq.h + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_dev.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_devlink.h + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lan_regs.h + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_lib.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_main.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.c + create mode 100644 drivers/net/ethernet/intel/ixd/ixd_virtchnl.h + create mode 100644 drivers/net/ethernet/intel/libie/controlq.c + create mode 100644 drivers/net/ethernet/intel/libie/pci.c + create mode 100644 drivers/net/ethernet/sfc/efx_cxl.c + create mode 100644 drivers/net/ethernet/sfc/efx_cxl.h + create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_err.c + create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_err.h + create mode 100644 drivers/net/ethernet/zte/Kconfig + create mode 100644 drivers/net/ethernet/zte/Makefile + create mode 100644 drivers/net/ethernet/zte/dinghai/Kconfig + create mode 100644 drivers/net/ethernet/zte/dinghai/Makefile + create mode 100644 drivers/net/ethernet/zte/dinghai/dh_queue.h + create mode 100644 drivers/net/ethernet/zte/dinghai/en_pf.c + create mode 100644 drivers/net/ethernet/zte/dinghai/en_pf.h + create mode 100644 drivers/net/mctp/mctp-usblib-test.c + create mode 100644 drivers/net/mctp/mctp-usblib.c + create mode 100644 drivers/net/phy/adin1140-phy.c + create mode 100644 drivers/net/phy/dap8211r.c + create mode 100644 drivers/net/phy/mediatek/mtk-fe-soc.c + create mode 100644 drivers/net/pse-pd/realtek-pse-mcu-core.c + create mode 100644 drivers/net/pse-pd/realtek-pse-mcu-i2c.c + create mode 100644 drivers/net/pse-pd/realtek-pse-mcu-uart.c + create mode 100644 drivers/net/pse-pd/realtek-pse-mcu.h + create mode 100644 drivers/net/wireless/mediatek/mt76/mt7925/nan.c + create mode 100644 drivers/net/wireless/mediatek/mt76/mt7925/nan.h + create mode 100644 drivers/net/wireless/morsemicro/Kconfig + create mode 100644 drivers/net/wireless/morsemicro/Makefile + create mode 100644 drivers/net/wireless/morsemicro/mm81x/Kconfig + create mode 100644 drivers/net/wireless/morsemicro/mm81x/Makefile + create mode 100644 drivers/net/wireless/morsemicro/mm81x/bus.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/command.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/command.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/command_defs.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/core.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/core.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/fw.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/fw.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/hif.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/hw.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/hw.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/mac.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/mac.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/mmrc.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/mmrc.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/ps.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/ps.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/rate_code.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/rc.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/rc.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/sdio.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/skbq.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/skbq.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/usb.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/yaps.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/yaps.h + create mode 100644 drivers/net/wireless/morsemicro/mm81x/yaps_hw.c + create mode 100644 drivers/net/wireless/morsemicro/mm81x/yaps_hw.h + create mode 100644 drivers/net/wireless/nxp/Kconfig + create mode 100644 drivers/net/wireless/nxp/Makefile + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11ac.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11ac.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11ax.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11ax.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11h.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n_aggr.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n_aggr.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/11n_rxreorder.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/Kconfig + create mode 100644 drivers/net/wireless/nxp/nxpwifi/Makefile + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cfg.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cfg80211.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cfg80211.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cfp.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cmdevt.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/cmdevt.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/debugfs.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/ethtool.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/fw.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/ie.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/init.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/join.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/main.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/main.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/scan.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sdio.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sdio.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sta_cfg.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sta_cmd.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sta_event.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sta_rx.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/sta_tx.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/txrx.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/uap_cmd.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/uap_event.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/uap_txrx.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/util.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/util.h + create mode 100644 drivers/net/wireless/nxp/nxpwifi/wmm.c + create mode 100644 drivers/net/wireless/nxp/nxpwifi/wmm.h + create mode 100644 drivers/net/wireless/realtek/rtw89/led.c + create mode 100644 drivers/net/wireless/realtek/rtw89/led.h + create mode 100644 drivers/net/wireless/realtek/rtw89/led_mc.c + create mode 100644 include/cxl/pci.h + create mode 100644 include/linux/net/intel/libie/controlq.h + create mode 100644 include/linux/net/intel/libie/pci.h + rename include/linux/{avf => net/intel}/virtchnl.h (100%) + rename {drivers/net/ethernet/intel/idpf => include/linux/net/intel}/virtchnl2.h (100%) + rename {drivers/net/ethernet/intel/idpf => include/linux/net/intel}/virtchnl2_lan_desc.h (100%) + delete mode 100644 include/linux/sonet.h + create mode 100644 net/dsa/tag_mt7628.c + create mode 100644 net/ipv6/ndisc_snoop.c + delete mode 100644 net/openvswitch/vport-geneve.c + delete mode 100644 net/openvswitch/vport-gre.c + delete mode 100644 net/openvswitch/vport-vxlan.c + create mode 100644 tools/net/ynl/pyynl/lib/specdir.py + create mode 100755 tools/testing/selftests/drivers/net/hw/devlink_rate_cross_esw.py + create mode 100755 tools/testing/selftests/drivers/net/netconsole/netcons_userdata.sh + create mode 100644 tools/testing/selftests/net/af_unix/scm_rights_denial_lsm.bpf.c + create mode 100644 tools/testing/selftests/net/af_unix/scm_rights_denial_lsm.c + create mode 100755 tools/testing/selftests/net/big_tcp_tunnels.sh + create mode 100755 tools/testing/selftests/net/fou_mcast_encap.sh + create mode 100755 tools/testing/selftests/net/hsr/hsr_prp_redbox.sh + create mode 100755 tools/testing/selftests/net/srv6_encap_lookup_l3vpn_test.sh +Merging bpf-next/for-next (f79066c784022 selftests/bpf: Add tests for a store on a fault prone qdisc pointer) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git bpf-next/for-next +Auto-merging MAINTAINERS +Auto-merging arch/s390/net/bpf_jit_comp.c +Auto-merging include/linux/btf.h +Auto-merging kernel/bpf/btf.c +Auto-merging net/socket.c +Auto-merging net/unix/af_unix.c +Auto-merging tools/bpf/resolve_btfids/Makefile +Auto-merging tools/lib/bpf/features.c +Auto-merging tools/lib/bpf/usdt.c +Auto-merging tools/testing/selftests/bpf/Makefile +Auto-merging tools/testing/selftests/bpf/bench.c +Auto-merging tools/testing/selftests/bpf/bpf_experimental.h +Merge made by the 'ort' strategy. + Documentation/bpf/bpf_devel_QA.rst | 5 +- + Documentation/bpf/index.rst | 1 + + Documentation/bpf/kfuncs.rst | 99 +- + Documentation/bpf/signing.rst | 497 +++ + Documentation/process/changes.rst | 5 - + MAINTAINERS | 6 +- + arch/arm64/include/asm/insn.h | 23 + + arch/arm64/lib/insn.c | 60 + + arch/arm64/net/bpf_jit.h | 11 + + arch/arm64/net/bpf_jit_comp.c | 229 +- + arch/riscv/net/Makefile | 2 +- + arch/riscv/net/bpf_jit.h | 1 + + arch/riscv/net/bpf_jit_comp32.c | 111 +- + arch/riscv/net/bpf_jit_comp64.c | 158 +- + arch/riscv/net/bpf_jit_core.c | 5 +- + arch/riscv/net/bpf_timed_may_goto.S | 47 + + arch/s390/net/bpf_jit_comp.c | 213 +- + arch/x86/mm/init.c | 4 +- + arch/x86/net/bpf_jit_comp.c | 178 +- + drivers/hid/bpf/hid_bpf_dispatch.c | 10 +- + include/linux/bpf.h | 123 +- + include/linux/bpf_ksock.h | 36 + + include/linux/bpf_verifier.h | 173 +- + include/linux/btf.h | 2 + + include/linux/filter.h | 70 +- + include/linux/socket.h | 2 + + include/uapi/linux/bpf.h | 117 +- + kernel/bpf/Makefile | 2 +- + kernel/bpf/arena.c | 43 +- + kernel/bpf/arraymap.c | 72 +- + kernel/bpf/backtrack.c | 5 +- + kernel/bpf/bloom_filter.c | 19 +- + kernel/bpf/bpf_iter.c | 17 +- + kernel/bpf/bpf_lsm.c | 5 +- + kernel/bpf/bpf_struct_ops.c | 68 +- + kernel/bpf/btf.c | 100 +- + kernel/bpf/cfg.c | 38 +- + kernel/bpf/cgroup.c | 35 +- + kernel/bpf/check_btf.c | 14 +- + kernel/bpf/const_fold.c | 12 +- + kernel/bpf/core.c | 95 +- + kernel/bpf/cpumask.c | 6 +- + kernel/bpf/diagnostics.c | 2359 +++++++++++++ + kernel/bpf/diagnostics.h | 111 + + kernel/bpf/disasm.c | 68 +- + kernel/bpf/dispatcher.c | 5 +- + kernel/bpf/fixups.c | 254 +- + kernel/bpf/hashtab.c | 2 - + kernel/bpf/helpers.c | 116 +- + kernel/bpf/liveness.c | 120 +- + kernel/bpf/log.c | 11 - + kernel/bpf/mmap_unlock_work.h | 51 +- + kernel/bpf/net_namespace.c | 17 +- + kernel/bpf/queue_stack_maps.c | 9 +- + kernel/bpf/ringbuf.c | 6 +- + kernel/bpf/rqspinlock.c | 8 +- + kernel/bpf/stackmap.c | 351 +- + kernel/bpf/states.c | 3 +- + kernel/bpf/syscall.c | 142 +- + kernel/bpf/task_iter.c | 48 +- + kernel/bpf/trampoline.c | 73 +- + kernel/bpf/verifier.c | 3551 +++++++++++++------- + kernel/trace/bpf_trace.c | 119 +- + net/core/Makefile | 3 + + net/core/bpf_ksock.c | 328 ++ + net/core/filter.c | 508 ++- + net/core/lwt_bpf.c | 15 +- + net/core/sock_map.c | 8 +- + net/ipv4/tcp_ipv4.c | 4 +- + net/socket.c | 32 +- + net/unix/af_unix.c | 4 +- + scripts/Makefile.btf | 4 +- + tools/bpf/bpftool/Makefile | 2 +- + tools/bpf/bpftool/btf.c | 13 +- + tools/bpf/bpftool/btf_dumper.c | 14 +- + tools/bpf/bpftool/common.c | 4 + + tools/bpf/bpftool/gen.c | 55 +- + tools/bpf/bpftool/link.c | 133 + + tools/bpf/bpftool/map.c | 16 +- + tools/bpf/bpftool/sign.c | 24 +- + tools/bpf/bpftool/struct_ops.c | 4 + + tools/bpf/bpftool/xlated_dumper.c | 19 +- + tools/bpf/resolve_btfids/Makefile | 5 +- + tools/bpf/resolve_btfids/main.c | 478 ++- + tools/include/linux/btf_ids.h | 78 +- + tools/include/uapi/linux/bpf.h | 117 +- + tools/lib/bpf/bpf_gen_internal.h | 4 +- + tools/lib/bpf/btf.c | 20 +- + tools/lib/bpf/btf.h | 2 + + tools/lib/bpf/btf_dump.c | 4 +- + tools/lib/bpf/btf_relocate.c | 8 +- + tools/lib/bpf/elf.c | 2 +- + tools/lib/bpf/features.c | 35 + + tools/lib/bpf/gen_loader.c | 95 +- + tools/lib/bpf/libbpf.c | 183 +- + tools/lib/bpf/libbpf.map | 1 + + tools/lib/bpf/libbpf_internal.h | 5 +- + tools/lib/bpf/nlattr.c | 2 +- + tools/lib/bpf/relo_core.c | 22 +- + tools/lib/bpf/ringbuf.c | 2 +- + tools/lib/bpf/skel_internal.h | 55 +- + tools/lib/bpf/usdt.c | 33 +- + tools/sched_ext/include/scx/compat.bpf.h | 2 +- + tools/testing/selftests/bpf/DENYLIST.riscv64 | 1 - + tools/testing/selftests/bpf/Makefile | 32 +- + tools/testing/selftests/bpf/README.rst | 4 +- + tools/testing/selftests/bpf/bench.c | 4 + + tools/testing/selftests/bpf/benchs/bench_bpf_for.c | 104 + + .../selftests/bpf/benchs/run_bench_bpf_for.sh | 15 + + tools/testing/selftests/bpf/bpf_experimental.h | 7 + + tools/testing/selftests/bpf/config.aarch64 | 1 - + tools/testing/selftests/bpf/config.ppc64el | 1 - + tools/testing/selftests/bpf/config.riscv64 | 1 - + tools/testing/selftests/bpf/config.s390x | 1 - + tools/testing/selftests/bpf/config.x86_64 | 1 - + tools/testing/selftests/bpf/disasm_helpers.c | 3 +- + .../bpf/libarena/include/bpf_arena_spin_lock.h | 7 +- + .../selftests/bpf/libarena/include/bpf_atomic.h | 20 + + .../bpf/libarena/include/libarena/bitmap.h | 34 + + .../bpf/libarena/include/libarena/common.h | 2 +- + .../bpf/libarena/include/libarena/userspace.h | 2 +- + .../{st_asan_buddy.bpf.c => test_asan_buddy.bpf.c} | 10 +- + .../{st_asan_common.h => test_asan_common.h} | 0 + .../bpf/libarena/selftests/test_bitmap.bpf.c | 394 +++ + .../selftests/{st_buddy.bpf.c => test_buddy.bpf.c} | 8 +- + .../libarena/selftests/test_parallel_bitmap.bpf.c | 190 ++ + .../libarena/selftests/test_parallel_spmc.bpf.c | 9 +- + .../selftests/bpf/libarena/src/bitmap.bpf.c | 245 ++ + .../selftests/bpf/libarena/src/common.bpf.c | 16 +- + tools/testing/selftests/bpf/network_helpers.c | 28 +- + tools/testing/selftests/bpf/network_helpers.h | 5 + + .../selftests/bpf/prog_tests/arena_atomics.c | 2 +- + .../selftests/bpf/prog_tests/arena_direct_value.c | 2 +- + .../testing/selftests/bpf/prog_tests/arena_htab.c | 2 +- + .../testing/selftests/bpf/prog_tests/arena_list.c | 2 +- + .../selftests/bpf/prog_tests/arena_mem_usage.c | 122 + + .../selftests/bpf/prog_tests/arena_spin_lock.c | 2 +- + .../selftests/bpf/prog_tests/arena_strsearch.c | 2 +- + tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c | 2 + + .../testing/selftests/bpf/prog_tests/bpf_tcp_ca.c | 12 + + tools/testing/selftests/bpf/prog_tests/btf.c | 48 + + .../selftests/bpf/prog_tests/cgroup_iter_memcg.c | 43 + + .../selftests/bpf/prog_tests/fexit_bpf2bpf.c | 71 +- + .../testing/selftests/bpf/prog_tests/fib_lookup.c | 741 +++- + .../selftests/bpf/prog_tests/fill_link_info.c | 242 ++ + .../bpf/prog_tests/get_smp_processor_id.c | 45 + + .../selftests/bpf/prog_tests/global_data_init.c | 336 ++ + .../selftests/bpf/prog_tests/global_map_resize.c | 8 +- + .../selftests/bpf/prog_tests/icmp_send_kfunc.c | 292 ++ + .../testing/selftests/bpf/prog_tests/kfunc_call.c | 4 + + tools/testing/selftests/bpf/prog_tests/ksock.c | 130 + + tools/testing/selftests/bpf/prog_tests/ksock_wq.c | 45 + + tools/testing/selftests/bpf/prog_tests/libarena.c | 28 +- + .../selftests/bpf/prog_tests/libarena_asan.c | 10 +- + .../testing/selftests/bpf/prog_tests/linked_list.c | 1 + + tools/testing/selftests/bpf/prog_tests/lsm_bdev.c | 3 +- + .../selftests/bpf/prog_tests/lwt_ip_encap.c | 11 +- + tools/testing/selftests/bpf/prog_tests/mptcp.c | 13 +- + .../selftests/bpf/prog_tests/rcu_read_lock.c | 2 + + .../selftests/bpf/prog_tests/res_spin_lock.c | 20 + + .../selftests/bpf/prog_tests/resolve_btfids.c | 282 +- + tools/testing/selftests/bpf/prog_tests/sha256.c | 4 +- + .../selftests/bpf/prog_tests/signed_loader.c | 1083 ++++-- + .../selftests/bpf/prog_tests/sockmap_basic.c | 52 - + tools/testing/selftests/bpf/prog_tests/sockopt.c | 22 + + tools/testing/selftests/bpf/prog_tests/stream.c | 6 + + tools/testing/selftests/bpf/prog_tests/tailcalls.c | 55 + + .../testing/selftests/bpf/prog_tests/task_kfunc.c | 8 + + .../testing/selftests/bpf/prog_tests/tc_redirect.c | 68 + + .../selftests/bpf/prog_tests/test_map_uninit.c | 68 + + .../bpf/prog_tests/test_struct_ops_arena.c | 128 + + .../selftests/bpf/prog_tests/test_tc_tunnel.c | 1 - + .../selftests/bpf/prog_tests/test_veristat.c | 113 +- + .../selftests/bpf/prog_tests/tracing_failure.c | 20 + + .../selftests/bpf/prog_tests/tracing_multi.c | 69 + + .../selftests/bpf/prog_tests/tracing_struct.c | 36 + + tools/testing/selftests/bpf/prog_tests/verifier.c | 16 + + tools/testing/selftests/bpf/progs/arena_atomics.c | 18 +- + tools/testing/selftests/bpf/progs/arena_kfunc.c | 243 ++ + .../testing/selftests/bpf/progs/arena_kfunc_jit.c | 118 + + .../testing/selftests/bpf/progs/arena_mem_usage.c | 40 + + .../testing/selftests/bpf/progs/arena_spin_lock.c | 7 + + tools/testing/selftests/bpf/progs/bpf_for_bench.c | 32 + + tools/testing/selftests/bpf/progs/bpf_misc.h | 9 +- + .../bpf/progs/bpf_qdisc_fail__untrusted_write.c | 65 + + .../testing/selftests/bpf/progs/bpf_tracing_net.h | 5 + + tools/testing/selftests/bpf/progs/btf_data.c | 40 + + .../selftests/bpf/progs/cgrp_kfunc_failure.c | 2 +- + tools/testing/selftests/bpf/progs/cpumask_common.h | 2 +- + .../testing/selftests/bpf/progs/cpumask_failure.c | 31 +- + .../testing/selftests/bpf/progs/cpumask_success.c | 6 +- + tools/testing/selftests/bpf/progs/dynptr_fail.c | 8 +- + .../testing/selftests/bpf/progs/fentry_sleepable.c | 18 + + tools/testing/selftests/bpf/progs/fib_lookup.c | 57 + + .../selftests/bpf/progs/freplace_cls_redirect.c | 34 - + .../selftests/bpf/progs/get_smp_processor_id.c | 20 + + tools/testing/selftests/bpf/progs/icmp_send.c | 123 + + tools/testing/selftests/bpf/progs/iters.c | 83 + + .../selftests/bpf/progs/iters_task_failure.c | 46 + + .../testing/selftests/bpf/progs/kfunc_call_fail.c | 72 + + .../testing/selftests/bpf/progs/kfunc_call_test.c | 12 + + tools/testing/selftests/bpf/progs/ksock_common.h | 78 + + tools/testing/selftests/bpf/progs/ksock_lsm.c | 72 + + .../selftests/bpf/progs/ksock_lsm_verifier.c | 35 + + tools/testing/selftests/bpf/progs/ksock_wq.c | 62 + + .../testing/selftests/bpf/progs/linked_list_fail.c | 23 + + tools/testing/selftests/bpf/progs/map_kptr.c | 12 + + tools/testing/selftests/bpf/progs/map_kptr_fail.c | 9 + + .../selftests/bpf/progs/mem_rdonly_untrusted.c | 236 +- + tools/testing/selftests/bpf/progs/mptcpify.c | 2 +- + tools/testing/selftests/bpf/progs/pyperf.h | 12 +- + tools/testing/selftests/bpf/progs/rcu_read_lock.c | 76 + + .../selftests/bpf/progs/refcounted_kptr_fail.c | 9 + + tools/testing/selftests/bpf/progs/setget_sockopt.c | 2 + + .../selftests/bpf/progs/sockmap_verdict_prog.c | 14 +- + tools/testing/selftests/bpf/progs/stream.c | 147 + + .../testing/selftests/bpf/progs/struct_ops_arena.c | 139 + + .../selftests/bpf/progs/struct_ops_arena_attach.c | 25 + + .../selftests/bpf/progs/struct_ops_arena_fail.c | 20 + + .../selftests/bpf/progs/tailcall_callback.c | 81 + + .../selftests/bpf/progs/task_kfunc_common.h | 14 + + .../selftests/bpf/progs/task_kfunc_failure.c | 75 +- + .../selftests/bpf/progs/task_kfunc_success.c | 195 ++ + .../bpf/progs/tcp_ca_untrusted_btf_write.c | 26 + + .../selftests/bpf/progs/test_fill_link_info.c | 6 + + .../selftests/bpf/progs/test_global_percpu_data.c | 89 + + .../selftests/bpf/progs/test_signed_loader.c | 9 +- + .../selftests/bpf/progs/test_sockmap_update.c | 48 - + tools/testing/selftests/bpf/progs/test_tc_peer.c | 22 + + tools/testing/selftests/bpf/progs/test_tc_tunnel.c | 91 +- + .../testing/selftests/bpf/progs/tracing_failure.c | 6 + + .../bpf/progs/tracing_multi_intersect_attach.c | 8 + + .../selftests/bpf/progs/tracing_struct_int128.c | 18 + + tools/testing/selftests/bpf/progs/verifier_arena.c | 72 +- + .../selftests/bpf/progs/verifier_basic_stack.c | 6 +- + .../testing/selftests/bpf/progs/verifier_bounds.c | 2 +- + .../selftests/bpf/progs/verifier_bpf_fastcall.c | 32 +- + .../selftests/bpf/progs/verifier_global_subprogs.c | 10 +- + tools/testing/selftests/bpf/progs/verifier_gotox.c | 25 + + .../bpf/progs/verifier_helper_access_var_len.c | 6 +- + .../bpf/progs/verifier_helper_value_access.c | 2 +- + .../selftests/bpf/progs/verifier_load_acquire.c | 44 + + .../selftests/bpf/progs/verifier_map_in_map.c | 3 +- + .../bpf/progs/verifier_map_lookup_refine.c | 73 + + .../testing/selftests/bpf/progs/verifier_map_ptr.c | 23 +- + .../selftests/bpf/progs/verifier_may_goto_1.c | 67 + + .../selftests/bpf/progs/verifier_mem_size_reg.c | 28 + + .../selftests/bpf/progs/verifier_percpu_addr.c | 72 + + .../selftests/bpf/progs/verifier_private_stack.c | 15 +- + .../selftests/bpf/progs/verifier_scalar_ids.c | 56 + + .../selftests/bpf/progs/verifier_sockmap_mutate.c | 12 +- + .../selftests/bpf/progs/verifier_spill_fill.c | 68 + + .../bpf/progs/verifier_subprog_insn_stats.c | 223 ++ + .../testing/selftests/bpf/progs/verifier_uninit.c | 1 + + .../testing/selftests/bpf/progs/verifier_unpriv.c | 18 + + .../testing/selftests/bpf/progs/verifier_var_off.c | 116 +- + .../selftests/bpf/progs/verifier_vfs_reject.c | 6 +- + tools/testing/selftests/bpf/progs/verifier_zext.c | 392 +++ + tools/testing/selftests/bpf/progs/veristat_bar.c | 3 + + tools/testing/selftests/bpf/progs/veristat_foo.c | 31 + + tools/testing/selftests/bpf/progs/xdp_dummy.c | 6 + + .../testing/selftests/bpf/test_kmods/bpf_testmod.c | 131 +- + .../testing/selftests/bpf/test_kmods/bpf_testmod.h | 14 + + .../selftests/bpf/test_kmods/bpf_testmod_kfunc.h | 13 + + tools/testing/selftests/bpf/test_loader.c | 2 +- + tools/testing/selftests/bpf/test_progs.c | 91 +- + tools/testing/selftests/bpf/test_progs.h | 3 +- + tools/testing/selftests/bpf/test_sockmap.c | 3 +- + tools/testing/selftests/bpf/test_verifier.c | 2 +- + tools/testing/selftests/bpf/verifier/calls.c | 18 +- + tools/testing/selftests/bpf/veristat.c | 122 +- + tools/testing/selftests/bpf/vmtest.sh | 13 +- + 272 files changed, 19015 insertions(+), 3464 deletions(-) + create mode 100644 Documentation/bpf/signing.rst + create mode 100644 arch/riscv/net/bpf_timed_may_goto.S + create mode 100644 include/linux/bpf_ksock.h + create mode 100644 kernel/bpf/diagnostics.c + create mode 100644 kernel/bpf/diagnostics.h + create mode 100644 net/core/bpf_ksock.c + create mode 100644 tools/testing/selftests/bpf/benchs/bench_bpf_for.c + create mode 100755 tools/testing/selftests/bpf/benchs/run_bench_bpf_for.sh + create mode 100644 tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h + rename tools/testing/selftests/bpf/libarena/selftests/{st_asan_buddy.bpf.c => test_asan_buddy.bpf.c} (98%) + rename tools/testing/selftests/bpf/libarena/selftests/{st_asan_common.h => test_asan_common.h} (100%) + create mode 100644 tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c + rename tools/testing/selftests/bpf/libarena/selftests/{st_buddy.bpf.c => test_buddy.bpf.c} (97%) + create mode 100644 tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c + create mode 100644 tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_mem_usage.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/get_smp_processor_id.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/icmp_send_kfunc.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/ksock.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/ksock_wq.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/test_map_uninit.c + create mode 100644 tools/testing/selftests/bpf/prog_tests/test_struct_ops_arena.c + create mode 100644 tools/testing/selftests/bpf/progs/arena_kfunc.c + create mode 100644 tools/testing/selftests/bpf/progs/arena_kfunc_jit.c + create mode 100644 tools/testing/selftests/bpf/progs/arena_mem_usage.c + create mode 100644 tools/testing/selftests/bpf/progs/bpf_for_bench.c + create mode 100644 tools/testing/selftests/bpf/progs/bpf_qdisc_fail__untrusted_write.c + create mode 100644 tools/testing/selftests/bpf/progs/fentry_sleepable.c + delete mode 100644 tools/testing/selftests/bpf/progs/freplace_cls_redirect.c + create mode 100644 tools/testing/selftests/bpf/progs/get_smp_processor_id.c + create mode 100644 tools/testing/selftests/bpf/progs/icmp_send.c + create mode 100644 tools/testing/selftests/bpf/progs/ksock_common.h + create mode 100644 tools/testing/selftests/bpf/progs/ksock_lsm.c + create mode 100644 tools/testing/selftests/bpf/progs/ksock_lsm_verifier.c + create mode 100644 tools/testing/selftests/bpf/progs/ksock_wq.c + create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_arena.c + create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_arena_attach.c + create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_arena_fail.c + create mode 100644 tools/testing/selftests/bpf/progs/tailcall_callback.c + create mode 100644 tools/testing/selftests/bpf/progs/tcp_ca_untrusted_btf_write.c + create mode 100644 tools/testing/selftests/bpf/progs/test_global_percpu_data.c + delete mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_update.c + create mode 100644 tools/testing/selftests/bpf/progs/tracing_struct_int128.c + create mode 100644 tools/testing/selftests/bpf/progs/verifier_map_lookup_refine.c + create mode 100644 tools/testing/selftests/bpf/progs/verifier_mem_size_reg.c + create mode 100644 tools/testing/selftests/bpf/progs/verifier_percpu_addr.c + create mode 100644 tools/testing/selftests/bpf/progs/verifier_subprog_insn_stats.c + create mode 100644 tools/testing/selftests/bpf/progs/verifier_zext.c + create mode 100644 tools/testing/selftests/bpf/progs/veristat_bar.c + create mode 100644 tools/testing/selftests/bpf/progs/veristat_foo.c +$ git am -3 ../patches/0001-perf-Fixup-for-btf_vlan-API-change.patch +Applying: perf: Fixup for btf_vlan() API change +Using index info to reconstruct a base tree... +M tools/perf/builtin-trace.c +M tools/perf/util/btf.c +Falling back to patching base and 3-way merge... +Auto-merging tools/perf/builtin-trace.c +No changes -- Patch already applied. +Merging ipsec-next/master (298bb2b890332 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git ipsec-next/master +Already up to date. +Merging mlx5-next/mlx5-next (36b1d3299d0b6 net/mlx5: Add qp_latency_sensitive_disable cap bit) +$ git merge -m Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git mlx5-next/mlx5-next +Already up to date. +Merging netfilter-next/main (a50eba1e778ad net: dns_resolver: allow shorter names in dns_query()) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git netfilter-next/main +Already up to date. +Merging ipvs-next/main (f6f3b36c15ed4 net: ethernet: qualcomm: remove unneeded 'fast_io' parameter in regmap_config) +$ git merge -m Merge branch 'main' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git ipvs-next/main +Already up to date. +Merging bluetooth/master (486f8908aa587 Bluetooth: ISO: fix use-after-free of listener socket in iso_conn_ready) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git bluetooth/master +Merge made by the 'ort' strategy. + drivers/bluetooth/btintel.c | 7 + + drivers/bluetooth/btintel.h | 1 + + drivers/bluetooth/btintel_pcie.c | 428 +++++++++++++++++++++++++++++-- + drivers/bluetooth/btintel_pcie.h | 77 +++++- + drivers/bluetooth/btmrvl_main.c | 4 +- + drivers/bluetooth/btmtk.c | 11 +- + drivers/bluetooth/btmtksdio.c | 59 ++++- + drivers/bluetooth/btnxpuart.c | 39 ++- + drivers/bluetooth/btusb.c | 2 + + drivers/bluetooth/hci_bcm.c | 1 + + drivers/bluetooth/hci_bcm4377.c | 1 + + drivers/bluetooth/hci_h5.c | 4 +- + drivers/bluetooth/hci_intel.c | 1 + + drivers/bluetooth/hci_serdev.c | 46 +++- + drivers/bluetooth/virtio_bt.c | 21 +- + include/net/bluetooth/hci_core.h | 46 +++- + include/net/bluetooth/l2cap.h | 7 + + net/bluetooth/bnep/core.c | 4 +- + net/bluetooth/eir.c | 3 +- + net/bluetooth/hci_conn.c | 3 +- + net/bluetooth/hci_core.c | 4 +- + net/bluetooth/hci_event.c | 7 +- + net/bluetooth/hci_sync.c | 67 +++-- + net/bluetooth/iso.c | 8 + + net/bluetooth/l2cap_core.c | 29 ++- + net/bluetooth/l2cap_sock.c | 101 ++++++-- + net/bluetooth/mgmt.c | 32 ++- + scripts/context-analysis-suppression.txt | 1 + + 28 files changed, 862 insertions(+), 152 deletions(-) +Merging wireless-next/for-next (ca800a9302764 wifi: nxpwifi: bound uAP association event IEs to the event buffer) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git wireless-next/for-next +Already up to date. +Merging ath-next/for-next (ca800a9302764 wifi: nxpwifi: bound uAP association event IEs to the event buffer) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git ath-next/for-next +Already up to date. +Merging iwlwifi-next/next (4a2610a5a9fcf wifi: iwlwifi: bump core version for BZ/SC/DR) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git iwlwifi-next/next +Already up to date. +Merging wpan-next/master (a6bfdfcc6711d ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next.git wpan-next/master +Already up to date. +Merging wpan-staging/staging (a6bfdfcc6711d ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation) +$ git merge -m Merge branch 'staging' of https://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan-next.git wpan-staging/staging +Already up to date. +Merging mtd/mtd/next (94d32f1ace8ee mtd: maps: remove dead select of MTD_CFI_BE_BYTE_SWAP) +$ git merge -m Merge branch 'mtd/next' of https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/mtd/next +Auto-merging drivers/mtd/maps/Kconfig +Auto-merging drivers/mtd/mtdpart.c +Auto-merging drivers/mtd/mtdswap.c +Merge made by the 'ort' strategy. + drivers/mtd/chips/cfi_cmdset_0001.c | 6 ++++++ + drivers/mtd/devices/mtd_intel_dg.c | 2 +- + drivers/mtd/maps/Kconfig | 1 - + drivers/mtd/maps/map_funcs.c | 2 +- + drivers/mtd/mtdoops.c | 3 +++ + drivers/mtd/mtdpart.c | 3 ++- + drivers/mtd/mtdswap.c | 1 + + drivers/mtd/nand/raw/mpc5121_nfc.c | 39 ++++++++++++------------------------- + drivers/mtd/parsers/afs.c | 7 +++++++ + 9 files changed, 33 insertions(+), 31 deletions(-) +Merging nand/nand/next (15a3cbce32994 mtd: rawnand: sunxi: fix H6/H616 controller timings) +$ git merge -m Merge branch 'nand/next' of https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/nand/next +Auto-merging drivers/mtd/nand/spi/core.c +Merge made by the 'ort' strategy. + .../devicetree/bindings/mtd/qcom,nandc.yaml | 25 +++ + drivers/memory/omap-gpmc.c | 9 +- + drivers/mtd/nand/ecc-realtek.c | 1 + + drivers/mtd/nand/raw/atmel/nand-controller.c | 3 +- + drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 29 +++ + drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h | 6 + + drivers/mtd/nand/raw/nand_ids.c | 3 + + drivers/mtd/nand/raw/nand_onfi.c | 27 ++- + drivers/mtd/nand/raw/nand_toshiba.c | 4 +- + drivers/mtd/nand/raw/omap2.c | 6 +- + drivers/mtd/nand/raw/pl35x-nand-controller.c | 20 +- + drivers/mtd/nand/raw/qcom_nandc.c | 30 ++- + drivers/mtd/nand/raw/sunxi_nand.c | 233 +++++++++++++++++---- + drivers/mtd/nand/spi/Makefile | 2 +- + drivers/mtd/nand/spi/core.c | 1 + + drivers/mtd/nand/spi/fmsh.c | 103 +++++++++ + drivers/mtd/nand/spi/heyangtek.c | 132 ++++++++++++ + drivers/mtd/parsers/redboot.c | 9 +- + include/linux/mtd/nand-qpic-common.h | 2 + + include/linux/mtd/spinand.h | 1 + + include/linux/platform_data/mtd-nand-omap2.h | 7 - + 21 files changed, 576 insertions(+), 77 deletions(-) + create mode 100644 drivers/mtd/nand/spi/heyangtek.c +Merging spi-nor/spi-nor/next (df415c5e1de0f mtd: spi-nor: spansion: add die erase support in s28hx-t) +$ git merge -m Merge branch 'spi-nor/next' of https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/spi-nor/next +Already up to date. +Merging crypto/master (7537036a2e6fe crypto: lskcipher - propagate errors from unaligned crypt) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git crypto/master +Already up to date. +Merging libcrypto/libcrypto-next (0f23d56f17fdf Merge tag 'linux_kselftest-next-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest) +$ git merge -m Merge branch 'libcrypto-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git libcrypto/libcrypto-next +Already up to date. +Merging drm/drm-next (c44e278ce02ef BackMerge tag 'v7.2' into drm-next) +$ git merge -m Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git drm/drm-next +Auto-merging .mailmap +Auto-merging Documentation/admin-guide/cgroup-v2.rst +Auto-merging Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml +Auto-merging Documentation/devicetree/bindings/vendor-prefixes.yaml +Auto-merging MAINTAINERS +Auto-merging drivers/accel/amdxdna/amdxdna_gem.c +Auto-merging drivers/firmware/Kconfig +Auto-merging drivers/gpu/drm/drm_gem.c +Auto-merging drivers/gpu/drm/drm_gem_shmem_helper.c +Auto-merging drivers/gpu/drm/drm_gpusvm.c +Auto-merging drivers/gpu/drm/i915/display/intel_cx0_phy.c +Auto-merging drivers/gpu/drm/i915/display/intel_ddi.c +Auto-merging drivers/gpu/drm/i915/display/intel_dp_mst.c +Auto-merging drivers/gpu/drm/i915/display/intel_lt_phy.c +Auto-merging drivers/gpu/drm/msm/dsi/dsi_host.c +Auto-merging drivers/gpu/drm/nouveau/nouveau_gem.c +Auto-merging drivers/gpu/drm/nova/driver.rs +Auto-merging drivers/gpu/drm/panthor/panthor_gem.c +Auto-merging drivers/gpu/drm/tyr/driver.rs +Auto-merging drivers/gpu/drm/virtio/virtgpu_drv.h +Auto-merging drivers/gpu/drm/virtio/virtgpu_kms.c +Auto-merging drivers/gpu/drm/virtio/virtgpu_object.c +Auto-merging drivers/gpu/drm/virtio/virtgpu_vq.c +Auto-merging drivers/gpu/drm/virtio/virtgpu_vram.c +Auto-merging drivers/gpu/drm/xe/xe_device.c +Auto-merging drivers/gpu/drm/xe/xe_i2c.c +Auto-merging drivers/gpu/nova-core/gpu.rs +CONFLICT (content): Merge conflict in drivers/gpu/nova-core/gpu.rs +Auto-merging drivers/gpu/nova-core/gsp/cmdq.rs +Auto-merging include/linux/pci.h +Auto-merging kernel/events/core.c +Auto-merging rust/helpers/pci.c +CONFLICT (content): Merge conflict in rust/helpers/pci.c +Auto-merging rust/kernel/dma.rs +Auto-merging rust/kernel/drm/device.rs +Auto-merging rust/kernel/drm/gem/mod.rs +Auto-merging rust/kernel/drm/gpuvm/va.rs +Auto-merging rust/kernel/drm/gpuvm/vm_bo.rs +Auto-merging rust/kernel/firmware.rs +Auto-merging rust/kernel/io.rs +Auto-merging rust/kernel/iommu/pgtable.rs +Auto-merging rust/kernel/pci.rs +Resolved 'drivers/gpu/nova-core/gpu.rs' using previous resolution. +Resolved 'rust/helpers/pci.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master ffa9b46bd1ce0] Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git +$ git diff -M --stat --summary HEAD^.. + .clang-format | 2 +- + .mailmap | 4 +- + .../ABI/testing/sysfs-driver-intel-xe-hwmon | 7 + + .../ABI/testing/sysfs-driver-intel-xe-ras | 30 + + Documentation/admin-guide/cgroup-v2.rst | 6 + + .../bindings/display/bridge/renesas,dsi.yaml | 1 + + .../display/bridge/renesas,r9a08g046-lvds.yaml | 120 + + .../bindings/display/mediatek/mediatek,cec.yaml | 11 +- + .../bindings/display/panel/anbernic,td4310.yaml | 66 + + .../bindings/display/panel/chipone,icna3512.yaml | 79 + + .../bindings/display/panel/himax,hx83121a.yaml | 3 + + .../bindings/display/panel/ilitek,ili7807s.yaml | 71 + + .../bindings/display/panel/ilitek,ili9488.yaml | 63 + + .../bindings/display/panel/jadard,jd9365da-h3.yaml | 1 + + .../bindings/display/panel/novatek,nt36536.yaml | 91 + + .../bindings/display/panel/panel-lvds.yaml | 2 + + .../bindings/display/panel/panel-simple.yaml | 2 + + .../bindings/display/panel/renesas,r63419.yaml | 98 + + .../display/panel/rocktech,jh057n00900.yaml | 2 + + .../bindings/display/panel/samsung,atna33xc20.yaml | 2 + + .../bindings/display/renesas,rzg2l-du.yaml | 26 +- + .../display/rockchip/rockchip,analogix-dp.yaml | 47 +- + .../display/tegra/nvidia,tegra124-vic.yaml | 1 + + .../display/tegra/nvidia,tegra20-host1x.yaml | 20 +- + .../devicetree/bindings/gpu/img,powervr-rogue.yaml | 3 +- + .../devicetree/bindings/gpu/img,powervr-sgx.yaml | 3 +- + .../devicetree/bindings/vendor-prefixes.yaml | 10 + + .../gpu/amdgpu/display/display-manager.rst | 9 + + Documentation/gpu/automated_testing.rst | 3 +- + Documentation/gpu/drm-kms-helpers.rst | 6 + + Documentation/gpu/drm-kms.rst | 12 + + .../gpu/intel-display/dp-link-capabilities.rst | 11 + + .../gpu/intel-display/dp-link-training.rst | 8 + + Documentation/gpu/intel-display/index.rst | 2 + + Documentation/gpu/nova/core/fsp.rst | 142 + + Documentation/gpu/nova/core/tlv.rst | 184 + + Documentation/gpu/nova/index.rst | 2 + + Documentation/gpu/todo.rst | 50 +- + Documentation/gpu/xe/xe_device.rst | 7 + + MAINTAINERS | 22 +- + drivers/accel/amdxdna/amdxdna_gem.c | 6 + + drivers/accel/ethosu/Makefile | 2 +- + drivers/accel/ethosu/ethosu_device.h | 35 +- + drivers/accel/ethosu/ethosu_drv.c | 23 +- + drivers/accel/ethosu/ethosu_drv.h | 61 +- + drivers/accel/ethosu/ethosu_job.c | 61 +- + drivers/accel/ethosu/ethosu_job.h | 2 + + drivers/accel/ethosu/ethosu_perfmon.c | 301 + + drivers/accel/ivpu/ivpu_drv.c | 28 +- + drivers/accel/ivpu/ivpu_drv.h | 5 +- + drivers/accel/ivpu/ivpu_fw.c | 2 +- + drivers/accel/ivpu/ivpu_hw.c | 4 + + drivers/accel/ivpu/ivpu_ipc.c | 25 +- + drivers/accel/ivpu/ivpu_ipc.h | 3 +- + drivers/accel/ivpu/ivpu_job.c | 59 +- + drivers/accel/ivpu/ivpu_job.h | 7 +- + drivers/accel/ivpu/ivpu_mmu_context.c | 4 +- + drivers/accel/rocket/rocket_job.c | 32 +- + drivers/dma-buf/dma-fence-unwrap.c | 8 +- + drivers/dma-buf/dma-fence.c | 22 +- + drivers/dma-buf/dma-heap.c | 3 +- + drivers/dma-buf/st-dma-fence-chain.c | 4 +- + drivers/dma-buf/st-dma-fence-unwrap.c | 42 +- + drivers/dma-buf/st-dma-fence.c | 16 +- + drivers/dma-buf/st-dma-resv.c | 10 +- + drivers/dma-buf/udmabuf.c | 4 +- + drivers/firmware/Kconfig | 28 +- + drivers/gpu/Kconfig | 3 +- + drivers/gpu/Makefile | 58 +- + drivers/gpu/buddy.c | 158 +- + drivers/gpu/drm/Makefile | 2 +- + drivers/gpu/drm/adp/adp-mipi.c | 4 + + drivers/gpu/drm/amd/amdgpu/Makefile | 5 +- + drivers/gpu/drm/amd/amdgpu/amdgpu.h | 321 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 985 - + drivers/gpu/drm/amd/amdgpu/amdgpu_aca.h | 232 - + drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 68 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.h | 151 + + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 18 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 30 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 18 +- + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c | 63 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 3 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c | 3 +- + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12_1.c | 3 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 24 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 - + drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 33 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 10 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 184 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 22 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 62 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 135 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_cper.h | 9 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 74 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 215 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 14 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 9 + + drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 1 + + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 439 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 313 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h | 6 + + drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 177 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 651 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 53 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 367 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 30 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 22 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 - + drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 23 + + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 52 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 85 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h | 6 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c | 14 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c | 157 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ip.h | 8 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 30 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 8 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 14 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 3 + + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 71 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 486 - + drivers/gpu/drm/amd/amdgpu/amdgpu_mca.h | 108 - + drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 312 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 89 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h | 23 - + drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 + + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 40 - + drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 14 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 70 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 1 + + drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 5 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1019 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 70 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 514 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 26 - + drivers/gpu/drm/amd/amdgpu/amdgpu_reg_access.h | 8 + + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 210 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 12 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 39 + + drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h | 10 + + drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 18 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_sa.h | 78 + + drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 8 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 19 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 28 - + drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 150 + + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 63 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 + + drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 266 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 44 - + drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 6 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 228 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h | 20 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 10 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 5 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 8 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 88 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 3 + + .../amdgpu_video_codecs.h} | 42 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 37 + + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 11 + + drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 10 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 128 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 10 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 2 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 8 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 65 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h | 3 + + drivers/gpu/drm/amd/amdgpu/amdgpu_wb.c | 129 + + drivers/gpu/drm/amd/amdgpu/amdgpu_wb.h | 102 + + drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 46 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 308 +- + drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 27 + + drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c | 61 +- + drivers/gpu/drm/amd/amdgpu/atom.c | 66 +- + drivers/gpu/drm/amd/amdgpu/atom.h | 3 +- + drivers/gpu/drm/amd/amdgpu/cik.c | 8 +- + drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 11 +- + drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 66 - + drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 57 - + drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 57 - + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 32 +- + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 425 +- + drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 318 +- + drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 301 +- + drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 386 +- + drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 348 +- + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 239 +- + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 34 +- + drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 1131 +- + drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 4 - + drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 4 - + drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 4 - + drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- + drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 125 - + drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 24 +- + drivers/gpu/drm/amd/amdgpu/imu_v11_0.c | 5 +- + drivers/gpu/drm/amd/amdgpu/imu_v12_0.c | 5 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 2 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h | 4 + + drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 21 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 88 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 2 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.h | 4 + + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c | 94 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.h | 8 + + drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_2.c | 66 +- + drivers/gpu/drm/amd/amdgpu/jpeg_v5_3_0.c | 22 +- + drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 182 +- + drivers/gpu/drm/amd/amdgpu/mes_userqueue.h | 9 + + drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 362 +- + drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 298 +- + drivers/gpu/drm/amd/amdgpu/mes_v12_1.c | 379 +- + drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 231 +- + drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 65 +- + drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 7 +- + drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 28 + + drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 2 + + drivers/gpu/drm/amd/amdgpu/nv.c | 7 +- + drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 4 +- + drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 4 +- + drivers/gpu/drm/amd/amdgpu/psp_v13_0_4.c | 4 +- + drivers/gpu/drm/amd/amdgpu/psp_v14_0.c | 4 +- + drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 10 +- + drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 73 +- + drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 8 +- + drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 204 +- + drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 10 +- + drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 10 +- + drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 28 +- + drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 28 +- + drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 28 +- + drivers/gpu/drm/amd/amdgpu/si.c | 12 +- + drivers/gpu/drm/amd/amdgpu/si_dma.c | 8 +- + drivers/gpu/drm/amd/amdgpu/soc15.c | 10 +- + drivers/gpu/drm/amd/amdgpu/soc15_common.h | 61 +- + drivers/gpu/drm/amd/amdgpu/soc21.c | 34 +- + drivers/gpu/drm/amd/amdgpu/soc24.c | 12 +- + drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 15 +- + drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 40 - + drivers/gpu/drm/amd/amdgpu/umc_v12_0.c | 736 +- + drivers/gpu/drm/amd/amdgpu/umc_v12_0.h | 31 - + drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 55 +- + drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 10 +- + drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 69 - + drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 12 +- + drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 45 +- + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 87 +- + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 6 +- + drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c | 90 +- + drivers/gpu/drm/amd/amdgpu/vcn_v5_0_2.c | 3 - + drivers/gpu/drm/amd/amdgpu/vi.c | 43 +- + drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 28 +- + drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 115 +- + drivers/gpu/drm/amd/amdkfd/kfd_device.c | 24 + + .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 345 +- + .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 2 + + drivers/gpu/drm/amd/amdkfd/kfd_events.c | 241 +- + drivers/gpu/drm/amd/amdkfd/kfd_events.h | 4 - + drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 8 +- + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 16 + + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h | 10 + + drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 54 +- + drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 16 +- + drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c | 70 +- + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 43 +- + drivers/gpu/drm/amd/amdkfd/kfd_process.c | 152 +- + .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 25 +- + drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 7 +- + drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 4 +- + drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 376 +- + drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 26 +- + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 11 +- + drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c | 18 +- + drivers/gpu/drm/amd/display/amdgpu_dm/Makefile | 8 +- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8242 +-- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 124 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_audio.c | 338 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_audio.h | 58 + + .../amd/display/amdgpu_dm/amdgpu_dm_backlight.c | 737 + + .../amd/display/amdgpu_dm/amdgpu_dm_backlight.h | 90 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 235 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.h | 34 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 3 +- + .../amd/display/amdgpu_dm/amdgpu_dm_connector.c | 3965 ++ + .../amd/display/amdgpu_dm/amdgpu_dm_connector.h | 226 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 122 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 6 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 47 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.h | 15 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c | 448 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.h | 52 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 135 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c | 964 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.h | 78 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c | 362 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.h | 65 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 297 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h | 64 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 152 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.h | 61 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 1765 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.h | 84 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 6 +- + .../display/amdgpu_dm/amdgpu_dm_kunit_helpers.h | 19 - + .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 195 +- + .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.h | 26 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 528 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h | 63 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 379 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.h | 64 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 53 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 5 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_quirks.c | 34 + + .../drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c | 12 +- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 60 + + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 34 +- + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.h | 17 + + drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h | 6 +- + .../drm/amd/display/amdgpu_dm/tests/.kunitconfig | 6 + + .../gpu/drm/amd/display/amdgpu_dm/tests/Makefile | 19 + + .../display/amdgpu_dm/tests/amdgpu_dm_audio_test.c | 1259 + + .../amdgpu_dm/tests/amdgpu_dm_backlight_test.c | 1995 + + .../display/amdgpu_dm/tests/amdgpu_dm_color_test.c | 1465 +- + .../amdgpu_dm/tests/amdgpu_dm_colorop_test.c | 140 +- + .../amdgpu_dm/tests/amdgpu_dm_connector_test.c | 5691 ++ + .../display/amdgpu_dm/tests/amdgpu_dm_crc_test.c | 850 + + .../display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c | 1939 + + .../amdgpu_dm/tests/amdgpu_dm_cursor_test.c | 268 + + .../display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c | 1419 + + .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 453 + + .../display/amdgpu_dm/tests/amdgpu_dm_hdcp_test.c | 2480 +- + .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 3907 ++ + .../display/amdgpu_dm/tests/amdgpu_dm_irq_test.c | 4093 ++ + .../display/amdgpu_dm/tests/amdgpu_dm_ism_test.c | 392 +- + .../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c | 195 + + .../amdgpu_dm/tests/amdgpu_dm_kunit_test_helpers.h | 39 + + .../amdgpu_dm/tests/amdgpu_dm_mst_types_test.c | 1429 + + .../display/amdgpu_dm/tests/amdgpu_dm_plane_test.c | 3137 + + .../amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c | 2474 + + .../display/amdgpu_dm/tests/amdgpu_dm_psr_test.c | 509 +- + .../amdgpu_dm/tests/amdgpu_dm_quirks_test.c | 168 + + .../amdgpu_dm/tests/amdgpu_dm_replay_test.c | 432 +- + .../amdgpu_dm/tests/amdgpu_dm_services_test.c | 313 + + .../amd/display/amdgpu_dm/tests/amdgpu_dm_test.c | 1232 + + .../display/amdgpu_dm/tests/amdgpu_dm_wb_test.c | 437 + + drivers/gpu/drm/amd/display/dc/basics/conversion.c | 61 +- + drivers/gpu/drm/amd/display/dc/basics/conversion.h | 12 +- + .../amd/display/dc/bios/command_table_helper2.c | 1 + + drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile | 9 + + drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 15 + + .../amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 57 +- + .../amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.h | 9 + + .../amd/display/dc/clk_mgr/dcn42/dcn42_clk_mgr.c | 72 +- + .../amd/display/dc/clk_mgr/dcn42/dcn42_clk_mgr.h | 2 + + .../drm/amd/display/dc/clk_mgr/dcn42/dcn42_smu.c | 29 +- + .../drm/amd/display/dc/clk_mgr/dcn42/dcn42_smu.h | 2 + + .../amd/display/dc/clk_mgr/dcn42b/dcn42b_clk_mgr.c | 183 +- + .../gpu/drm/amd/display/dc/clk_mgr/dcn60/dalsmc.h | 389 + + .../amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c | 1673 + + .../amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.h | 150 + + .../dc/clk_mgr/dcn60/dcn60_clk_mgr_smu_msg.c | 369 + + .../dc/clk_mgr/dcn60/dcn60_clk_mgr_smu_msg.h | 35 + + drivers/gpu/drm/amd/display/dc/core/dc.c | 895 +- + .../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 1025 +- + .../gpu/drm/amd/display/dc/core/dc_link_exports.c | 7 + + drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 156 +- + drivers/gpu/drm/amd/display/dc/core/dc_sink.c | 3 + + drivers/gpu/drm/amd/display/dc/core/dc_state.c | 82 +- + drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 76 +- + drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 44 +- + drivers/gpu/drm/amd/display/dc/dc.h | 486 +- + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 89 +- + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 66 +- + drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 1 + + drivers/gpu/drm/amd/display/dc/dc_helper.c | 228 +- + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 53 +- + drivers/gpu/drm/amd/display/dc/dc_probe.h | 97 + + drivers/gpu/drm/amd/display/dc/dc_spl_translate.c | 32 +- + drivers/gpu/drm/amd/display/dc/dc_state.h | 7 + + drivers/gpu/drm/amd/display/dc/dc_state_priv.h | 1 + + drivers/gpu/drm/amd/display/dc/dc_stream.h | 62 +- + drivers/gpu/drm/amd/display/dc/dc_types.h | 81 +- + drivers/gpu/drm/amd/display/dc/dccg/Makefile | 8 + + .../gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.h | 10 + + .../gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c | 11 +- + .../gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.h | 5 +- + .../gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c | 61 +- + .../gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.h | 1 + + .../gpu/drm/amd/display/dc/dccg/dcn60/dcn60_dccg.c | 187 + + .../gpu/drm/amd/display/dc/dccg/dcn60/dcn60_dccg.h | 182 + + drivers/gpu/drm/amd/display/dc/dce/Makefile | 4 +- + drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 9 +- + .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 28 + + .../gpu/drm/amd/display/dc/dce/dce_clock_source.h | 9 + + drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 4 +- + drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 73 +- + drivers/gpu/drm/amd/display/dc/dce/dmub_abm_cacp.c | 213 + + drivers/gpu/drm/amd/display/dc/dce/dmub_abm_cacp.h | 20 + + drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 4 +- + drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 2 +- + .../drm/amd/display/dc/dce110/dce110_compressor.c | 2 - + .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 2 - + .../drm/amd/display/dc/dce112/dce112_compressor.c | 8 +- + .../gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c | 184 + + drivers/gpu/drm/amd/display/dc/dio/Makefile | 8 + + .../amd/display/dc/dio/dcn10/dcn10_link_encoder.c | 10 +- + .../amd/display/dc/dio/dcn10/dcn10_link_encoder.h | 16 + + .../display/dc/dio/dcn31/dcn31_dio_link_encoder.c | 4 + + .../display/dc/dio/dcn31/dcn31_dio_link_encoder.h | 2 + + .../dc/dio/dcn401/dcn401_dio_link_encoder.c | 15 + + .../dc/dio/dcn401/dcn401_dio_link_encoder.h | 10 + + .../display/dc/dio/dcn60/dcn60_dio_link_encoder.c | 373 + + .../display/dc/dio/dcn60/dcn60_dio_link_encoder.h | 43 + + .../dc/dio/dcn60/dcn60_dio_stream_encoder.c | 538 + + .../dc/dio/dcn60/dcn60_dio_stream_encoder.h | 181 + + drivers/gpu/drm/amd/display/dc/dm_helpers.h | 19 + + drivers/gpu/drm/amd/display/dc/dm_services.h | 4 - + .../gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c | 2 +- + .../amd/display/dc/dml/dcn31/display_mode_vba_31.c | 2 +- + .../display/dc/dml/dcn314/display_mode_vba_314.c | 2 +- + .../gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 4 +- + .../gpu/drm/amd/display/dc/dml/dml1_frl_cap_chk.c | 10 +- + drivers/gpu/drm/amd/display/dc/dml2_0/Makefile | 40 +- + .../dc/dml2_0/dml21/dml21_translation_helper.c | 149 +- + .../drm/amd/display/dc/dml2_0/dml21/dml21_utils.c | 146 +- + .../drm/amd/display/dc/dml2_0/dml21/dml21_utils.h | 5 + + .../display/dc/dml2_0/dml21/dml21_wrapper_fpu.c | 40 +- + .../dml2_0/dml21/inc/bounding_boxes/dcn42_soc_bb.h | 6 - + .../dml21/inc/bounding_boxes/dcn42b_soc_bb.h | 42 +- + .../dml2_0/dml21/inc/bounding_boxes/dcn5_soc_bb.h | 36 + + .../dml2_0/dml21/inc/bounding_boxes/dcn6_soc_bb.h | 229 + + .../inc/bounding_boxes/utm_qos_model_dchub_v1.h | 109 + + .../inc/bounding_boxes/utm_qos_model_dchub_v2.h | 122 + + .../inc/bounding_boxes/utm_qos_model_dchub_v3.h | 53 + + .../dml21/inc/bounding_boxes/utm_qos_model_types.h | 51 + + .../amd/display/dc/dml2_0/dml21/inc/dml_dmub_cmd.h | 502 + + .../dc/dml2_0/dml21/inc/dml_top_dchub_registers.h | 30 + + .../dml2_0/dml21/inc/dml_top_display_cfg_types.h | 10 + + .../dml2_0/dml21/inc/dml_top_soc_parameter_types.h | 15 + + .../display/dc/dml2_0/dml21/inc/dml_top_types.h | 50 + + .../dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c | 152 + + .../dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.h | 9 + + .../dml2_0/dml21/src/dml2_cga/dml2_cga_factory.c | 38 + + .../dml2_0/dml21/src/dml2_cga/dml2_cga_factory.h | 9 + + .../dml2_core/dml2_core_calcs_dsc_shared_types.h | 32 + + .../dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c | 38 +- + .../dml21/src/dml2_core/dml2_core_dcn4_calcs.c | 149 +- + .../dml21/src/dml2_core/dml2_core_dcn4_calcs.h | 2 + + .../src/dml2_core/dml2_core_dcn5_calcs_dchub.c | 5893 ++ + .../src/dml2_core/dml2_core_dcn5_calcs_dchub.h | 426 + + .../dml2_core/dml2_core_dcn5_calcs_display_pipe.c | 1029 + + .../dml2_core/dml2_core_dcn5_calcs_display_pipe.h | 151 + + .../dml2_core/dml2_core_dcn5_calcs_dsc_latency.c | 501 + + .../dml2_core/dml2_core_dcn5_calcs_dsc_latency.h | 23 + + .../dml2_core/dml2_core_dcn5_funcs_initialize.c | 78 + + .../dml2_core/dml2_core_dcn5_funcs_initialize.h | 12 + + .../dml2_core_dcn5_funcs_mode_programming.c | 1791 + + .../dml2_core_dcn5_funcs_mode_programming.h | 11 + + .../dml2_core/dml2_core_dcn5_funcs_mode_support.c | 2957 + + .../dml2_core/dml2_core_dcn5_funcs_mode_support.h | 11 + + .../dml21/src/dml2_core/dml2_core_dcn6_calcs.c | 11 + + .../dml21/src/dml2_core/dml2_core_dcn6_calcs.h | 8 + + .../src/dml2_core/dml2_core_dcn6_calcs_dchub.c | 1951 + + .../src/dml2_core/dml2_core_dcn6_calcs_dchub.h | 101 + + .../dml2_core/dml2_core_dcn6_funcs_initialize.c | 165 + + .../dml2_core/dml2_core_dcn6_funcs_initialize.h | 12 + + .../dml2_core_dcn6_funcs_mode_programming.c | 1389 + + .../dml2_core_dcn6_funcs_mode_programming.h | 11 + + .../dml2_core/dml2_core_dcn6_funcs_mode_support.c | 4277 ++ + .../dml2_core/dml2_core_dcn6_funcs_mode_support.h | 11 + + .../dml2_0/dml21/src/dml2_core/dml2_core_factory.c | 27 +- + .../dml21/src/dml2_core/dml2_core_shared_types.h | 165 +- + .../dc/dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 22 +- + .../dc/dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_dcn5.c | 449 + + .../dc/dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_dcn5.h | 19 + + .../dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_factory.c | 12 + + .../dml2_0/dml21/src/dml2_mcg/dml2_mcg_factory.c | 5 + + .../dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn42.c | 32 +- + .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 59 +- + .../dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5.c | 522 + + .../dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5.h | 21 + + .../src/dml2_pmo/dml2_pmo_dcn5_stage_optimizers.c | 2228 + + .../src/dml2_pmo/dml2_pmo_dcn5_stage_optimizers.h | 97 + + .../dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6.c | 506 + + .../dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6.h | 22 + + .../src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c | 1789 + + .../src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.h | 17 + + .../dml2_0/dml21/src/dml2_pmo/dml2_pmo_factory.c | 34 + + .../alternate_pstate_shared_lib.c | 1078 + + .../alternate_pstate_shared_lib.h | 109 + + .../dml21/src/dml2_top/dml2_top_interfaces.c | 7 + + .../dc/dml2_0/dml21/src/dml2_top/dml2_top_utm.c | 394 + + .../dc/dml2_0/dml21/src/dml2_top/dml2_top_utm.h | 9 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn5.c | 144 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn5.h | 11 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn6.c | 405 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn6.h | 12 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_factory.c | 29 + + .../src/dml2_utm_soc_bb/dml2_utm_soc_bb_factory.h | 11 + + .../dml21/src/inc/dml2_internal_shared_types.h | 486 +- + .../gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.h | 8 + + drivers/gpu/drm/amd/display/dc/dpp/Makefile | 17 + + .../drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c | 13 +- + .../drm/amd/display/dc/dpp/dcn20/dcn20_dpp_cm.c | 8 +- + .../drm/amd/display/dc/dpp/dcn30/dcn30_dpp_cm.c | 8 +- + .../gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp.h | 41 + + .../amd/display/dc/dpp/dcn401/dcn401_dpp_dscl.c | 51 +- + .../gpu/drm/amd/display/dc/dpp/dcn42/dcn42_dpp.c | 7 +- + .../gpu/drm/amd/display/dc/dpp/dcn42/dcn42_dpp.h | 6 + + .../gpu/drm/amd/display/dc/dpp/dcn50/dcn50_dpp.c | 391 + + .../gpu/drm/amd/display/dc/dpp/dcn50/dcn50_dpp.h | 86 + + .../gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c | 346 + + .../gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h | 525 + + .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c | 315 + + drivers/gpu/drm/amd/display/dc/dsc/Makefile | 7 + + .../gpu/drm/amd/display/dc/dsc/dcn60/dcn60_dsc.c | 447 + + .../gpu/drm/amd/display/dc/dsc/dcn60/dcn60_dsc.h | 248 + + .../drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h | 4 + + .../drm/amd/display/dc/dwb/dcn30/dcn30_dwb_cm.c | 3 +- + drivers/gpu/drm/amd/display/dc/gpio/Makefile | 10 + + .../amd/display/dc/gpio/dce80/hw_translate_dce80.c | 5 +- + .../amd/display/dc/gpio/dcn10/hw_translate_dcn10.c | 484 +- + .../amd/display/dc/gpio/dcn20/hw_translate_dcn20.c | 434 +- + .../amd/display/dc/gpio/dcn21/hw_translate_dcn21.c | 419 +- + .../amd/display/dc/gpio/dcn30/hw_translate_dcn30.c | 434 +- + .../display/dc/gpio/dcn315/hw_translate_dcn315.c | 420 +- + .../amd/display/dc/gpio/dcn32/hw_translate_dcn32.c | 386 +- + .../display/dc/gpio/dcn401/hw_translate_dcn401.c | 394 +- + .../amd/display/dc/gpio/dcn42/hw_translate_dcn42.c | 191 +- + .../amd/display/dc/gpio/dcn60/hw_factory_dcn60.c | 228 + + .../amd/display/dc/gpio/dcn60/hw_factory_dcn60.h | 11 + + .../amd/display/dc/gpio/dcn60/hw_translate_dcn60.c | 168 + + .../amd/display/dc/gpio/dcn60/hw_translate_dcn60.h | 13 + + drivers/gpu/drm/amd/display/dc/gpio/ddc_regs.h | 15 + + drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c | 302 + + drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.h | 28 + + drivers/gpu/drm/amd/display/dc/gpio/hw_factory.c | 4 + + drivers/gpu/drm/amd/display/dc/gpio/hw_translate.c | 90 + + drivers/gpu/drm/amd/display/dc/gpio/hw_translate.h | 21 + + drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 9 + + drivers/gpu/drm/amd/display/dc/hpo/Makefile | 8 + + .../dc/hpo/dcn31/dcn31_hpo_dp_stream_encoder.h | 47 - + .../dc/hpo/dcn60/dcn60_hpo_frl_link_encoder.c | 114 + + .../dc/hpo/dcn60/dcn60_hpo_frl_link_encoder.h | 18 + + .../dc/hpo/dcn60/dcn60_hpo_frl_stream_encoder.c | 358 + + .../dc/hpo/dcn60/dcn60_hpo_frl_stream_encoder.h | 32 + + drivers/gpu/drm/amd/display/dc/hubbub/Makefile | 8 + + .../drm/amd/display/dc/hubbub/dcn10/dcn10_hubbub.h | 108 + + .../drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c | 8 +- + .../drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.c | 2 +- + .../drm/amd/display/dc/hubbub/dcn35/dcn35_hubbub.h | 7 +- + .../amd/display/dc/hubbub/dcn401/dcn401_hubbub.c | 3 +- + .../amd/display/dc/hubbub/dcn401/dcn401_hubbub.h | 4 +- + .../drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c | 1816 + + .../drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.h | 207 + + drivers/gpu/drm/amd/display/dc/hubp/Makefile | 16 + + .../gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c | 3 +- + .../gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.h | 32 +- + .../drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c | 201 +- + .../drm/amd/display/dc/hubp/dcn401/dcn401_hubp.h | 23 +- + .../gpu/drm/amd/display/dc/hubp/dcn42/dcn42_hubp.c | 135 +- + .../gpu/drm/amd/display/dc/hubp/dcn42/dcn42_hubp.h | 15 +- + .../gpu/drm/amd/display/dc/hubp/dcn50/dcn50_hubp.c | 532 + + .../gpu/drm/amd/display/dc/hubp/dcn50/dcn50_hubp.h | 48 + + .../gpu/drm/amd/display/dc/hubp/dcn60/dcn60_hubp.c | 472 + + .../gpu/drm/amd/display/dc/hubp/dcn60/dcn60_hubp.h | 272 + + drivers/gpu/drm/amd/display/dc/hwss/Makefile | 16 + + .../gpu/drm/amd/display/dc/hwss/dce/dce_hwseq.h | 9 + + .../drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 49 +- + .../drm/amd/display/dc/hwss/dce60/dce60_hwseq.c | 10 +- + .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 96 +- + .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.h | 5 +- + .../drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 101 +- + .../drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.h | 3 +- + .../drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c | 2 +- + .../drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 40 +- + .../drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.h | 2 + + .../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 68 +- + .../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h | 6 +- + .../drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 70 +- + .../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 72 +- + .../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 8 +- + .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 19 +- + .../drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 775 +- + .../drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h | 23 +- + .../drm/amd/display/dc/hwss/dcn401/dcn401_init.c | 3 +- + .../drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.c | 540 +- + .../drm/amd/display/dc/hwss/dcn42/dcn42_hwseq.h | 9 +- + .../gpu/drm/amd/display/dc/hwss/dcn42/dcn42_init.c | 2 - + .../drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c | 759 + + .../drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.h | 32 + + .../drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c | 1164 + + .../drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.h | 32 + + .../gpu/drm/amd/display/dc/hwss/dcn60/dcn60_init.c | 181 + + .../gpu/drm/amd/display/dc/hwss/dcn60/dcn60_init.h | 12 + + drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h | 315 +- + .../drm/amd/display/dc/hwss/hw_sequencer_private.h | 10 +- + drivers/gpu/drm/amd/display/dc/inc/core_status.h | 10 + + drivers/gpu/drm/amd/display/dc/inc/core_types.h | 54 + + drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 3 + + drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 23 + + .../drm/amd/display/dc/inc/hw/clk_mgr_internal.h | 22 + + .../drm/amd/display/dc/inc/hw/cursor_reg_cache.h | 3 +- + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 1 + + drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 18 +- + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 7 + + drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 35 +- + .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h | 6 + + drivers/gpu/drm/amd/display/dc/inc/hw/mcif_wb.h | 24 +- + drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 81 +- + drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 1 + + drivers/gpu/drm/amd/display/dc/inc/link_service.h | 5 +- + drivers/gpu/drm/amd/display/dc/inc/reg_helper.h | 19 - + drivers/gpu/drm/amd/display/dc/inc/resource.h | 9 +- + .../drm/amd/display/dc/inc/soc_and_ip_translator.h | 14 - + drivers/gpu/drm/amd/display/dc/irq/Makefile | 9 + + .../amd/display/dc/irq/dcn60/irq_service_dcn60.c | 417 + + .../amd/display/dc/irq/dcn60/irq_service_dcn60.h | 12 + + .../gpu/drm/amd/display/dc/link/link_detection.c | 56 +- + drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 360 +- + drivers/gpu/drm/amd/display/dc/link/link_dpms.h | 4 +- + drivers/gpu/drm/amd/display/dc/link/link_factory.c | 12 +- + .../drm/amd/display/dc/link/protocols/link_ddc.c | 28 +- + .../drm/amd/display/dc/link/protocols/link_ddc.h | 2 + + .../display/dc/link/protocols/link_dp_capability.c | 14 +- + .../dc/link/protocols/link_dp_irq_handler.c | 1 - + .../dc/link/protocols/link_dp_panel_replay.c | 3 +- + .../display/dc/link/protocols/link_dp_training.c | 28 +- + .../dc/link/protocols/link_edp_panel_control.c | 21 +- + .../amd/display/dc/link/protocols/link_hdmi_frl.c | 25 +- + drivers/gpu/drm/amd/display/dc/mmhubbub/Makefile | 10 + + .../amd/display/dc/mmhubbub/dcn32/dcn32_mmhubbub.c | 4 +- + .../amd/display/dc/mmhubbub/dcn32/dcn32_mmhubbub.h | 5 + + .../display/dc/mmhubbub/dcn401/dcn401_mmhubbub.c | 135 + + .../display/dc/mmhubbub/dcn401/dcn401_mmhubbub.h | 40 + + .../amd/display/dc/mmhubbub/dcn42/dcn42_mmhubbub.h | 1 + + drivers/gpu/drm/amd/display/dc/mpc/Makefile | 8 + + .../gpu/drm/amd/display/dc/mpc/dcn20/dcn20_mpc.c | 4 - + .../gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c | 44 +- + .../gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.c | 246 +- + .../gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.h | 31 +- + .../gpu/drm/amd/display/dc/mpc/dcn42/dcn42_mpc.c | 405 +- + .../gpu/drm/amd/display/dc/mpc/dcn42/dcn42_mpc.h | 55 +- + .../gpu/drm/amd/display/dc/mpc/dcn60/dcn60_mpc.c | 330 + + .../gpu/drm/amd/display/dc/mpc/dcn60/dcn60_mpc.h | 472 + + drivers/gpu/drm/amd/display/dc/opp/Makefile | 8 + + .../gpu/drm/amd/display/dc/opp/dcn20/dcn20_opp.c | 51 +- + .../gpu/drm/amd/display/dc/opp/dcn60/dcn60_opp.c | 25 + + .../gpu/drm/amd/display/dc/opp/dcn60/dcn60_opp.h | 64 + + drivers/gpu/drm/amd/display/dc/optc/Makefile | 9 + + .../gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c | 41 +- + .../gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.h | 3 +- + .../gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c | 5 - + .../gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.c | 5 - + .../gpu/drm/amd/display/dc/optc/dcn31/dcn31_optc.h | 4 + + .../drm/amd/display/dc/optc/dcn314/dcn314_optc.c | 5 - + .../drm/amd/display/dc/optc/dcn314/dcn314_optc.h | 1 + + .../gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c | 5 - + .../gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.h | 2 + + .../gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c | 31 +- + .../drm/amd/display/dc/optc/dcn401/dcn401_optc.c | 5 - + .../drm/amd/display/dc/optc/dcn401/dcn401_optc.h | 1 + + .../gpu/drm/amd/display/dc/optc/dcn42/dcn42_optc.c | 9 +- + .../gpu/drm/amd/display/dc/optc/dcn42/dcn42_optc.h | 4 + + .../gpu/drm/amd/display/dc/optc/dcn60/dcn60_optc.c | 107 + + .../gpu/drm/amd/display/dc/optc/dcn60/dcn60_optc.h | 178 + + drivers/gpu/drm/amd/display/dc/os_types.h | 10 + + .../drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.c | 258 +- + .../drm/amd/display/dc/pg/dcn42/dcn42_pg_cntl.h | 22 +- + drivers/gpu/drm/amd/display/dc/resource/Makefile | 10 + + .../display/dc/resource/dce100/dce100_resource.h | 1 - + .../display/dc/resource/dce112/dce112_resource.h | 7 - + .../amd/display/dc/resource/dcn10/dcn10_resource.c | 1 + + .../amd/display/dc/resource/dcn20/dcn20_resource.c | 1 + + .../display/dc/resource/dcn201/dcn201_resource.c | 1 + + .../amd/display/dc/resource/dcn21/dcn21_resource.c | 1 + + .../amd/display/dc/resource/dcn30/dcn30_resource.c | 5 +- + .../display/dc/resource/dcn301/dcn301_resource.c | 3 + + .../display/dc/resource/dcn302/dcn302_resource.c | 5 +- + .../display/dc/resource/dcn303/dcn303_resource.c | 5 +- + .../amd/display/dc/resource/dcn31/dcn31_resource.c | 8 +- + .../display/dc/resource/dcn314/dcn314_resource.c | 8 +- + .../display/dc/resource/dcn315/dcn315_resource.c | 13 +- + .../display/dc/resource/dcn316/dcn316_resource.c | 12 +- + .../amd/display/dc/resource/dcn32/dcn32_resource.c | 5 +- + .../display/dc/resource/dcn321/dcn321_resource.c | 5 +- + .../amd/display/dc/resource/dcn35/dcn35_resource.c | 10 +- + .../display/dc/resource/dcn351/dcn351_resource.c | 10 +- + .../amd/display/dc/resource/dcn36/dcn36_resource.c | 10 +- + .../display/dc/resource/dcn401/dcn401_resource.c | 65 +- + .../display/dc/resource/dcn401/dcn401_resource.h | 11 +- + .../amd/display/dc/resource/dcn42/dcn42_resource.c | 44 +- + .../amd/display/dc/resource/dcn42/dcn42_resource.h | 1 + + .../display/dc/resource/dcn42b/dcn42b_resource.c | 60 +- + .../display/dc/resource/dcn42b/dcn42b_resource.h | 43 +- + .../amd/display/dc/resource/dcn60/dcn60_resource.c | 2377 + + .../amd/display/dc/resource/dcn60/dcn60_resource.h | 676 + + .../amd/display/dc/soc_and_ip_translator/Makefile | 6 + + .../dcn401/dcn401_soc_and_ip_translator.c | 16 + + .../dcn42/dcn42_soc_and_ip_translator.c | 18 +- + .../dcn42/dcn42_soc_and_ip_translator.h | 1 + + .../dcn42b/dcn42b_soc_and_ip_translator.c | 42 + + .../dcn42b/dcn42b_soc_and_ip_translator.h | 17 + + .../dcn60/dcn60_soc_and_ip_translator.c | 117 + + .../dcn60/dcn60_soc_and_ip_translator.h | 16 + + .../soc_and_ip_translator/soc_and_ip_translator.c | 9 +- + drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 202 +- + drivers/gpu/drm/amd/display/dc/sspl/dc_spl_types.h | 58 +- + drivers/gpu/drm/amd/display/dc/sspl/spl_debug.h | 4 +- + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 14 +- + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 518 +- + drivers/gpu/drm/amd/display/dmub/src/Makefile | 1 + + drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c | 732 + + drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h | 303 + + drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 107 +- + drivers/gpu/drm/amd/display/include/dal_asic_id.h | 18 + + drivers/gpu/drm/amd/display/include/dal_types.h | 1 + + .../drm/amd/display/include/ddc_service_types.h | 1 + + drivers/gpu/drm/amd/display/include/gpio_types.h | 48 + + .../drm/amd/display/modules/freesync/freesync.c | 8 +- + .../gpu/drm/amd/display/modules/inc/mod_power.h | 11 + + drivers/gpu/drm/amd/display/modules/power/Makefile | 2 +- + drivers/gpu/drm/amd/display/modules/power/power.c | 28 +- + .../gpu/drm/amd/display/modules/power/power_abm.c | 365 +- + .../drm/amd/display/modules/power/power_helpers.h | 19 + + .../gpu/drm/amd/display/modules/power/power_psr.c | 7 + + .../drm/amd/display/modules/power/power_replay.c | 16 +- + drivers/gpu/drm/amd/include/amd_shared.h | 6 - + drivers/gpu/drm/amd/include/amdgpu_ptl.h | 9 +- + .../amd/include/asic_reg/dcn/dcn_6_0_0_offset.h | 15799 +++++ + .../amd/include/asic_reg/dcn/dcn_6_0_0_sh_mask.h | 58556 +++++++++++++++++++ + .../amd/include/asic_reg/dpcs/dpcs_6_0_0_offset.h | 47 + + .../amd/include/asic_reg/dpcs/dpcs_6_0_0_sh_mask.h | 55 + + .../drm/amd/include/asic_reg/gca/gfx_6_0_sh_mask.h | 32 +- + .../include/asic_reg/mmhub/mmhub_5_0_1_offset.h | 17 + + .../include/asic_reg/mmhub/mmhub_5_0_1_sh_mask.h | 17 + + .../amd/include/asic_reg/sdma/sdma_4_4_2_offset.h | 4 + + drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 3 + + drivers/gpu/drm/amd/include/mes_v11_api_def.h | 52 +- + drivers/gpu/drm/amd/include/mes_v12_api_def.h | 5 +- + drivers/gpu/drm/amd/include/soc15_hw_ip.h | 1 + + drivers/gpu/drm/amd/include/v9_structs.h | 4 +- + drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 9 +- + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 151 +- + drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 1 - + drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 21 +- + .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 38 +- + .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c | 11 +- + .../amd/pm/powerplay/hwmgr/process_pptables_v1_0.c | 753 +- + .../drm/amd/pm/powerplay/hwmgr/processpptables.c | 450 +- + .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 60 +- + .../gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 83 +- + .../pm/powerplay/hwmgr/vega10_processpptables.c | 761 +- + .../pm/powerplay/hwmgr/vega12_processpptables.c | 7 + + .../pm/powerplay/hwmgr/vega20_processpptables.c | 7 + + drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h | 20 + + .../gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c | 25 +- + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 267 +- + drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 109 +- + .../amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_metrics.h | 230 + + .../amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_ppsmc.h | 5 +- + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 + + drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0.h | 17 +- + drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 24 +- + drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h | 15 +- + drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h | 15 +- + drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 73 +- + drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 94 +- + .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 124 +- + drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 105 +- + drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 134 +- + drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 1 - + drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 98 +- + drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 117 +- + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 128 +- + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 148 +- + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 816 +- + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.h | 31 +- + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 128 +- + drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 108 +- + .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c | 105 +- + .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 134 +- + drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 109 +- + .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 314 +- + .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.h | 13 + + .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c | 150 +- + .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h | 2 +- + drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 140 + + drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 13 + + drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 4 +- + drivers/gpu/drm/amd/ras/Makefile | 4 +- + drivers/gpu/drm/amd/ras/{rascore => core}/Makefile | 16 +- + .../drm/amd/ras/{rascore/ras_aca.c => core/aca.c} | 21 +- + .../drm/amd/ras/{rascore/ras_aca.h => core/aca.h} | 4 +- + .../{rascore/ras_aca_v1_0.c => core/aca_v1_0.c} | 17 +- + .../{rascore/ras_aca_v1_0.h => core/aca_v1_0.h} | 4 +- + .../drm/amd/ras/{rascore/ras_cmd.c => core/cmd.c} | 2 +- + .../drm/amd/ras/{rascore/ras_cmd.h => core/cmd.h} | 8 +- + .../amd/ras/{rascore/ras_core.c => core/core.c} | 40 +- + .../ras_core_status.h => core/core_status.h} | 4 +- + .../ras/{rascore/ras_eeprom.c => core/eeprom.c} | 10 +- + .../ras/{rascore/ras_eeprom.h => core/eeprom.h} | 8 +- + .../{rascore/ras_eeprom_fw.c => core/eeprom_fw.c} | 2 +- + .../{rascore/ras_eeprom_fw.h => core/eeprom_fw.h} | 4 +- + .../{rascore/ras_log_ring.c => core/log_ring.c} | 4 +- + .../{rascore/ras_log_ring.h => core/log_ring.h} | 6 +- + drivers/gpu/drm/amd/ras/{rascore => core}/ras.h | 22 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_cper.c | 4 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_cper.h | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_gfx.c | 2 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_gfx.h | 0 + .../drm/amd/ras/{rascore => core}/ras_gfx_v9_0.c | 2 +- + .../drm/amd/ras/{rascore => core}/ras_gfx_v9_0.h | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_mp1.c | 19 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_mp1.h | 3 + + .../drm/amd/ras/{rascore => core}/ras_mp1_v13_0.c | 15 +- + .../drm/amd/ras/{rascore => core}/ras_mp1_v13_0.h | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_nbio.c | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_nbio.h | 0 + .../drm/amd/ras/{rascore => core}/ras_nbio_v7_9.c | 0 + .../drm/amd/ras/{rascore => core}/ras_nbio_v7_9.h | 0 + .../drm/amd/ras/{rascore => core}/ras_process.c | 5 +- + .../drm/amd/ras/{rascore => core}/ras_process.h | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_psp.c | 5 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_psp.h | 2 +- + .../drm/amd/ras/{rascore => core}/ras_psp_v13_0.c | 0 + .../drm/amd/ras/{rascore => core}/ras_psp_v13_0.h | 0 + .../gpu/drm/amd/ras/{rascore => core}/ras_umc.c | 216 +- + .../gpu/drm/amd/ras/{rascore => core}/ras_umc.h | 51 +- + .../drm/amd/ras/{rascore => core}/ras_umc_v12_0.c | 240 +- + .../drm/amd/ras/{rascore => core}/ras_umc_v12_0.h | 5 +- + .../amd/ras/{rascore/ras_ta_if.h => core/ta_if.h} | 4 +- + drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_cmd.c | 89 +- + .../drm/amd/ras/ras_mgr/amdgpu_ras_eeprom_i2c.c | 4 +- + drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 96 +- + drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.h | 4 + + .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c | 14 + + drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_sys.c | 22 + + drivers/gpu/drm/amd/ras/ras_mgr/ras_sys.h | 3 + + drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 +- + drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 27 +- + drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 13 +- + drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 19 +- + drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 6 +- + drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 32 +- + drivers/gpu/drm/bridge/analogix/anx7625.c | 6 +- + drivers/gpu/drm/bridge/aux-bridge.c | 4 + + drivers/gpu/drm/bridge/aux-hpd-bridge.c | 4 + + drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 9 +- + .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 8 +- + drivers/gpu/drm/bridge/chipone-icn6211.c | 6 +- + drivers/gpu/drm/bridge/chrontel-ch7033.c | 15 +- + drivers/gpu/drm/bridge/cros-ec-anx7688.c | 4 + + drivers/gpu/drm/bridge/display-connector.c | 38 +- + drivers/gpu/drm/bridge/fsl-ldb.c | 3 +- + drivers/gpu/drm/bridge/imx/Kconfig | 11 + + drivers/gpu/drm/bridge/imx/Makefile | 1 + + drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c | 2 +- + drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 2 +- + drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 2 +- + .../gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 2 +- + drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 2 +- + drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 2 +- + drivers/gpu/drm/bridge/imx/imx93-pdfc.c | 222 + + drivers/gpu/drm/bridge/inno-hdmi.c | 2 +- + drivers/gpu/drm/bridge/ite-it6263.c | 4 +- + drivers/gpu/drm/bridge/ite-it6505.c | 4 +- + drivers/gpu/drm/bridge/ite-it66121.c | 2 +- + drivers/gpu/drm/bridge/lontium-lt8713sx.c | 6 +- + drivers/gpu/drm/bridge/lontium-lt8912b.c | 14 +- + drivers/gpu/drm/bridge/lontium-lt9211.c | 7 +- + drivers/gpu/drm/bridge/lontium-lt9611.c | 6 +- + drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 +- + drivers/gpu/drm/bridge/lvds-codec.c | 13 +- + .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 11 +- + drivers/gpu/drm/bridge/microchip-lvds.c | 3 + + drivers/gpu/drm/bridge/nwl-dsi.c | 2 +- + drivers/gpu/drm/bridge/nxp-ptn3460.c | 21 +- + drivers/gpu/drm/bridge/of-display-mode-bridge.c | 6 +- + drivers/gpu/drm/bridge/panel.c | 22 +- + drivers/gpu/drm/bridge/parade-ps8622.c | 26 +- + drivers/gpu/drm/bridge/parade-ps8640.c | 2 +- + drivers/gpu/drm/bridge/samsung-dsim.c | 5 +- + drivers/gpu/drm/bridge/sii902x.c | 8 +- + drivers/gpu/drm/bridge/sii9234.c | 41 +- + drivers/gpu/drm/bridge/sil-sii8620.c | 6 +- + drivers/gpu/drm/bridge/simple-bridge.c | 13 +- + drivers/gpu/drm/bridge/ssd2825.c | 3 +- + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 9 +- + drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 +- + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 5 +- + drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 2 +- + drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi2.c | 3 +- + drivers/gpu/drm/bridge/tc358762.c | 21 +- + drivers/gpu/drm/bridge/tc358764.c | 32 +- + drivers/gpu/drm/bridge/tc358767.c | 10 +- + drivers/gpu/drm/bridge/tc358768.c | 7 +- + drivers/gpu/drm/bridge/tc358775.c | 6 +- + drivers/gpu/drm/bridge/tda998x_drv.c | 15 +- + drivers/gpu/drm/bridge/thc63lvd1024.c | 14 +- + drivers/gpu/drm/bridge/ti-dlpc3433.c | 4 +- + drivers/gpu/drm/bridge/ti-sn65dsi83.c | 9 +- + drivers/gpu/drm/bridge/ti-sn65dsi86.c | 8 +- + drivers/gpu/drm/bridge/ti-tdp158.c | 2 +- + drivers/gpu/drm/bridge/ti-tfp410.c | 14 +- + drivers/gpu/drm/bridge/ti-tpd12s015.c | 4 + + drivers/gpu/drm/bridge/waveshare-dsi.c | 15 +- + drivers/gpu/drm/clients/drm_log.c | 10 +- + drivers/gpu/drm/display/drm_bridge_connector.c | 45 +- + drivers/gpu/drm/display/drm_dp_tunnel.c | 116 +- + drivers/gpu/drm/display/drm_hdmi_state_helper.c | 68 +- + drivers/gpu/drm/drm_atomic.c | 82 +- + drivers/gpu/drm/drm_atomic_helper.c | 86 + + drivers/gpu/drm/drm_atomic_state_helper.c | 154 +- + drivers/gpu/drm/drm_atomic_uapi.c | 4 + + drivers/gpu/drm/drm_blend.c | 20 +- + drivers/gpu/drm/drm_bridge.c | 187 +- + drivers/gpu/drm/drm_buddy.c | 30 +- + drivers/gpu/drm/drm_colorop.c | 41 +- + drivers/gpu/drm/drm_connector.c | 192 +- + drivers/gpu/drm/drm_displayid_internal.h | 24 + + drivers/gpu/drm/drm_draw_internal.h | 7 - + drivers/gpu/drm/drm_drv.c | 46 +- + drivers/gpu/drm/drm_dumb_buffers.c | 1 - + drivers/gpu/drm/drm_edid.c | 80 +- + drivers/gpu/drm/drm_exec.c | 2 +- + drivers/gpu/drm/drm_fb_helper.c | 11 +- + drivers/gpu/drm/drm_gem.c | 3 +- + drivers/gpu/drm/drm_gem_shmem_helper.c | 22 +- + drivers/gpu/drm/drm_gpusvm.c | 243 +- + drivers/gpu/drm/drm_gpuvm.c | 44 - + drivers/gpu/drm/drm_mode_config.c | 210 +- + drivers/gpu/drm/drm_modes.c | 23 + + drivers/gpu/drm/drm_of.c | 49 +- + drivers/gpu/drm/drm_panel.c | 68 +- + drivers/gpu/drm/drm_panic.c | 6 +- + drivers/gpu/drm/drm_print.c | 4 +- + drivers/gpu/drm/drm_probe_helper.c | 53 +- + drivers/gpu/drm/drm_syncobj.c | 2 +- + drivers/gpu/drm/drm_writeback.c | 6 + + drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 33 +- + drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 6 + + drivers/gpu/drm/exynos/exynos_dp.c | 32 +- + drivers/gpu/drm/exynos/exynos_drm_dpi.c | 17 +- + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +- + drivers/gpu/drm/exynos/exynos_drm_mic.c | 14 +- + drivers/gpu/drm/exynos/exynos_drm_vidi.c | 14 +- + drivers/gpu/drm/exynos/exynos_hdmi.c | 20 +- + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 18 + + drivers/gpu/drm/gma500/cdv_intel_crt.c | 9 +- + drivers/gpu/drm/gma500/cdv_intel_dp.c | 120 +- + drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 10 +- + drivers/gpu/drm/gma500/cdv_intel_lvds.c | 9 +- + drivers/gpu/drm/gma500/oaktrail_hdmi.c | 9 +- + drivers/gpu/drm/gma500/oaktrail_lvds.c | 9 +- + drivers/gpu/drm/gma500/psb_drv.c | 56 +- + drivers/gpu/drm/gma500/psb_intel_lvds.c | 9 +- + drivers/gpu/drm/hisilicon/hibmc/Kconfig | 4 +- + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 114 +- + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 78 +- + drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 5 + + drivers/gpu/drm/hyperv/hyperv_drm.h | 16 +- + drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 100 +- + drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 110 +- + drivers/gpu/drm/hyperv/hyperv_drm_proto.c | 70 +- + drivers/gpu/drm/i915/.kunitconfig | 9 + + drivers/gpu/drm/i915/Kconfig.debug | 12 + + drivers/gpu/drm/i915/Makefile | 7 +- + drivers/gpu/drm/i915/display/g4x_dp.c | 15 +- + drivers/gpu/drm/i915/display/g4x_hdmi.c | 4 +- + drivers/gpu/drm/i915/display/hsw_ips.c | 2 +- + drivers/gpu/drm/i915/display/i9xx_plane.c | 8 +- + drivers/gpu/drm/i915/display/icl_dsi.c | 5 +- + drivers/gpu/drm/i915/display/intel_alpm.c | 15 +- + drivers/gpu/drm/i915/display/intel_audio.c | 55 +- + drivers/gpu/drm/i915/display/intel_bios.c | 62 +- + drivers/gpu/drm/i915/display/intel_bw.c | 280 +- + drivers/gpu/drm/i915/display/intel_cdclk.c | 60 +- + drivers/gpu/drm/i915/display/intel_cdclk.h | 1 + + drivers/gpu/drm/i915/display/intel_cmtg.c | 280 +- + drivers/gpu/drm/i915/display/intel_cmtg.h | 19 +- + drivers/gpu/drm/i915/display/intel_cmtg_regs.h | 24 +- + drivers/gpu/drm/i915/display/intel_color.c | 115 +- + drivers/gpu/drm/i915/display/intel_crt.c | 9 +- + drivers/gpu/drm/i915/display/intel_crtc.c | 2 +- + drivers/gpu/drm/i915/display/intel_cursor.c | 5 +- + drivers/gpu/drm/i915/display/intel_cx0_phy.c | 11 + + drivers/gpu/drm/i915/display/intel_cx0_phy.h | 1 - + drivers/gpu/drm/i915/display/intel_ddi.c | 37 +- + drivers/gpu/drm/i915/display/intel_de.c | 40 +- + drivers/gpu/drm/i915/display/intel_display.c | 242 +- + drivers/gpu/drm/i915/display/intel_display.h | 7 + + drivers/gpu/drm/i915/display/intel_display_core.h | 16 +- + .../gpu/drm/i915/display/intel_display_debugfs.c | 2 + + .../gpu/drm/i915/display/intel_display_device.c | 14 + + .../gpu/drm/i915/display/intel_display_device.h | 6 +- + .../gpu/drm/i915/display/intel_display_driver.c | 202 +- + .../gpu/drm/i915/display/intel_display_driver.h | 17 +- + drivers/gpu/drm/i915/display/intel_display_irq.c | 21 +- + drivers/gpu/drm/i915/display/intel_display_irq.h | 2 + + .../gpu/drm/i915/display/intel_display_limits.h | 2 + + drivers/gpu/drm/i915/display/intel_display_power.c | 189 +- + drivers/gpu/drm/i915/display/intel_display_power.h | 40 + + .../drm/i915/display/intel_display_power_well.c | 76 +- + .../drm/i915/display/intel_display_power_well.h | 1 + + drivers/gpu/drm/i915/display/intel_display_regs.h | 49 +- + drivers/gpu/drm/i915/display/intel_display_types.h | 67 +- + drivers/gpu/drm/i915/display/intel_display_wa.c | 4 + + drivers/gpu/drm/i915/display/intel_display_wa.h | 2 + + drivers/gpu/drm/i915/display/intel_dmc.c | 25 +- + drivers/gpu/drm/i915/display/intel_dmc_regs.h | 2 + + drivers/gpu/drm/i915/display/intel_dmc_wl.c | 2 +- + drivers/gpu/drm/i915/display/intel_dp.c | 849 +- + drivers/gpu/drm/i915/display/intel_dp.h | 31 +- + drivers/gpu/drm/i915/display/intel_dp_link_caps.c | 1312 + + drivers/gpu/drm/i915/display/intel_dp_link_caps.h | 195 + + .../gpu/drm/i915/display/intel_dp_link_training.c | 1271 +- + .../gpu/drm/i915/display/intel_dp_link_training.h | 46 + + drivers/gpu/drm/i915/display/intel_dp_mst.c | 87 +- + drivers/gpu/drm/i915/display/intel_dp_test.c | 108 +- + drivers/gpu/drm/i915/display/intel_dp_test.h | 3 +- + drivers/gpu/drm/i915/display/intel_dp_tunnel.c | 55 +- + drivers/gpu/drm/i915/display/intel_dp_tunnel.h | 17 + + drivers/gpu/drm/i915/display/intel_dram.c | 14 +- + drivers/gpu/drm/i915/display/intel_dsb.c | 32 +- + drivers/gpu/drm/i915/display/intel_dvo.c | 5 +- + drivers/gpu/drm/i915/display/intel_fbc.c | 21 +- + drivers/gpu/drm/i915/display/intel_fbdev.c | 35 +- + drivers/gpu/drm/i915/display/intel_gmbus.c | 148 +- + drivers/gpu/drm/i915/display/intel_gmbus.h | 22 +- + drivers/gpu/drm/i915/display/intel_hdcp.c | 2 + + drivers/gpu/drm/i915/display/intel_hdmi.c | 45 +- + drivers/gpu/drm/i915/display/intel_initial_plane.c | 8 +- + drivers/gpu/drm/i915/display/intel_lpe_audio.c | 4 +- + drivers/gpu/drm/i915/display/intel_lt_phy.c | 14 +- + drivers/gpu/drm/i915/display/intel_lvds.c | 5 +- + drivers/gpu/drm/i915/display/intel_modeset_setup.c | 30 +- + drivers/gpu/drm/i915/display/intel_panel.c | 170 +- + drivers/gpu/drm/i915/display/intel_panel.h | 6 +- + drivers/gpu/drm/i915/display/intel_parent.c | 6 +- + drivers/gpu/drm/i915/display/intel_parent.h | 4 +- + drivers/gpu/drm/i915/display/intel_plane.c | 109 +- + drivers/gpu/drm/i915/display/intel_plane.h | 10 +- + drivers/gpu/drm/i915/display/intel_pmdemand.c | 12 +- + drivers/gpu/drm/i915/display/intel_psr.c | 280 +- + drivers/gpu/drm/i915/display/intel_psr.h | 1 + + drivers/gpu/drm/i915/display/intel_psr_regs.h | 1 + + drivers/gpu/drm/i915/display/intel_sdvo.c | 7 +- + drivers/gpu/drm/i915/display/intel_sprite.c | 22 +- + drivers/gpu/drm/i915/display/intel_tv.c | 5 +- + drivers/gpu/drm/i915/display/intel_vrr.c | 29 +- + drivers/gpu/drm/i915/display/intel_vrr.h | 4 +- + drivers/gpu/drm/i915/display/skl_universal_plane.c | 22 +- + drivers/gpu/drm/i915/display/skl_universal_plane.h | 9 + + drivers/gpu/drm/i915/display/skl_watermark.c | 6 + + drivers/gpu/drm/i915/display/tests/Makefile | 7 + + .../drm/i915/display/tests/intel_dp_link_test.c | 1408 + + drivers/gpu/drm/i915/display/vlv_dsi.c | 5 +- + drivers/gpu/drm/i915/gem/i915_gem_object.h | 7 - + drivers/gpu/drm/i915/gem/i915_gem_pages.c | 128 - + drivers/gpu/drm/i915/gem/i915_gem_panic.c | 147 + + drivers/gpu/drm/i915/gem/i915_gem_panic.h | 11 + + drivers/gpu/drm/i915/gt/intel_gsc.c | 2 +- + drivers/gpu/drm/i915/gt/intel_reset.c | 2 +- + .../gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c | 2 +- + drivers/gpu/drm/i915/gvt/edid.c | 14 +- + drivers/gpu/drm/i915/i915_active.c | 2 +- + drivers/gpu/drm/i915/i915_driver.c | 181 +- + drivers/gpu/drm/i915/i915_initial_plane.c | 12 +- + drivers/gpu/drm/i915/i915_panic.c | 35 - + drivers/gpu/drm/i915/i915_panic.h | 9 - + drivers/gpu/drm/imagination/pvr_ccb.c | 6 +- + drivers/gpu/drm/imagination/pvr_check.h | 36 + + drivers/gpu/drm/imagination/pvr_device.c | 4 +- + drivers/gpu/drm/imagination/pvr_device_info.h | 6 +- + drivers/gpu/drm/imagination/pvr_drv.c | 7 +- + drivers/gpu/drm/imagination/pvr_gem.h | 12 +- + drivers/gpu/drm/imagination/pvr_queue.c | 14 +- + drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h | 11 +- + .../drm/imagination/pvr_rogue_fwif_client_check.h | 9 +- + .../drm/imagination/pvr_rogue_fwif_shared_check.h | 9 +- + .../gpu/drm/imagination/pvr_rogue_heap_config.h | 10 +- + drivers/gpu/drm/imagination/pvr_rogue_mips_check.h | 71 +- + drivers/gpu/drm/imx/dc/dc-ic.c | 6 +- + drivers/gpu/drm/imx/dcss/dcss-kms.c | 4 + + drivers/gpu/drm/imx/ipuv3/parallel-display.c | 2 +- + drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 +- + drivers/gpu/drm/lima/lima_device.c | 12 +- + drivers/gpu/drm/logicvc/logicvc_interface.c | 12 + + drivers/gpu/drm/loongson/lsdc_drv.c | 4 +- + drivers/gpu/drm/mcde/mcde_drv.c | 1 + + drivers/gpu/drm/mcde/mcde_dsi.c | 4 + + drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- + drivers/gpu/drm/mediatek/mtk_dpi.c | 12 +- + drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- + drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- + drivers/gpu/drm/mediatek/mtk_hdmi_v2.c | 2 +- + drivers/gpu/drm/meson/meson_encoder_cvbs.c | 2 +- + drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +- + drivers/gpu/drm/meson/meson_encoder_hdmi.c | 2 +- + drivers/gpu/drm/mgag200/mgag200_drv.c | 24 +- + drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- + drivers/gpu/drm/msm/dsi/dsi_host.c | 25 +- + drivers/gpu/drm/msm/dsi/dsi_manager.c | 13 +- + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 2 +- + drivers/gpu/drm/msm/msm_drv.c | 2 - + drivers/gpu/drm/mxsfb/lcdif_drv.c | 2 +- + drivers/gpu/drm/mxsfb/lcdif_kms.c | 18 +- + drivers/gpu/drm/mxsfb/lcdif_regs.h | 1 + + drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 + + drivers/gpu/drm/nouveau/dispnv50/base.h | 6 + + drivers/gpu/drm/nouveau/dispnv50/base507c.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/base827c.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/base907c.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 3 + + drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 + + drivers/gpu/drm/nouveau/dispnv50/wndw.c | 40 +- + drivers/gpu/drm/nouveau/dispnv50/wndw.h | 11 + + drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c | 1 + + drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c | 1 + + drivers/gpu/drm/nouveau/nouveau_abi16.c | 14 +- + drivers/gpu/drm/nouveau/nouveau_drm.c | 36 +- + drivers/gpu/drm/nouveau/nouveau_drv.h | 4 +- + drivers/gpu/drm/nouveau/nouveau_gem.c | 11 +- + drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 + + drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c | 4 +- + drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h | 2 + + .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c | 8 +- + .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c | 1 + + drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c | 39 +- + drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h | 1 + + drivers/gpu/drm/nova/Makefile | 5 +- + drivers/gpu/drm/nova/driver.rs | 36 +- + drivers/gpu/drm/nova/file.rs | 22 +- + drivers/gpu/drm/nova/gem.rs | 18 +- + drivers/gpu/drm/omapdrm/dss/dpi.c | 14 +- + drivers/gpu/drm/omapdrm/dss/dsi.c | 21 +- + drivers/gpu/drm/omapdrm/dss/dsi.h | 2 - + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +- + drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +- + drivers/gpu/drm/omapdrm/dss/output.c | 1 + + drivers/gpu/drm/omapdrm/dss/sdi.c | 14 +- + drivers/gpu/drm/omapdrm/dss/venc.c | 14 +- + drivers/gpu/drm/panel/Kconfig | 67 + + drivers/gpu/drm/panel/Makefile | 6 + + drivers/gpu/drm/panel/panel-anbernic-td4310.c | 258 + + .../gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 3 +- + drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 3 +- + drivers/gpu/drm/panel/panel-chipone-icna35xx.c | 423 + + drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c | 3 +- + drivers/gpu/drm/panel/panel-edp.c | 73 +- + drivers/gpu/drm/panel/panel-elida-kd35t133.c | 3 +- + drivers/gpu/drm/panel/panel-focaltech-ota7290b.c | 3 +- + drivers/gpu/drm/panel/panel-himax-hx83102.c | 3 +- + drivers/gpu/drm/panel/panel-himax-hx83121a.c | 39 +- + drivers/gpu/drm/panel/panel-himax-hx8394.c | 3 +- + drivers/gpu/drm/panel/panel-ilitek-ili7807s.c | 285 + + drivers/gpu/drm/panel/panel-ilitek-ili9488.c | 290 + + drivers/gpu/drm/panel/panel-ilitek-ili9805.c | 212 +- + drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c | 3 +- + drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 3 +- + drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 3 +- + drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 251 +- + drivers/gpu/drm/panel/panel-lvds.c | 2 +- + drivers/gpu/drm/panel/panel-novatek-nt36523.c | 3 +- + drivers/gpu/drm/panel/panel-novatek-nt36536.c | 486 + + drivers/gpu/drm/panel/panel-novatek-nt36672a.c | 522 +- + drivers/gpu/drm/panel/panel-novatek-nt37801.c | 106 +- + drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c | 14 +- + drivers/gpu/drm/panel/panel-renesas-r63419.c | 351 + + drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 10 +- + drivers/gpu/drm/panel/panel-samsung-sofef00.c | 4 + + drivers/gpu/drm/panel/panel-simple.c | 38 +- + drivers/gpu/drm/panel/panel-sitronix-st7701.c | 3 +- + drivers/gpu/drm/panel/panel-sitronix-st7703.c | 99 +- + drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 3 +- + drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 42 +- + drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 42 +- + drivers/gpu/drm/panfrost/panfrost_device.c | 1 - + drivers/gpu/drm/panfrost/panfrost_device.h | 1 - + drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + + drivers/gpu/drm/panthor/panthor_device.h | 3 + + drivers/gpu/drm/panthor/panthor_drv.c | 16 +- + drivers/gpu/drm/panthor/panthor_fw.c | 22 +- + drivers/gpu/drm/panthor/panthor_gem.c | 18 + + drivers/gpu/drm/panthor/panthor_gem.h | 2 + + drivers/gpu/drm/panthor/panthor_mmu.c | 270 +- + drivers/gpu/drm/panthor/panthor_sched.c | 1 - + drivers/gpu/drm/pl111/pl111_drv.c | 1 + + drivers/gpu/drm/qxl/qxl_display.c | 12 +- + drivers/gpu/drm/qxl/qxl_drv.c | 15 +- + drivers/gpu/drm/radeon/r600_dpm.c | 21 +- + drivers/gpu/drm/radeon/radeon_bios.c | 64 +- + drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 20 +- + drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c | 1 + + drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c | 3 +- + drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 2 +- + drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 1 + + drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 2 +- + drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 51 +- + drivers/gpu/drm/rockchip/cdn-dp-core.c | 11 +- + drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 9 +- + drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 8 +- + drivers/gpu/drm/rockchip/dw_dp-rockchip.c | 16 +- + drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 228 +- + drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 112 +- + drivers/gpu/drm/rockchip/rk3066_hdmi.c | 10 +- + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 4 + + drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 176 +- + drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 2 +- + drivers/gpu/drm/rockchip/rockchip_lvds.c | 15 +- + drivers/gpu/drm/rockchip/rockchip_rgb.c | 11 +- + drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 46 +- + drivers/gpu/drm/scheduler/sched_entity.c | 7 - + drivers/gpu/drm/scheduler/sched_main.c | 9 - + drivers/gpu/drm/scheduler/tests/tests_basic.c | 359 + + drivers/gpu/drm/scheduler/tests/tests_scheduler.c | 2 +- + drivers/gpu/drm/solomon/ssd130x.c | 414 +- + drivers/gpu/drm/sti/sti_dvo.c | 23 +- + drivers/gpu/drm/sti/sti_hda.c | 20 +- + drivers/gpu/drm/sti/sti_hdmi.c | 20 +- + drivers/gpu/drm/stm/ltdc.c | 2 + + drivers/gpu/drm/stm/lvds.c | 14 +- + drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +- + drivers/gpu/drm/sun4i/sun4i_crtc.c | 2 +- + drivers/gpu/drm/sun4i/sun4i_drv.c | 3 + + drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 19 +- + drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 13 +- + drivers/gpu/drm/sun4i/sun4i_lvds.c | 23 +- + drivers/gpu/drm/sun4i/sun4i_rgb.c | 23 +- + drivers/gpu/drm/sun4i/sun4i_tcon.c | 24 +- + drivers/gpu/drm/sun4i/sun4i_tv.c | 10 +- + drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 16 +- + drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 10 +- + drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 2 +- + drivers/gpu/drm/sun4i/sun8i_mixer.c | 2 +- + drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 71 +- + drivers/gpu/drm/sun4i/sun8i_tcon_top.h | 6 + + drivers/gpu/drm/sun4i/sun8i_vi_scaler.c | 20 +- + drivers/gpu/drm/sun4i/sun8i_vi_scaler.h | 1 + + drivers/gpu/drm/sysfb/Kconfig | 7 +- + drivers/gpu/drm/sysfb/simpledrm.c | 120 +- + drivers/gpu/drm/tegra/drm.c | 3 + + drivers/gpu/drm/tegra/dsi.c | 131 +- + drivers/gpu/drm/tegra/dsi.h | 10 + + drivers/gpu/drm/tegra/falcon.c | 66 +- + drivers/gpu/drm/tegra/falcon.h | 23 + + drivers/gpu/drm/tegra/output.c | 24 +- + drivers/gpu/drm/tegra/vic.c | 92 +- + drivers/gpu/drm/tegra/vic.h | 9 +- + drivers/gpu/drm/tests/Makefile | 3 +- + drivers/gpu/drm/tests/drm_bridge_test.c | 1017 +- + drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 347 +- + drivers/gpu/drm/tests/drm_kunit_edid.c | 995 + + drivers/gpu/drm/tests/drm_kunit_edid.h | 985 +- + drivers/gpu/drm/tidss/tidss_crtc.c | 17 +- + drivers/gpu/drm/tidss/tidss_encoder.c | 2 +- + drivers/gpu/drm/tidss/tidss_kms.c | 16 +- + drivers/gpu/drm/tidss/tidss_oldi.c | 2 +- + drivers/gpu/drm/tidss/tidss_plane.c | 2 +- + drivers/gpu/drm/tiny/gm12u320.c | 5 +- + drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c | 2 +- + drivers/gpu/drm/ttm/ttm_bo.c | 322 +- + drivers/gpu/drm/ttm/ttm_bo_util.c | 3 +- + drivers/gpu/drm/ttm/ttm_pool.c | 37 +- + drivers/gpu/drm/ttm/ttm_resource.c | 111 +- + drivers/gpu/drm/tve200/tve200_drv.c | 2 + + drivers/gpu/drm/tyr/Kconfig | 5 + + drivers/gpu/drm/tyr/driver.rs | 81 +- + drivers/gpu/drm/tyr/file.rs | 15 +- + drivers/gpu/drm/tyr/fw.rs | 321 + + drivers/gpu/drm/tyr/fw/parser.rs | 588 + + drivers/gpu/drm/tyr/gem.rs | 141 +- + drivers/gpu/drm/tyr/mmu.rs | 120 + + drivers/gpu/drm/tyr/mmu/address_space.rs | 511 + + drivers/gpu/drm/tyr/regs.rs | 149 +- + drivers/gpu/drm/tyr/slot.rs | 404 + + drivers/gpu/drm/tyr/tyr.rs | 4 + + drivers/gpu/drm/tyr/vm.rs | 950 + + drivers/gpu/drm/v3d/Kconfig | 1 + + drivers/gpu/drm/v3d/v3d_drv.c | 20 +- + drivers/gpu/drm/v3d/v3d_drv.h | 88 +- + drivers/gpu/drm/v3d/v3d_gem.c | 7 +- + drivers/gpu/drm/v3d/v3d_irq.c | 7 +- + drivers/gpu/drm/v3d/v3d_perfmon.c | 189 +- + drivers/gpu/drm/v3d/v3d_power.c | 4 + + drivers/gpu/drm/v3d/v3d_sched.c | 103 +- + drivers/gpu/drm/v3d/v3d_submit.c | 1008 +- + drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- + drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +- + drivers/gpu/drm/verisilicon/vs_bridge.c | 4 +- + drivers/gpu/drm/virtio/virtgpu_drv.c | 101 +- + drivers/gpu/drm/virtio/virtgpu_drv.h | 26 +- + drivers/gpu/drm/virtio/virtgpu_kms.c | 71 +- + drivers/gpu/drm/virtio/virtgpu_object.c | 90 +- + drivers/gpu/drm/virtio/virtgpu_prime.c | 45 +- + drivers/gpu/drm/virtio/virtgpu_vq.c | 50 +- + drivers/gpu/drm/virtio/virtgpu_vram.c | 5 +- + drivers/gpu/drm/xe/.gitignore | 1 + + drivers/gpu/drm/xe/.kunitconfig-display | 11 + + drivers/gpu/drm/xe/Kconfig.debug | 16 + + drivers/gpu/drm/xe/Kconfig.profile | 71 +- + drivers/gpu/drm/xe/Makefile | 5 + + drivers/gpu/drm/xe/abi/guc_actions_abi.h | 1 + + drivers/gpu/drm/xe/abi/guc_capture_abi.h | 3 +- + drivers/gpu/drm/xe/abi/guc_klvs_abi.h | 39 +- + drivers/gpu/drm/xe/abi/guc_scheduler_abi.h | 3 +- + drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h | 27 + + drivers/gpu/drm/xe/display/tests/Makefile | 13 + + drivers/gpu/drm/xe/display/xe_display.c | 284 +- + drivers/gpu/drm/xe/display/xe_display.h | 12 +- + drivers/gpu/drm/xe/display/xe_display_bo.c | 33 +- + drivers/gpu/drm/xe/display/xe_initial_plane.c | 58 +- + drivers/gpu/drm/xe/display/xe_panic.c | 26 +- + drivers/gpu/drm/xe/regs/xe_pmt.h | 2 + + drivers/gpu/drm/xe/regs/xe_regs.h | 2 + + drivers/gpu/drm/xe/tests/Makefile | 1 + + drivers/gpu/drm/xe/tests/xe_bo.c | 242 + + .../gpu/drm/xe/tests/xe_guc_klv_helpers_kunit.c | 429 + + drivers/gpu/drm/xe/tests/xe_live_test_mod.c | 6 + + drivers/gpu/drm/xe/tests/xe_pci.c | 53 +- + drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c | 112 + + drivers/gpu/drm/xe/tests/xe_rtp_test.c | 52 + + drivers/gpu/drm/xe/tests/xe_sriov_packet_kunit.c | 89 + + drivers/gpu/drm/xe/tests/xe_wa_test.c | 3 - + drivers/gpu/drm/xe/xe_bo.c | 174 +- + drivers/gpu/drm/xe/xe_bo.h | 1 + + drivers/gpu/drm/xe/xe_configfs.c | 65 + + drivers/gpu/drm/xe/xe_configfs.h | 2 + + drivers/gpu/drm/xe/xe_debugfs.c | 166 +- + drivers/gpu/drm/xe/xe_debugfs.h | 6 + + drivers/gpu/drm/xe/xe_device.c | 70 +- + drivers/gpu/drm/xe/xe_device.h | 65 +- + drivers/gpu/drm/xe/xe_device_types.h | 45 +- + drivers/gpu/drm/xe/xe_drm_client.c | 5 +- + drivers/gpu/drm/xe/xe_drm_ras.c | 44 +- + drivers/gpu/drm/xe/xe_eu_stall.c | 42 +- + drivers/gpu/drm/xe/xe_exec_queue.c | 17 +- + drivers/gpu/drm/xe/xe_exec_queue_types.h | 29 +- + drivers/gpu/drm/xe/xe_execlist.c | 8 +- + drivers/gpu/drm/xe/xe_ggtt.c | 8 +- + drivers/gpu/drm/xe/xe_gt.c | 21 +- + drivers/gpu/drm/xe/xe_gt.h | 14 +- + drivers/gpu/drm/xe/xe_gt_mcr.c | 28 +- + drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 5 +- + drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c | 5 +- + drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 47 + + drivers/gpu/drm/xe/xe_gt_sriov_vf.h | 1 + + drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h | 4 + + drivers/gpu/drm/xe/xe_gt_types.h | 17 +- + drivers/gpu/drm/xe/xe_guc.c | 70 + + drivers/gpu/drm/xe/xe_guc.h | 23 +- + drivers/gpu/drm/xe/xe_guc_ads.c | 134 +- + drivers/gpu/drm/xe/xe_guc_capture.c | 21 +- + drivers/gpu/drm/xe/xe_guc_capture.h | 6 +- + drivers/gpu/drm/xe/xe_guc_ct.c | 43 +- + drivers/gpu/drm/xe/xe_guc_engine_activity.c | 12 +- + drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 7 + + drivers/gpu/drm/xe/xe_guc_fwif.h | 1 + + drivers/gpu/drm/xe/xe_guc_klv_helpers.c | 260 +- + drivers/gpu/drm/xe/xe_guc_klv_helpers.h | 10 + + drivers/gpu/drm/xe/xe_guc_submit.c | 382 +- + drivers/gpu/drm/xe/xe_guc_submit.h | 1 + + drivers/gpu/drm/xe/xe_guc_tlb_inval.c | 6 - + drivers/gpu/drm/xe/xe_hw_engine.c | 300 +- + drivers/gpu/drm/xe/xe_hw_engine_group.c | 85 +- + drivers/gpu/drm/xe/xe_hw_engine_types.h | 7 +- + drivers/gpu/drm/xe/xe_hw_error.c | 34 +- + drivers/gpu/drm/xe/xe_i2c.c | 3 - + drivers/gpu/drm/xe/xe_lrc.c | 8 +- + drivers/gpu/drm/xe/xe_migrate.c | 65 +- + drivers/gpu/drm/xe/xe_mmio.c | 100 +- + drivers/gpu/drm/xe/xe_module.c | 3 - + drivers/gpu/drm/xe/xe_module.h | 1 - + drivers/gpu/drm/xe/xe_oa.c | 25 +- + drivers/gpu/drm/xe/xe_observation.c | 32 +- + drivers/gpu/drm/xe/xe_observation.h | 3 +- + drivers/gpu/drm/xe/xe_pat.c | 44 + + drivers/gpu/drm/xe/xe_pci.c | 206 +- + drivers/gpu/drm/xe/xe_pci_error.c | 139 + + drivers/gpu/drm/xe/xe_pci_error.h | 13 + + drivers/gpu/drm/xe/xe_pci_types.h | 3 + + drivers/gpu/drm/xe/xe_pcode.c | 40 +- + drivers/gpu/drm/xe/xe_pcode.h | 9 +- + drivers/gpu/drm/xe/xe_pm.c | 2 + + drivers/gpu/drm/xe/xe_preempt_fence.c | 7 + + drivers/gpu/drm/xe/xe_pt.c | 84 +- + drivers/gpu/drm/xe/xe_pxp.c | 35 +- + drivers/gpu/drm/xe/xe_query.c | 7 +- + drivers/gpu/drm/xe/xe_ras.c | 604 +- + drivers/gpu/drm/xe/xe_ras.h | 7 + + drivers/gpu/drm/xe/xe_ras_types.h | 216 + + drivers/gpu/drm/xe/xe_reg_whitelist.c | 5 +- + drivers/gpu/drm/xe/xe_reg_whitelist.h | 4 + + drivers/gpu/drm/xe/xe_rtp.c | 10 +- + drivers/gpu/drm/xe/xe_rtp.h | 19 + + drivers/gpu/drm/xe/xe_rtp_types.h | 33 +- + drivers/gpu/drm/xe/xe_sched_job.c | 2 +- + drivers/gpu/drm/xe/xe_sriov_packet.c | 115 +- + drivers/gpu/drm/xe/xe_step.c | 38 +- + drivers/gpu/drm/xe/xe_step.h | 8 +- + drivers/gpu/drm/xe/xe_survivability_mode.c | 13 +- + drivers/gpu/drm/xe/xe_svm.c | 68 +- + drivers/gpu/drm/xe/xe_svm.h | 14 +- + drivers/gpu/drm/xe/xe_sysctrl_event.c | 2 +- + drivers/gpu/drm/xe/xe_sysctrl_event_types.h | 3 - + drivers/gpu/drm/xe/xe_sysctrl_mailbox.c | 28 + + drivers/gpu/drm/xe/xe_sysctrl_mailbox.h | 3 + + drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h | 13 + + drivers/gpu/drm/xe/xe_tile.c | 4 +- + drivers/gpu/drm/xe/xe_trace.h | 5 + + drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 16 +- + drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 71 +- + drivers/gpu/drm/xe/xe_tuning.c | 3 +- + drivers/gpu/drm/xe/xe_tuning.h | 6 + + drivers/gpu/drm/xe/xe_uc_fw.c | 1 + + drivers/gpu/drm/xe/xe_userptr.c | 7 +- + drivers/gpu/drm/xe/xe_vm.c | 28 +- + drivers/gpu/drm/xe/xe_wa.c | 15 +- + drivers/gpu/drm/xe/xe_wa.h | 7 + + drivers/gpu/drm/xe/xe_wa_oob.rules | 7 + + drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- + drivers/gpu/host1x/Makefile | 3 +- + drivers/gpu/host1x/bus.c | 2 +- + drivers/gpu/host1x/cdma.c | 3 +- + drivers/gpu/host1x/context.c | 13 +- + drivers/gpu/host1x/debug.c | 4 +- + drivers/gpu/host1x/dev.c | 41 + + drivers/gpu/host1x/hw/cdma_hw.c | 14 +- + drivers/gpu/host1x/hw/channel_hw.c | 15 +- + drivers/gpu/host1x/hw/host1x10.c | 33 + + drivers/gpu/host1x/hw/host1x10.h | 15 + + drivers/gpu/host1x/hw/host1x10_hardware.h | 21 + + drivers/gpu/host1x/hw/hw_host1x10_common.h | 6 + + drivers/gpu/host1x/hw/hw_host1x10_hypervisor.h | 10 + + drivers/gpu/host1x/hw/hw_host1x10_uclass.h | 181 + + drivers/gpu/host1x/hw/hw_host1x10_vm.h | 36 + + drivers/gpu/host1x/intr.c | 5 +- + drivers/gpu/host1x/job.c | 2 +- + drivers/gpu/host1x/syncpt.c | 7 +- + drivers/gpu/host1x/syncpt.h | 3 +- + drivers/gpu/nova-core/.gitignore | 1 + + drivers/gpu/nova-core/Makefile | 5 +- + drivers/gpu/nova-core/bitfield.rs | 329 - + drivers/gpu/nova-core/falcon.rs | 272 +- + drivers/gpu/nova-core/falcon/fsp.rs | 65 +- + drivers/gpu/nova-core/falcon/gsp.rs | 32 +- + drivers/gpu/nova-core/falcon/hal.rs | 19 +- + drivers/gpu/nova-core/falcon/hal/ga102.rs | 36 +- + drivers/gpu/nova-core/falcon/hal/tu102.rs | 28 +- + drivers/gpu/nova-core/fb.rs | 104 +- + drivers/gpu/nova-core/fb/hal.rs | 2 +- + drivers/gpu/nova-core/fb/hal/ga100.rs | 10 +- + drivers/gpu/nova-core/fb/hal/ga102.rs | 2 +- + drivers/gpu/nova-core/fb/hal/gb100.rs | 11 +- + drivers/gpu/nova-core/fb/hal/gb202.rs | 39 +- + drivers/gpu/nova-core/fb/hal/gh100.rs | 37 +- + drivers/gpu/nova-core/fb/hal/tu102.rs | 14 +- + drivers/gpu/nova-core/fb/regs.rs | 155 + + drivers/gpu/nova-core/firmware.rs | 327 +- + drivers/gpu/nova-core/firmware/booter.rs | 344 +- + drivers/gpu/nova-core/firmware/fsp.rs | 88 +- + drivers/gpu/nova-core/firmware/fwsec.rs | 24 +- + drivers/gpu/nova-core/firmware/fwsec/bootloader.rs | 95 +- + drivers/gpu/nova-core/firmware/gsp.rs | 65 +- + drivers/gpu/nova-core/firmware/riscv.rs | 75 +- + drivers/gpu/nova-core/firmware/tlv.rs | 262 + + drivers/gpu/nova-core/fsp.rs | 366 +- + drivers/gpu/nova-core/fsp/hal.rs | 4 + + drivers/gpu/nova-core/fsp/hal/gb100.rs | 6 + + drivers/gpu/nova-core/fsp/hal/gb202.rs | 9 +- + drivers/gpu/nova-core/fsp/hal/gh100.rs | 9 +- + drivers/gpu/nova-core/gpu.rs | 191 +- + drivers/gpu/nova-core/gsp.rs | 48 +- + drivers/gpu/nova-core/gsp/boot.rs | 152 +- + drivers/gpu/nova-core/gsp/cmdq.rs | 11 +- + drivers/gpu/nova-core/gsp/commands.rs | 90 +- + drivers/gpu/nova-core/gsp/fw.rs | 119 +- + drivers/gpu/nova-core/gsp/fw/commands.rs | 42 +- + drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 1 + + drivers/gpu/nova-core/gsp/hal.rs | 72 +- + drivers/gpu/nova-core/gsp/hal/ga102.rs | 14 + + drivers/gpu/nova-core/gsp/hal/gh100.rs | 122 +- + drivers/gpu/nova-core/gsp/hal/tu102.rs | 390 +- + drivers/gpu/nova-core/gsp/regs.rs | 22 + + drivers/gpu/nova-core/gsp/sequencer.rs | 112 +- + drivers/gpu/nova-core/mctp.rs | 88 +- + drivers/gpu/nova-core/nova_core.rs | 6 +- + drivers/gpu/nova-core/nova_core_exports.c | 15 + + drivers/gpu/nova-core/regs.rs | 148 +- + drivers/gpu/nova-core/vbios.rs | 64 +- + drivers/gpu/nova-core/vgpu.rs | 91 + + drivers/gpu/nova-core/vgpu/hal.rs | 25 + + drivers/gpu/nova-core/vgpu/hal/gb202.rs | 15 + + drivers/gpu/nova-core/vgpu/hal/tu102.rs | 15 + + drivers/gpu/tests/.kunitconfig | 2 + + drivers/gpu/tests/gpu_buddy_test.c | 95 + + drivers/pci/iov.c | 2 +- + include/drm/bridge/analogix_dp.h | 13 +- + include/drm/bridge/dw_dp.h | 1 + + include/drm/display/drm_dp.h | 25 +- + include/drm/display/drm_dp_tunnel.h | 21 + + include/drm/display/drm_hdmi_state_helper.h | 4 +- + include/drm/drm_atomic.h | 5 +- + include/drm/drm_atomic_helper.h | 7 + + include/drm/drm_atomic_state_helper.h | 18 +- + include/drm/drm_bridge.h | 151 +- + include/drm/drm_colorop.h | 2 + + include/drm/drm_connector.h | 123 +- + include/drm/drm_crtc.h | 16 + + include/drm/drm_debugfs.h | 2 +- + include/drm/drm_drv.h | 10 +- + include/drm/drm_gem.h | 3 - + include/drm/drm_gem_shmem_helper.h | 4 + + include/drm/drm_gpusvm.h | 67 +- + include/drm/drm_gpuvm.h | 4 +- + include/drm/drm_managed.h | 2 +- + include/drm/drm_mipi_dsi.h | 2 + + include/drm/drm_mode_config.h | 1 + + include/drm/drm_modes.h | 1 + + include/drm/drm_of.h | 11 + + include/drm/drm_panel.h | 8 - + include/drm/drm_plane.h | 16 + + include/drm/drm_print.h | 2 +- + include/drm/gpu_scheduler.h | 3 +- + include/drm/intel/display_parent_interface.h | 4 +- + include/drm/intel/mchbar_regs.h | 2 - + include/drm/intel/pciids.h | 5 +- + include/drm/ttm/ttm_bo.h | 10 + + include/drm/ttm/ttm_resource.h | 13 +- + include/linux/cgroup.h | 21 + + include/linux/cgroup_dmem.h | 63 +- + include/linux/dma-fence-unwrap.h | 6 +- + include/linux/dma-fence.h | 4 +- + include/linux/font.h | 3 + + include/linux/gpu_buddy.h | 17 + + include/linux/pci.h | 4 +- + include/linux/perf_event.h | 31 +- + include/linux/sysfb.h | 4 +- + include/uapi/drm/amdgpu_drm.h | 21 + + include/uapi/drm/drm_fourcc.h | 209 +- + include/uapi/drm/drm_mode.h | 1 + + include/uapi/drm/ethosu_accel.h | 60 +- + include/uapi/drm/nouveau_drm.h | 1 + + include/uapi/drm/panthor_drm.h | 26 +- + include/uapi/drm/xe_drm.h | 17 +- + include/uapi/linux/kfd_ioctl.h | 180 +- + kernel/cgroup/dmem.c | 278 +- + kernel/events/core.c | 18 + + lib/fonts/fonts.c | 31 + + rust/helpers/pci.c | 8 + + rust/kernel/alloc/kvec.rs | 27 + + rust/kernel/dma.rs | 70 +- + rust/kernel/drm/device.rs | 291 +- + rust/kernel/drm/driver.rs | 113 +- + rust/kernel/drm/gem/mod.rs | 111 +- + rust/kernel/drm/gem/shmem.rs | 594 +- + rust/kernel/drm/gpuvm/mod.rs | 36 +- + rust/kernel/drm/gpuvm/sm_ops.rs | 4 +- + rust/kernel/drm/gpuvm/va.rs | 8 + + rust/kernel/drm/gpuvm/vm_bo.rs | 9 + + rust/kernel/drm/ioctl.rs | 56 +- + rust/kernel/drm/mod.rs | 4 +- + rust/kernel/faux.rs | 81 +- + rust/kernel/firmware.rs | 46 +- + rust/kernel/iommu/pgtable.rs | 32 +- + rust/kernel/pci.rs | 13 + + samples/rust/rust_driver_faux.rs | 3 +- + 1576 files changed, 229746 insertions(+), 39851 deletions(-) + create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-xe-ras + create mode 100644 Documentation/devicetree/bindings/display/bridge/renesas,r9a08g046-lvds.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/anbernic,td4310.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/chipone,icna3512.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/ilitek,ili7807s.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/ilitek,ili9488.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml + create mode 100644 Documentation/devicetree/bindings/display/panel/renesas,r63419.yaml + create mode 100644 Documentation/gpu/intel-display/dp-link-capabilities.rst + create mode 100644 Documentation/gpu/intel-display/dp-link-training.rst + create mode 100644 Documentation/gpu/nova/core/fsp.rst + create mode 100644 Documentation/gpu/nova/core/tlv.rst + create mode 100644 drivers/accel/ethosu/ethosu_perfmon.c + delete mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c + delete mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_aca.h + create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.h + create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_sa.h + rename drivers/gpu/drm/amd/{display/modules/power/power_helpers.c => amdgpu/amdgpu_video_codecs.h} (63%) + create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_wb.c + create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_wb.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_audio.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_audio.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_backlight.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_backlight.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_dmub.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.h + delete mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_kunit_helpers.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_audio_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_dmub_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_irq_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_test_helpers.h + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_pp_smu_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_quirks_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_services_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c + create mode 100644 drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_wb_test.c + create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dalsmc.h + create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.c + create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr.h + create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr_smu_msg.c + create mode 100644 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn60/dcn60_clk_mgr_smu_msg.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dc_probe.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dccg/dcn60/dcn60_dccg.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dccg/dcn60/dcn60_dccg.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_cacp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dce/dmub_abm_cacp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_link_encoder.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_link_encoder.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dio/dcn60/dcn60_dio_stream_encoder.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/dcn5_soc_bb.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/dcn6_soc_bb.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/utm_qos_model_dchub_v1.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/utm_qos_model_dchub_v2.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/utm_qos_model_dchub_v3.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/bounding_boxes/utm_qos_model_types.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/dml_dmub_cmd.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_factory.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_factory.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_calcs_dsc_shared_types.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dchub.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dchub.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_display_pipe.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_display_pipe.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dsc_latency.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dsc_latency.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_initialize.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_initialize.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_programming.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_programming.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_programming.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_programming.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_dcn5.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_dpmm/dml2_dpmm_dcn5.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5_stage_optimizers.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn5_stage_optimizers.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_top/dml2_top_utm.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_top/dml2_top_utm.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn5.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn5.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn6.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_dcn6.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_factory.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_utm_soc_bb/dml2_utm_soc_bb_factory.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn50/dcn50_dpp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn50/dcn50_dpp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dsc/dcn60/dcn60_dsc.c + create mode 100644 drivers/gpu/drm/amd/display/dc/dsc/dcn60/dcn60_dsc.h + create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn60/hw_factory_dcn60.c + create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn60/hw_factory_dcn60.h + create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn60/hw_translate_dcn60.c + create mode 100644 drivers/gpu/drm/amd/display/dc/gpio/dcn60/hw_translate_dcn60.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hpo/dcn60/dcn60_hpo_frl_link_encoder.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hpo/dcn60/dcn60_hpo_frl_link_encoder.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hpo/dcn60/dcn60_hpo_frl_stream_encoder.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hpo/dcn60/dcn60_hpo_frl_stream_encoder.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hubbub/dcn60/dcn60_hubbub.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hubp/dcn50/dcn50_hubp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hubp/dcn50/dcn50_hubp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hubp/dcn60/dcn60_hubp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hubp/dcn60/dcn60_hubp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn50/dcn50_hwseq.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_hwseq.h + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_init.c + create mode 100644 drivers/gpu/drm/amd/display/dc/hwss/dcn60/dcn60_init.h + create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn60/irq_service_dcn60.c + create mode 100644 drivers/gpu/drm/amd/display/dc/irq/dcn60/irq_service_dcn60.h + create mode 100644 drivers/gpu/drm/amd/display/dc/mmhubbub/dcn401/dcn401_mmhubbub.c + create mode 100644 drivers/gpu/drm/amd/display/dc/mmhubbub/dcn401/dcn401_mmhubbub.h + create mode 100644 drivers/gpu/drm/amd/display/dc/mpc/dcn60/dcn60_mpc.c + create mode 100644 drivers/gpu/drm/amd/display/dc/mpc/dcn60/dcn60_mpc.h + create mode 100644 drivers/gpu/drm/amd/display/dc/opp/dcn60/dcn60_opp.c + create mode 100644 drivers/gpu/drm/amd/display/dc/opp/dcn60/dcn60_opp.h + create mode 100644 drivers/gpu/drm/amd/display/dc/optc/dcn60/dcn60_optc.c + create mode 100644 drivers/gpu/drm/amd/display/dc/optc/dcn60/dcn60_optc.h + create mode 100644 drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.c + create mode 100644 drivers/gpu/drm/amd/display/dc/resource/dcn60/dcn60_resource.h + create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.c + create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn42b/dcn42b_soc_and_ip_translator.h + create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.c + create mode 100644 drivers/gpu/drm/amd/display/dc/soc_and_ip_translator/dcn60/dcn60_soc_and_ip_translator.h + create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.c + create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn60.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_offset.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_sh_mask.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_offset.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_sh_mask.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_offset.h + create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_sh_mask.h + create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_metrics.h + rename drivers/gpu/drm/amd/ras/{rascore => core}/Makefile (86%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_aca.c => core/aca.c} (97%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_aca.h => core/aca.h} (98%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_aca_v1_0.c => core/aca_v1_0.c} (97%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_aca_v1_0.h => core/aca_v1_0.h} (98%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_cmd.c => core/cmd.c} (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_cmd.h => core/cmd.h} (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_core.c => core/core.c} (94%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_core_status.h => core/core_status.h} (96%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_eeprom.c => core/eeprom.c} (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_eeprom.h => core/eeprom.h} (97%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_eeprom_fw.c => core/eeprom_fw.c} (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_eeprom_fw.h => core/eeprom_fw.h} (98%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_log_ring.c => core/log_ring.c} (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_log_ring.h => core/log_ring.h} (97%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras.h (94%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_cper.c (99%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_cper.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_gfx.c (98%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_gfx.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_gfx_v9_0.c (99%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_gfx_v9_0.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_mp1.c (86%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_mp1.h (92%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_mp1_v13_0.c (89%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_mp1_v13_0.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_nbio.c (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_nbio.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_nbio_v7_9.c (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_nbio_v7_9.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_process.c (98%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_process.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_psp.c (99%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_psp.h (99%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_psp_v13_0.c (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_psp_v13_0.h (100%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_umc.c (77%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_umc.h (78%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_umc_v12_0.c (75%) + rename drivers/gpu/drm/amd/ras/{rascore => core}/ras_umc_v12_0.h (99%) + rename drivers/gpu/drm/amd/ras/{rascore/ras_ta_if.h => core/ta_if.h} (99%) + create mode 100644 drivers/gpu/drm/bridge/imx/imx93-pdfc.c + create mode 100644 drivers/gpu/drm/i915/.kunitconfig + create mode 100644 drivers/gpu/drm/i915/display/intel_dp_link_caps.c + create mode 100644 drivers/gpu/drm/i915/display/intel_dp_link_caps.h + create mode 100644 drivers/gpu/drm/i915/display/tests/Makefile + create mode 100644 drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c + create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_panic.c + create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_panic.h + delete mode 100644 drivers/gpu/drm/i915/i915_panic.c + delete mode 100644 drivers/gpu/drm/i915/i915_panic.h + create mode 100644 drivers/gpu/drm/imagination/pvr_check.h + create mode 100644 drivers/gpu/drm/panel/panel-anbernic-td4310.c + create mode 100644 drivers/gpu/drm/panel/panel-chipone-icna35xx.c + create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili7807s.c + create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9488.c + create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36536.c + create mode 100644 drivers/gpu/drm/panel/panel-renesas-r63419.c + create mode 100644 drivers/gpu/drm/tests/drm_kunit_edid.c + create mode 100644 drivers/gpu/drm/tyr/fw.rs + create mode 100644 drivers/gpu/drm/tyr/fw/parser.rs + create mode 100644 drivers/gpu/drm/tyr/mmu.rs + create mode 100644 drivers/gpu/drm/tyr/mmu/address_space.rs + create mode 100644 drivers/gpu/drm/tyr/slot.rs + create mode 100644 drivers/gpu/drm/tyr/vm.rs + create mode 100644 drivers/gpu/drm/xe/.kunitconfig-display + create mode 100644 drivers/gpu/drm/xe/abi/xe_driver_klvs_abi.h + create mode 100644 drivers/gpu/drm/xe/display/tests/Makefile + create mode 100644 drivers/gpu/drm/xe/tests/xe_guc_klv_helpers_kunit.c + create mode 100644 drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c + create mode 100644 drivers/gpu/drm/xe/tests/xe_sriov_packet_kunit.c + create mode 100644 drivers/gpu/drm/xe/xe_pci_error.c + create mode 100644 drivers/gpu/drm/xe/xe_pci_error.h + create mode 100644 drivers/gpu/host1x/hw/host1x10.c + create mode 100644 drivers/gpu/host1x/hw/host1x10.h + create mode 100644 drivers/gpu/host1x/hw/host1x10_hardware.h + create mode 100644 drivers/gpu/host1x/hw/hw_host1x10_common.h + create mode 100644 drivers/gpu/host1x/hw/hw_host1x10_hypervisor.h + create mode 100644 drivers/gpu/host1x/hw/hw_host1x10_uclass.h + create mode 100644 drivers/gpu/host1x/hw/hw_host1x10_vm.h + create mode 100644 drivers/gpu/nova-core/.gitignore + delete mode 100644 drivers/gpu/nova-core/bitfield.rs + create mode 100644 drivers/gpu/nova-core/fb/regs.rs + create mode 100644 drivers/gpu/nova-core/firmware/tlv.rs + create mode 100644 drivers/gpu/nova-core/gsp/hal/ga102.rs + create mode 100644 drivers/gpu/nova-core/gsp/regs.rs + create mode 100644 drivers/gpu/nova-core/nova_core_exports.c + create mode 100644 drivers/gpu/nova-core/vgpu.rs + create mode 100644 drivers/gpu/nova-core/vgpu/hal.rs + create mode 100644 drivers/gpu/nova-core/vgpu/hal/gb202.rs + create mode 100644 drivers/gpu/nova-core/vgpu/hal/tu102.rs + create mode 100644 drivers/gpu/tests/.kunitconfig +$ git am -3 ../patches/0001-drm-Fix-up-lut3d-mismerge.patch +Applying: drm: Fix up lut3d mismerge +Using index info to reconstruct a base tree... +M drivers/gpu/drm/drm_atomic.c +M include/drm/drm_colorop.h +Falling back to patching base and 3-way merge... +Auto-merging include/drm/drm_colorop.h +Auto-merging drivers/gpu/drm/drm_atomic.c +No changes -- Patch already applied. +$ git am -3 ../patches/0001-drm-amdgpu_dpm-Fix-up-commiting-unresolved-merge.patch +Applying: drm: amdgpu_dpm: Fix up commiting unresolved merge +Using index info to reconstruct a base tree... +M drivers/gpu/drm/amd/pm/amdgpu_dpm.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/amd/pm/amdgpu_dpm.c +No changes -- Patch already applied. +$ git am -3 ../patches/0001-drm-Fix-up-merge-with-sched-entity-reverts.patch +Applying: drm: Fix up merge with sched entity reverts +Using index info to reconstruct a base tree... +M drivers/gpu/drm/scheduler/sched_entity.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/scheduler/sched_entity.c +CONFLICT (content): Merge conflict in drivers/gpu/drm/scheduler/sched_entity.c +Recorded preimage for 'drivers/gpu/drm/scheduler/sched_entity.c' +error: Failed to merge in the changes. +hint: Use 'git am --show-current-patch=diff' to see the failed patch +hint: When you have resolved this problem, run "git am --continue". +hint: If you prefer to skip this patch, run "git am --skip" instead. +hint: To restore the original branch and stop patching, run "git am --abort". +hint: Disable this message with "git config advice.mergeConflict false" +Patch failed at 0001 drm: Fix up merge with sched entity reverts +$ git am -3 ../patches/0001-drm-Fix-up-mismerge-with-dc_disable_dangling_timing_.patch +Applying: drm: Fix up mismerge with dc_disable_dangling_timing_generators +Using index info to reconstruct a base tree... +M drivers/gpu/drm/amd/display/dc/core/dc.c +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging drm-exynos/for-linux-next (3a8660878839f Linux 6.18-rc1) +$ git merge -m Merge branch 'for-linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git drm-exynos/for-linux-next +Already up to date. +Merging drm-misc/for-linux-next (271e90eb5f9ff drm: use drm_warn() in validate_blend_mode_for_alpha_formats()) +$ git merge -m Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc/for-linux-next +Merge made by the 'ort' strategy. + drivers/gpu/drm/drm_mode_config.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) +$ git am -3 ../patches/0001-drm-bridge-microchip-lvds-Rename-drm_atomic_state-to.patch +Applying: drm/bridge: microchip-lvds: Rename drm_atomic_state to drm_atomic_commit +Using index info to reconstruct a base tree... +M drivers/gpu/drm/bridge/microchip-lvds.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/bridge/microchip-lvds.c +No changes -- Patch already applied. +Merging amdgpu/drm-next (e4c3ab59021e7 drm/amd/display: validate plane degamma LUT size for private color prop) +$ git merge -m Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux.git amdgpu/drm-next +Auto-merging drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +Auto-merging drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +Merge made by the 'ort' strategy. + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 54 +++++++++++++++++++--- + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 15 +++++- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 ++- + drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 49 ++++++++++---------- + drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 +-- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 27 ++++++----- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- + drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++ + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 10 ++-- + drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 10 ++-- + drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- + .../amd/display/amdgpu_dm/amdgpu_dm_backlight.c | 8 ++-- + .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 13 ++++++ + drivers/gpu/drm/radeon/atombios_crtc.c | 5 +- + drivers/gpu/drm/radeon/atombios_encoders.c | 23 +++++---- + 16 files changed, 160 insertions(+), 74 deletions(-) +$ git am -3 ../patches/0001-amdgpu-Fix-up-drm_atomic_commit-rename.patch +Applying: amdgpu: Fix up drm_atomic_commit rename +Using index info to reconstruct a base tree... +M drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +No changes -- Patch already applied. +Merging drm-intel/for-linux-next (65b92bc671db7 Merge tag 'drm-xe-next-fixes-2026-08-13' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next) +$ git merge -m Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/i915/kernel.git drm-intel/for-linux-next +Already up to date. +Merging drm-msm/msm-next (140b134753026 drm/msm: detach the ARM DMA mapping before attaching our own domain) +$ git merge -m Merge branch 'msm-next' of https://gitlab.freedesktop.org/drm/msm.git drm-msm/msm-next +Auto-merging Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +Auto-merging Documentation/devicetree/bindings/iommu/arm,smmu.yaml +Auto-merging drivers/gpu/drm/msm/adreno/adreno_gpu.c +Auto-merging drivers/gpu/drm/msm/msm_gem.c +Auto-merging drivers/gpu/drm/msm/msm_gem_vma.c +Merge made by the 'ort' strategy. + .../bindings/display/msm/dsi-controller-main.yaml | 4 + + .../devicetree/bindings/display/msm/gmu.yaml | 1 + + .../devicetree/bindings/display/msm/gpu.yaml | 4 + + .../bindings/display/msm/qcom,qcm2290-dpu.yaml | 6 +- + .../bindings/display/msm/qcom,qcm2290-mdss.yaml | 19 +- + drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 40 +- + drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 19 +- + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 6 +- + drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 81 +++- + drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 5 + + drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 2 +- + .../gpu/drm/msm/adreno/adreno_gen7_17_0_snapshot.h | 428 +++++++++++++++++++++ + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 17 +- + drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 + + .../drm/msm/disp/dpu1/catalog/dpu_13_0_kaanapali.h | 12 +- + drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 + + drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +- + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 12 + + drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 24 +- + drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 11 +- + drivers/gpu/drm/msm/dp/dp_audio.c | 4 +- + drivers/gpu/drm/msm/dp/dp_ctrl.c | 409 +++++++++++--------- + drivers/gpu/drm/msm/dp/dp_ctrl.h | 30 +- + drivers/gpu/drm/msm/dp/dp_display.c | 341 ++++++++-------- + drivers/gpu/drm/msm/dp/dp_display.h | 9 + + drivers/gpu/drm/msm/dp/dp_drm.c | 52 ++- + drivers/gpu/drm/msm/dp/dp_drm.h | 12 - + drivers/gpu/drm/msm/dp/dp_panel.c | 77 +--- + drivers/gpu/drm/msm/dp/dp_panel.h | 17 +- + drivers/gpu/drm/msm/dp/dp_reg.h | 2 + + drivers/gpu/drm/msm/dsi/dsi_host.c | 2 - + drivers/gpu/drm/msm/hdmi/hdmi.h | 19 + + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 98 ++--- + drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 85 ++-- + drivers/gpu/drm/msm/msm_drv.c | 26 +- + drivers/gpu/drm/msm/msm_drv.h | 17 - + drivers/gpu/drm/msm/msm_fb.c | 96 ++--- + drivers/gpu/drm/msm/msm_fbdev.c | 84 ++-- + drivers/gpu/drm/msm/msm_gem.c | 94 +++-- + drivers/gpu/drm/msm/msm_gem.h | 5 +- + drivers/gpu/drm/msm/msm_gem_prime.c | 2 +- + drivers/gpu/drm/msm/msm_gem_submit.c | 31 +- + drivers/gpu/drm/msm/msm_gem_vma.c | 14 +- + drivers/gpu/drm/msm/msm_gpu.c | 2 +- + drivers/gpu/drm/msm/msm_gpu.h | 4 +- + drivers/gpu/drm/msm/msm_iommu.c | 22 ++ + drivers/gpu/drm/msm/msm_submitqueue.c | 24 +- + drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 2 +- + include/uapi/drm/msm_drm.h | 6 +- + 49 files changed, 1456 insertions(+), 833 deletions(-) + create mode 100644 drivers/gpu/drm/msm/adreno/adreno_gen7_17_0_snapshot.h +Merging drm-msm-lumag/msm-next-lumag (140b134753026 drm/msm: detach the ARM DMA mapping before attaching our own domain) +$ git merge -m Merge branch 'msm-next-lumag' of https://gitlab.freedesktop.org/lumag/msm.git drm-msm-lumag/msm-next-lumag +Already up to date. +Merging drm-xe/drm-xe-next (a1c1dbd0f047b drm/xe: don't WARN on kernel job timeout when device already wedged) +$ git merge -m Merge branch 'drm-xe-next' of https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe/drm-xe-next +Auto-merging MAINTAINERS +Auto-merging drivers/gpu/drm/drm_drv.c +Auto-merging drivers/gpu/drm/xe/xe_device.c +Auto-merging drivers/gpu/drm/xe/xe_drm_ras.c +Auto-merging drivers/gpu/drm/xe/xe_exec_queue.c +Auto-merging drivers/gpu/drm/xe/xe_guc_pc.c +Auto-merging drivers/gpu/drm/xe/xe_oa.c +Auto-merging drivers/gpu/drm/xe/xe_ras.c +Merge made by the 'ort' strategy. + Documentation/gpu/drm-ras.rst | 21 + + Documentation/gpu/drm-uapi.rst | 93 +++- + Documentation/gpu/xe/index.rst | 1 + + Documentation/gpu/xe/xe_sigid.rst | 14 + + Documentation/netlink/specs/drm_ras.yaml | 48 ++ + MAINTAINERS | 13 + + drivers/gpu/drm/drm_drv.c | 2 + + drivers/gpu/drm/drm_ras.c | 101 ++++ + drivers/gpu/drm/drm_ras_nl.c | 6 + + drivers/gpu/drm/drm_ras_nl.h | 4 + + drivers/gpu/drm/xe/Makefile | 1 + + drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h | 1 + + drivers/gpu/drm/xe/abi/xe_log_abi.h | 199 +++++++ + drivers/gpu/drm/xe/abi/xe_sigid_abi.h | 172 +++++++ + drivers/gpu/drm/xe/regs/xe_gt_regs.h | 6 + + drivers/gpu/drm/xe/tests/Makefile | 1 + + drivers/gpu/drm/xe/tests/xe_any_kunit.c | 213 ++++++++ + drivers/gpu/drm/xe/tests/xe_kunit_helpers.c | 4 + + drivers/gpu/drm/xe/tests/xe_log_kunit.c | 553 ++++++++++++++++++++ + drivers/gpu/drm/xe/tests/xe_migrate.c | 3 +- + drivers/gpu/drm/xe/xe_any.h | 137 +++++ + drivers/gpu/drm/xe/xe_debugfs.c | 15 + + drivers/gpu/drm/xe/xe_debugfs.h | 2 + + drivers/gpu/drm/xe/xe_defaults.h | 1 + + drivers/gpu/drm/xe/xe_device.c | 30 +- + drivers/gpu/drm/xe/xe_device_types.h | 23 +- + drivers/gpu/drm/xe/xe_drm_ras.c | 31 ++ + drivers/gpu/drm/xe/xe_drm_ras.h | 3 + + drivers/gpu/drm/xe/xe_exec_queue.c | 6 +- + drivers/gpu/drm/xe/xe_exec_queue_types.h | 21 +- + drivers/gpu/drm/xe/xe_gsc.c | 3 +- + drivers/gpu/drm/xe/xe_gt.c | 7 +- + drivers/gpu/drm/xe/xe_gt_debugfs.c | 80 +++ + drivers/gpu/drm/xe/xe_gt_printk.h | 3 + + drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 191 ++++--- + drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h | 6 + + drivers/gpu/drm/xe/xe_gt_sriov_printk.h | 3 + + drivers/gpu/drm/xe/xe_gt_stats.c | 7 + + drivers/gpu/drm/xe/xe_gt_stats_types.h | 22 + + drivers/gpu/drm/xe/xe_guc.c | 18 +- + drivers/gpu/drm/xe/xe_guc_ct.c | 95 +++- + drivers/gpu/drm/xe/xe_guc_ct.h | 38 +- + drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 32 +- + drivers/gpu/drm/xe/xe_guc_pagefault.c | 39 +- + drivers/gpu/drm/xe/xe_guc_pc.c | 15 +- + drivers/gpu/drm/xe/xe_guc_submit.c | 273 +++++++--- + drivers/gpu/drm/xe/xe_guc_types.h | 6 + + drivers/gpu/drm/xe/xe_hwmon.c | 88 ++-- + drivers/gpu/drm/xe/xe_log.c | 235 +++++++++ + drivers/gpu/drm/xe/xe_log.h | 194 +++++++ + drivers/gpu/drm/xe/xe_mert.c | 2 +- + drivers/gpu/drm/xe/xe_migrate.c | 2 - + drivers/gpu/drm/xe/xe_module.c | 4 + + drivers/gpu/drm/xe/xe_module.h | 1 + + drivers/gpu/drm/xe/xe_oa.c | 7 +- + drivers/gpu/drm/xe/xe_pagefault.c | 716 +++++++++++++++++++++----- + drivers/gpu/drm/xe/xe_pagefault.h | 74 +++ + drivers/gpu/drm/xe/xe_pagefault_types.h | 114 +++- + drivers/gpu/drm/xe/xe_pci.c | 32 +- + drivers/gpu/drm/xe/xe_pci_error.c | 13 +- + drivers/gpu/drm/xe/xe_pcode.c | 14 +- + drivers/gpu/drm/xe/xe_pm.c | 5 + + drivers/gpu/drm/xe/xe_printk.h | 3 + + drivers/gpu/drm/xe/xe_pt.c | 6 + + drivers/gpu/drm/xe/xe_pxp_submit.c | 5 +- + drivers/gpu/drm/xe/xe_ras.c | 125 ++++- + drivers/gpu/drm/xe/xe_sriov_printk.h | 3 + + drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 1 - + drivers/gpu/drm/xe/xe_survivability_mode.c | 85 +-- + drivers/gpu/drm/xe/xe_svm.c | 146 ++++-- + drivers/gpu/drm/xe/xe_svm.h | 59 ++- + drivers/gpu/drm/xe/xe_tile_printk.h | 3 + + drivers/gpu/drm/xe/xe_tile_sriov_printk.h | 3 + + drivers/gpu/drm/xe/xe_userptr.c | 19 +- + drivers/gpu/drm/xe/xe_vm.c | 301 ++++++++--- + drivers/gpu/drm/xe/xe_vm_types.h | 42 +- + include/drm/drm_device.h | 1 + + include/drm/drm_ras.h | 5 + + include/uapi/drm/drm_ras.h | 15 + + 79 files changed, 4296 insertions(+), 590 deletions(-) + create mode 100644 Documentation/gpu/xe/xe_sigid.rst + create mode 100644 drivers/gpu/drm/xe/abi/xe_log_abi.h + create mode 100644 drivers/gpu/drm/xe/abi/xe_sigid_abi.h + create mode 100644 drivers/gpu/drm/xe/tests/xe_any_kunit.c + create mode 100644 drivers/gpu/drm/xe/tests/xe_log_kunit.c + create mode 100644 drivers/gpu/drm/xe/xe_any.h + create mode 100644 drivers/gpu/drm/xe/xe_log.c + create mode 100644 drivers/gpu/drm/xe/xe_log.h +$ git am -3 ../patches/0001-drm-xe-Fix-up-merge-issue.patch +Applying: drm: xe: Fix up merge issue +Using index info to reconstruct a base tree... +M drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +No changes -- Patch already applied. +Merging drm-rust/for-linux-next (4c9ba407018e8 gpu: nova-core: falcon: use I/O projection to check transfer bounds) +$ git merge -m Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/rust/kernel.git drm-rust/for-linux-next +Already up to date. +Merging drm-nova/nova-next (93296e9d9528f gpu: nova-core: vbios: store reference to Device where relevant) +$ git merge -m Merge branch 'nova-next' of https://gitlab.freedesktop.org/drm/nova.git drm-nova/nova-next +Already up to date. +Merging etnaviv/etnaviv/next (6bde14ba5f7ef drm/etnaviv: add optional reset support) +$ git merge -m Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux etnaviv/etnaviv/next +Already up to date. +Merging fbdev/for-next (8c3c7f132f146 fbdev: omapfb: panel-dsi-cm: initialize lock before registering display) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git fbdev/for-next +Auto-merging drivers/video/fbdev/core/fb_io_fops.c +Auto-merging include/linux/font.h +Merge made by the 'ort' strategy. + drivers/video/fbdev/Kconfig | 3 +- + drivers/video/fbdev/atafb.c | 291 ++++++++++++++++++++- + drivers/video/fbdev/aty/aty128fb.c | 40 +-- + drivers/video/fbdev/aty/atyfb_base.c | 47 ++-- + drivers/video/fbdev/au1100fb.c | 2 +- + drivers/video/fbdev/clps711x-fb.c | 2 - + drivers/video/fbdev/core/fb_io_fops.c | 16 ++ + drivers/video/fbdev/core/fb_sys_fops.c | 16 ++ + drivers/video/fbdev/kyro/fbdev.c | 24 +- + drivers/video/fbdev/matrox/matroxfb_base.c | 30 +-- + drivers/video/fbdev/maxinefb.c | 15 +- + drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 6 +- + drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 - + drivers/video/fbdev/nvidia/nvidia.c | 19 +- + .../fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 8 +- + drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 9 +- + drivers/video/fbdev/platinumfb.c | 36 ++- + drivers/video/fbdev/pvr2fb.c | 4 +- + drivers/video/fbdev/pxa168fb.c | 1 - + drivers/video/fbdev/pxa3xx-gcu.c | 4 +- + drivers/video/fbdev/pxafb.c | 1 - + drivers/video/fbdev/s3c-fb.c | 4 +- + drivers/video/fbdev/sa1100fb.c | 4 +- + drivers/video/fbdev/savage/savagefb_driver.c | 16 +- + drivers/video/fbdev/ssd1307fb.c | 72 ++++- + drivers/video/fbdev/sstfb.c | 1 + + drivers/video/fbdev/tdfxfb.c | 157 ++++++++++- + drivers/video/fbdev/udlfb.c | 22 +- + drivers/video/fbdev/uvesafb.c | 2 + + drivers/video/fbdev/via/viafbdev.c | 3 +- + drivers/video/sticore.c | 22 +- + include/linux/font.h | 4 +- + include/video/maxinefb.h | 4 +- + 33 files changed, 712 insertions(+), 175 deletions(-) +$ git am -3 ../patches/0001-fix-up-for-drm-hyperv-Remove-reference-to-hyperv_fb-.patch +Applying: fix up for "drm/hyperv: Remove reference to hyperv_fb driver" +$ git reset HEAD^ +Unstaged changes after reset: +M drivers/gpu/drm/hyperv/Kconfig +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master e94002ce32ebe] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git + Date: Thu Aug 20 13:40:22 2026 +0100 +Merging regmap/for-next (efc5e244e8258 Merge remote-tracking branch 'regmap/for-7.3' into regmap-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git regmap/for-next +Merge made by the 'ort' strategy. +Merging sound/for-next (2b366b833f52a ALSA: hda/conexant: Simplify headset plugin type handling) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git sound/for-next +Already up to date. +Merging ieee1394/for-next (05bfb1327dc5f firewire: core: fix memory leak in error path of build_tree()) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git ieee1394/for-next +Merge made by the 'ort' strategy. + drivers/firewire/.kunitconfig | 1 + + drivers/firewire/Kconfig | 15 + + drivers/firewire/core-card.c | 32 +- + drivers/firewire/core-topology.c | 62 ++-- + drivers/firewire/node-tree-test.c | 607 ++++++++++++++++++++++++++++++++++++++ + 5 files changed, 687 insertions(+), 30 deletions(-) + create mode 100644 drivers/firewire/node-tree-test.c +Merging sound-asoc/for-next (2792cc1b80b76 Merge remote-tracking branch 'asoc/for-7.3' into asoc-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git sound-asoc/for-next +Merge made by the 'ort' strategy. +Merging modules/modules-next (3dfaae04243cd params: fix charp corruption on allocation failure) +$ git merge -m Merge branch 'modules-next' of https://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git modules/modules-next +Auto-merging kernel/params.c +Auto-merging rust/macros/lib.rs +Auto-merging rust/macros/module.rs +Merge made by the 'ort' strategy. + arch/xtensa/platforms/iss/simdisk.c | 38 ++++++-- + include/linux/module.h | 4 - + kernel/module/dups.c | 173 ++++++++++++++++-------------------- + kernel/module/kallsyms.c | 24 +++-- + kernel/module/main.c | 29 ++++-- + kernel/module/procfs.c | 2 +- + kernel/module/stats.c | 2 +- + kernel/params.c | 16 ++-- + rust/kernel/module_param.rs | 27 +++++- + rust/macros/lib.rs | 1 + + rust/macros/module.rs | 1 + + samples/rust/rust_minimal.rs | 10 ++- + scripts/module.lds.S | 5 -- + 13 files changed, 196 insertions(+), 136 deletions(-) +Merging input/next (9a29ee801f525 Input: rmi4 - use platform data instead of query, when available) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git input/next +Already up to date. +Merging block/for-next (a33221f7ab120 Merge branch 'for-7.3/io_uring' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git block/for-next +Auto-merging MAINTAINERS +Auto-merging block/bdev.c +Auto-merging block/fops.c +Auto-merging drivers/block/ublk_drv.c +Auto-merging drivers/nvme/host/rdma.c +Auto-merging drivers/nvme/target/rdma.c +Auto-merging fs/aio.c +Auto-merging fs/buffer.c +Auto-merging fs/erofs/zdata.c +Auto-merging fs/fs-writeback.c +Auto-merging fs/iomap/direct-io.c +Auto-merging fs/iomap/ioend.c +Auto-merging include/linux/blk_types.h +Auto-merging include/linux/blkdev.h +Auto-merging include/linux/io_uring_types.h +Auto-merging include/linux/iomap.h +Auto-merging include/linux/list.h +Auto-merging io_uring/io_uring.c +Auto-merging io_uring/rsrc.c +Auto-merging io_uring/rsrc.h +Auto-merging kernel/exit.c +Auto-merging kernel/sched/core.c +Auto-merging mm/madvise.c +Auto-merging mm/page-writeback.c +Auto-merging mm/swap_state.c +Auto-merging mm/vmscan.c +Merge made by the 'ort' strategy. + Documentation/ABI/stable/configfs-nvmet | 352 ++++++ + Documentation/ABI/stable/sysfs-nvme | 453 ++++++++ + Documentation/ABI/testing/sysfs-nvme | 13 - + Documentation/admin-guide/blockdev/zoned_loop.rst | 15 +- + Documentation/block/biovecs.rst | 8 +- + MAINTAINERS | 4 + + block/bdev.c | 1 - + block/bfq-cgroup.c | 4 +- + block/bio-integrity-auto.c | 10 +- + block/bio-integrity-fs.c | 6 +- + block/bio.c | 206 +++- + block/blk-cgroup-rwstat.c | 5 +- + block/blk-cgroup.c | 80 +- + block/blk-cgroup.h | 25 +- + block/blk-core.c | 6 +- + block/blk-iocost.c | 21 +- + block/blk-iolatency.c | 13 +- + block/blk-map.c | 4 +- + block/blk-merge.c | 8 +- + block/blk-mq-dma.c | 2 +- + block/blk-mq.c | 1 + + block/blk-stat.c | 2 +- + block/blk-throttle.h | 2 - + block/blk-zoned.c | 30 - + block/blk.h | 2 +- + block/fops.c | 28 +- + block/genhd.c | 1 + + block/ioctl.c | 60 +- + block/kyber-iosched.c | 2 +- + block/mq-deadline.c | 25 +- + drivers/block/loop.c | 48 +- + drivers/block/mtip32xx/mtip32xx.c | 7 + + drivers/block/mtip32xx/mtip32xx.h | 2 + + drivers/block/nbd.c | 257 +++-- + drivers/block/null_blk/main.c | 106 +- + drivers/block/null_blk/zoned.c | 10 +- + drivers/block/swim3.c | 1 + + drivers/block/ublk_drv.c | 378 +++--- + drivers/block/zloop.c | 42 +- + drivers/md/dm-io-rewind.c | 10 +- + drivers/md/dm-pcache/segment.c | 4 +- + drivers/md/md-bitmap.c | 22 +- + drivers/md/md-bitmap.h | 12 +- + drivers/md/md-linear.c | 1 + + drivers/md/md-llbitmap.c | 754 ++++++++++-- + drivers/md/md.c | 178 ++- + drivers/md/md.h | 15 +- + drivers/md/raid0.c | 1 + + drivers/md/raid1-10.c | 8 +- + drivers/md/raid1.c | 139 +-- + drivers/md/raid10.c | 227 ++-- + drivers/md/raid10.h | 2 +- + drivers/md/raid5-ppl.c | 4 +- + drivers/md/raid5.c | 318 ++++-- + drivers/nvdimm/btt.c | 2 +- + drivers/nvme/common/auth.c | 13 +- + drivers/nvme/host/Makefile | 1 + + drivers/nvme/host/apple.c | 66 +- + drivers/nvme/host/auth.c | 3 +- + drivers/nvme/host/core.c | 52 +- + drivers/nvme/host/fabrics.c | 4 +- + drivers/nvme/host/fc.c | 8 +- + drivers/nvme/host/ioctl.c | 121 +- + drivers/nvme/host/multipath.c | 64 +- + drivers/nvme/host/nvme.h | 67 +- + drivers/nvme/host/pci.c | 31 +- + drivers/nvme/host/rdma.c | 160 ++- + drivers/nvme/host/sysfs.c | 4 +- + drivers/nvme/host/tcp.c | 73 +- + drivers/nvme/host/zns.c | 11 +- + drivers/nvme/target/admin-cmd.c | 14 +- + drivers/nvme/target/configfs.c | 10 +- + drivers/nvme/target/core.c | 56 +- + drivers/nvme/target/debugfs.c | 103 ++ + drivers/nvme/target/debugfs.h | 5 + + drivers/nvme/target/fabrics-cmd-auth.c | 17 +- + drivers/nvme/target/fabrics-cmd.c | 2 +- + drivers/nvme/target/fc.c | 2 +- + drivers/nvme/target/nvmet.h | 9 + + drivers/nvme/target/passthru.c | 9 + + drivers/nvme/target/pci-epf.c | 12 +- + drivers/nvme/target/pr.c | 37 +- + drivers/nvme/target/rdma.c | 31 +- + drivers/nvme/target/tcp.c | 19 +- + drivers/nvme/target/zns.c | 15 +- + drivers/s390/block/Makefile | 2 + + drivers/s390/block/dasd.c | 246 +++- + drivers/s390/block/dasd_3990_erp.c | 1 + + drivers/s390/block/dasd_devmap.c | 90 +- + drivers/s390/block/dasd_eckd.c | 1270 ++++++++++++++++++--- + drivers/s390/block/dasd_eckd.h | 68 +- + drivers/s390/block/dasd_erp.c | 11 +- + drivers/s390/block/dasd_int.h | 149 ++- + fs/aio.c | 2 +- + fs/btrfs/misc.h | 2 +- + fs/buffer.c | 3 + + fs/erofs/zdata.c | 11 +- + fs/fs-writeback.c | 2 +- + fs/iomap/direct-io.c | 1 + + fs/iomap/ioend.c | 5 +- + fs/xfs/xfs_aops.c | 19 +- + include/linux/bio-integrity.h | 3 + + include/linux/bio.h | 43 +- + include/linux/blk-cgroup.h | 23 +- + include/linux/blk_plug.h | 95 ++ + include/linux/blk_types.h | 1 + + include/linux/blkdev.h | 86 +- + include/linux/bvec.h | 14 +- + include/linux/io_uring_types.h | 13 +- + include/linux/iomap.h | 5 +- + include/linux/list.h | 9 + + include/linux/nvme.h | 4 +- + include/linux/uio.h | 10 +- + include/uapi/linux/blkdev.h | 1 + + include/uapi/linux/io_uring/zcrx.h | 7 + + include/uapi/linux/ublk_cmd.h | 5 +- + io_uring/eventfd.c | 8 +- + io_uring/eventfd.h | 2 +- + io_uring/futex.c | 32 +- + io_uring/futex.h | 1 + + io_uring/io-wq.c | 14 +- + io_uring/io_uring.c | 17 +- + io_uring/io_uring.h | 3 +- + io_uring/kbuf.c | 1 + + io_uring/memmap.c | 39 +- + io_uring/net.c | 81 +- + io_uring/opdef.c | 2 +- + io_uring/poll.c | 23 +- + io_uring/query.c | 2 +- + io_uring/rsrc.c | 2 +- + io_uring/rsrc.h | 2 + + io_uring/rw.c | 24 +- + io_uring/rw.h | 1 + + io_uring/sqpoll.c | 7 +- + io_uring/tw.c | 2 +- + io_uring/uring_cmd.c | 10 +- + io_uring/waitid.c | 2 +- + io_uring/zcrx.c | 400 +++++-- + io_uring/zcrx.h | 15 +- + kernel/exit.c | 1 - + kernel/sched/core.c | 1 - + lib/iov_iter.c | 11 +- + mm/madvise.c | 2 +- + mm/page-writeback.c | 1 - + mm/readahead.c | 2 +- + mm/swap_state.c | 2 +- + mm/vmscan.c | 2 +- + net/ceph/messenger.c | 4 +- + tools/testing/selftests/ublk/Makefile | 4 + + tools/testing/selftests/ublk/batch.c | 2 +- + tools/testing/selftests/ublk/kublk.c | 210 +++- + tools/testing/selftests/ublk/kublk.h | 43 +- + tools/testing/selftests/ublk/test_batch_04.sh | 44 + + tools/testing/selftests/ublk/test_loop_08.sh | 25 + + tools/testing/selftests/ublk/test_params_01.sh | 114 ++ + 155 files changed, 6470 insertions(+), 1845 deletions(-) + create mode 100644 Documentation/ABI/stable/configfs-nvmet + create mode 100644 Documentation/ABI/stable/sysfs-nvme + delete mode 100644 Documentation/ABI/testing/sysfs-nvme + create mode 100644 include/linux/blk_plug.h + create mode 100755 tools/testing/selftests/ublk/test_batch_04.sh + create mode 100755 tools/testing/selftests/ublk/test_loop_08.sh + create mode 100755 tools/testing/selftests/ublk/test_params_01.sh +$ git am -3 ../patches/0001-Revert-block-remove-bio_last_bvec_all.patch +Applying: Revert "block: remove bio_last_bvec_all" +$ git reset HEAD^ +Unstaged changes after reset: +M Documentation/block/biovecs.rst +M include/linux/bio.h +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master b5ed1f7033fc8] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git + Date: Thu Aug 20 13:40:33 2026 +0100 +$ git am -3 ../patches/0001-fs-Fix-up-semantic-conflict-with-bio_iov_iter_get_pa.patch +Applying: fs: Fix up semantic conflict with bio_iov_iter_get_pages +$ git reset HEAD^ +Unstaged changes after reset: +M fs/iomap/direct-io.c +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master c173295d3b7a0] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git + Date: Thu Aug 20 13:40:33 2026 +0100 +$ git am -3 ../patches/0001-io_uring-Add-missing-include-for-ITER_SOURCE-and-ITE.patch +Applying: io_uring: Add missing include for ITER_SOURCE and ITER_DEST +Using index info to reconstruct a base tree... +M include/linux/io_uring_types.h +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging device-mapper/for-next (39c5aa3bd8ec3 dm-era: fix shadowed superblock leak on take-snap failure) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git device-mapper/for-next +Already up to date. +Merging libata/for-next (73b6bf3c314ad ata: use named initializers for acpi_device_id) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux libata/for-next +Already up to date. +Merging pcmcia/pcmcia-next (b3c26ea81ccc5 pcmcia: remove obsolete host controller drivers) +$ git merge -m Merge branch 'pcmcia-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git pcmcia/pcmcia-next +Already up to date. +Merging mmc/next (35e689fb79dcb ARM: PXA: Fix build error for PXA93x) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git mmc/next +Auto-merging MAINTAINERS +Auto-merging arch/arm/boot/dts/st/stih407-family.dtsi +Merge made by the 'ort' strategy. + .../bindings/mmc/allwinner,sun4i-a10-mmc.yaml | 4 +- + .../devicetree/bindings/mmc/mmc-card.yaml | 23 +++- + .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 6 + + .../devicetree/bindings/mmc/qcom,sdhci-msm.yaml | 95 ++++++++++----- + .../devicetree/bindings/mmc/rockchip-dw-mshc.yaml | 1 + + Documentation/devicetree/bindings/mmc/sdhci-st.txt | 110 ----------------- + .../devicetree/bindings/mmc/st,sdhci.yaml | 105 +++++++++++++++++ + .../devicetree/bindings/mmc/ti,omap2420-mmc.yaml | 60 ++++++++++ + Documentation/devicetree/bindings/mmc/ti-omap.txt | 26 ---- + MAINTAINERS | 7 ++ + arch/arm/boot/dts/st/stih407-family.dtsi | 4 +- + arch/arm/boot/dts/st/stih410-b2260.dts | 4 +- + arch/arm/boot/dts/st/stih418-b2199.dts | 4 +- + arch/arm/boot/dts/st/stih418.dtsi | 2 +- + drivers/misc/cardreader/rtsx_usb.c | 26 +++- + drivers/mmc/core/block.c | 5 + + drivers/mmc/core/sd.c | 9 +- + drivers/mmc/host/alcor.c | 3 +- + drivers/mmc/host/bcm2835.c | 37 +++--- + drivers/mmc/host/cavium-octeon.c | 10 +- + drivers/mmc/host/cqhci-core.c | 17 ++- + drivers/mmc/host/cqhci.h | 3 +- + drivers/mmc/host/dw_mmc-pltfm.h | 1 - + drivers/mmc/host/dw_mmc.c | 1 + + drivers/mmc/host/dw_mmc.h | 2 + + drivers/mmc/host/litex_mmc.c | 131 +++++---------------- + drivers/mmc/host/meson-mx-sdio.c | 5 +- + drivers/mmc/host/moxart-mmc.c | 40 +++---- + drivers/mmc/host/mtk-sd.c | 2 +- + drivers/mmc/host/mvsdio.c | 4 +- + drivers/mmc/host/omap_hsmmc.c | 15 +-- + drivers/mmc/host/owl-mmc.c | 5 +- + drivers/mmc/host/pxamci.c | 3 +- + drivers/mmc/host/rtsx_usb_sdmmc.c | 13 +- + drivers/mmc/host/sdhci-brcmstb.c | 2 +- + drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- + drivers/mmc/host/sdhci-esdhc-mcf.c | 24 ++-- + drivers/mmc/host/sdhci-msm.c | 6 +- + drivers/mmc/host/sdhci-of-arasan.c | 2 +- + drivers/mmc/host/sdhci-of-dwcmshc.c | 3 +- + drivers/mmc/host/sdhci-of-ma35d1.c | 1 + + drivers/mmc/host/sdhci-pci-core.c | 2 +- + drivers/mmc/host/sdhci-pci-gli.c | 2 +- + drivers/mmc/host/sdhci-tegra.c | 32 ++++- + drivers/mmc/host/sdhci_am654.c | 2 +- + drivers/mmc/host/sh_mmcif.c | 8 +- + drivers/mmc/host/via-sdmmc.c | 12 +- + drivers/mmc/host/wbsd.c | 6 +- + include/linux/rtsx_usb.h | 3 + + include/linux/soc/pxa/cpu.h | 58 +-------- + 50 files changed, 488 insertions(+), 460 deletions(-) + delete mode 100644 Documentation/devicetree/bindings/mmc/sdhci-st.txt + create mode 100644 Documentation/devicetree/bindings/mmc/st,sdhci.yaml + create mode 100644 Documentation/devicetree/bindings/mmc/ti,omap2420-mmc.yaml + delete mode 100644 Documentation/devicetree/bindings/mmc/ti-omap.txt +Merging mfd/for-mfd-next (9d0e4b1ae5b04 mfd: cs42l43: Fix regmap defaults ordering) +$ git merge -m Merge branch 'for-mfd-next' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git mfd/for-mfd-next +Auto-merging Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml +Auto-merging Documentation/devicetree/bindings/vendor-prefixes.yaml +Auto-merging MAINTAINERS +Auto-merging drivers/mfd/cros_ec_dev.c +Auto-merging drivers/mfd/cs42l43-i2c.c +Auto-merging drivers/mfd/cs42l43-sdw.c +Auto-merging drivers/mfd/motorola-cpcap.c +Auto-merging drivers/mfd/ocelot-spi.c +Auto-merging drivers/mfd/sm501.c +Auto-merging drivers/thermal/db8500_thermal.c +Auto-merging include/linux/mfd/ucb1x00.h +Merge made by the 'ort' strategy. + Documentation/devicetree/bindings/Makefile | 2 +- + .../bindings/mfd/marvell,88pm886-a1.yaml | 2 +- + .../bindings/mfd/mediatek,mt8195-scpsys.yaml | 1 + + .../devicetree/bindings/mfd/omap-usb-tll.txt | 27 - + .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 5 + + .../devicetree/bindings/mfd/qcom,tcsr.yaml | 4 + + .../devicetree/bindings/mfd/st,stmpe.yaml | 2 +- + .../devicetree/bindings/mfd/syscon-common.yaml | 34 ++ + Documentation/devicetree/bindings/mfd/syscon.yaml | 118 +---- + .../devicetree/bindings/mfd/ti,usbhs-tll.yaml | 53 ++ + .../devicetree/bindings/vendor-prefixes.yaml | 2 + + MAINTAINERS | 13 + + arch/arm/mach-ux500/cpu-db8500.c | 6 +- + drivers/clk/ux500/clk-prcmu.c | 20 +- + drivers/clk/ux500/u8500_of_clk.c | 2 +- + drivers/cpuidle/cpuidle-ux500.c | 6 +- + drivers/mfd/88pm886.c | 21 +- + drivers/mfd/Kconfig | 7 +- + drivers/mfd/Makefile | 1 + + drivers/mfd/ab8500-core.c | 2 +- + drivers/mfd/altera-a10sr.c | 2 +- + drivers/mfd/arizona-spi.c | 12 +- + drivers/mfd/axp20x.c | 2 +- + drivers/mfd/cgbc-core.c | 4 +- + drivers/mfd/cros_ec_dev.c | 18 +- + drivers/mfd/cs40l50-spi.c | 4 +- + drivers/mfd/cs42l43-i2c.c | 2 - + drivers/mfd/cs42l43-sdw.c | 13 +- + drivers/mfd/cs42l43.c | 30 +- + drivers/mfd/da9052-spi.c | 12 +- + drivers/mfd/db8500-prcmu.c | 6 +- + drivers/mfd/intel-m10-bmc-spi.c | 6 +- + drivers/mfd/ipaq-micro.c | 2 +- + drivers/mfd/iqs62x.c | 2 +- + drivers/mfd/macsmc.c | 8 +- + drivers/mfd/madera-spi.c | 18 +- + drivers/mfd/motorola-cpcap.c | 6 +- + drivers/mfd/mt6397-core.c | 6 + + drivers/mfd/ocelot-spi.c | 2 +- + drivers/mfd/qnap-mcu.c | 13 +- + drivers/mfd/rave-sp.c | 64 ++- + drivers/mfd/rk8xx-spi.c | 2 +- + drivers/mfd/rohm-bd71828.c | 84 +-- + drivers/mfd/rohm-bd718x7.c | 84 +-- + drivers/mfd/rohm-pwrbutton.c | 112 ++++ + drivers/mfd/rohm-pwrbutton.h | 12 + + drivers/mfd/rsmu_spi.c | 12 +- + drivers/mfd/si476x-cmd.c | 1 - + drivers/mfd/si476x-i2c.c | 47 +- + drivers/mfd/sm501.c | 2 + + drivers/mfd/sprd-sc27xx-spi.c | 3 +- + drivers/mfd/stmpe-spi.c | 12 +- + drivers/mfd/tps65912-spi.c | 2 +- + drivers/mfd/ucb1x00-assabet.c | 120 ++++- + drivers/mfd/ucb1x00-core.c | 16 +- + drivers/mfd/viperboard.c | 3 +- + drivers/mfd/wm831x-spi.c | 16 +- + drivers/platform/chrome/cros_ec_proto.c | 30 +- + drivers/regulator/db8500-prcmu.c | 12 +- + drivers/thermal/db8500_thermal.c | 10 +- + drivers/watchdog/db8500_wdt.c | 22 +- + include/linux/mfd/88pm886.h | 5 + + include/linux/mfd/cs42l43.h | 2 - + include/linux/mfd/db8500-prcmu.h | 252 ++++++++- + include/linux/mfd/dbx500-prcmu.h | 575 --------------------- + include/linux/mfd/si476x-core.h | 5 +- + include/linux/mfd/si476x-platform.h | 2 - + include/linux/mfd/ucb1x00.h | 3 + + include/linux/mfd/viperboard.h | 10 +- + include/linux/platform_data/cros_ec_proto.h | 2 + + sound/soc/ux500/ux500_msp_dai.c | 2 +- + 71 files changed, 887 insertions(+), 1133 deletions(-) + delete mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt + create mode 100644 Documentation/devicetree/bindings/mfd/ti,usbhs-tll.yaml + create mode 100644 drivers/mfd/rohm-pwrbutton.c + create mode 100644 drivers/mfd/rohm-pwrbutton.h + delete mode 100644 include/linux/mfd/dbx500-prcmu.h +Merging backlight/for-backlight-next (cf1a12e080451 backlight: Use sysfs_emit() instead of sprintf()) +$ git merge -m Merge branch 'for-backlight-next' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git backlight/for-backlight-next +Auto-merging MAINTAINERS +Merge made by the 'ort' strategy. + .../bindings/leds/backlight/88pm860x.txt | 1 + + .../bindings/leds/backlight/awinic,aw99706.yaml | 2 +- + .../bindings/leds/backlight/silergy,sy7758.yaml | 52 +++++ + MAINTAINERS | 2 +- + drivers/video/backlight/Kconfig | 10 +- + drivers/video/backlight/Makefile | 1 + + drivers/video/backlight/aw99706.c | 25 +- + drivers/video/backlight/backlight.c | 16 +- + drivers/video/backlight/lcd.c | 6 +- + drivers/video/backlight/qcom-wled.c | 2 - + drivers/video/backlight/sy7758.c | 259 +++++++++++++++++++++ + 11 files changed, 350 insertions(+), 26 deletions(-) + create mode 100644 Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml + create mode 100644 drivers/video/backlight/sy7758.c +Merging battery/for-next (2da28b059e0dd power: supply: bq27xxx: bq27z561: fix invalid AverageEnergy address) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git battery/for-next +Auto-merging Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml +Auto-merging MAINTAINERS +Auto-merging drivers/power/reset/pwr-mlxbf.c +Auto-merging drivers/power/supply/bd71828-power.c +Auto-merging drivers/power/supply/bq24190_charger.c +Auto-merging drivers/power/supply/bq25890_charger.c +Auto-merging drivers/power/supply/cpcap-charger.c +Auto-merging drivers/power/supply/cros_peripheral_charger.c +Auto-merging drivers/power/supply/cros_usbpd-charger.c +Auto-merging drivers/power/supply/max14656_charger_detector.c +Auto-merging drivers/power/supply/max17040_battery.c +Auto-merging drivers/power/supply/max17042_battery.c +Auto-merging drivers/power/supply/max77759_charger.c +Auto-merging drivers/power/supply/max8971_charger.c +Auto-merging drivers/power/supply/mp2629_charger.c +Auto-merging drivers/power/supply/pm8916_lbc.c +Auto-merging drivers/power/supply/rt9467-charger.c +Auto-merging drivers/power/supply/rt9471.c +Merge made by the 'ort' strategy. + Documentation/ABI/testing/sysfs-class-power | 2 +- + .../devicetree/bindings/power/reset/qcom,pon.yaml | 20 +- + .../bindings/power/supply/maxim,max17042.yaml | 4 +- + .../bindings/power/supply/maxim,max8903.yaml | 53 + + .../bindings/power/supply/sgmicro,sgm41542.yaml | 96 ++ + .../bindings/power/supply/ti,bq25630.yaml | 55 + + MAINTAINERS | 6 + + drivers/power/reset/Kconfig | 12 + + drivers/power/reset/Makefile | 1 + + drivers/power/reset/mcf-rcm-reset.c | 126 +++ + drivers/power/reset/piix4-poweroff.c | 1 + + drivers/power/reset/pwr-mlxbf.c | 2 - + drivers/power/reset/reboot-mode.c | 30 +- + drivers/power/reset/syscon-reboot.c | 4 +- + drivers/power/supply/88pm860x_battery.c | 10 +- + drivers/power/supply/88pm860x_charger.c | 5 +- + drivers/power/supply/Kconfig | 16 + + drivers/power/supply/Makefile | 2 + + drivers/power/supply/ab8500_btemp.c | 5 +- + drivers/power/supply/ab8500_charger.c | 5 +- + drivers/power/supply/ab8500_fg.c | 32 +- + drivers/power/supply/act8945a_charger.c | 4 +- + drivers/power/supply/axp20x_ac_power.c | 5 +- + drivers/power/supply/axp20x_usb_power.c | 5 +- + drivers/power/supply/axp288_charger.c | 3 +- + drivers/power/supply/axp288_fuel_gauge.c | 2 +- + drivers/power/supply/bd71828-power.c | 20 +- + drivers/power/supply/bd99954-charger.h | 23 +- + drivers/power/supply/bq24190_charger.c | 18 +- + drivers/power/supply/bq24257_charger.c | 20 +- + drivers/power/supply/bq24735-charger.c | 6 +- + drivers/power/supply/bq25630_charger.c | 1075 +++++++++++++++++++ + drivers/power/supply/bq256xx_charger.c | 41 +- + drivers/power/supply/bq257xx_charger.c | 530 ++++++++- + drivers/power/supply/bq25890_charger.c | 12 + + drivers/power/supply/bq27xxx_battery.c | 6 +- + drivers/power/supply/charger-manager.c | 54 +- + drivers/power/supply/cpcap-battery.c | 6 +- + drivers/power/supply/cpcap-charger.c | 6 +- + drivers/power/supply/cros_peripheral_charger.c | 13 +- + drivers/power/supply/cros_usbpd-charger.c | 17 +- + drivers/power/supply/cw2015_battery.c | 1 + + drivers/power/supply/da9150-fg.c | 4 +- + drivers/power/supply/generic-adc-battery.c | 2 +- + drivers/power/supply/isp1704_charger.c | 1 + + drivers/power/supply/lp8727_charger.c | 4 +- + drivers/power/supply/lp8788-charger.c | 2 +- + drivers/power/supply/ltc2941-battery-gauge.c | 2 +- + drivers/power/supply/max14656_charger_detector.c | 4 +- + drivers/power/supply/max17040_battery.c | 32 +- + drivers/power/supply/max17042_battery.c | 375 ++++++- + drivers/power/supply/max77759_charger.c | 4 +- + drivers/power/supply/max8903_charger.c | 430 +++++++- + drivers/power/supply/max8971_charger.c | 2 +- + drivers/power/supply/mp2629_charger.c | 4 +- + drivers/power/supply/mt6360_charger.c | 3 +- + drivers/power/supply/mt6370-charger.c | 4 +- + drivers/power/supply/pf1550-charger.c | 5 +- + drivers/power/supply/pm8916_lbc.c | 6 +- + drivers/power/supply/power_supply_core.c | 169 ++- + drivers/power/supply/power_supply_leds.c | 88 +- + drivers/power/supply/power_supply_sysfs.c | 4 + + drivers/power/supply/qcom_battmgr.c | 17 +- + drivers/power/supply/qcom_smbb.c | 5 +- + drivers/power/supply/qcom_smbx.c | 3 +- + drivers/power/supply/rk817_charger.c | 12 +- + drivers/power/supply/rn5t618_power.c | 5 +- + drivers/power/supply/rt9455_charger.c | 25 +- + drivers/power/supply/rt9467-charger.c | 3 +- + drivers/power/supply/rt9471.c | 52 +- + drivers/power/supply/sbs-battery.c | 15 +- + drivers/power/supply/sbs-charger.c | 2 +- + drivers/power/supply/sc2731_charger.c | 2 + + drivers/power/supply/sc27xx_fuel_gauge.c | 8 +- + drivers/power/supply/sgm41542_charger.c | 1127 ++++++++++++++++++++ + drivers/power/supply/surface-rt-ec.c | 2 +- + drivers/power/supply/tps65090-charger.c | 6 +- + drivers/power/supply/tps65217_charger.c | 6 +- + drivers/power/supply/twl4030_charger.c | 22 +- + drivers/power/supply/twl6030_charger.c | 4 +- + drivers/power/supply/ucs1002_power.c | 16 +- + include/linux/mfd/bq257xx.h | 14 + + include/linux/power/max17042_battery.h | 2 + + include/linux/power_supply.h | 36 +- + tools/testing/selftests/power_supply/helpers.sh | 8 +- + .../power_supply/test_power_supply_properties.sh | 3 +- + 86 files changed, 4448 insertions(+), 446 deletions(-) + create mode 100644 Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml + create mode 100644 Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml + create mode 100644 drivers/power/reset/mcf-rcm-reset.c + create mode 100644 drivers/power/supply/bq25630_charger.c + create mode 100644 drivers/power/supply/sgm41542_charger.c +Merging regulator/for-next (bd2a0c2d8c49f Merge remote-tracking branch 'regulator/for-7.2' into regulator-linus) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git regulator/for-next +Already up to date. +Merging security/next (0cee720cfd514 selftests/lsm: Fix memory leak in attr_lsm_count) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git security/next +Already up to date. +Merging apparmor/apparmor-next (4ec11f14d1d6f apparmor: fix deadlock in complain-mode change_hat) +$ git merge -m Merge branch 'apparmor-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor apparmor/apparmor-next +Merge made by the 'ort' strategy. + security/apparmor/Kconfig | 14 +- + security/apparmor/Makefile | 2 +- + security/apparmor/af_inet.c | 565 ++++++++++++++++++++++++++++++ + security/apparmor/af_unix.c | 44 ++- + security/apparmor/apparmorfs.c | 281 +++++++++++---- + security/apparmor/audit.c | 40 ++- + security/apparmor/capability.c | 2 +- + security/apparmor/domain.c | 157 ++++++--- + security/apparmor/file.c | 15 +- + security/apparmor/include/af_inet.h | 36 ++ + security/apparmor/include/apparmor.h | 1 + + security/apparmor/include/apparmorfs.h | 3 + + security/apparmor/include/audit.h | 10 +- + security/apparmor/include/capability.h | 3 +- + security/apparmor/include/cred.h | 22 +- + security/apparmor/include/file.h | 2 +- + security/apparmor/include/label.h | 31 +- + security/apparmor/include/lib.h | 6 +- + security/apparmor/include/match.h | 18 +- + security/apparmor/include/net.h | 9 +- + security/apparmor/include/path.h | 3 + + security/apparmor/include/perms.h | 19 +- + security/apparmor/include/policy.h | 17 +- + security/apparmor/include/policy_unpack.h | 4 +- + security/apparmor/include/procattr.h | 2 + + security/apparmor/include/task.h | 20 +- + security/apparmor/label.c | 95 +++-- + security/apparmor/lib.c | 53 ++- + security/apparmor/lsm.c | 282 +++++++++------ + security/apparmor/match.c | 35 +- + security/apparmor/mount.c | 279 ++++++--------- + security/apparmor/net.c | 47 +-- + security/apparmor/policy.c | 30 +- + security/apparmor/policy_compat.c | 14 +- + security/apparmor/policy_unpack.c | 30 +- + security/apparmor/task.c | 27 ++ + 36 files changed, 1607 insertions(+), 611 deletions(-) + create mode 100644 security/apparmor/af_inet.c + create mode 100644 security/apparmor/include/af_inet.h +Merging integrity/next-integrity (f1e10b1087405 ima: measure userspace policy writes before parsing) +$ git merge -m Merge branch 'next-integrity' of https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity integrity/next-integrity +Already up to date. +Merging selinux/next (3b93fe26412a4 Automated merge of 'dev' into 'next') +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git selinux/next +Merge made by the 'ort' strategy. +Merging smack/next (fedc88e38ce97 smack: fix cred UAF in smack_file_send_sigiotask()) +$ git merge -m Merge branch 'next' of https://github.com/cschaufler/smack-next smack/next +Already up to date. +Merging tomoyo/master (2d2338c93da79 Merge tag 'i2c-fixes-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux) +$ git merge -m Merge branch 'master' of git://git.code.sf.net/p/tomoyo/tomoyo.git tomoyo/master +Already up to date. +Merging tpmdd-tpm/for-next-tpm (9ab8748961671 tpm: atmel: depend on X86) +$ git merge -m Merge branch 'for-next-tpm' of https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpmdd-tpm/for-next-tpm +Merge made by the 'ort' strategy. + drivers/char/tpm/Kconfig | 3 +-- + drivers/char/tpm/st33zp24/st33zp24.c | 5 +---- + drivers/char/tpm/tpm_i2c_nuvoton.c | 8 ++++---- + drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 +--- + security/keys/trusted-keys/trusted_tpm1.c | 2 +- + 5 files changed, 8 insertions(+), 14 deletions(-) +Merging tpmdd-keys/for-next-keys (d239c5a8828cb KEYS: trusted: Fix TPM teardown ordering) +$ git merge -m Merge branch 'for-next-keys' of https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpmdd-keys/for-next-keys +Already up to date. +Merging watchdog/watchdog-next (3bbbeb7fddf54 watchdog: orion_wdt: Propagate errors from optional IRQ lookup) +$ git merge -m Merge branch 'watchdog-next' of https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git watchdog/watchdog-next +Already up to date. +Merging iommu/next (3c6a2bac15247 Merge branches 'arm/smmu/updates', 'arm/smmu/bindings', 'mediatek', 'qualcomm/msm', 'rockchip', 'ti/omap', 'riscv', 'intel/vt-d', 'amd/amd-vi', 'core' and 'typos' into next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git iommu/next +Already up to date. +Merging audit/next (2b10b6de62d7b Automated merge of 'dev' into 'next') +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git audit/next +Merge made by the 'ort' strategy. +Merging devicetree/for-next (e1c13aed4a164 dt-bindings: interconnect: qcom-bwmon: Add Maili cpu-bwmon compatible) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git devicetree/for-next +Already up to date. +Merging dt-krzk/for-next (6bd34d56818cc Merge branches 'next/dt' and 'next/dt64' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt.git dt-krzk/for-next +Merge made by the 'ort' strategy. +Merging mailbox/for-next (36cac4b5101f8 mailbox: imx: Don't force-thread the primary handler) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox.git mailbox/for-next +Already up to date. +Merging spi/for-next (14a6d09db0c71 Merge remote-tracking branch 'spi/for-7.3' into spi-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git spi/for-next +Merge made by the 'ort' strategy. +Merging tip/master (57e0daeacc1da Merge branch into tip/master: 'locking/urgent') +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tip/master +Already up to date. +Merging kexec/kexec-next (9d50f7c5ad5b4 Merge branch 'crashkernel-cma' into kexec-next) +$ git merge -m Merge branch 'kexec-next' of https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git kexec/kexec-next +Already up to date. +Merging liveupdate/next (352ebb57013a0 Merge branch 'luo-internal-api' into next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git liveupdate/next +Auto-merging MAINTAINERS +Auto-merging arch/x86/kernel/setup.c +Auto-merging kernel/liveupdate/kexec_handover.c +Auto-merging mm/hugetlb.c +Auto-merging mm/memblock.c +Auto-merging mm/mm_init.c +Auto-merging tools/testing/memblock/internal.h +Merge made by the 'ort' strategy. + MAINTAINERS | 1 + + arch/x86/boot/compressed/kaslr.c | 2 + + arch/x86/include/asm/Kbuild | 1 + + arch/x86/include/asm/setup.h | 2 - + arch/x86/kernel/setup.c | 1 + + include/asm-generic/kexec_handover.h | 12 + + include/linux/kexec_handover.h | 31 +- + include/linux/kho/abi/kexec_handover.h | 9 +- + include/linux/kho_radix_tree.h | 60 ++- + include/linux/liveupdate.h | 22 + + include/linux/memblock.h | 23 +- + kernel/liveupdate/Makefile | 1 - + kernel/liveupdate/kexec_handover.c | 525 +++++++++++++++++++----- + kernel/liveupdate/kexec_handover_debug.c | 25 -- + kernel/liveupdate/kexec_handover_internal.h | 9 - + kernel/liveupdate/luo_file.c | 69 ++++ + kernel/liveupdate/luo_internal.h | 17 + + mm/hugetlb.c | 9 +- + mm/memblock.c | 154 +++++-- + mm/mm_init.c | 29 +- + tools/testing/memblock/internal.h | 5 + + tools/testing/memblock/linux/kexec_handover.h | 9 + + tools/testing/memblock/linux/kho/abi/memblock.h | 10 + + tools/testing/memblock/linux/libfdt.h | 9 + + 24 files changed, 781 insertions(+), 254 deletions(-) + create mode 100644 include/asm-generic/kexec_handover.h + delete mode 100644 kernel/liveupdate/kexec_handover_debug.c + create mode 100644 tools/testing/memblock/linux/kexec_handover.h + create mode 100644 tools/testing/memblock/linux/kho/abi/memblock.h + create mode 100644 tools/testing/memblock/linux/libfdt.h +Merging clockevents/timers/drivers/next (1b8b356b4b06e clocksource/drivers/armada: Unwind timer clock on init failure) +$ git merge -m Merge branch 'timers/drivers/next' of https://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux.git clockevents/timers/drivers/next +Auto-merging drivers/pwm/pwm-samsung.c +Merge made by the 'ort' strategy. +Merging edac/edac-for-next (9fa765b3ed33d Merge ras/edac-misc into for-next) +$ git merge -m Merge branch 'edac-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac/edac-for-next +Auto-merging CREDITS +Auto-merging MAINTAINERS +Auto-merging drivers/edac/ie31200_edac.c +Merge made by the 'ort' strategy. + CREDITS | 4 + + MAINTAINERS | 16 +- + drivers/edac/al_mc_edac.c | 12 +- + drivers/edac/altera_edac.c | 135 ++++++----- + drivers/edac/altera_edac.h | 1 + + drivers/edac/amd64_edac.c | 2 + + drivers/edac/aspeed_edac.c | 4 +- + drivers/edac/debugfs.c | 65 +----- + drivers/edac/edac_device.c | 10 +- + drivers/edac/edac_device_sysfs.c | 23 +- + drivers/edac/edac_mc_sysfs.c | 2 +- + drivers/edac/edac_module.h | 3 +- + drivers/edac/highbank_mc_edac.c | 4 +- + drivers/edac/ie31200_edac.c | 18 +- + drivers/edac/igen6_edac.c | 473 ++++++++++++++++++++++----------------- + drivers/edac/thunderx_edac.c | 4 +- + drivers/edac/xgene_edac.c | 5 +- + drivers/ras/amd/atl/core.c | 1 - + drivers/ras/amd/atl/map.c | 6 +- + include/linux/edac.h | 3 - + 20 files changed, 392 insertions(+), 399 deletions(-) +Merging ftrace/for-next (3df3ae98c30c2 Merge tracefs/for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git ftrace/for-next +Auto-merging MAINTAINERS +Auto-merging Makefile +Auto-merging arch/x86/Kconfig +Auto-merging arch/x86/kernel/setup.c +Auto-merging init/Kconfig +Auto-merging init/main.c +Auto-merging lib/Makefile +Merge made by the 'ort' strategy. + Documentation/admin-guide/bootconfig.rst | 81 ++ + Documentation/trace/boottime-trace.rst | 18 +- + Documentation/trace/eprobetrace.rst | 7 +- + Documentation/trace/fprobe.rst | 2 +- + Documentation/trace/fprobetrace.rst | 10 + + Documentation/trace/kprobetrace.rst | 11 + + MAINTAINERS | 1 + + Makefile | 27 +- + arch/x86/Kconfig | 1 + + arch/x86/kernel/setup.c | 14 +- + include/asm-generic/kprobes.h | 4 +- + include/linux/bootconfig.h | 14 + + init/Kconfig | 36 + + init/main.c | 52 +- + kernel/trace/Kconfig | 12 + + kernel/trace/fprobe.c | 13 +- + kernel/trace/trace.c | 8 +- + kernel/trace/trace_boot.c | 97 ++ + kernel/trace/trace_dynevent.c | 5 + + kernel/trace/trace_eprobe.c | 2 + + kernel/trace/trace_fprobe.c | 12 +- + kernel/trace/trace_kprobe.c | 27 +- + kernel/trace/trace_probe.c | 1207 ++++++++++++++------ + kernel/trace/trace_probe.h | 288 +++-- + kernel/trace/trace_probe_kernel.h | 2 +- + kernel/trace/trace_probe_tmpl.h | 27 +- + kernel/trace/trace_uprobe.c | 5 +- + lib/Makefile | 16 + + lib/bootconfig.c | 139 ++- + lib/embedded-cmdline.S | 16 + + samples/trace_events/trace-events-sample.c | 40 +- + samples/trace_events/trace-events-sample.h | 34 +- + tools/bootconfig/Makefile | 4 +- + tools/bootconfig/scripts/ftrace2bconf.sh | 2 + + tools/testing/selftests/ftrace/ftracetest | 3 + + .../ftrace/test.d/dynevent/btf_probe_event.tc | 51 + + .../test.d/dynevent/btf_typecast_accepted.tc | 103 ++ + .../test.d/dynevent/eprobes_syntax_errors.tc | 12 +- + .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc | 16 +- + .../ftrace/test.d/dynevent/tprobe_syntax_errors.tc | 4 +- + .../ftrace/test.d/kprobe/kprobe_module.tc | 6 + + .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 16 +- + .../ftrace/test.d/kprobe/uprobe_syntax_errors.tc | 5 + + 43 files changed, 1914 insertions(+), 536 deletions(-) + create mode 100644 lib/embedded-cmdline.S + create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/btf_probe_event.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/btf_typecast_accepted.tc +$ git am -3 ../patches/0001-ftrace-Fix-semantic-conflict-with-mm-tree.patch +Applying: ftrace: Fix semantic conflict with mm tree +Using index info to reconstruct a base tree... +M kernel/trace/trace_printk.c +Falling back to patching base and 3-way merge... +Auto-merging kernel/trace/trace_printk.c +No changes -- Patch already applied. +Merging rcu/next (9cc63f8bcd560 Merge branches 'expcb.2026.07.24a', 'misc.2026.07.30a', 'rcu-tasks.2026.07.30a', 'srcu.2026.08.11a' and 'torture.2026.08.14a' into HEAD) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux rcu/next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging MAINTAINERS +Auto-merging include/linux/srcu.h +Auto-merging mm/slab_common.c +Auto-merging rust/helpers/helpers.c +Auto-merging rust/kernel/sync.rs +Merge made by the 'ort' strategy. + .../Expedited-Grace-Periods.rst | 2 +- + .../RCU/Design/Memory-Ordering/TreeRCU-gp.svg | 2 +- + .../RCU/Design/Memory-Ordering/TreeRCU-qs.svg | 2 +- + .../RCU/Design/Requirements/Requirements.rst | 2 +- + Documentation/RCU/rcu_dereference.rst | 4 +- + Documentation/admin-guide/kernel-parameters.txt | 14 + + MAINTAINERS | 3 + + include/linux/rcu_segcblist.h | 16 +- + include/linux/rcupdate.h | 29 +- + include/linux/rcupdate_trace.h | 19 +- + include/linux/rcupdate_wait.h | 2 +- + include/linux/rcutiny.h | 36 +- + include/linux/rcutree.h | 29 +- + include/linux/srcu.h | 29 +- + include/linux/srcutiny.h | 13 + + include/linux/srcutree.h | 24 ++ + include/trace/events/rcu.h | 5 +- + kernel/rcu/Kconfig | 1 - + kernel/rcu/rcu.h | 20 +- + kernel/rcu/rcu_segcblist.c | 139 +++++--- + kernel/rcu/rcu_segcblist.h | 8 +- + kernel/rcu/rcuscale.c | 84 ++++- + kernel/rcu/rcutorture.c | 374 ++++++++++++++------- + kernel/rcu/srcutiny.c | 14 +- + kernel/rcu/srcutree.c | 57 ++-- + kernel/rcu/tasks.h | 62 ++-- + kernel/rcu/tiny.c | 4 +- + kernel/rcu/tree.c | 195 +++++++---- + kernel/rcu/tree.h | 14 +- + kernel/rcu/tree_exp.h | 24 +- + kernel/rcu/tree_nocb.h | 126 +++++-- + kernel/rcu/tree_plugin.h | 93 ++++- + kernel/rcu/tree_stall.h | 64 ++-- + kernel/torture.c | 7 +- + mm/slab_common.c | 6 +- + rust/helpers/helpers.c | 1 + + rust/helpers/srcu.c | 35 ++ + rust/kernel/sync.rs | 2 + + rust/kernel/sync/srcu.rs | 171 ++++++++++ + 39 files changed, 1251 insertions(+), 481 deletions(-) + create mode 100644 rust/helpers/srcu.c + create mode 100644 rust/kernel/sync/srcu.rs +Merging paulmck/non-rcu/next (e39a12053df09 Merge branches 'hazptr.2026.08.05a', 'hrtimer_sleeper.2026.08.05a' and 'scftorture.2026.07.23a' into HEAD) +$ git merge -m Merge branch 'non-rcu/next' of https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git paulmck/non-rcu/next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging fs/aio.c +Auto-merging include/linux/hrtimer.h +Auto-merging init/main.c +Auto-merging io_uring/rw.c +Auto-merging kernel/scftorture.c +Auto-merging kernel/sched/core.c +Auto-merging kernel/time/hrtimer.c +Auto-merging kernel/torture.c +Auto-merging net/core/pktgen.c +Merge made by the 'ort' strategy. + Documentation/admin-guide/kernel-parameters.txt | 96 +++ + fs/aio.c | 2 +- + include/linux/hazptr.h | 323 +++++++ + include/linux/hrtimer.h | 10 +- + include/linux/torture.h | 6 +- + include/linux/wait.h | 2 +- + init/main.c | 2 + + io_uring/rw.c | 2 +- + kernel/Makefile | 2 +- + kernel/futex/requeue.c | 2 +- + kernel/futex/waitwake.c | 8 +- + kernel/hazptr.c | 284 +++++++ + kernel/locking/rtmutex.c | 2 +- + kernel/rcu/Kconfig.debug | 21 + + kernel/rcu/Makefile | 1 + + kernel/rcu/hazptrtorture.c | 946 +++++++++++++++++++++ + kernel/rcu/refscale.c | 43 + + kernel/rcu/update.c | 3 +- + kernel/scftorture.c | 3 +- + kernel/sched/core.c | 2 + + kernel/time/hrtimer.c | 17 +- + kernel/time/sleep_timeout.c | 4 +- + kernel/torture.c | 38 +- + net/core/pktgen.c | 4 +- + tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +- + .../selftests/rcutorture/configs/hazptr/CFLIST | 2 + + .../selftests/rcutorture/configs/hazptr/CFcommon | 2 + + .../selftests/rcutorture/configs/hazptr/NOPREEMPT | 19 + + .../rcutorture/configs/hazptr/NOPREEMPT.boot | 1 + + .../selftests/rcutorture/configs/hazptr/PREEMPT | 16 + + .../rcutorture/configs/hazptr/ver_functions.sh | 40 + + 31 files changed, 1878 insertions(+), 31 deletions(-) + create mode 100644 include/linux/hazptr.h + create mode 100644 kernel/hazptr.c + create mode 100644 kernel/rcu/hazptrtorture.c + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/CFLIST + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/CFcommon + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/NOPREEMPT + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/NOPREEMPT.boot + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/PREEMPT + create mode 100644 tools/testing/selftests/rcutorture/configs/hazptr/ver_functions.sh +Merging kvm/next (a204badd8432f Merge branch 'kvm-chainsaw' into HEAD) +$ git merge -m Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm/next +Auto-merging arch/x86/include/asm/kvm_host.h +Auto-merging arch/x86/kvm/cpuid.c +Auto-merging arch/x86/kvm/hyperv.c +Auto-merging arch/x86/kvm/irq.c +Auto-merging arch/x86/kvm/mmu/mmu.c +CONFLICT (content): Merge conflict in arch/x86/kvm/mmu/mmu.c +Auto-merging arch/x86/kvm/mmu/paging_tmpl.h +Auto-merging arch/x86/kvm/mmu/spte.c +Auto-merging arch/x86/kvm/pmu.c +Auto-merging arch/x86/kvm/svm/svm.c +Auto-merging arch/x86/kvm/vmx/nested.c +Auto-merging arch/x86/kvm/vmx/vmx.c +Auto-merging arch/x86/kvm/x86.c +CONFLICT (content): Merge conflict in arch/x86/kvm/x86.c +Auto-merging tools/testing/selftests/kvm/Makefile.kvm +Resolved 'arch/x86/kvm/mmu/mmu.c' using previous resolution. +Resolved 'arch/x86/kvm/x86.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master e65ec8ff783c1] Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git +$ git diff -M --stat --summary HEAD^.. + arch/x86/include/asm/kvm_host.h | 655 +--- + arch/x86/kvm/Makefile | 4 +- + arch/x86/kvm/cpuid.c | 1 + + arch/x86/kvm/fpu.h | 26 + + arch/x86/kvm/hyperv.c | 7 +- + arch/x86/kvm/hyperv.h | 3 +- + arch/x86/kvm/ioapic.c | 1 + + arch/x86/kvm/ioapic.h | 12 + + arch/x86/kvm/irq.c | 7 + + arch/x86/kvm/irq.h | 6 + + arch/x86/kvm/lapic.h | 8 + + arch/x86/kvm/mmu.h | 121 +- + arch/x86/kvm/mmu/mmu.c | 541 +-- + arch/x86/kvm/mmu/mmu_internal.h | 66 - + arch/x86/kvm/mmu/paging_tmpl.h | 88 +- + arch/x86/kvm/mmu/spte.c | 4 +- + arch/x86/kvm/mmu/spte.h | 69 +- + arch/x86/kvm/mmu/tdp_mmu.c | 3 +- + arch/x86/kvm/msrs.c | 2745 ++++++++++++++ + arch/x86/kvm/msrs.h | 156 + + arch/x86/kvm/mtrr.c | 2 +- + arch/x86/kvm/pmu.c | 12 + + arch/x86/kvm/regs.c | 874 +++++ + arch/x86/kvm/regs.h | 60 + + arch/x86/kvm/svm/nested.c | 14 +- + arch/x86/kvm/svm/svm.c | 6 +- + arch/x86/kvm/tss.h | 7 + + arch/x86/kvm/vmx/nested.c | 16 +- + arch/x86/kvm/vmx/vmx.c | 26 +- + arch/x86/kvm/x86.c | 3762 +------------------- + arch/x86/kvm/x86.h | 462 ++- + tools/testing/selftests/kvm/Makefile.kvm | 1 + + tools/testing/selftests/kvm/include/x86/pmu.h | 6 + + .../testing/selftests/kvm/include/x86/processor.h | 10 + + tools/testing/selftests/kvm/include/x86/svm_util.h | 5 +- + tools/testing/selftests/kvm/include/x86/vmx.h | 4 +- + tools/testing/selftests/kvm/lib/x86/memstress.c | 19 +- + tools/testing/selftests/kvm/lib/x86/processor.c | 45 +- + tools/testing/selftests/kvm/lib/x86/svm.c | 6 +- + tools/testing/selftests/kvm/lib/x86/vmx.c | 6 +- + tools/testing/selftests/kvm/x86/aperfmperf_test.c | 9 +- + .../selftests/kvm/x86/evmcs_smm_controls_test.c | 5 +- + tools/testing/selftests/kvm/x86/hyperv_evmcs.c | 6 +- + tools/testing/selftests/kvm/x86/hyperv_svm_test.c | 6 +- + tools/testing/selftests/kvm/x86/kvm_buslock_test.c | 9 +- + .../selftests/kvm/x86/nested_close_kvm_test.c | 12 +- + .../selftests/kvm/x86/nested_dirty_log_test.c | 8 +- + .../selftests/kvm/x86/nested_emulation_test.c | 4 +- + .../selftests/kvm/x86/nested_exceptions_test.c | 9 +- + .../selftests/kvm/x86/nested_invalid_cr3_test.c | 10 +- + .../selftests/kvm/x86/nested_tdp_fault_test.c | 9 +- + .../selftests/kvm/x86/nested_tsc_adjust_test.c | 10 +- + .../selftests/kvm/x86/nested_tsc_scaling_test.c | 10 +- + .../selftests/kvm/x86/nested_vmsave_vmload_test.c | 6 +- + tools/testing/selftests/kvm/x86/smm_test.c | 8 +- + tools/testing/selftests/kvm/x86/state_test.c | 11 +- + tools/testing/selftests/kvm/x86/svm_int_ctl_test.c | 5 +- + .../selftests/kvm/x86/svm_lbr_nested_state.c | 6 +- + .../selftests/kvm/x86/svm_nested_clear_efer_svme.c | 7 +- + .../selftests/kvm/x86/svm_nested_pat_test.c | 8 +- + .../selftests/kvm/x86/svm_nested_shutdown_test.c | 5 +- + .../kvm/x86/svm_nested_soft_inject_test.c | 6 +- + .../selftests/kvm/x86/svm_nested_vmcb12_gpa.c | 13 +- + .../selftests/kvm/x86/svm_pmu_host_guest_test.c | 215 ++ + tools/testing/selftests/kvm/x86/svm_vmcall_test.c | 5 +- + .../selftests/kvm/x86/triple_fault_event_test.c | 9 +- + .../selftests/kvm/x86/vmx_apic_access_test.c | 5 +- + .../selftests/kvm/x86/vmx_apicv_updates_test.c | 4 +- + .../kvm/x86/vmx_invalid_nested_guest_state.c | 6 +- + .../selftests/kvm/x86/vmx_nested_la57_state_test.c | 5 +- + .../selftests/kvm/x86/vmx_preemption_timer_test.c | 5 +- + 71 files changed, 5273 insertions(+), 5029 deletions(-) + create mode 100644 arch/x86/kvm/msrs.c + create mode 100644 arch/x86/kvm/msrs.h + create mode 100644 arch/x86/kvm/regs.c + create mode 100644 tools/testing/selftests/kvm/x86/svm_pmu_host_guest_test.c +$ git am -3 ../patches/kvm-x86-static-cpu-has +Applying: Signed-off-by: Mark Brown +$ git reset HEAD^ +Unstaged changes after reset: +M arch/x86/kvm/msrs.c +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master e542121a80884] Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git + Date: Thu Aug 20 13:56:40 2026 +0100 +Merging kvm-arm/next (aa8e5dc6a7a2a Merge branch 'kvm-arm64/misc-7.3' into next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git kvm-arm/next +Auto-merging Documentation/virt/kvm/api.rst +Auto-merging arch/arm64/include/asm/cpufeature.h +Auto-merging arch/arm64/kernel/cpu_errata.c +Auto-merging arch/arm64/kernel/cpufeature.c +Auto-merging arch/arm64/kernel/pi/idreg-override.c +Auto-merging arch/arm64/kvm/arm.c +Auto-merging arch/arm64/kvm/hyp/nvhe/hyp-main.c +Auto-merging arch/arm64/kvm/mmu.c +Auto-merging arch/arm64/kvm/vgic/vgic-its.c +Auto-merging arch/arm64/kvm/vgic/vgic-v3.c +Auto-merging arch/arm64/kvm/vgic/vgic.c +Auto-merging arch/arm64/tools/cpucaps +CONFLICT (content): Merge conflict in arch/arm64/tools/cpucaps +Auto-merging arch/arm64/tools/sysreg +Auto-merging include/kvm/arm_vgic.h +Auto-merging include/uapi/linux/kvm.h +CONFLICT (content): Merge conflict in include/uapi/linux/kvm.h +Auto-merging tools/testing/selftests/kvm/Makefile.kvm +Resolved 'arch/arm64/tools/cpucaps' using previous resolution. +Resolved 'include/uapi/linux/kvm.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 5bfcdef290354] Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git +$ git diff -M --stat --summary HEAD^.. + Documentation/virt/kvm/api.rst | 11 + + Documentation/virt/kvm/devices/vcpu.rst | 11 +- + arch/arm64/include/asm/cpufeature.h | 1 + + arch/arm64/include/asm/kvm_arm.h | 27 +- + arch/arm64/include/asm/kvm_asm.h | 4 +- + arch/arm64/include/asm/kvm_emulate.h | 107 +++++++- + arch/arm64/include/asm/kvm_host.h | 14 +- + arch/arm64/include/asm/kvm_nested.h | 20 ++ + arch/arm64/include/asm/kvm_pkvm.h | 8 +- + arch/arm64/include/asm/vncr_mapping.h | 2 +- + arch/arm64/include/uapi/asm/kvm.h | 1 + + arch/arm64/kernel/asm-offsets.c | 1 - + arch/arm64/kernel/cpu_errata.c | 17 +- + arch/arm64/kernel/cpufeature.c | 18 +- + arch/arm64/kernel/image-vars.h | 2 + + arch/arm64/kernel/pi/idreg-override.c | 10 + + arch/arm64/kvm/arch_timer.c | 15 +- + arch/arm64/kvm/arm.c | 26 +- + arch/arm64/kvm/at.c | 2 - + arch/arm64/kvm/config.c | 27 +- + arch/arm64/kvm/emulate-nested.c | 18 +- + arch/arm64/kvm/handle_exit.c | 40 ++- + arch/arm64/kvm/hyp/exception.c | 34 +-- + arch/arm64/kvm/hyp/include/hyp/switch.h | 42 ++-- + arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 11 + + arch/arm64/kvm/hyp/include/nvhe/clock.h | 8 +- + arch/arm64/kvm/hyp/nvhe/clock.c | 4 +- + arch/arm64/kvm/hyp/nvhe/hyp-init.S | 11 +- + arch/arm64/kvm/hyp/nvhe/hyp-main.c | 271 ++++++++++++++++++--- + arch/arm64/kvm/hyp/nvhe/mem_protect.c | 7 + + arch/arm64/kvm/hyp/nvhe/pkvm.c | 15 +- + arch/arm64/kvm/hyp/nvhe/sys_regs.c | 5 +- + arch/arm64/kvm/hyp/nvhe/timer-sr.c | 10 +- + arch/arm64/kvm/hyp/nvhe/trace.c | 4 +- + arch/arm64/kvm/hyp/vgic-v3-sr.c | 43 +--- + arch/arm64/kvm/hyp/vhe/switch.c | 62 +++-- + arch/arm64/kvm/hyp/vhe/sysreg-sr.c | 21 +- + arch/arm64/kvm/mmu.c | 9 +- + arch/arm64/kvm/nested.c | 190 ++++++++++----- + arch/arm64/kvm/pkvm.c | 34 +-- + arch/arm64/kvm/pmu-emul.c | 54 +++- + arch/arm64/kvm/psci.c | 30 +-- + arch/arm64/kvm/reset.c | 60 +---- + arch/arm64/kvm/sys_regs.c | 152 ++++++++++-- + arch/arm64/kvm/sys_regs.h | 19 ++ + arch/arm64/kvm/vgic-sys-reg-v3.c | 8 +- + arch/arm64/kvm/vgic/vgic-init.c | 8 +- + arch/arm64/kvm/vgic/vgic-its.c | 26 +- + arch/arm64/kvm/vgic/vgic-v3-nested.c | 2 +- + arch/arm64/kvm/vgic/vgic-v3.c | 105 +++++--- + arch/arm64/kvm/vgic/vgic-v5.c | 5 +- + arch/arm64/kvm/vgic/vgic.c | 7 +- + arch/arm64/kvm/vgic/vgic.h | 19 +- + arch/arm64/tools/cpucaps | 3 + + arch/arm64/tools/gen-sysreg.awk | 8 +- + arch/arm64/tools/sysreg | 44 +++- + include/kvm/arm_arch_timer.h | 34 ++- + include/kvm/arm_pmu.h | 4 + + include/kvm/arm_psci.h | 27 ++ + include/kvm/arm_vgic.h | 4 +- + include/uapi/linux/kvm.h | 1 + + tools/testing/selftests/kvm/Makefile.kvm | 1 + + .../testing/selftests/kvm/arm64/debug-exceptions.c | 41 ++++ + tools/testing/selftests/kvm/arm64/get-reg-list.c | 3 + + .../selftests/kvm/arm64/stage2_block_transitions.c | 226 +++++++++++++++++ + 65 files changed, 1578 insertions(+), 476 deletions(-) + create mode 100644 tools/testing/selftests/kvm/arm64/stage2_block_transitions.c +Merging kvms390/next (dd6f4ef6f8a37 s390/vfio-ap: Fix NULL deref in status_show() during queue probe) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git kvms390/next +Auto-merging MAINTAINERS +Auto-merging arch/s390/kvm/gmap/gmap.c +Auto-merging arch/s390/kvm/s390/gaccess.c +Auto-merging arch/s390/kvm/s390/pv.c +Auto-merging arch/s390/kvm/s390/s390.c +Auto-merging arch/s390/kvm/s390/vsie.c +Merge made by the 'ort' strategy. + MAINTAINERS | 8 +- + arch/s390/include/asm/kvm_host.h | 723 +-------------------------- + arch/s390/include/asm/kvm_host_s390.h | 729 ++++++++++++++++++++++++++++ + arch/s390/include/asm/kvm_host_s390_types.h | 349 +++++++++++++ + arch/s390/include/asm/kvm_host_types.h | 347 +------------ + arch/s390/kvm/Makefile | 11 +- + arch/s390/kvm/gmap/Makefile | 5 + + arch/s390/kvm/{ => gmap}/dat.c | 4 + + arch/s390/kvm/{ => gmap}/dat.h | 21 +- + arch/s390/kvm/{ => gmap}/faultin.c | 3 +- + arch/s390/kvm/{ => gmap}/faultin.h | 6 +- + arch/s390/kvm/{ => gmap}/gmap.c | 19 +- + arch/s390/kvm/{ => gmap}/gmap.h | 25 +- + arch/s390/kvm/gmap/kvm_mmu.c | 133 +++++ + arch/s390/kvm/gmap/kvm_mmu.h | 18 + + arch/s390/kvm/gmap/trace_gmap.h | 47 ++ + arch/s390/kvm/s390/Makefile | 14 + + arch/s390/kvm/{ => s390}/diag.c | 21 +- + arch/s390/kvm/{ => s390}/gaccess.c | 2 +- + arch/s390/kvm/{ => s390}/gaccess.h | 2 +- + arch/s390/kvm/{ => s390}/guestdbg.c | 2 +- + arch/s390/kvm/{ => s390}/intercept.c | 2 +- + arch/s390/kvm/{ => s390}/interrupt.c | 2 +- + arch/s390/kvm/{ => s390}/pci.c | 2 +- + arch/s390/kvm/{ => s390}/pci.h | 0 + arch/s390/kvm/{ => s390}/priv.c | 2 +- + arch/s390/kvm/{ => s390}/pv.c | 2 +- + arch/s390/kvm/{kvm-s390.c => s390/s390.c} | 131 +---- + arch/s390/kvm/{kvm-s390.h => s390/s390.h} | 10 +- + arch/s390/kvm/{ => s390}/sigp.c | 2 +- + arch/s390/kvm/{ => s390}/trace-s390.h | 0 + arch/s390/kvm/{ => s390}/trace.h | 40 +- + arch/s390/kvm/{ => s390}/vsie.c | 21 +- + arch/s390/tools/gen_facilities.c | 14 +- + drivers/s390/crypto/vfio_ap_ops.c | 158 ++++-- + 35 files changed, 1580 insertions(+), 1295 deletions(-) + create mode 100644 arch/s390/include/asm/kvm_host_s390.h + create mode 100644 arch/s390/include/asm/kvm_host_s390_types.h + create mode 100644 arch/s390/kvm/gmap/Makefile + rename arch/s390/kvm/{ => gmap}/dat.c (99%) + rename arch/s390/kvm/{ => gmap}/dat.h (98%) + rename arch/s390/kvm/{ => gmap}/faultin.c (98%) + rename arch/s390/kvm/{ => gmap}/faultin.h (96%) + rename arch/s390/kvm/{ => gmap}/gmap.c (99%) + rename arch/s390/kvm/{ => gmap}/gmap.h (96%) + create mode 100644 arch/s390/kvm/gmap/kvm_mmu.c + create mode 100644 arch/s390/kvm/gmap/kvm_mmu.h + create mode 100644 arch/s390/kvm/gmap/trace_gmap.h + create mode 100644 arch/s390/kvm/s390/Makefile + rename arch/s390/kvm/{ => s390}/diag.c (96%) + rename arch/s390/kvm/{ => s390}/gaccess.c (99%) + rename arch/s390/kvm/{ => s390}/gaccess.h (99%) + rename arch/s390/kvm/{ => s390}/guestdbg.c (99%) + rename arch/s390/kvm/{ => s390}/intercept.c (99%) + rename arch/s390/kvm/{ => s390}/interrupt.c (99%) + rename arch/s390/kvm/{ => s390}/pci.c (99%) + rename arch/s390/kvm/{ => s390}/pci.h (100%) + rename arch/s390/kvm/{ => s390}/priv.c (99%) + rename arch/s390/kvm/{ => s390}/pv.c (99%) + rename arch/s390/kvm/{kvm-s390.c => s390/s390.c} (98%) + rename arch/s390/kvm/{kvm-s390.h => s390/s390.h} (98%) + rename arch/s390/kvm/{ => s390}/sigp.c (99%) + rename arch/s390/kvm/{ => s390}/trace-s390.h (100%) + rename arch/s390/kvm/{ => s390}/trace.h (95%) + rename arch/s390/kvm/{ => s390}/vsie.c (98%) +Merging kvm-ppc/topic/ppc-kvm (f5098b6bae761 Linux 7.2-rc5) +$ git merge -m Merge branch 'topic/ppc-kvm' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git kvm-ppc/topic/ppc-kvm +Already up to date. +Merging kvm-riscv/riscv_kvm_next (b5060a4aa33d7 RISC-V: KVM: fix vcpu vector context handling for kernel-mode vector) +$ git merge -m Merge branch 'riscv_kvm_next' of https://github.com/kvm-riscv/linux.git kvm-riscv/riscv_kvm_next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging arch/riscv/include/asm/csr.h +Auto-merging arch/riscv/include/asm/processor.h +Auto-merging arch/riscv/kvm/isa.c +Auto-merging arch/riscv/kvm/main.c +Auto-merging arch/riscv/kvm/vcpu_onereg.c +Auto-merging arch/riscv/kvm/vcpu_vector.c +CONFLICT (content): Merge conflict in arch/riscv/kvm/vcpu_vector.c +Resolved 'arch/riscv/kvm/vcpu_vector.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 1c63c30f06198] Merge branch 'riscv_kvm_next' of https://github.com/kvm-riscv/linux.git +$ git diff -M --stat --summary HEAD^.. + Documentation/admin-guide/kernel-parameters.txt | 7 +- + arch/riscv/include/asm/csr.h | 1 + + arch/riscv/include/asm/kvm_aia.h | 3 + + arch/riscv/include/asm/kvm_gstage.h | 9 +- + arch/riscv/include/asm/kvm_host.h | 10 ++ + arch/riscv/include/asm/kvm_vcpu_insn.h | 4 +- + arch/riscv/include/asm/kvm_vcpu_sbi.h | 4 + + arch/riscv/include/asm/kvm_vcpu_vector.h | 24 +++ + arch/riscv/include/asm/processor.h | 8 + + arch/riscv/include/asm/simd.h | 16 +- + arch/riscv/include/asm/vector.h | 5 + + arch/riscv/include/uapi/asm/kvm.h | 13 ++ + arch/riscv/kernel/kernel_mode_vector.c | 88 +++++++--- + arch/riscv/kvm/aia.c | 42 +++++ + arch/riscv/kvm/aia_aplic.c | 3 +- + arch/riscv/kvm/aia_device.c | 6 + + arch/riscv/kvm/aia_imsic.c | 18 +- + arch/riscv/kvm/gstage.c | 82 ++++++++- + arch/riscv/kvm/isa.c | 2 + + arch/riscv/kvm/main.c | 114 ++++++++++--- + arch/riscv/kvm/mmu.c | 108 +++++++++++- + arch/riscv/kvm/nacl.c | 2 +- + arch/riscv/kvm/tlb.c | 117 ++++++++++--- + arch/riscv/kvm/trace.h | 81 ++++++++- + arch/riscv/kvm/vcpu.c | 34 ++++ + arch/riscv/kvm/vcpu_config.c | 2 + + arch/riscv/kvm/vcpu_exit.c | 20 ++- + arch/riscv/kvm/vcpu_insn.c | 17 +- + arch/riscv/kvm/vcpu_onereg.c | 68 +++++++- + arch/riscv/kvm/vcpu_pmu.c | 16 +- + arch/riscv/kvm/vcpu_sbi.c | 30 ++++ + arch/riscv/kvm/vcpu_sbi_fwft.c | 207 ++++++++++++++++++++++- + arch/riscv/kvm/vcpu_sbi_v01.c | 52 +++--- + arch/riscv/kvm/vcpu_vector.c | 26 ++- + tools/testing/selftests/kvm/riscv/get-reg-list.c | 90 ++++++++++ + 35 files changed, 1170 insertions(+), 159 deletions(-) +Merging kvm-x86/next (1b731e5ded480 Merge branch 'vmx') +$ git merge -m Merge branch 'next' of https://github.com/kvm-x86/linux.git kvm-x86/next +Auto-merging Documentation/virt/kvm/api.rst +Auto-merging MAINTAINERS +Auto-merging arch/x86/include/asm/cpufeatures.h +Auto-merging arch/x86/include/asm/kvm_host.h +Auto-merging arch/x86/kvm/cpuid.c +Auto-merging arch/x86/kvm/emulate.c +Auto-merging arch/x86/kvm/hyperv.c +Auto-merging arch/x86/kvm/lapic.c +Auto-merging arch/x86/kvm/mmu/mmu.c +Auto-merging arch/x86/kvm/mmu/paging_tmpl.h +Auto-merging arch/x86/kvm/msrs.c +Auto-merging arch/x86/kvm/svm/avic.c +Auto-merging arch/x86/kvm/svm/sev.c +Auto-merging arch/x86/kvm/svm/svm.c +Auto-merging arch/x86/kvm/svm/svm.h +Auto-merging arch/x86/kvm/vmx/main.c +Auto-merging arch/x86/kvm/vmx/nested.c +Auto-merging arch/x86/kvm/vmx/vmx.c +Auto-merging arch/x86/kvm/vmx/x86_ops.h +Auto-merging arch/x86/kvm/x86.c +Auto-merging arch/x86/kvm/xen.c +Auto-merging tools/testing/selftests/kvm/Makefile.kvm +Auto-merging tools/testing/selftests/kvm/x86/sev_init2_tests.c +Auto-merging virt/kvm/guest_memfd.c +Auto-merging virt/kvm/kvm_main.c +Merge made by the 'ort' strategy. + Documentation/virt/kvm/api.rst | 15 +- + MAINTAINERS | 14 + + arch/powerpc/kvm/book3s_pr.c | 11 +- + arch/x86/include/asm/cpufeatures.h | 10 + + arch/x86/include/asm/kvm-x86-nested-ops.h | 36 ++ + arch/x86/include/asm/kvm-x86-ops.h | 17 +- + arch/x86/include/asm/kvm_host.h | 227 ++----------- + arch/x86/kvm/Kconfig | 3 +- + arch/x86/kvm/cpuid.c | 38 +-- + arch/x86/kvm/emulate.c | 49 ++- + arch/x86/kvm/hyperv.c | 95 +++--- + arch/x86/kvm/hyperv.h | 117 ++++++- + arch/x86/kvm/irq.h | 20 ++ + arch/x86/kvm/lapic.c | 13 +- + arch/x86/kvm/lapic.h | 33 ++ + arch/x86/kvm/mmu.h | 11 +- + arch/x86/kvm/mmu/mmu.c | 134 ++++---- + arch/x86/kvm/mmu/paging_tmpl.h | 2 +- + arch/x86/kvm/mmu/tdp_iter.h | 7 + + arch/x86/kvm/mmu/tdp_mmu.c | 20 +- + arch/x86/kvm/msrs.c | 21 +- + arch/x86/kvm/msrs.h | 5 +- + arch/x86/kvm/pmu.c | 12 +- + arch/x86/kvm/pmu.h | 4 +- + arch/x86/kvm/regs.c | 3 +- + arch/x86/kvm/regs.h | 38 +++ + arch/x86/kvm/smm.c | 4 + + arch/x86/kvm/svm/avic.c | 96 ++++-- + arch/x86/kvm/svm/nested.c | 21 +- + arch/x86/kvm/svm/sev.c | 242 ++++++++++---- + arch/x86/kvm/svm/svm.c | 110 +++---- + arch/x86/kvm/svm/svm.h | 24 +- + arch/x86/kvm/tss.h | 7 + + arch/x86/kvm/vmx/main.c | 24 +- + arch/x86/kvm/vmx/nested.c | 89 ++--- + arch/x86/kvm/vmx/nested.h | 6 +- + arch/x86/kvm/vmx/pmu_intel.c | 1 - + arch/x86/kvm/vmx/tdx.c | 16 +- + arch/x86/kvm/vmx/vmx.c | 193 ++++++----- + arch/x86/kvm/vmx/x86_ops.h | 4 +- + arch/x86/kvm/x86.c | 135 ++++++-- + arch/x86/kvm/x86.h | 10 +- + arch/x86/kvm/xen.c | 73 +++-- + arch/x86/kvm/xen.h | 13 - + include/linux/kvm_host.h | 38 ++- + tools/testing/selftests/kvm/Makefile.kvm | 14 +- + tools/testing/selftests/kvm/arch_timer.c | 20 +- + .../selftests/kvm/arm64/arch_timer_edge_cases.c | 2 +- + tools/testing/selftests/kvm/arm64/vgic_irq.c | 14 +- + .../testing/selftests/kvm/arm64/vgic_lpi_stress.c | 8 +- + tools/testing/selftests/kvm/demand_paging_test.c | 2 +- + tools/testing/selftests/kvm/dirty_log_perf_test.c | 4 +- + tools/testing/selftests/kvm/dirty_log_test.c | 15 +- + .../testing/selftests/kvm/hardware_disable_test.c | 109 +++---- + tools/testing/selftests/kvm/include/kvm_syscalls.h | 55 ++++ + tools/testing/selftests/kvm/include/kvm_util.h | 21 ++ + tools/testing/selftests/kvm/include/proc_util.h | 11 + + tools/testing/selftests/kvm/include/test_util.h | 26 +- + tools/testing/selftests/kvm/include/x86/evmcs.h | 46 +-- + .../selftests/kvm/include/x86/kvm_util_arch.h | 4 +- + .../testing/selftests/kvm/include/x86/processor.h | 54 ++- + tools/testing/selftests/kvm/include/x86/vmx.h | 69 ++-- + tools/testing/selftests/kvm/irq_test.c | 362 +++++++++++++++++++++ + tools/testing/selftests/kvm/irqfd_test.c | 4 +- + tools/testing/selftests/kvm/kvm_page_table_test.c | 6 +- + tools/testing/selftests/kvm/lib/assert.c | 10 +- + tools/testing/selftests/kvm/lib/kvm_util.c | 52 ++- + tools/testing/selftests/kvm/lib/memstress.c | 12 +- + tools/testing/selftests/kvm/lib/proc_util.c | 54 +++ + tools/testing/selftests/kvm/lib/test_util.c | 41 ++- + tools/testing/selftests/kvm/lib/userfaultfd_util.c | 7 +- + tools/testing/selftests/kvm/lib/x86/processor.c | 14 + + tools/testing/selftests/kvm/lib/x86/svm.c | 62 ++-- + tools/testing/selftests/kvm/lib/x86/ucall.c | 32 +- + tools/testing/selftests/kvm/lib/x86/vmx.c | 2 +- + tools/testing/selftests/kvm/memslot_perf_test.c | 4 +- + tools/testing/selftests/kvm/mmu_stress_test.c | 19 +- + .../testing/selftests/kvm/pre_fault_memory_test.c | 4 +- + tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 4 +- + tools/testing/selftests/kvm/rseq_test.c | 16 +- + tools/testing/selftests/kvm/s390/memop.c | 4 +- + .../testing/selftests/kvm/set_memory_region_test.c | 6 +- + tools/testing/selftests/kvm/steal_time.c | 39 +-- + tools/testing/selftests/kvm/vm_types_test.c | 48 +++ + .../selftests/kvm/x86/evmcs_smm_controls_test.c | 5 +- + .../testing/selftests/kvm/x86/fix_hypercall_test.c | 1 - + tools/testing/selftests/kvm/x86/hyperv_clock.c | 4 +- + tools/testing/selftests/kvm/x86/hyperv_evmcs.c | 2 +- + tools/testing/selftests/kvm/x86/hyperv_ipi.c | 32 +- + tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c | 30 +- + .../testing/selftests/kvm/x86/pmu_counters_test.c | 231 +++++++------ + .../selftests/kvm/x86/pmu_event_filter_test.c | 4 +- + .../kvm/x86/private_mem_conversions_test.c | 4 +- + .../selftests/kvm/x86/private_mem_kvm_exits_test.c | 7 +- + .../selftests/kvm/x86/recalc_apic_map_test.c | 5 +- + .../kvm/x86/save_restore_pf_stress_test.c | 288 ++++++++++++++++ + tools/testing/selftests/kvm/x86/set_sregs_test.c | 81 +++-- + tools/testing/selftests/kvm/x86/sev_dbg_test.c | 2 +- + tools/testing/selftests/kvm/x86/sev_init2_tests.c | 4 - + .../testing/selftests/kvm/x86/sev_migrate_tests.c | 4 +- + tools/testing/selftests/kvm/x86/smm_test.c | 5 +- + tools/testing/selftests/kvm/x86/sync_regs_test.c | 5 +- + tools/testing/selftests/kvm/x86/tsc_scaling_sync.c | 4 +- + .../kvm/x86/vmx_invalid_nested_guest_state.c | 124 +++++-- + tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 33 +- + tools/testing/selftests/kvm/x86/xen_shinfo_test.c | 10 +- + virt/kvm/Kconfig | 6 +- + virt/kvm/guest_memfd.c | 73 ++--- + virt/kvm/guest_memfd.h | 34 ++ + virt/kvm/kvm_main.c | 22 +- + virt/kvm/kvm_mm.h | 27 -- + 111 files changed, 2887 insertions(+), 1497 deletions(-) + create mode 100644 arch/x86/include/asm/kvm-x86-nested-ops.h + create mode 100644 tools/testing/selftests/kvm/include/proc_util.h + create mode 100644 tools/testing/selftests/kvm/irq_test.c + create mode 100644 tools/testing/selftests/kvm/lib/proc_util.c + create mode 100644 tools/testing/selftests/kvm/vm_types_test.c + create mode 100644 tools/testing/selftests/kvm/x86/save_restore_pf_stress_test.c + create mode 100644 virt/kvm/guest_memfd.h +$ git am -3 ../patches/0001-KVM-selftests-Fix-up-semantic-changes.patch +Applying: KVM: selftests: Fix up semantic changes +Using index info to reconstruct a base tree... +M tools/testing/selftests/kvm/lib/kvm_util.c +Falling back to patching base and 3-way merge... +Auto-merging tools/testing/selftests/kvm/lib/kvm_util.c +No changes -- Patch already applied. +Merging xen-tip/linux-next (d330fb86a7170 xenbus: Unregister reboot notifier on init failure) +$ git merge -m Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git xen-tip/linux-next +Already up to date. +Merging percpu/for-next (8f0b4cce4481f Linux 6.19-rc1) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu.git percpu/for-next +Already up to date. +Merging workqueues/for-next (7e2f2a377ac9f workqueue: Use raise_softirq() to trigger softirq in irq_work handler) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git workqueues/for-next +Auto-merging kernel/workqueue.c +Merge made by the 'ort' strategy. + Documentation/core-api/workqueue.rst | 2 +- + kernel/workqueue.c | 338 +++++++++++++++++++++++++---------- + tools/workqueue/wq_dump.py | 16 +- + tools/workqueue/wq_monitor.py | 6 +- + 4 files changed, 252 insertions(+), 110 deletions(-) +Merging sched-ext/for-next (4fb8d6379d2c7 sched_ext: Fix nonexistent field in sched-ext.rst example) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git sched-ext/for-next +Auto-merging include/linux/cgroup.h +Auto-merging init/init_task.c +Auto-merging kernel/Kconfig.preempt +Auto-merging kernel/rcu/tree.c +Auto-merging kernel/rcu/tree_exp.h +Auto-merging kernel/rcu/tree_stall.h +Auto-merging kernel/sched/core.c +Auto-merging kernel/sched/sched.h +Merge made by the 'ort' strategy. + Documentation/scheduler/sched-ext.rst | 19 +- + include/linux/cgroup.h | 26 + + include/linux/sched/ext.h | 61 +- + include/trace/events/sched_ext.h | 28 + + init/init_task.c | 1 + + kernel/Kconfig.preempt | 1 + + kernel/cgroup/cgroup.c | 93 +- + kernel/rcu/tree.c | 3 + + kernel/rcu/tree_exp.h | 5 +- + kernel/rcu/tree_stall.h | 13 +- + kernel/sched/build_policy.c | 3 + + kernel/sched/core.c | 49 +- + kernel/sched/ext/arena.c | 16 +- + kernel/sched/ext/cid.c | 730 +++- + kernel/sched/ext/cid.h | 72 +- + kernel/sched/ext/ext.c | 4071 ++++++++++---------- + kernel/sched/ext/idle.c | 117 +- + kernel/sched/ext/inlines.h | 138 + + kernel/sched/ext/internal.h | 827 +++- + kernel/sched/ext/sub.c | 2681 +++++++++++++ + kernel/sched/ext/sub.h | 232 ++ + kernel/sched/ext/types.h | 88 +- + kernel/sched/idle.c | 8 +- + kernel/sched/sched.h | 40 +- + tools/sched_ext/include/scx/cid.bpf.h | 77 + + tools/sched_ext/include/scx/common.bpf.h | 32 +- + tools/sched_ext/include/scx/compat.bpf.h | 42 +- + tools/sched_ext/include/scx/compat.h | 51 +- + tools/sched_ext/include/scx/enum_defs.autogen.h | 69 +- + tools/sched_ext/include/scx/enums.autogen.bpf.h | 9 +- + tools/sched_ext/include/scx/enums.autogen.h | 3 +- + tools/sched_ext/scx_central.c | 2 +- + tools/sched_ext/scx_cpu0.c | 4 +- + tools/sched_ext/scx_flatcg.bpf.c | 22 +- + tools/sched_ext/scx_flatcg.c | 6 +- + tools/sched_ext/scx_pair.bpf.c | 138 +- + tools/sched_ext/scx_pair.c | 2 +- + tools/sched_ext/scx_qmap.bpf.c | 1024 ++++- + tools/sched_ext/scx_qmap.c | 336 +- + tools/sched_ext/scx_qmap.h | 153 +- + tools/sched_ext/scx_sdt.c | 4 +- + tools/sched_ext/scx_simple.c | 4 +- + tools/sched_ext/scx_userland.c | 13 +- + .../testing/selftests/sched_ext/allowed_cpus.bpf.c | 49 +- + .../selftests/sched_ext/ddsp_bogus_dsq_fail.bpf.c | 20 +- + .../selftests/sched_ext/ddsp_vtimelocal_fail.bpf.c | 13 +- + tools/testing/selftests/sched_ext/exit.c | 1 + + tools/testing/selftests/sched_ext/numa.bpf.c | 28 +- + tools/testing/selftests/sched_ext/prog_run.c | 36 +- + 49 files changed, 8856 insertions(+), 2604 deletions(-) + create mode 100644 kernel/sched/ext/inlines.h + create mode 100644 kernel/sched/ext/sub.c + create mode 100644 kernel/sched/ext/sub.h +Merging drivers-x86/for-next (54745d563114b platform/x86: think-lmi: Fix current password length check) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git drivers-x86/for-next +Auto-merging MAINTAINERS +Auto-merging drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c +Auto-merging drivers/platform/x86/amd/pmc/pmc.c +Auto-merging drivers/platform/x86/asus-armoury.h +Auto-merging drivers/platform/x86/asus-wmi.c +Auto-merging drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +Auto-merging drivers/platform/x86/lenovo/thinkpad_acpi.c +Auto-merging include/linux/amd-pmf-io.h +Merge made by the 'ort' strategy. + Documentation/ABI/testing/amdpmf-interface | 73 +++ + .../ABI/testing/sysfs-driver-lenovo-yb9-kbdock | 19 + + .../ABI/testing/sysfs-driver-uniwill-laptop | 25 + + .../admin-guide/laptops/thinkpad-acpi.rst | 24 + + .../admin-guide/laptops/uniwill-laptop.rst | 27 + + Documentation/arch/x86/amd_hsmp.rst | 35 +- + MAINTAINERS | 17 +- + arch/x86/include/uapi/asm/amd_hsmp.h | 222 ++++++- + arch/x86/platform/olpc/olpc-xo15-sci.c | 5 - + drivers/char/sonypi.c | 2 - + drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 13 +- + drivers/platform/arm64/qcom-hamoa-ec.c | 4 +- + drivers/platform/mellanox/mlxbf-bootctl.c | 1 + + drivers/platform/mellanox/mlxbf-pmc.c | 10 +- + drivers/platform/surface/surface_acpi_notify.c | 6 +- + drivers/platform/surface/surface_aggregator_hub.c | 9 +- + .../platform/surface/surface_aggregator_tabletsw.c | 9 +- + drivers/platform/surface/surfacepro3_button.c | 8 +- + drivers/platform/x86/Kconfig | 1 - + drivers/platform/x86/acer-wmi.c | 4 +- + drivers/platform/x86/amd/Kconfig | 11 + + drivers/platform/x86/amd/Makefile | 1 + + drivers/platform/x86/amd/amd_halo_led.c | 315 ++++++++++ + drivers/platform/x86/amd/hsmp/acpi.c | 221 ++++++- + drivers/platform/x86/amd/hsmp/hsmp.c | 304 ++++++++- + drivers/platform/x86/amd/hsmp/hsmp.h | 19 +- + drivers/platform/x86/amd/hsmp/hwmon.c | 3 + + drivers/platform/x86/amd/hsmp/plat.c | 38 +- + drivers/platform/x86/amd/pmc/mp1_stb.c | 83 ++- + drivers/platform/x86/amd/pmc/pmc-quirks.c | 8 + + drivers/platform/x86/amd/pmc/pmc.c | 9 +- + drivers/platform/x86/amd/pmf/Kconfig | 10 + + drivers/platform/x86/amd/pmf/Makefile | 4 +- + drivers/platform/x86/amd/pmf/core.c | 261 +++----- + drivers/platform/x86/amd/pmf/metrics.c | 330 ++++++++++ + drivers/platform/x86/amd/pmf/pmf.h | 270 +++++++- + drivers/platform/x86/amd/pmf/spc.c | 72 +-- + drivers/platform/x86/amd/pmf/tee-if.c | 13 +- + drivers/platform/x86/amd/pmf/util.c | 153 +++++ + drivers/platform/x86/asus-armoury.c | 66 +- + drivers/platform/x86/asus-armoury.h | 150 +++++ + drivers/platform/x86/asus-laptop.c | 9 +- + drivers/platform/x86/asus-nb-wmi.c | 1 + + drivers/platform/x86/asus-wireless.c | 11 +- + drivers/platform/x86/asus-wmi.c | 30 +- + drivers/platform/x86/dell/dell-smbios-base.c | 6 +- + drivers/platform/x86/dell/dell-smbios-smm.c | 8 +- + drivers/platform/x86/dell/dell-smbios-wmi.c | 105 ++-- + drivers/platform/x86/dell/dell-smbios.h | 4 +- + drivers/platform/x86/dell/dell-wmi-base.c | 19 +- + drivers/platform/x86/dell/dell-wmi-ddv.c | 22 +- + drivers/platform/x86/dell/dell-wmi-privacy.c | 4 +- + .../x86/dell/dell-wmi-sysman/biosattr-interface.c | 1 - + .../x86/dell/dell-wmi-sysman/dell-wmi-sysman.h | 2 +- + drivers/platform/x86/eeepc-laptop.c | 7 +- + drivers/platform/x86/fujitsu-laptop.c | 18 +- + drivers/platform/x86/fujitsu-tablet.c | 13 +- + drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 18 +- + drivers/platform/x86/hp/hp-bioscfg/bioscfg.h | 8 + + .../platform/x86/hp/hp-bioscfg/enum-attributes.c | 15 +- + .../platform/x86/hp/hp-bioscfg/int-attributes.c | 6 +- + .../x86/hp/hp-bioscfg/order-list-attributes.c | 14 +- + .../x86/hp/hp-bioscfg/passwdobj-attributes.c | 19 +- + .../platform/x86/hp/hp-bioscfg/spmobj-attributes.c | 4 +- + .../platform/x86/hp/hp-bioscfg/string-attributes.c | 6 +- + drivers/platform/x86/hp/hp-wmi.c | 421 ++++++++++--- + drivers/platform/x86/huawei-wmi.c | 99 +++ + drivers/platform/x86/intel/int1092/intel_sar.c | 32 +- + drivers/platform/x86/intel/ishtp_eclite.c | 5 +- + drivers/platform/x86/intel/pmc/core.c | 2 +- + .../x86/intel/speed_select_if/isst_tpmi_core.c | 80 ++- + drivers/platform/x86/lenovo/Kconfig | 14 + + drivers/platform/x86/lenovo/Makefile | 1 + + drivers/platform/x86/lenovo/ideapad-laptop.c | 2 +- + drivers/platform/x86/lenovo/think-lmi.c | 19 +- + drivers/platform/x86/lenovo/thinkpad_acpi.c | 131 +++- + drivers/platform/x86/lenovo/yb9-kbdock.c | 323 ++++++++++ + drivers/platform/x86/lenovo/ymc.c | 27 +- + drivers/platform/x86/lg-laptop.c | 652 ++++++++++++------- + drivers/platform/x86/msi-ec.c | 82 +++ + drivers/platform/x86/msi-wmi.c | 97 ++- + drivers/platform/x86/oxpec.c | 7 + + drivers/platform/x86/panasonic-laptop.c | 15 +- + drivers/platform/x86/redmi-wmi.c | 26 +- + drivers/platform/x86/samsung-galaxybook.c | 1 + + drivers/platform/x86/sony-laptop.c | 5 +- + drivers/platform/x86/topstar-laptop.c | 2 - + drivers/platform/x86/toshiba_acpi.c | 6 +- + drivers/platform/x86/toshiba_bluetooth.c | 6 +- + drivers/platform/x86/toshiba_haps.c | 4 +- + drivers/platform/x86/uniwill/uniwill-acpi.c | 692 +++++++++++++++++++-- + drivers/platform/x86/uniwill/uniwill-wmi.h | 2 + + drivers/platform/x86/xo15-ebook.c | 8 +- + drivers/power/supply/surface_battery.c | 11 +- + drivers/power/supply/surface_charger.c | 7 +- + include/linux/amd-pmf-io.h | 11 +- + include/linux/platform_data/x86/asus-wmi.h | 5 + + include/uapi/linux/amd-pmf.h | 204 ++++++ + tools/platform/x86/amd/Makefile | 60 ++ + tools/platform/x86/amd/test-pmf.c | 142 +++++ + 100 files changed, 5355 insertions(+), 1051 deletions(-) + create mode 100644 Documentation/ABI/testing/amdpmf-interface + create mode 100644 Documentation/ABI/testing/sysfs-driver-lenovo-yb9-kbdock + create mode 100644 drivers/platform/x86/amd/amd_halo_led.c + create mode 100644 drivers/platform/x86/amd/pmf/metrics.c + create mode 100644 drivers/platform/x86/amd/pmf/util.c + create mode 100644 drivers/platform/x86/lenovo/yb9-kbdock.c + create mode 100644 include/uapi/linux/amd-pmf.h + create mode 100644 tools/platform/x86/amd/Makefile + create mode 100644 tools/platform/x86/amd/test-pmf.c +Merging chrome-platform/for-next (81c1c0cb68a13 platform/chrome: of_hw_prober: Add delay for hana trackpads) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git chrome-platform/for-next +Already up to date. +Merging chrome-platform-firmware/for-firmware-next (a58a57a1076f8 firmware: coreboot: Validate table bounds) +$ git merge -m Merge branch 'for-firmware-next' of https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git chrome-platform-firmware/for-firmware-next +Already up to date. +Merging hsi/for-next (e81250ec6b692 hsi: omap_ssi_core: fix missing DMA mask setup for SSI controller device) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git hsi/for-next +Auto-merging drivers/hsi/controllers/omap_ssi_port.c +Merge made by the 'ort' strategy. + drivers/hsi/clients/nokia-modem.c | 5 +---- + drivers/hsi/controllers/omap_ssi_core.c | 14 ++++++++++---- + drivers/hsi/controllers/omap_ssi_port.c | 6 ------ + 3 files changed, 11 insertions(+), 14 deletions(-) +Merging leds-lj/for-leds-next (f8cca63a0a4f3 leds: is31fl319x: Modernize registration) +$ git merge -m Merge branch 'for-leds-next' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git leds-lj/for-leds-next +Auto-merging MAINTAINERS +Auto-merging drivers/leds/leds-gpio.c +Auto-merging drivers/leds/leds-is31fl319x.c +Auto-merging drivers/leds/rgb/leds-pwm-multicolor.c +Merge made by the 'ort' strategy. + .../devicetree/bindings/leds/adi,ltc3220.yaml | 133 +++++ + .../bindings/leds/backlight/ti,tps65217.yaml | 170 ++++++ + .../bindings/leds/backlight/tps65217-backlight.txt | 27 - + .../bindings/leds/brcm,bcm6358-leds.yaml | 96 ++++ + Documentation/devicetree/bindings/leds/common.yaml | 12 + + .../devicetree/bindings/leds/lacie,ns2-leds.yaml | 85 +++ + .../devicetree/bindings/leds/leds-bcm6358.txt | 143 ----- + .../devicetree/bindings/leds/leds-ns2.txt | 35 -- + .../bindings/leds/leds-pwm-multicolor.yaml | 4 + + .../devicetree/bindings/leds/nxp,pca963x.yaml | 108 +++- + .../devicetree/bindings/regulator/tps65217.txt | 78 --- + Documentation/leds/leds-st1202.rst | 9 +- + MAINTAINERS | 8 + + drivers/leds/Kconfig | 14 + + drivers/leds/Makefile | 1 + + drivers/leds/blink/leds-bcm63138.c | 4 +- + drivers/leds/leds-gpio.c | 53 +- + drivers/leds/leds-is31fl319x.c | 61 +-- + drivers/leds/leds-ltc3220.c | 586 +++++++++++++++++++++ + drivers/leds/leds-pca9532.c | 18 +- + drivers/leds/leds-pca963x.c | 193 +++++-- + drivers/leds/leds-st1202.c | 102 ++-- + drivers/leds/rgb/leds-lp5860-core.c | 3 +- + drivers/leds/rgb/leds-lp5860-spi.c | 10 +- + drivers/leds/rgb/leds-pwm-multicolor.c | 2 + + drivers/leds/trigger/ledtrig-netdev.c | 46 +- + include/linux/leds.h | 6 + + 27 files changed, 1567 insertions(+), 440 deletions(-) + create mode 100644 Documentation/devicetree/bindings/leds/adi,ltc3220.yaml + create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml + delete mode 100644 Documentation/devicetree/bindings/leds/backlight/tps65217-backlight.txt + create mode 100644 Documentation/devicetree/bindings/leds/brcm,bcm6358-leds.yaml + create mode 100644 Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml + delete mode 100644 Documentation/devicetree/bindings/leds/leds-bcm6358.txt + delete mode 100644 Documentation/devicetree/bindings/leds/leds-ns2.txt + delete mode 100644 Documentation/devicetree/bindings/regulator/tps65217.txt + create mode 100644 drivers/leds/leds-ltc3220.c +Merging ipmi/for-next (ae84a25365770 ipmi:msghandler: Cancel work cleanly on an error) +$ git merge -m Merge branch 'for-next' of https://github.com/cminyard/linux-ipmi.git ipmi/for-next +Merge made by the 'ort' strategy. + drivers/char/ipmi/Kconfig | 9 ++++ + drivers/char/ipmi/ipmb_dev_int.c | 9 ++-- + drivers/char/ipmi/ipmi_msghandler.c | 4 ++ + drivers/char/ipmi/ipmi_si_intf.c | 79 ++++++++++++++++++++++++++++-------- + drivers/char/ipmi/ipmi_si_platform.c | 4 +- + drivers/char/ipmi/ipmi_ssif.c | 4 +- + 6 files changed, 85 insertions(+), 24 deletions(-) +Merging driver-core/driver-core-next (3b5ea0f078e1b rust: pci: expose the allocated interrupt type) +$ git merge -m Merge branch 'driver-core-next' of https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git driver-core/driver-core-next +Already up to date. +Merging usb/usb-next (e1e6e541c5c9c Merge tag 'thunderbolt-for-v7.3-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next) +$ git merge -m Merge branch 'usb-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb/usb-next +Auto-merging Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml +Auto-merging drivers/net/thunderbolt/main.c +Auto-merging drivers/power/supply/power_supply_core.c +Auto-merging include/linux/power_supply.h +Auto-merging rust/kernel/usb.rs +Merge made by the 'ort' strategy. + Documentation/ABI/obsolete/sysfs-bus-usb | 2 +- + .../ABI/testing/configfs-thunderbolt_stream | 15 + + .../ABI/testing/configfs-usb-gadget-uac1_legacy | 3 - + Documentation/ABI/testing/sysfs-bus-usb | 2 +- + Documentation/admin-guide/thunderbolt.rst | 4 +- + .../devicetree/bindings/usb/aspeed,dwc3.yaml | 93 +++ + .../devicetree/bindings/usb/cdns,usb3.yaml | 3 + + .../devicetree/bindings/usb/generic-ehci.yaml | 7 + + .../devicetree/bindings/usb/generic-ohci.yaml | 5 + + .../devicetree/bindings/usb/mediatek,mtu3.yaml | 6 +- + .../devicetree/bindings/usb/qcom,snps-dwc3.yaml | 9 + + .../devicetree/bindings/usb/renesas,usbhs.yaml | 1 + + .../devicetree/bindings/usb/ti,tps6598x.yaml | 6 +- + Documentation/translations/zh_CN/usb/CREDITS | 147 +++-- + Documentation/translations/zh_CN/usb/acm.rst | 62 +- + .../translations/zh_CN/usb/authorization.rst | 79 ++- + Documentation/translations/zh_CN/usb/chipidea.rst | 63 +- + Documentation/translations/zh_CN/usb/dwc3.rst | 37 +- + Documentation/translations/zh_CN/usb/ehci.rst | 249 ++++---- + Documentation/translations/zh_CN/usb/index.rst | 18 +- + Documentation/translations/zh_CN/usb/usbmon.rst | 332 +++++------ + Documentation/usb/functionfs.rst | 80 +++ + Documentation/usb/gadget-testing.rst | 3 - + drivers/media/usb/as102/as102_usb_drv.c | 75 +-- + drivers/net/thunderbolt/main.c | 4 +- + drivers/net/usb/pegasus.c | 54 +- + drivers/net/usb/pegasus.h | 3 - + drivers/net/wireless/ath/ath9k/hif_usb.c | 12 +- + drivers/net/wireless/ath/ath9k/hif_usb.h | 2 +- + drivers/target/target_core_fabric_configfs.c | 8 + + drivers/thunderbolt/debugfs.c | 28 +- + drivers/thunderbolt/dma_test.c | 4 +- + drivers/thunderbolt/domain.c | 30 +- + drivers/thunderbolt/nhi.c | 55 +- + drivers/thunderbolt/nhi.h | 21 +- + drivers/thunderbolt/nhi_regs.h | 4 + + drivers/thunderbolt/pci.c | 54 +- + drivers/thunderbolt/stream.c | 268 +++++++-- + drivers/thunderbolt/switch.c | 11 +- + drivers/thunderbolt/tb.c | 21 + + drivers/thunderbolt/tb.h | 1 + + drivers/thunderbolt/tunnel.c | 13 +- + drivers/thunderbolt/xdomain.c | 4 + + drivers/usb/atm/xusbatm.c | 6 +- + drivers/usb/c67x00/c67x00-sched.c | 4 +- + drivers/usb/cdns3/cdns3-plat.c | 4 +- + drivers/usb/chipidea/ci_hdrc_imx.c | 2 +- + drivers/usb/class/usbtmc.c | 2 - + drivers/usb/core/config.c | 2 +- + drivers/usb/core/devices.c | 7 +- + drivers/usb/core/devio.c | 15 +- + drivers/usb/core/driver.c | 12 +- + drivers/usb/core/hub.c | 17 +- + drivers/usb/dwc2/core_intr.c | 3 +- + drivers/usb/dwc2/gadget.c | 11 +- + drivers/usb/dwc3/core.c | 99 +++- + drivers/usb/dwc3/core.h | 7 +- + drivers/usb/dwc3/dwc3-am62.c | 13 +- + drivers/usb/dwc3/dwc3-qcom.c | 2 +- + drivers/usb/dwc3/dwc3-xilinx.c | 18 +- + drivers/usb/dwc3/gadget.c | 16 +- + drivers/usb/dwc3/host.c | 5 +- + drivers/usb/gadget/configfs.c | 8 +- + drivers/usb/gadget/function/f_fs.c | 163 +++++- + drivers/usb/gadget/function/f_mass_storage.c | 3 - + drivers/usb/gadget/function/f_midi2.c | 2 + + drivers/usb/gadget/function/f_tcm.c | 25 +- + drivers/usb/gadget/function/f_uac1.c | 13 +- + drivers/usb/gadget/function/f_uac1_legacy.c | 56 -- + drivers/usb/gadget/function/f_uac2.c | 13 +- + drivers/usb/gadget/function/f_uvc.c | 7 +- + drivers/usb/gadget/function/u_audio.c | 36 +- + drivers/usb/gadget/function/u_fs.h | 8 +- + drivers/usb/gadget/function/u_uac1_legacy.h | 3 - + drivers/usb/gadget/function/uvc_video.c | 2 +- + drivers/usb/gadget/legacy/inode.c | 17 +- + drivers/usb/gadget/legacy/nokia.c | 2 +- + drivers/usb/gadget/udc/Kconfig | 2 +- + drivers/usb/gadget/udc/aspeed_udc.c | 50 +- + drivers/usb/gadget/udc/at91_udc.c | 20 +- + drivers/usb/gadget/udc/fsl_qe_udc.c | 8 +- + drivers/usb/gadget/udc/pch_udc.c | 1 - + drivers/usb/gadget/udc/r8a66597-udc.c | 1 - + drivers/usb/gadget/udc/snps_udc_plat.c | 5 +- + drivers/usb/host/fsl-mph-dr-of.c | 7 +- + drivers/usb/host/ohci-dbg.c | 9 +- + drivers/usb/host/xhci-caps.h | 41 +- + drivers/usb/host/xhci-dbgtty.c | 25 +- + drivers/usb/host/xhci-debugfs.c | 3 +- + drivers/usb/host/xhci-histb.c | 2 +- + drivers/usb/host/xhci-hub.c | 6 +- + drivers/usb/host/xhci-mem.c | 7 +- + drivers/usb/host/xhci-mtk.c | 4 +- + drivers/usb/host/xhci-pci.c | 4 +- + drivers/usb/host/xhci-plat.c | 2 +- + drivers/usb/host/xhci-ring.c | 496 ++++++++-------- + drivers/usb/host/xhci-tegra.c | 5 +- + drivers/usb/host/xhci.c | 43 +- + drivers/usb/host/xhci.h | 21 +- + drivers/usb/misc/cypress_cy7c63.c | 8 +- + drivers/usb/misc/usb-ljca.c | 3 + + drivers/usb/misc/usbtest.c | 1 + + drivers/usb/misc/uss720.c | 1 + + drivers/usb/mtu3/mtu3_core.c | 11 +- + drivers/usb/mtu3/mtu3_host.c | 26 + + drivers/usb/mtu3/mtu3_plat.c | 3 +- + drivers/usb/musb/Kconfig | 1 - + drivers/usb/musb/musb_host.c | 14 +- + drivers/usb/phy/phy-fsl-usb.c | 52 +- + drivers/usb/phy/phy-fsl-usb.h | 6 +- + drivers/usb/renesas_usbhs/common.c | 6 +- + drivers/usb/serial/digi_acceleport.c | 325 +++++------ + drivers/usb/serial/keyspan_pda.c | 1 - + drivers/usb/serial/metro-usb.c | 31 +- + drivers/usb/serial/option.c | 20 +- + drivers/usb/serial/pl2303.c | 108 +++- + drivers/usb/serial/pl2303.h | 2 +- + drivers/usb/serial/spcp8x5.c | 6 +- + drivers/usb/typec/altmodes/Kconfig | 1 + + drivers/usb/typec/altmodes/displayport.c | 18 +- + drivers/usb/typec/altmodes/thunderbolt.c | 6 + + drivers/usb/typec/class.c | 71 +++ + drivers/usb/typec/hd3ss3220.c | 2 +- + drivers/usb/typec/mux/tusb1046.c | 1 + + drivers/usb/typec/tcpm/tcpci.c | 12 +- + drivers/usb/typec/tcpm/tcpm.c | 636 ++++++++++++++++----- + drivers/usb/typec/tipd/core.c | 85 ++- + drivers/usb/typec/tipd/tps6598x.h | 10 +- + drivers/usb/typec/ucsi/debugfs.c | 5 +- + drivers/usb/typec/ucsi/ucsi.c | 21 +- + drivers/usb/typec/ucsi/ucsi.h | 1 + + drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 15 +- + include/linux/thunderbolt.h | 10 +- + include/linux/usb.h | 3 +- + include/linux/usb/pd.h | 53 +- + include/linux/usb/tcpci.h | 1 + + include/linux/usb/typec.h | 1 + + include/target/target_core_fabric.h | 2 + + include/uapi/linux/usb/functionfs.h | 24 + + rust/kernel/usb.rs | 35 +- + 140 files changed, 3136 insertions(+), 1765 deletions(-) + create mode 100644 Documentation/devicetree/bindings/usb/aspeed,dwc3.yaml +Merging thunderbolt/next (86feaba911f2f thunderbolt: Clamp DMA tunnel credits to what a hop register can hold) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git thunderbolt/next +Already up to date. +Merging usb-serial/usb-next (15734de99517b USB: serial: pl2303: add support for PL256X multi-port devices) +$ git merge -m Merge branch 'usb-next' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-serial/usb-next +Already up to date. +Merging tty/tty-next (8b0b29fdcb479 serial: imx: serialize imx_uart_ports[] lifetime) +$ git merge -m Merge branch 'tty-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty/tty-next +Auto-merging MAINTAINERS +Auto-merging arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +Auto-merging arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi +Auto-merging arch/arm64/boot/dts/mediatek/mt8390-tungsten-smarc.dtsi +Auto-merging arch/arm64/boot/dts/mediatek/mt8395-genio-common.dtsi +Auto-merging arch/powerpc/configs/ppc6xx_defconfig +Auto-merging drivers/tty/serial/8250/8250_of.c +Auto-merging drivers/tty/serial/amba-pl011.c +Auto-merging drivers/tty/serial/qcom_geni_serial.c +Auto-merging drivers/tty/serial/sc16is7xx.c +Auto-merging drivers/tty/tty_io.c +Auto-merging drivers/tty/vt/vt_ioctl.c +Merge made by the 'ort' strategy. + Documentation/devicetree/bindings/serial/8250.yaml | 8 +- + .../devicetree/bindings/serial/maxim,max310x.yaml | 92 +- + .../bindings/serial/snps-dw-apb-uart.yaml | 2 + + MAINTAINERS | 6 - + .../boot/dts/mediatek/mt6795-sony-xperia-m5.dts | 1 + + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 + + .../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 + + arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 2 + + arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + + .../boot/dts/mediatek/mt8192-asurada-hayato-r1.dts | 4 + + arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 1 + + arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 2 + + .../boot/dts/mediatek/mt8390-genio-common.dtsi | 2 + + .../boot/dts/mediatek/mt8390-grinn-genio-sbc.dtsi | 2 + + .../boot/dts/mediatek/mt8390-tungsten-smarc.dtsi | 2 + + .../boot/dts/mediatek/mt8395-genio-common.dtsi | 1 + + arch/powerpc/configs/ppc6xx_defconfig | 1 - + drivers/tty/Kconfig | 9 - + drivers/tty/Makefile | 2 - + drivers/tty/amiserial.c | 14 +- + drivers/tty/goldfish.c | 23 +- + drivers/tty/hvc/Kconfig | 2 +- + drivers/tty/ipwireless/Makefile | 9 - + drivers/tty/ipwireless/hardware.c | 1770 -------------------- + drivers/tty/ipwireless/hardware.h | 63 - + drivers/tty/ipwireless/main.c | 356 ---- + drivers/tty/ipwireless/main.h | 66 - + drivers/tty/ipwireless/network.c | 517 ------ + drivers/tty/ipwireless/network.h | 54 - + drivers/tty/ipwireless/setup_protocol.h | 109 -- + drivers/tty/ipwireless/tty.c | 627 ------- + drivers/tty/ipwireless/tty.h | 46 - + drivers/tty/serdev/core.c | 4 +- + drivers/tty/serial/8250/8250.h | 11 +- + drivers/tty/serial/8250/8250_bcm7271.c | 4 +- + drivers/tty/serial/8250/8250_core.c | 71 +- + drivers/tty/serial/8250/8250_dw.c | 2 +- + drivers/tty/serial/8250/8250_early.c | 19 +- + drivers/tty/serial/8250/8250_exar.c | 53 +- + drivers/tty/serial/8250/8250_hub6.c | 8 + + drivers/tty/serial/8250/8250_mtk.c | 7 +- + drivers/tty/serial/8250/8250_mxpcie.c | 627 +++++++ + drivers/tty/serial/8250/8250_of.c | 12 + + drivers/tty/serial/8250/8250_pci.c | 245 +-- + drivers/tty/serial/8250/8250_platform.c | 1 + + drivers/tty/serial/8250/8250_pnp.c | 309 ++-- + drivers/tty/serial/8250/8250_port.c | 321 +++- + drivers/tty/serial/8250/8250_rsa.c | 40 +- + drivers/tty/serial/8250/Kconfig | 10 + + drivers/tty/serial/8250/Makefile | 1 + + drivers/tty/serial/amba-pl011.c | 48 +- + drivers/tty/serial/bcm63xx_uart.c | 11 +- + drivers/tty/serial/cpm_uart.c | 9 +- + drivers/tty/serial/earlycon.c | 17 +- + drivers/tty/serial/imx.c | 39 +- + drivers/tty/serial/kgdboc.c | 2 +- + drivers/tty/serial/ma35d1_serial.c | 12 +- + drivers/tty/serial/max3100.c | 1 + + drivers/tty/serial/max310x.c | 101 +- + drivers/tty/serial/men_z135_uart.c | 7 +- + drivers/tty/serial/mpc52xx_uart.c | 8 + + drivers/tty/serial/mvebu-uart.c | 12 +- + drivers/tty/serial/pch_uart.c | 11 +- + drivers/tty/serial/qcom_geni_serial.c | 660 +++++--- + drivers/tty/serial/rp2.c | 2 +- + drivers/tty/serial/rsci.c | 3 - + drivers/tty/serial/sc16is7xx.c | 9 +- + drivers/tty/serial/serial_core.c | 167 +- + drivers/tty/serial/serial_mctrl_gpio.c | 3 - + drivers/tty/serial/sh-sci.c | 2 - + drivers/tty/serial/sprd_serial.c | 5 +- + drivers/tty/tty_io.c | 6 +- + drivers/tty/tty_jobctrl.c | 41 +- + drivers/tty/vt/vc_screen.c | 6 +- + drivers/tty/vt/vt_ioctl.c | 2 + + include/linux/goldfish.h | 24 - + include/linux/serial_8250.h | 17 +- + include/linux/serial_core.h | 9 + + include/trace/events/qcom_geni_serial.h | 7 +- + include/uapi/linux/serial.h | 1 + + include/uapi/linux/serial_core.h | 3 + + 81 files changed, 2061 insertions(+), 4726 deletions(-) + delete mode 100644 drivers/tty/ipwireless/Makefile + delete mode 100644 drivers/tty/ipwireless/hardware.c + delete mode 100644 drivers/tty/ipwireless/hardware.h + delete mode 100644 drivers/tty/ipwireless/main.c + delete mode 100644 drivers/tty/ipwireless/main.h + delete mode 100644 drivers/tty/ipwireless/network.c + delete mode 100644 drivers/tty/ipwireless/network.h + delete mode 100644 drivers/tty/ipwireless/setup_protocol.h + delete mode 100644 drivers/tty/ipwireless/tty.c + delete mode 100644 drivers/tty/ipwireless/tty.h + create mode 100644 drivers/tty/serial/8250/8250_mxpcie.c +Merging char-misc/char-misc-next (8992f32c57607 Merge tag 'coresight-next-v7.3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next) +$ git merge -m Merge branch 'char-misc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc/char-misc-next +Auto-merging .mailmap +Auto-merging Documentation/devicetree/bindings/vendor-prefixes.yaml +Auto-merging Documentation/hwmon/index.rst +Auto-merging MAINTAINERS +Auto-merging drivers/android/binder/process.rs +Auto-merging drivers/android/binder/rust_binder_main.rs +Auto-merging drivers/char/hw_random/imx-rngc.c +Auto-merging drivers/char/hw_random/omap-rng.c +Auto-merging drivers/char/hw_random/xgene-rng.c +Auto-merging drivers/char/tpm/tpm_i2c_nuvoton.c +Auto-merging drivers/hwmon/Kconfig +Auto-merging drivers/hwmon/Makefile +Auto-merging drivers/iio/accel/kionix-kx022a.c +Auto-merging drivers/iio/adc/ad7173.c +Auto-merging drivers/iio/adc/ade9000.c +Auto-merging drivers/iio/dac/rohm-bd79703.c +Auto-merging drivers/iio/frequency/adf4377.c +Auto-merging drivers/iio/health/max30102.c +Auto-merging drivers/iio/pressure/bmp280-core.c +Auto-merging drivers/iio/pressure/rohm-bm1390.c +Auto-merging drivers/misc/fastrpc.c +Auto-merging drivers/misc/pci_endpoint_test.c +CONFLICT (modify/delete): drivers/misc/sgi-xp/xpc_uv.c deleted in char-misc/char-misc-next and modified in HEAD. Version HEAD of drivers/misc/sgi-xp/xpc_uv.c left in tree. +Auto-merging drivers/nvmem/core.c +Auto-merging drivers/nvmem/internals.h +Auto-merging drivers/power/supply/ab8500_btemp.c +Auto-merging drivers/power/supply/ab8500_charger.c +Auto-merging drivers/power/supply/ab8500_fg.c +Auto-merging drivers/power/supply/axp20x_ac_power.c +Auto-merging drivers/power/supply/axp20x_usb_power.c +Auto-merging drivers/power/supply/axp288_fuel_gauge.c +Auto-merging drivers/power/supply/cpcap-battery.c +Auto-merging drivers/power/supply/cpcap-charger.c +Auto-merging drivers/power/supply/generic-adc-battery.c +Auto-merging drivers/power/supply/lp8788-charger.c +Auto-merging drivers/power/supply/max17040_battery.c +Auto-merging drivers/power/supply/mp2629_charger.c +Auto-merging drivers/power/supply/mt6370-charger.c +Auto-merging drivers/power/supply/qcom_smbx.c +Auto-merging drivers/power/supply/rn5t618_power.c +Auto-merging drivers/power/supply/sc27xx_fuel_gauge.c +Auto-merging drivers/power/supply/twl4030_charger.c +Auto-merging drivers/power/supply/twl6030_charger.c +Auto-merging drivers/thermal/qcom/qcom-spmi-adc-tm5.c +Auto-merging lib/vsprintf.c +Auto-merging rust/bindings/bindings_helper.h +Auto-merging rust/helpers/helpers.c +Auto-merging rust/kernel/miscdevice.rs +Auto-merging rust/kernel/sync/poll.rs +CONFLICT (content): Merge conflict in rust/kernel/sync/poll.rs +Auto-merging rust/kernel/task.rs +CONFLICT (content): Merge conflict in rust/kernel/task.rs +Auto-merging rust/uapi/uapi_helper.h +CONFLICT (content): Merge conflict in rust/uapi/uapi_helper.h +Auto-merging sound/soc/samsung/aries_wm8994.c +Auto-merging sound/soc/stm/stm32_adfsdm.c +Resolved 'rust/kernel/sync/poll.rs' using previous resolution. +Resolved 'rust/kernel/task.rs' using previous resolution. +Resolved 'rust/uapi/uapi_helper.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git rm -f drivers/misc/sgi-xp/xpc_uv.c +rm 'drivers/misc/sgi-xp/xpc_uv.c' +$ git commit --no-edit -v -a +[master 261c482f9a30e] Merge branch 'char-misc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git +$ git diff -M --stat --summary HEAD^.. + .mailmap | 2 + + Documentation/ABI/testing/sysfs-bus-iio | 31 +- + Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 | 2 +- + Documentation/ABI/testing/sysfs-bus-iio-flow | 21 + + Documentation/ABI/testing/sysfs-bus-iio-frequency | 11 + + .../ABI/testing/sysfs-bus-iio-frequency-adf4350 | 10 - + Documentation/ABI/testing/sysfs-class-issei | 73 + + .../testing/sysfs-devices-platform-stratix10-rsu | 58 + + Documentation/ABI/testing/sysfs-platform-dfl-port | 2 +- + Documentation/devicetree/bindings/iio/adc/adc.yaml | 41 + + .../devicetree/bindings/iio/adc/adi,ad4080.yaml | 2 + + .../devicetree/bindings/iio/adc/adi,ltc2378.yaml | 170 ++ + .../devicetree/bindings/iio/adc/avia-hx711.yaml | 21 + + .../bindings/iio/adc/mediatek,mt6359-auxadc.yaml | 3 +- + .../bindings/iio/adc/rockchip-saradc.yaml | 4 +- + .../devicetree/bindings/iio/adc/ti,ads112c14.yaml | 219 ++ + .../bindings/iio/adc/xlnx,versal-sysmon.yaml | 154 ++ + .../bindings/iio/chemical/sensirion,scd30.yaml | 3 +- + .../devicetree/bindings/iio/dac/adi,ad3530r.yaml | 16 +- + .../devicetree/bindings/iio/dac/adi,ad5686.yaml | 86 +- + .../devicetree/bindings/iio/dac/adi,ad5696.yaml | 79 +- + .../devicetree/bindings/iio/dac/adi,ad5791.yaml | 4 +- + .../bindings/iio/dac/microchip,mcp47a1.yaml | 50 + + .../bindings/iio/flow/sensirion,slf3s.yaml | 55 + + .../bindings/iio/frequency/adi,adf41513.yaml | 227 +++ + .../bindings/iio/imu/invensense,icm42600.yaml | 20 +- + .../iio/magnetometer/qstcorp,qmc5883l.yaml | 52 + + .../bindings/iio/magnetometer/qstcorp,qmc6308.yaml | 47 + + .../bindings/iio/proximity/st,vl53l0x.yaml | 2 +- + .../bindings/iio/temperature/ti,tmp117.yaml | 16 +- + .../bindings/interconnect/qcom,maili-rpmh.yaml | 127 ++ + .../bindings/interconnect/qcom,osm-l3.yaml | 2 + + .../bindings/interconnect/qcom,sc8280xp-rpmh.yaml | 101 +- + .../bindings/interconnect/qcom,x1e80100-rpmh.yaml | 72 + + .../devicetree/bindings/misc/qcom,fastrpc.yaml | 4 + + .../bindings/nvmem/airoha,smc-efuses.yaml | 67 + + .../bindings/nvmem/microchip,lan9662-otpc.yaml | 1 + + .../devicetree/bindings/nvmem/qcom,qfprom.yaml | 6 + + .../devicetree/bindings/vendor-prefixes.yaml | 2 + + Documentation/devicetree/bindings/w1/omap-hdq.txt | 22 - + Documentation/devicetree/bindings/w1/ti,hdq.yaml | 70 + + Documentation/driver-api/index.rst | 1 + + Documentation/driver-api/issei/index.rst | 16 + + Documentation/driver-api/issei/issei.rst | 135 ++ + Documentation/hwmon/index.rst | 1 + + Documentation/hwmon/socfpga-hwmon.rst | 34 + + Documentation/iio/adf41513.rst | 199 ++ + Documentation/iio/index.rst | 1 + + Documentation/misc-devices/amd-sbi.rst | 74 + + Documentation/userspace-api/ntsync.rst | 33 +- + Documentation/w1/masters/omap-hdq.rst | 2 +- + MAINTAINERS | 119 +- + drivers/accessibility/speakup/fakekey.c | 4 +- + drivers/accessibility/speakup/genmap.c | 3 +- + drivers/accessibility/speakup/i18n.c | 2 +- + drivers/accessibility/speakup/keyhelp.c | 27 +- + drivers/accessibility/speakup/kobjects.c | 14 +- + drivers/accessibility/speakup/main.c | 75 +- + drivers/accessibility/speakup/selection.c | 2 +- + drivers/accessibility/speakup/speakup.h | 10 +- + drivers/accessibility/speakup/speakup_acnt.h | 3 + + drivers/accessibility/speakup/speakup_decpc.c | 2 +- + drivers/accessibility/speakup/speakup_dtlk.h | 5 +- + drivers/accessibility/speakup/speakup_soft.c | 5 +- + drivers/accessibility/speakup/spk_types.h | 2 +- + drivers/accessibility/speakup/synth.c | 4 +- + drivers/accessibility/speakup/utils.h | 2 +- + drivers/android/Kconfig | 2 +- + drivers/android/binder/allocation.rs | 4 +- + drivers/android/binder/debug.rs | 76 + + drivers/android/binder/defs.rs | 8 +- + drivers/android/binder/freeze.rs | 125 +- + drivers/android/binder/netlink.rs | 117 ++ + drivers/android/binder/node.rs | 87 +- + drivers/android/binder/node/wrapper.rs | 2 +- + drivers/android/binder/page_range.rs | 8 +- + drivers/android/binder/process.rs | 226 ++- + drivers/android/binder/rust_binder_main.rs | 39 +- + drivers/android/binder/rust_binderfs.c | 3 + + drivers/android/binder/thread.rs | 296 +-- + drivers/android/binder/trace.rs | 4 +- + drivers/android/binder/transaction.rs | 131 +- + drivers/base/cacheinfo.c | 9 +- + drivers/bus/mhi/ep/main.c | 56 +- + drivers/bus/mhi/host/init.c | 4 +- + drivers/bus/mhi/host/main.c | 6 + + drivers/bus/mhi/host/pci_generic.c | 5 + + drivers/bus/mhi/host/pm.c | 71 +- + drivers/cdx/cdx.c | 7 +- + drivers/char/powernv-op-panel.c | 2 - + drivers/char/ppdev.c | 10 +- + drivers/char/tlclk.c | 36 +- + drivers/char/virtio_console.c | 196 +- + drivers/char/xilinx_hwicap/xilinx_hwicap.c | 5 +- + drivers/char/xillybus/xillybus_of.c | 5 +- + drivers/char/xillybus/xillybus_pcie.c | 5 +- + drivers/comedi/drivers/aio_iiro_16.c | 3 + + drivers/comedi/drivers/c6xdigio.c | 6 +- + drivers/comedi/drivers/das6402.c | 10 +- + drivers/comedi/drivers/dt2811.c | 7 +- + drivers/comedi/drivers/ni_at_a2150.c | 13 +- + drivers/comedi/drivers/ni_atmio.c | 14 +- + drivers/comedi/drivers/ni_atmio16d.c | 3 + + drivers/comedi/drivers/ni_pcimio.c | 5 +- + drivers/comedi/drivers/pcl711.c | 3 +- + drivers/comedi/drivers/pcl816.c | 3 +- + drivers/comedi/drivers/pcl818.c | 3 +- + drivers/comedi/drivers/pcmmio.c | 3 + + drivers/comedi/drivers/pcmuio.c | 5 +- + drivers/comedi/drivers/quatech_daqp_cs.c | 4 +- + drivers/counter/stm32-timer-cnt.c | 10 +- + drivers/counter/ti-ecap-capture.c | 2 +- + drivers/counter/ti-eqep.c | 2 +- + drivers/eisa/eisa-bus.c | 3 +- + drivers/extcon/extcon-adc-jack.c | 1 + + drivers/firmware/stratix10-rsu.c | 421 +++- + drivers/firmware/stratix10-svc.c | 139 +- + drivers/fpga/altera-cvp.c | 10 +- + drivers/fpga/dfl-fme-perf.c | 2 + + drivers/fpga/stratix10-soc.c | 21 +- + drivers/fpga/xilinx-pr-decoupler.c | 20 +- + drivers/fpga/zynq-fpga.c | 1 - + drivers/gpib/agilent_82350b/agilent_82350b.c | 9 +- + drivers/gpib/cb7210/cb7210.c | 8 +- + drivers/gpib/cec/cec_gpib.c | 4 +- + drivers/gpib/common/gpib_os.c | 21 +- + drivers/gpib/common/iblib.c | 3 - + drivers/gpib/fmh_gpib/fmh_gpib.c | 2 +- + drivers/gpib/hp_82341/hp_82341.c | 4 +- + drivers/gpib/include/amccs5933.h | 10 +- + drivers/gpib/ines/ines_gpib.c | 21 +- + drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 13 +- + drivers/gpib/tnt4882/mite.h | 4 +- + drivers/gpib/tnt4882/tnt4882_gpib.c | 4 +- + drivers/greybus/manifest.c | 2 + + drivers/hwmon/Kconfig | 12 +- + drivers/hwmon/Makefile | 1 + + drivers/hwmon/iio_hwmon.c | 1 + + drivers/hwmon/ntc_thermistor.c | 1 + + drivers/hwmon/sbtsi_temp.c | 152 +- + drivers/hwmon/socfpga-hwmon.c | 579 ++++++ + .../hwtracing/coresight/coresight-etm3x-sysfs.c | 15 +- + drivers/hwtracing/coresight/coresight-etm4x-cfg.c | 2 +- + drivers/hwtracing/coresight/coresight-etm4x-core.c | 59 +- + .../hwtracing/coresight/coresight-etm4x-sysfs.c | 6 +- + drivers/hwtracing/coresight/coresight-etm4x.h | 12 +- + drivers/hwtracing/ptt/hisi_ptt.c | 25 +- + drivers/iio/Kconfig | 1 + + drivers/iio/Makefile | 1 + + drivers/iio/TODO | 13 +- + drivers/iio/accel/adxl345_spi.c | 4 +- + drivers/iio/accel/adxl355_core.c | 3 +- + drivers/iio/accel/adxl355_spi.c | 4 +- + drivers/iio/accel/adxl367.c | 2 +- + drivers/iio/accel/adxl367_spi.c | 2 +- + drivers/iio/accel/adxl372_spi.c | 4 +- + drivers/iio/accel/adxl380_spi.c | 8 +- + drivers/iio/accel/bma180.c | 4 +- + drivers/iio/accel/bma220_core.c | 3 +- + drivers/iio/accel/bma220_spi.c | 2 +- + drivers/iio/accel/bma400_core.c | 3 +- + drivers/iio/accel/bma400_spi.c | 2 +- + drivers/iio/accel/bmc150-accel-core.c | 6 +- + drivers/iio/accel/bmc150-accel-spi.c | 18 +- + drivers/iio/accel/bmi088-accel-spi.c | 6 +- + drivers/iio/accel/dmard09.c | 7 + + drivers/iio/accel/fxls8962af-core.c | 2 + + drivers/iio/accel/fxls8962af-spi.c | 4 +- + drivers/iio/accel/hid-sensor-accel-3d.c | 68 +- + drivers/iio/accel/kionix-kx022a.c | 2 +- + drivers/iio/accel/kxsd9-spi.c | 2 +- + drivers/iio/accel/mma7455_spi.c | 4 +- + drivers/iio/accel/mma9551.c | 4 +- + drivers/iio/accel/mma9553.c | 5 +- + drivers/iio/accel/msa311.c | 2 +- + drivers/iio/accel/mxc4005.c | 5 +- + drivers/iio/accel/sca3000.c | 8 +- + drivers/iio/accel/sca3300.c | 4 +- + drivers/iio/accel/st_accel_spi.c | 40 +- + drivers/iio/accel/stk8312.c | 17 +- + drivers/iio/accel/stk8ba50.c | 14 +- + drivers/iio/adc/88pm886-gpadc.c | 2 +- + drivers/iio/adc/Kconfig | 78 +- + drivers/iio/adc/Makefile | 6 + + drivers/iio/adc/ad4000.c | 62 +- + drivers/iio/adc/ad4030.c | 14 +- + drivers/iio/adc/ad4080.c | 40 +- + drivers/iio/adc/ad4130.c | 12 +- + drivers/iio/adc/ad4134.c | 2 +- + drivers/iio/adc/ad4170-4.c | 6 +- + drivers/iio/adc/ad4851.c | 18 +- + drivers/iio/adc/ad7091r8.c | 6 +- + drivers/iio/adc/ad7124.c | 4 +- + drivers/iio/adc/ad7173.c | 26 +- + drivers/iio/adc/ad7191.c | 2 +- + drivers/iio/adc/ad7192.c | 10 +- + drivers/iio/adc/ad7266.c | 4 +- + drivers/iio/adc/ad7280a.c | 2 +- + drivers/iio/adc/ad7292.c | 2 +- + drivers/iio/adc/ad7298.c | 2 +- + drivers/iio/adc/ad7380.c | 36 +- + drivers/iio/adc/ad7476.c | 60 +- + drivers/iio/adc/ad7606_spi.c | 22 +- + drivers/iio/adc/ad7766.c | 12 +- + drivers/iio/adc/ad7768-1.c | 8 +- + drivers/iio/adc/ad7779.c | 6 +- + drivers/iio/adc/ad7780.c | 8 +- + drivers/iio/adc/ad7791.c | 10 +- + drivers/iio/adc/ad7793.c | 18 +- + drivers/iio/adc/ad7887.c | 2 +- + drivers/iio/adc/ad7923.c | 14 +- + drivers/iio/adc/ad7944.c | 6 +- + drivers/iio/adc/ad7949.c | 6 +- + drivers/iio/adc/ad9467.c | 14 +- + drivers/iio/adc/ade9000.c | 4 +- + drivers/iio/adc/at91_adc.c | 4 +- + drivers/iio/adc/envelope-detector.c | 1 + + drivers/iio/adc/hi8435.c | 2 +- + drivers/iio/adc/hx711.c | 98 +- + drivers/iio/adc/ltc2378.c | 857 ++++++++ + drivers/iio/adc/max1027.c | 12 +- + drivers/iio/adc/max1118.c | 6 +- + drivers/iio/adc/max11205.c | 4 +- + drivers/iio/adc/max11410.c | 2 +- + drivers/iio/adc/max1241.c | 9 +- + drivers/iio/adc/max14001.c | 4 +- + drivers/iio/adc/mcp320x.c | 26 +- + drivers/iio/adc/mcp3564.c | 24 +- + drivers/iio/adc/mcp3911.c | 14 +- + drivers/iio/adc/mt6323-auxadc.c | 313 +++ + drivers/iio/adc/rcar-gyroadc.c | 14 +- + drivers/iio/adc/rohm-bd79112.c | 2 +- + drivers/iio/adc/rtq6056.c | 4 +- + drivers/iio/adc/stm32-dfsdm-adc.c | 12 +- + drivers/iio/adc/ti-adc081c.c | 6 +- + drivers/iio/adc/ti-adc0832.c | 8 +- + drivers/iio/adc/ti-adc084s021.c | 8 +- + drivers/iio/adc/ti-adc108s102.c | 2 +- + drivers/iio/adc/ti-adc12138.c | 6 +- + drivers/iio/adc/ti-adc128s052.c | 24 +- + drivers/iio/adc/ti-adc161s626.c | 4 +- + drivers/iio/adc/ti-ads1015.c | 46 +- + drivers/iio/adc/ti-ads1018.c | 4 +- + drivers/iio/adc/ti-ads112c14.c | 1454 ++++++++++++++ + drivers/iio/adc/ti-ads124s08.c | 4 +- + drivers/iio/adc/ti-ads1298.c | 2 +- + drivers/iio/adc/ti-ads131e08.c | 6 +- + drivers/iio/adc/ti-ads131m02.c | 10 +- + drivers/iio/adc/ti-ads7950.c | 24 +- + drivers/iio/adc/ti-ads8688.c | 4 +- + drivers/iio/adc/ti-lmp92064.c | 2 +- + drivers/iio/adc/ti-tlc4541.c | 4 +- + drivers/iio/adc/ti-tsc2046.c | 25 +- + drivers/iio/adc/versal-sysmon-core.c | 1052 ++++++++++ + drivers/iio/adc/versal-sysmon-i2c.c | 134 ++ + drivers/iio/adc/versal-sysmon.c | 92 + + drivers/iio/adc/versal-sysmon.h | 120 ++ + drivers/iio/addac/ad74115.c | 2 +- + drivers/iio/addac/ad74413r.c | 2 +- + drivers/iio/afe/iio-rescale.c | 1 + + drivers/iio/amplifiers/ad8366.c | 26 +- + drivers/iio/amplifiers/ada4250.c | 2 +- + drivers/iio/buffer/industrialio-buffer-cb.c | 1 + + drivers/iio/buffer/industrialio-buffer-dmaengine.c | 42 +- + drivers/iio/buffer/industrialio-hw-consumer.c | 1 + + drivers/iio/chemical/bme680_i2c.c | 7 +- + drivers/iio/chemical/bme680_spi.c | 9 +- + drivers/iio/chemical/ccs811.c | 4 +- + drivers/iio/chemical/ens160_core.c | 2 +- + drivers/iio/chemical/ens160_spi.c | 2 +- + drivers/iio/chemical/scd30_core.c | 12 +- + drivers/iio/chemical/scd30_i2c.c | 4 +- + drivers/iio/chemical/scd30_serial.c | 4 +- + drivers/iio/chemical/sgp30.c | 3 + + drivers/iio/chemical/sps30_i2c.c | 4 +- + drivers/iio/chemical/sps30_serial.c | 4 +- + .../iio/common/hid-sensors/hid-sensor-attributes.c | 81 +- + .../iio/common/hid-sensors/hid-sensor-trigger.c | 7 +- + .../iio/common/hid-sensors/hid-sensor-trigger.h | 2 +- + .../iio/common/inv_sensors/inv_sensors_timestamp.c | 107 +- + drivers/iio/common/st_sensors/st_sensors_trigger.c | 4 +- + drivers/iio/dac/Kconfig | 61 +- + drivers/iio/dac/Makefile | 2 + + drivers/iio/dac/ad3530r.c | 359 +++- + drivers/iio/dac/ad5064.c | 32 +- + drivers/iio/dac/ad5360.c | 16 +- + drivers/iio/dac/ad5380.c | 32 +- + drivers/iio/dac/ad5446-spi.c | 62 +- + drivers/iio/dac/ad5449.c | 14 +- + drivers/iio/dac/ad5504.c | 4 +- + drivers/iio/dac/ad5624r_spi.c | 12 +- + drivers/iio/dac/ad5686-spi.c | 163 +- + drivers/iio/dac/ad5686.c | 311 ++- + drivers/iio/dac/ad5686.h | 63 +- + drivers/iio/dac/ad5696-i2c.c | 32 +- + drivers/iio/dac/ad5706r.c | 2 +- + drivers/iio/dac/ad5755.c | 10 +- + drivers/iio/dac/ad5758.c | 2 +- + drivers/iio/dac/ad5761.c | 8 +- + drivers/iio/dac/ad5764.c | 8 +- + drivers/iio/dac/ad5766.c | 4 +- + drivers/iio/dac/ad5770r.c | 2 +- + drivers/iio/dac/ad5791.c | 10 +- + drivers/iio/dac/ad7293.c | 2 +- + drivers/iio/dac/ad7303.c | 2 +- + drivers/iio/dac/ad8460.c | 1 + + drivers/iio/dac/ad8801.c | 4 +- + drivers/iio/dac/ad9739a.c | 2 +- + drivers/iio/dac/dpot-dac.c | 1 + + drivers/iio/dac/ltc1660.c | 4 +- + drivers/iio/dac/ltc2632.c | 44 +- + drivers/iio/dac/ltc2664.c | 4 +- + drivers/iio/dac/ltc2688.c | 2 +- + drivers/iio/dac/max22007.c | 2 +- + drivers/iio/dac/max5522.c | 31 +- + drivers/iio/dac/mcf54415_dac.c | 180 ++ + drivers/iio/dac/mcp47a1.c | 166 ++ + drivers/iio/dac/mcp4821.c | 12 +- + drivers/iio/dac/mcp4922.c | 8 +- + drivers/iio/dac/rohm-bd79703.c | 8 +- + drivers/iio/dac/ti-dac082s085.c | 12 +- + drivers/iio/dac/ti-dac7311.c | 6 +- + drivers/iio/dac/ti-dac7612.c | 2 +- + drivers/iio/filter/admv8818.c | 2 +- + drivers/iio/flow/Kconfig | 22 + + drivers/iio/flow/Makefile | 7 + + drivers/iio/flow/slf3s.c | 542 +++++ + drivers/iio/frequency/Kconfig | 10 + + drivers/iio/frequency/Makefile | 1 + + drivers/iio/frequency/ad9523.c | 3 +- + drivers/iio/frequency/adf41513.c | 1246 ++++++++++++ + drivers/iio/frequency/adf4350.c | 4 +- + drivers/iio/frequency/adf4371.c | 4 +- + drivers/iio/frequency/adf4377.c | 85 +- + drivers/iio/frequency/admv1013.c | 2 +- + drivers/iio/frequency/admv1014.c | 2 +- + drivers/iio/frequency/adrf6780.c | 2 +- + drivers/iio/gyro/adis16080.c | 4 +- + drivers/iio/gyro/adis16136.c | 8 +- + drivers/iio/gyro/adis16260.c | 12 +- + drivers/iio/gyro/adxrs290.c | 5 +- + drivers/iio/gyro/adxrs450.c | 4 +- + drivers/iio/gyro/bmg160_spi.c | 7 +- + drivers/iio/gyro/fxas21002c_spi.c | 2 +- + drivers/iio/gyro/hid-sensor-gyro-3d.c | 57 +- + drivers/iio/gyro/st_gyro_spi.c | 18 +- + drivers/iio/health/afe4403.c | 6 +- + drivers/iio/health/afe4404.c | 4 +- + drivers/iio/health/max30100.c | 4 +- + drivers/iio/health/max30102.c | 4 +- + drivers/iio/humidity/hdc3020.c | 3 +- + drivers/iio/humidity/hid-sensor-humidity.c | 35 +- + drivers/iio/humidity/hts221_buffer.c | 5 +- + drivers/iio/humidity/hts221_spi.c | 2 +- + drivers/iio/iio_core_trigger.h | 2 +- + drivers/iio/imu/Kconfig | 1 + + drivers/iio/imu/Makefile | 1 + + drivers/iio/imu/adis16400.c | 30 +- + drivers/iio/imu/adis16460.c | 2 +- + drivers/iio/imu/adis16475.c | 54 +- + drivers/iio/imu/adis16480.c | 44 +- + drivers/iio/imu/adis16550.c | 89 +- + drivers/iio/imu/bmi160/bmi160_core.c | 2 +- + drivers/iio/imu/bmi160/bmi160_spi.c | 4 +- + drivers/iio/imu/bmi270/bmi270_core.c | 2 +- + drivers/iio/imu/bmi270/bmi270_spi.c | 5 +- + drivers/iio/imu/bmi323/bmi323_core.c | 4 +- + drivers/iio/imu/bmi323/bmi323_spi.c | 2 +- + drivers/iio/imu/fxos8700_core.c | 2 +- + drivers/iio/imu/fxos8700_spi.c | 2 +- + drivers/iio/imu/inv_icm42600/inv_icm42600.h | 10 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 18 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 45 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 3 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 12 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 16 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 6 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 20 +- + drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c | 3 +- + drivers/iio/imu/inv_icm42607/Kconfig | 30 + + drivers/iio/imu/inv_icm42607/Makefile | 13 + + drivers/iio/imu/inv_icm42607/inv_icm42607.h | 421 ++++ + drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c | 316 +++ + drivers/iio/imu/inv_icm42607/inv_icm42607_core.c | 702 +++++++ + drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c | 313 +++ + drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c | 97 + + drivers/iio/imu/inv_icm42607/inv_icm42607_spi.c | 107 + + drivers/iio/imu/inv_icm42607/inv_icm42607_temp.c | 99 + + drivers/iio/imu/inv_icm42607/inv_icm42607_temp.h | 38 + + drivers/iio/imu/inv_icm45600/inv_icm45600.h | 2 +- + drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c | 7 +- + drivers/iio/imu/inv_icm45600/inv_icm45600_core.c | 2 +- + drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c | 2 +- + drivers/iio/imu/inv_icm45600/inv_icm45600_spi.c | 16 +- + drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c | 4 +- + drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 34 +- + drivers/iio/imu/smi240.c | 2 +- + drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 5 +- + drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 5 + + drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c | 48 +- + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +- + drivers/iio/industrialio-backend.c | 8 +- + drivers/iio/industrialio-core.c | 52 +- + drivers/iio/inkern.c | 54 +- + drivers/iio/light/adux1020.c | 4 +- + drivers/iio/light/apds9160.c | 7 +- + drivers/iio/light/apds9300.c | 4 +- + drivers/iio/light/apds9306.c | 3 +- + drivers/iio/light/apds9960.c | 4 +- + drivers/iio/light/bh1745.c | 3 +- + drivers/iio/light/cm32181.c | 2 +- + drivers/iio/light/cm3323.c | 17 +- + drivers/iio/light/cm3605.c | 5 +- + drivers/iio/light/gp2ap002.c | 5 +- + drivers/iio/light/hid-sensor-als.c | 74 +- + drivers/iio/light/hid-sensor-prox.c | 49 +- + drivers/iio/light/isl29028.c | 22 +- + drivers/iio/light/ltr390.c | 3 +- + drivers/iio/light/ltr501.c | 5 +- + drivers/iio/light/opt3001.c | 543 ++--- + drivers/iio/light/opt4060.c | 2 +- + drivers/iio/light/rpr0521.c | 10 +- + drivers/iio/light/si1145.c | 4 +- + drivers/iio/light/st_uvis25_core.c | 5 +- + drivers/iio/light/st_uvis25_spi.c | 2 +- + drivers/iio/light/stk3310.c | 5 +- + drivers/iio/light/tcs3472.c | 317 ++- + drivers/iio/light/tsl2563.c | 2 +- + drivers/iio/light/tsl2583.c | 44 +- + drivers/iio/light/tsl2772.c | 7 +- + drivers/iio/light/vcnl4000.c | 16 +- + drivers/iio/light/vcnl4035.c | 23 +- + drivers/iio/light/veml6030.c | 4 +- + drivers/iio/light/vl6180.c | 2 +- + drivers/iio/magnetometer/Kconfig | 22 + + drivers/iio/magnetometer/Makefile | 3 + + drivers/iio/magnetometer/ak8974.c | 11 +- + drivers/iio/magnetometer/bmc150_magn.c | 50 +- + drivers/iio/magnetometer/bmc150_magn_spi.c | 6 +- + drivers/iio/magnetometer/hid-sensor-magn-3d.c | 73 +- + drivers/iio/magnetometer/hmc5843_spi.c | 6 +- + drivers/iio/magnetometer/mmc5983.c | 2 +- + drivers/iio/magnetometer/qmc5883l.c | 516 +++++ + drivers/iio/magnetometer/qmc6308.c | 601 ++++++ + drivers/iio/magnetometer/rm3100-core.c | 4 +- + drivers/iio/magnetometer/st_magn_spi.c | 12 +- + drivers/iio/multiplexer/iio-mux.c | 1 + + drivers/iio/orientation/hid-sensor-incl-3d.c | 55 +- + drivers/iio/orientation/hid-sensor-rotation.c | 48 +- + .../iio/position/hid-sensor-custom-intel-hinge.c | 19 +- + drivers/iio/potentiometer/max5481.c | 8 +- + drivers/iio/potentiometer/max5487.c | 6 +- + drivers/iio/potentiometer/mcp41010.c | 12 +- + drivers/iio/potentiometer/mcp4131.c | 128 +- + drivers/iio/potentiometer/x9250.c | 4 +- + drivers/iio/potentiostat/lmp91000.c | 1 + + drivers/iio/pressure/abp2030pa.c | 1 - + drivers/iio/pressure/abp2030pa_spi.c | 2 +- + drivers/iio/pressure/bmp280-core.c | 34 +- + drivers/iio/pressure/bmp280-spi.c | 14 +- + drivers/iio/pressure/dlhl60d.c | 4 +- + drivers/iio/pressure/hid-sensor-press.c | 57 +- + drivers/iio/pressure/hsc030pa_spi.c | 2 +- + drivers/iio/pressure/mpl115.c | 11 +- + drivers/iio/pressure/mpl115_spi.c | 2 +- + drivers/iio/pressure/mprls0025pa_spi.c | 2 +- + drivers/iio/pressure/ms5611_spi.c | 4 +- + drivers/iio/pressure/rohm-bm1390.c | 25 +- + drivers/iio/pressure/st_pressure_spi.c | 24 +- + drivers/iio/pressure/zpa2326.c | 5 +- + drivers/iio/pressure/zpa2326_spi.c | 2 +- + drivers/iio/proximity/as3935.c | 6 +- + drivers/iio/proximity/d3323aa.c | 2 +- + drivers/iio/proximity/hx9023s.c | 2 +- + drivers/iio/proximity/irsd200.c | 2 +- + drivers/iio/proximity/mb1232.c | 4 +- + drivers/iio/proximity/srf04.c | 4 +- + drivers/iio/proximity/sx_common.c | 2 +- + drivers/iio/proximity/vcnl3020.c | 6 +- + drivers/iio/proximity/vl53l0x-i2c.c | 4 +- + drivers/iio/proximity/vl53l1x-i2c.c | 43 +- + drivers/iio/resolver/ad2s1200.c | 20 +- + drivers/iio/resolver/ad2s1210.c | 32 +- + drivers/iio/resolver/ad2s90.c | 2 +- + drivers/iio/temperature/hid-sensor-temperature.c | 34 +- + drivers/iio/temperature/ltc2983.c | 12 +- + drivers/iio/temperature/max31856.c | 2 +- + drivers/iio/temperature/max31865.c | 2 +- + drivers/iio/temperature/maxim_thermocouple.c | 18 +- + drivers/iio/temperature/tmp007.c | 4 +- + drivers/iio/temperature/tmp117.c | 13 + + drivers/iio/test/iio-test-format.c | 97 +- + drivers/iio/test/iio-test-rescale.c | 2 +- + drivers/input/joystick/adc-joystick.c | 1 + + drivers/input/keyboard/adc-keys.c | 1 + + drivers/input/touchscreen/colibri-vf50-ts.c | 1 + + drivers/input/touchscreen/resistive-adc-touch.c | 1 + + drivers/interconnect/core.c | 7 +- + drivers/interconnect/debugfs-client.c | 2 + + drivers/interconnect/qcom/Kconfig | 12 +- + drivers/interconnect/qcom/Makefile | 2 + + drivers/interconnect/qcom/icc-rpm.c | 7 +- + drivers/interconnect/qcom/icc-rpm.h | 8 +- + drivers/interconnect/qcom/maili.c | 2091 ++++++++++++++++++++ + drivers/interconnect/qcom/osm-l3.c | 16 +- + drivers/interconnect/qcom/sc8280xp.c | 356 ++++ + drivers/interconnect/qcom/x1e80100.c | 485 +++++ + drivers/ipack/devices/ipoctal.c | 60 +- + drivers/mailbox/mailbox-mchp-ipc-sbi.c | 2 + + drivers/misc/Kconfig | 67 +- + drivers/misc/Makefile | 5 +- + drivers/misc/ad525x_dpot-i2c.c | 53 +- + drivers/misc/ad525x_dpot-spi.c | 59 +- + drivers/misc/ad525x_dpot.c | 177 +- + drivers/misc/ad525x_dpot.h | 3 + + drivers/misc/amd-sbi/Kconfig | 13 + + drivers/misc/amd-sbi/Makefile | 3 + + drivers/misc/amd-sbi/rmi-core.c | 4 + + drivers/misc/amd-sbi/rmi-i2c.c | 6 +- + drivers/misc/amd-sbi/tsi-core.c | 207 ++ + drivers/misc/amd-sbi/tsi-core.h | 29 + + drivers/misc/amd-sbi/tsi.c | 234 +++ + drivers/misc/apds9802als.c | 2 +- + drivers/misc/bcm-vk/bcm_vk_dev.c | 17 +- + drivers/misc/bcm-vk/bcm_vk_msg.c | 24 +- + drivers/misc/bh1770glc.c | 6 +- + drivers/misc/cardreader/alcor_pci.c | 2 +- + drivers/misc/cardreader/rtsx_pcr.c | 2 + + drivers/misc/cb710/core.c | 5 +- + drivers/misc/ds1682.c | 6 +- + drivers/misc/eeprom/Kconfig | 93 - + drivers/misc/eeprom/Makefile | 5 - + drivers/misc/eeprom/idt_89hpesx.c | 202 +- + drivers/misc/eeprom/max6875.c | 2 +- + drivers/misc/enclosure.c | 4 +- + drivers/misc/fastrpc.c | 260 ++- + drivers/misc/gehc-achc.c | 4 +- + drivers/misc/genwqe/card_base.c | 88 +- + drivers/misc/genwqe/card_utils.c | 2 +- + drivers/misc/hi6421v600-irq.c | 7 +- + drivers/misc/hisi_hikey_usb.c | 274 --- + drivers/misc/hmc6352.c | 2 +- + drivers/misc/hpilo.c | 13 +- + drivers/misc/ibmasm/Makefile | 16 - + drivers/misc/ibmasm/command.c | 173 -- + drivers/misc/ibmasm/dot_command.c | 138 -- + drivers/misc/ibmasm/dot_command.h | 64 - + drivers/misc/ibmasm/event.c | 163 -- + drivers/misc/ibmasm/heartbeat.c | 88 - + drivers/misc/ibmasm/i2o.h | 63 - + drivers/misc/ibmasm/ibmasm.h | 209 -- + drivers/misc/ibmasm/ibmasmfs.c | 604 ------ + drivers/misc/ibmasm/lowlevel.c | 75 - + drivers/misc/ibmasm/lowlevel.h | 123 -- + drivers/misc/ibmasm/module.c | 224 --- + drivers/misc/ibmasm/r_heartbeat.c | 86 - + drivers/misc/ibmasm/remote.c | 273 --- + drivers/misc/ibmasm/remote.h | 257 --- + drivers/misc/ibmasm/uart.c | 58 - + drivers/misc/ibmvmc.c | 21 +- + drivers/misc/ics932s401.c | 2 +- + drivers/misc/isl29003.c | 4 +- + drivers/misc/isl29020.c | 2 +- + drivers/misc/issei/Kconfig | 29 + + drivers/misc/issei/Makefile | 15 + + drivers/misc/issei/cdev.c | 446 +++++ + drivers/misc/issei/cdev.h | 16 + + drivers/misc/issei/dma.c | 154 ++ + drivers/misc/issei/dma.h | 69 + + drivers/misc/issei/fw_client.c | 240 +++ + drivers/misc/issei/fw_client.h | 45 + + drivers/misc/issei/ham.c | 169 ++ + drivers/misc/issei/ham.h | 20 + + drivers/misc/issei/host_client.c | 519 +++++ + drivers/misc/issei/host_client.h | 75 + + drivers/misc/issei/hw_heci.c | 550 +++++ + drivers/misc/issei/hw_heci.h | 47 + + drivers/misc/issei/hw_heci_regs.h | 35 + + drivers/misc/issei/hw_msg.h | 163 ++ + drivers/misc/issei/issei_dev.h | 163 ++ + drivers/misc/issei/main.c | 296 +++ + drivers/misc/issei/pci_heci.c | 151 ++ + drivers/misc/keba/cp500.c | 17 +- + drivers/misc/keba/lan9252.c | 4 +- + drivers/misc/lan966x_pci.c | 1 + + drivers/misc/lattice-ecp3-config.c | 4 +- + drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 8 +- + drivers/misc/lis3lv02d/lis3lv02d_spi.c | 2 +- + drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 2 +- + drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 4 +- + drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c | 4 +- + drivers/misc/mei/gsc-me.c | 4 +- + drivers/misc/mei/mei_lb.c | 4 +- + drivers/misc/mei/pci-csc.c | 2 +- + drivers/misc/mei/pci-me.c | 166 +- + drivers/misc/mei/pci-txe.c | 6 +- + drivers/misc/mei/platform-vsc.c | 2 +- + drivers/misc/mei/vsc-tp.c | 10 +- + drivers/misc/mrvl_cn10k_dpi.c | 6 +- + drivers/misc/nsm.c | 7 +- + drivers/misc/ntsync.c | 3 + + drivers/misc/ocxl/pci.c | 2 +- + drivers/misc/open-dice.c | 53 +- + drivers/misc/pch_phub.c | 59 +- + drivers/misc/pci_endpoint_test.c | 16 +- + drivers/misc/phantom.c | 6 +- + drivers/misc/pvpanic/pvpanic-mmio.c | 8 +- + drivers/misc/pvpanic/pvpanic-pci.c | 4 +- + drivers/misc/qcom-coincell.c | 4 +- + drivers/misc/rp1/rp1_pci.c | 29 +- + drivers/misc/sgi-gru/Makefile | 6 - + drivers/misc/sgi-gru/gru.h | 76 - + drivers/misc/sgi-gru/gru_instructions.h | 726 ------- + drivers/misc/sgi-gru/grufault.c | 903 --------- + drivers/misc/sgi-gru/grufile.c | 540 ----- + drivers/misc/sgi-gru/gruhandles.c | 192 -- + drivers/misc/sgi-gru/gruhandles.h | 517 ----- + drivers/misc/sgi-gru/grukdump.c | 223 --- + drivers/misc/sgi-gru/grukservices.c | 1157 ----------- + drivers/misc/sgi-gru/grukservices.h | 201 -- + drivers/misc/sgi-gru/grulib.h | 153 -- + drivers/misc/sgi-gru/grumain.c | 969 --------- + drivers/misc/sgi-gru/gruprocfs.c | 308 --- + drivers/misc/sgi-gru/grutables.h | 659 ------ + drivers/misc/sgi-gru/grutlbpurge.c | 316 --- + drivers/misc/sgi-xp/Makefile | 13 - + drivers/misc/sgi-xp/xp.h | 341 ---- + drivers/misc/sgi-xp/xp_main.c | 261 --- + drivers/misc/sgi-xp/xp_uv.c | 151 -- + drivers/misc/sgi-xp/xpc.h | 732 ------- + drivers/misc/sgi-xp/xpc_channel.c | 1011 ---------- + drivers/misc/sgi-xp/xpc_main.c | 1309 ------------ + drivers/misc/sgi-xp/xpc_partition.c | 545 ----- + drivers/misc/sgi-xp/xpc_uv.c | 1727 ---------------- + drivers/misc/sgi-xp/xpnet.c | 599 ------ + drivers/misc/sram.c | 2 +- + drivers/misc/ti_fpc202.c | 2 +- + drivers/misc/tps6594-esm.c | 2 +- + drivers/misc/tps6594-pfsm.c | 2 +- + drivers/misc/tsl2550.c | 2 +- + drivers/misc/vcpu_stall_detector.c | 4 +- + drivers/misc/vmw_vmci/vmci_event.c | 4 +- + drivers/misc/vmw_vmci/vmci_guest.c | 4 +- + drivers/misc/xilinx_sdfec.c | 78 +- + drivers/nvmem/Kconfig | 110 +- + drivers/nvmem/Makefile | 7 + + drivers/nvmem/airoha-smc-efuses.c | 125 ++ + drivers/{misc/eeprom => nvmem}/at24.c | 0 + drivers/{misc/eeprom => nvmem}/at25.c | 0 + drivers/nvmem/brcm_nvram.c | 15 +- + drivers/nvmem/core.c | 213 +- + drivers/{misc/eeprom => nvmem}/ee1004.c | 0 + drivers/{misc/eeprom => nvmem}/eeprom_93xx46.c | 0 + drivers/nvmem/internals.h | 10 +- + drivers/nvmem/lan9662-otpc.c | 12 +- + drivers/nvmem/layouts/u-boot-env.c | 5 +- + drivers/{misc/eeprom => nvmem}/m24lr.c | 0 + drivers/nvmem/nintendo-otp.c | 9 +- + drivers/nvmem/rockchip-otp.c | 9 +- + drivers/parport/parport_pc.c | 204 +- + drivers/parport/parport_serial.c | 280 +-- + drivers/pci/endpoint/functions/pci-epf-mhi.c | 10 + + drivers/phy/motorola/phy-cpcap-usb.c | 1 + + drivers/power/supply/ab8500_btemp.c | 1 + + drivers/power/supply/ab8500_charger.c | 1 + + drivers/power/supply/ab8500_fg.c | 1 + + drivers/power/supply/axp20x_ac_power.c | 1 + + drivers/power/supply/axp20x_battery.c | 1 + + drivers/power/supply/axp20x_usb_power.c | 1 + + drivers/power/supply/axp288_fuel_gauge.c | 1 + + drivers/power/supply/cpcap-battery.c | 1 + + drivers/power/supply/cpcap-charger.c | 1 + + drivers/power/supply/da9150-charger.c | 1 + + drivers/power/supply/generic-adc-battery.c | 1 + + drivers/power/supply/ingenic-battery.c | 1 + + drivers/power/supply/intel_dc_ti_battery.c | 1 + + drivers/power/supply/lego_ev3_battery.c | 1 + + drivers/power/supply/lp8788-charger.c | 1 + + drivers/power/supply/max17040_battery.c | 1 + + drivers/power/supply/mp2629_charger.c | 1 + + drivers/power/supply/mt6370-charger.c | 1 + + drivers/power/supply/qcom_smbx.c | 1 + + drivers/power/supply/rn5t618_power.c | 1 + + drivers/power/supply/rx51_battery.c | 1 + + drivers/power/supply/sc27xx_fuel_gauge.c | 1 + + drivers/power/supply/twl4030_charger.c | 1 + + drivers/power/supply/twl4030_madc_battery.c | 1 + + drivers/power/supply/twl6030_charger.c | 1 + + drivers/staging/iio/adc/ad7816.c | 6 +- + drivers/staging/iio/addac/adt7316-spi.c | 13 +- + drivers/staging/iio/addac/adt7316.c | 5 +- + drivers/staging/iio/frequency/ad9832.c | 24 +- + drivers/staging/iio/frequency/ad9834.c | 30 +- + drivers/staging/iio/frequency/dds.h | 50 +- + drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 1 + + drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 1 + + drivers/thermal/renesas/rzg3s_thermal.c | 1 + + drivers/thermal/thermal-generic-adc.c | 1 + + drivers/uio/uio.c | 7 +- + drivers/uio/uio_fsl_elbc_gpcm.c | 60 +- + drivers/uio/uio_sercos3.c | 1 + + drivers/w1/masters/ds2482.c | 12 + + drivers/w1/slaves/w1_ds28e17.c | 8 + + drivers/w1/w1.c | 5 + + .../dt-bindings/iio/adc/mediatek,mt6323-auxadc.h | 24 + + include/dt-bindings/interconnect/qcom,maili-rpmh.h | 171 ++ + include/linux/firmware/intel/stratix10-smc.h | 63 +- + .../linux/firmware/intel/stratix10-svc-client.h | 12 +- + include/linux/greybus/greybus_id.h | 4 +- + include/linux/iio/common/inv_sensors_timestamp.h | 40 +- + include/linux/iio/types.h | 21 + + include/linux/kstrtox.h | 3 + + include/linux/math64.h | 18 + + include/linux/mhi.h | 17 +- + include/linux/mhi_ep.h | 2 + + include/linux/misc/tsi.h | 72 + + include/linux/most.h | 37 +- + include/uapi/linux/iio/types.h | 1 + + include/uapi/linux/issei.h | 69 + + include/uapi/misc/amd-apml.h | 23 + + include/uapi/misc/fastrpc.h | 29 + + lib/kstrtox.c | 115 +- + lib/kstrtox.h | 17 +- + lib/math/div64.c | 15 + + lib/math/test_mul_u64_u64_div_u64.c | 1 + + lib/test-kstrtox.c | 182 ++ + lib/vsprintf.c | 2 +- + rust/bindings/bindings_helper.h | 3 + + rust/helpers/helpers.c | 1 + + rust/helpers/net/genetlink.c | 46 + + rust/kernel/miscdevice.rs | 2 +- + rust/kernel/{net.rs => net/mod.rs} | 2 + + rust/kernel/net/netlink.rs | 337 ++++ + rust/kernel/sync/poll.rs | 75 +- + rust/kernel/task.rs | 7 + + rust/uapi/uapi_helper.h | 1 + + .../cmd_graph/savedcmd_parser/savedcmd_parser.py | 2 +- + .../sbom/tests/cmd_graph/test_savedcmd_parser.py | 25 + + sound/soc/codecs/audio-iio-aux.c | 1 + + sound/soc/samsung/aries_wm8994.c | 1 + + sound/soc/samsung/midas_wm1811.c | 1 + + sound/soc/stm/stm32_adfsdm.c | 1 + + tools/iio/iio_event_monitor.c | 2 + + tools/testing/selftests/drivers/ntsync/ntsync.c | 133 +- + 744 files changed, 27984 insertions(+), 21199 deletions(-) + create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-flow + create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-frequency + create mode 100644 Documentation/ABI/testing/sysfs-class-issei + create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ltc2378.yaml + create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads112c14.yaml + create mode 100644 Documentation/devicetree/bindings/iio/adc/xlnx,versal-sysmon.yaml + create mode 100644 Documentation/devicetree/bindings/iio/dac/microchip,mcp47a1.yaml + create mode 100644 Documentation/devicetree/bindings/iio/flow/sensirion,slf3s.yaml + create mode 100644 Documentation/devicetree/bindings/iio/frequency/adi,adf41513.yaml + create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/qstcorp,qmc5883l.yaml + create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/qstcorp,qmc6308.yaml + create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,maili-rpmh.yaml + create mode 100644 Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml + delete mode 100644 Documentation/devicetree/bindings/w1/omap-hdq.txt + create mode 100644 Documentation/devicetree/bindings/w1/ti,hdq.yaml + create mode 100644 Documentation/driver-api/issei/index.rst + create mode 100644 Documentation/driver-api/issei/issei.rst + create mode 100644 Documentation/hwmon/socfpga-hwmon.rst + create mode 100644 Documentation/iio/adf41513.rst + create mode 100644 drivers/android/binder/debug.rs + create mode 100644 drivers/android/binder/netlink.rs + create mode 100644 drivers/hwmon/socfpga-hwmon.c + create mode 100644 drivers/iio/adc/ltc2378.c + create mode 100644 drivers/iio/adc/mt6323-auxadc.c + create mode 100644 drivers/iio/adc/ti-ads112c14.c + create mode 100644 drivers/iio/adc/versal-sysmon-core.c + create mode 100644 drivers/iio/adc/versal-sysmon-i2c.c + create mode 100644 drivers/iio/adc/versal-sysmon.c + create mode 100644 drivers/iio/adc/versal-sysmon.h + create mode 100644 drivers/iio/dac/mcf54415_dac.c + create mode 100644 drivers/iio/dac/mcp47a1.c + create mode 100644 drivers/iio/flow/Kconfig + create mode 100644 drivers/iio/flow/Makefile + create mode 100644 drivers/iio/flow/slf3s.c + create mode 100644 drivers/iio/frequency/adf41513.c + create mode 100644 drivers/iio/imu/inv_icm42607/Kconfig + create mode 100644 drivers/iio/imu/inv_icm42607/Makefile + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607.h + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_core.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_spi.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_temp.c + create mode 100644 drivers/iio/imu/inv_icm42607/inv_icm42607_temp.h + create mode 100644 drivers/iio/magnetometer/qmc5883l.c + create mode 100644 drivers/iio/magnetometer/qmc6308.c + create mode 100644 drivers/interconnect/qcom/maili.c + create mode 100644 drivers/misc/amd-sbi/tsi-core.c + create mode 100644 drivers/misc/amd-sbi/tsi-core.h + create mode 100644 drivers/misc/amd-sbi/tsi.c + delete mode 100644 drivers/misc/hisi_hikey_usb.c + delete mode 100644 drivers/misc/ibmasm/Makefile + delete mode 100644 drivers/misc/ibmasm/command.c + delete mode 100644 drivers/misc/ibmasm/dot_command.c + delete mode 100644 drivers/misc/ibmasm/dot_command.h + delete mode 100644 drivers/misc/ibmasm/event.c + delete mode 100644 drivers/misc/ibmasm/heartbeat.c + delete mode 100644 drivers/misc/ibmasm/i2o.h + delete mode 100644 drivers/misc/ibmasm/ibmasm.h + delete mode 100644 drivers/misc/ibmasm/ibmasmfs.c + delete mode 100644 drivers/misc/ibmasm/lowlevel.c + delete mode 100644 drivers/misc/ibmasm/lowlevel.h + delete mode 100644 drivers/misc/ibmasm/module.c + delete mode 100644 drivers/misc/ibmasm/r_heartbeat.c + delete mode 100644 drivers/misc/ibmasm/remote.c + delete mode 100644 drivers/misc/ibmasm/remote.h + delete mode 100644 drivers/misc/ibmasm/uart.c + create mode 100644 drivers/misc/issei/Kconfig + create mode 100644 drivers/misc/issei/Makefile + create mode 100644 drivers/misc/issei/cdev.c + create mode 100644 drivers/misc/issei/cdev.h + create mode 100644 drivers/misc/issei/dma.c + create mode 100644 drivers/misc/issei/dma.h + create mode 100644 drivers/misc/issei/fw_client.c + create mode 100644 drivers/misc/issei/fw_client.h + create mode 100644 drivers/misc/issei/ham.c + create mode 100644 drivers/misc/issei/ham.h + create mode 100644 drivers/misc/issei/host_client.c + create mode 100644 drivers/misc/issei/host_client.h + create mode 100644 drivers/misc/issei/hw_heci.c + create mode 100644 drivers/misc/issei/hw_heci.h + create mode 100644 drivers/misc/issei/hw_heci_regs.h + create mode 100644 drivers/misc/issei/hw_msg.h + create mode 100644 drivers/misc/issei/issei_dev.h + create mode 100644 drivers/misc/issei/main.c + create mode 100644 drivers/misc/issei/pci_heci.c + delete mode 100644 drivers/misc/sgi-gru/Makefile + delete mode 100644 drivers/misc/sgi-gru/gru.h + delete mode 100644 drivers/misc/sgi-gru/gru_instructions.h + delete mode 100644 drivers/misc/sgi-gru/grufault.c + delete mode 100644 drivers/misc/sgi-gru/grufile.c + delete mode 100644 drivers/misc/sgi-gru/gruhandles.c + delete mode 100644 drivers/misc/sgi-gru/gruhandles.h + delete mode 100644 drivers/misc/sgi-gru/grukdump.c + delete mode 100644 drivers/misc/sgi-gru/grukservices.c + delete mode 100644 drivers/misc/sgi-gru/grukservices.h + delete mode 100644 drivers/misc/sgi-gru/grulib.h + delete mode 100644 drivers/misc/sgi-gru/grumain.c + delete mode 100644 drivers/misc/sgi-gru/gruprocfs.c + delete mode 100644 drivers/misc/sgi-gru/grutables.h + delete mode 100644 drivers/misc/sgi-gru/grutlbpurge.c + delete mode 100644 drivers/misc/sgi-xp/Makefile + delete mode 100644 drivers/misc/sgi-xp/xp.h + delete mode 100644 drivers/misc/sgi-xp/xp_main.c + delete mode 100644 drivers/misc/sgi-xp/xp_uv.c + delete mode 100644 drivers/misc/sgi-xp/xpc.h + delete mode 100644 drivers/misc/sgi-xp/xpc_channel.c + delete mode 100644 drivers/misc/sgi-xp/xpc_main.c + delete mode 100644 drivers/misc/sgi-xp/xpc_partition.c + delete mode 100644 drivers/misc/sgi-xp/xpc_uv.c + delete mode 100644 drivers/misc/sgi-xp/xpnet.c + create mode 100644 drivers/nvmem/airoha-smc-efuses.c + rename drivers/{misc/eeprom => nvmem}/at24.c (100%) + rename drivers/{misc/eeprom => nvmem}/at25.c (100%) + rename drivers/{misc/eeprom => nvmem}/ee1004.c (100%) + rename drivers/{misc/eeprom => nvmem}/eeprom_93xx46.c (100%) + rename drivers/{misc/eeprom => nvmem}/m24lr.c (100%) + create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6323-auxadc.h + create mode 100644 include/dt-bindings/interconnect/qcom,maili-rpmh.h + create mode 100644 include/linux/misc/tsi.h + create mode 100644 include/uapi/linux/issei.h + create mode 100644 rust/helpers/net/genetlink.c + rename rust/kernel/{net.rs => net/mod.rs} (85%) + create mode 100644 rust/kernel/net/netlink.rs +$ git am -3 ../patches/rust-vs-char-misc-fixup +Applying: pin-init changes for v7.3-rc1 +Using index info to reconstruct a base tree... +M rust/kernel/serdev.rs +Falling back to patching base and 3-way merge... +Auto-merging rust/kernel/serdev.rs +No changes -- Patch already applied. +$ git am -3 ../merge-fixes/rust_binder-use-LocalModule-for-THIS_MODULE +Applying: rust_binder: use `LocalModule` for `THIS_MODULE` +$ git reset HEAD^ +Unstaged changes after reset: +M drivers/android/binder/netlink.rs +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master d9537063c0441] Merge branch 'char-misc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git + Date: Thu Aug 20 13:57:28 2026 +0100 +Merging coresight/next (9e3604d7369cf coresight: etm4x: remove redundant fields in etmv4_save_state) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git coresight/next +Already up to date. +Merging fastrpc/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/srini/fastrpc.git fastrpc/for-next +Already up to date. +Merging fpga/for-next (4216e549a2657 fpga: dfl: fix spelling in sysfs-platform-dfl-port ABI documentation) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga.git fpga/for-next +Already up to date. +Merging icc/icc-next (9621c81fd2eb7 Merge branch 'icc-misc' into icc-next) +$ git merge -m Merge branch 'icc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc.git icc/icc-next +Already up to date. +Merging iio/togreg (350d1fb9204b1 iio: dac: mcp47a1: add support for new device) +$ git merge -m Merge branch 'togreg' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git iio/togreg +Already up to date. +Merging nfc/for-next (9f69d05b5a85c nfc: st95hf: switch to using sleeping variants of gpiod API) +$ git merge -m Merge branch 'for-next' of https://codeberg.org/linux-nfc/linux.git nfc/for-next +Already up to date. +Merging phy-next/next (ba8376e8c76c6 MAINTAINERS: Add Manivannan Sadhasivam as the Reviewer for Generic PHY Framework) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git phy-next/next +Auto-merging MAINTAINERS +Auto-merging drivers/phy/freescale/Kconfig +Auto-merging drivers/phy/freescale/phy-fsl-lynx-10g.c +Auto-merging drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c +Merge made by the 'ort' strategy. + .../devicetree/bindings/phy/mediatek,dsi-phy.yaml | 1 + + .../phy/qcom,glymur-qmp-gen5x8-pcie-phy.yaml | 177 +++++ + .../bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml | 21 + + .../bindings/phy/qcom,m31-eusb2-phy.yaml | 1 + + .../bindings/phy/qcom,qcs615-qmp-usb3dp-phy.yaml | 49 +- + .../devicetree/bindings/phy/qcom,qusb2-phy.yaml | 1 + + .../bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml | 11 + + .../bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml | 8 + + .../bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml | 2 + + .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 3 + + .../devicetree/bindings/phy/renesas,usb2-phy.yaml | 2 + + .../bindings/phy/rockchip-inno-csi-dphy.yaml | 10 + + .../bindings/phy/spacemit,k3-combo-phy.yaml | 68 ++ + MAINTAINERS | 2 + + drivers/phy/freescale/Kconfig | 1 + + drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 186 +++-- + drivers/phy/freescale/phy-fsl-lynx-10g.c | 2 +- + drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 3 + + drivers/phy/mediatek/Makefile | 1 + + drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c | 201 +++++ + drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 1 + + drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 2 +- + drivers/phy/phy-can-transceiver.c | 2 +- + drivers/phy/qualcomm/Kconfig | 10 + + drivers/phy/qualcomm/Makefile | 1 + + drivers/phy/qualcomm/phy-qcom-qmp-com-aon-v10.h | 15 + + drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 459 ++++++++++- + drivers/phy/qualcomm/phy-qcom-qmp-dp-phy-v10.h | 15 + + .../phy/qualcomm/phy-qcom-qmp-dp-qserdes-com-v8.h | 52 -- + drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c | 743 ++++++++++++++++++ + drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 864 ++++++++++++++++++++- + drivers/phy/qualcomm/phy-qcom-qmp-pcs-aon-v10.h | 13 + + drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v10.h | 18 + + .../phy/qualcomm/phy-qcom-qmp-pcs-pcie-v10_60.h | 26 + + drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v7.h | 24 + + drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v10.h | 19 + + drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10.h | 36 + + drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10_60.h | 23 + + .../phy/qualcomm/phy-qcom-qmp-qserdes-com-v10.h | 89 +++ + .../phy/qualcomm/phy-qcom-qmp-qserdes-com-v10_60.h | 55 ++ + drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v8.h | 13 +- + .../qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v8.h | 37 + + .../phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v10.h | 91 +++ + .../qualcomm/phy-qcom-qmp-qserdes-txrx-v10_60.h | 109 +++ + drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 139 ++++ + drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c | 36 +- + drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 36 +- + drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 79 +- + drivers/phy/qualcomm/phy-qcom-qmp.h | 10 + + drivers/phy/qualcomm/phy-qcom-qusb2.c | 14 + + drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 37 +- + drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 26 +- + drivers/phy/renesas/phy-rcar-gen2.c | 1 - + drivers/phy/renesas/phy-rcar-gen3-usb2.c | 31 +- + drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 27 +- + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 71 +- + drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 2 +- + drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 287 +++---- + drivers/phy/spacemit/Kconfig | 16 + + drivers/phy/spacemit/Makefile | 2 + + drivers/phy/spacemit/phy-k3-combo.c | 252 ++++++ + drivers/phy/spacemit/phy-k3-common.c | 391 ++++++++++ + drivers/phy/spacemit/phy-k3-common.h | 27 + + drivers/phy/starfive/phy-jh7110-dphy-rx.c | 5 +- + drivers/phy/starfive/phy-jh7110-dphy-tx.c | 5 +- + drivers/phy/sunplus/phy-sunplus-usb2.c | 6 +- + 66 files changed, 4608 insertions(+), 359 deletions(-) + create mode 100644 Documentation/devicetree/bindings/phy/qcom,glymur-qmp-gen5x8-pcie-phy.yaml + create mode 100644 Documentation/devicetree/bindings/phy/spacemit,k3-combo-phy.yaml + create mode 100644 drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8196.c + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-com-aon-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-dp-phy-v10.h + delete mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-dp-qserdes-com-v8.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-aon-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v10_60.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v7.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10_60.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v10_60.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v8.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v10.h + create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v10_60.h + create mode 100644 drivers/phy/spacemit/phy-k3-combo.c + create mode 100644 drivers/phy/spacemit/phy-k3-common.c + create mode 100644 drivers/phy/spacemit/phy-k3-common.h +Merging soundwire/next (5b08a3afd2995 soundwire: dmi-quirks: Disable ghost Realtek on Asus ROG Zephyrus Duo) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git soundwire/next +Auto-merging drivers/soundwire/bus.c +Auto-merging drivers/soundwire/cadence_master.c +Auto-merging drivers/soundwire/intel_ace2x.c +Auto-merging drivers/soundwire/mipi_disco.c +Auto-merging drivers/soundwire/stream.c +Auto-merging include/linux/soundwire/sdw.h +Merge made by the 'ort' strategy. + .../bindings/soundwire/qcom,soundwire.yaml | 20 +++++------ + drivers/soundwire/bus.c | 7 ++-- + drivers/soundwire/bus.h | 10 +++--- + drivers/soundwire/cadence_master.c | 35 ++++++++++++++---- + drivers/soundwire/cadence_master.h | 1 + + drivers/soundwire/dmi-quirks.c | 42 +++++++++++++++++++++- + drivers/soundwire/intel_ace2x.c | 20 +++++++++-- + drivers/soundwire/intel_auxdevice.c | 1 + + drivers/soundwire/mipi_disco.c | 6 ++++ + drivers/soundwire/qcom.c | 24 +++++++++++-- + drivers/soundwire/stream.c | 17 ++++++--- + include/linux/soundwire/sdw.h | 14 ++++++++ + 12 files changed, 164 insertions(+), 33 deletions(-) +Merging extcon/extcon-next (254f49634ee16 Linux 7.1-rc1) +$ git merge -m Merge branch 'extcon-next' of https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon/extcon-next +Already up to date. +Merging gnss/gnss-next (a13c140cc289c Linux 7.2-rc3) +$ git merge -m Merge branch 'gnss-next' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git gnss/gnss-next +Already up to date. +Merging vfio/next (4e3c1fc8abcb8 vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX) +$ git merge -m Merge branch 'next' of https://github.com/awilliam/linux-vfio.git vfio/next +Auto-merging arch/s390/pci/pci.c +Auto-merging arch/s390/pci/pci_event.c +Auto-merging drivers/vfio/pci/vfio_pci_core.c +Merge made by the 'ort' strategy. + arch/s390/include/asm/pci.h | 32 + + arch/s390/pci/pci.c | 1 + + arch/s390/pci/pci_event.c | 137 ++-- + drivers/vfio/pci/vfio_pci_config.c | 1 + + drivers/vfio/pci/vfio_pci_core.c | 13 +- + drivers/vfio/pci/vfio_pci_intrs.c | 3 +- + drivers/vfio/pci/vfio_pci_priv.h | 9 + + drivers/vfio/pci/vfio_pci_zdev.c | 62 +- + include/uapi/linux/vfio.h | 21 + + include/uapi/linux/vfio_zdev.h | 2 + + tools/testing/selftests/kselftest_harness.h | 2 +- + .../selftests/vfio/lib/drivers/igb/e1000_82575.h | 1 + + .../selftests/vfio/lib/drivers/igb/e1000_defines.h | 1 + + .../selftests/vfio/lib/drivers/igb/e1000_regs.h | 1 + + tools/testing/selftests/vfio/lib/drivers/igb/igb.c | 585 +++++++++++++++ + .../selftests/vfio/lib/drivers/nv_falcon/hw.h | 352 +++++++++ + .../vfio/lib/drivers/nv_falcon/nv_falcon.c | 783 +++++++++++++++++++++ + .../selftests/vfio/lib/include/libvfio/assert.h | 18 + + .../vfio/lib/include/libvfio/vfio_pci_device.h | 29 + + tools/testing/selftests/vfio/lib/iommu.c | 12 +- + tools/testing/selftests/vfio/lib/iova_allocator.c | 4 +- + tools/testing/selftests/vfio/lib/libvfio.mk | 3 + + tools/testing/selftests/vfio/lib/sysfs.c | 3 +- + tools/testing/selftests/vfio/lib/vfio_pci_device.c | 74 +- + tools/testing/selftests/vfio/lib/vfio_pci_driver.c | 22 +- + .../vfio/vfio_pci_device_init_perf_test.c | 4 +- + .../testing/selftests/vfio/vfio_pci_driver_test.c | 57 +- + 27 files changed, 2113 insertions(+), 119 deletions(-) + create mode 120000 tools/testing/selftests/vfio/lib/drivers/igb/e1000_82575.h + create mode 120000 tools/testing/selftests/vfio/lib/drivers/igb/e1000_defines.h + create mode 120000 tools/testing/selftests/vfio/lib/drivers/igb/e1000_regs.h + create mode 100644 tools/testing/selftests/vfio/lib/drivers/igb/igb.c + create mode 100644 tools/testing/selftests/vfio/lib/drivers/nv_falcon/hw.h + create mode 100644 tools/testing/selftests/vfio/lib/drivers/nv_falcon/nv_falcon.c +Merging w1/for-next (4d3721b204f96 w1: ds2482: Fix signedness bug in ds2482_w1_triplet()) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1.git w1/for-next +Already up to date. +Merging spmi/spmi-next (8cdeaa50eae8d Linux 7.2-rc2) +$ git merge -m Merge branch 'spmi-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git spmi/spmi-next +Already up to date. +Merging staging/staging-next (c6eb4dc5964fd staging: rtl8723bs: add blank line after declaration) +$ git merge -m Merge branch 'staging-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging/staging-next +Auto-merging drivers/staging/rtl8723bs/core/rtw_ieee80211.c +Auto-merging drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +Auto-merging drivers/staging/rtl8723bs/core/rtw_wlan_util.c +CONFLICT (content): Merge conflict in drivers/staging/rtl8723bs/core/rtw_wlan_util.c +Auto-merging drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +Resolved 'drivers/staging/rtl8723bs/core/rtw_wlan_util.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master d95a3476a869c] Merge branch 'staging-next' of https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git +$ git diff -M --stat --summary HEAD^.. + drivers/staging/axis-fifo/axis-fifo.c | 9 +- + drivers/staging/fbtft/fb_upd161704.c | 2 +- + drivers/staging/fbtft/fbtft-sysfs.c | 2 +- + drivers/staging/greybus/audio_codec.c | 5 +- + drivers/staging/greybus/audio_codec.h | 4 +- + drivers/staging/greybus/audio_gb.c | 32 +- + drivers/staging/greybus/audio_manager_sysfs.c | 2 +- + drivers/staging/greybus/audio_module.c | 27 +- + drivers/staging/greybus/authentication.c | 2 - + drivers/staging/greybus/hid.c | 2 +- + drivers/staging/greybus/loopback.c | 26 -- + drivers/staging/greybus/power_supply.c | 4 +- + drivers/staging/greybus/uart.c | 2 +- + drivers/staging/greybus/vibrator.c | 2 +- + drivers/staging/most/dim2/dim2.c | 14 +- + drivers/staging/most/video/video.c | 10 +- + drivers/staging/nvec/nvec.c | 4 +- + drivers/staging/nvec/nvec_power.c | 2 +- + drivers/staging/octeon/ethernet-rx.c | 20 +- + drivers/staging/octeon/ethernet-rx.h | 2 +- + drivers/staging/octeon/ethernet-tx.c | 19 +- + drivers/staging/octeon/ethernet-tx.h | 2 +- + drivers/staging/octeon/ethernet.c | 66 ++- + drivers/staging/rtl8723bs/core/rtw_ap.c | 182 ++------ + drivers/staging/rtl8723bs/core/rtw_cmd.c | 251 +++++----- + drivers/staging/rtl8723bs/core/rtw_efuse.c | 11 +- + drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 12 +- + drivers/staging/rtl8723bs/core/rtw_io.c | 7 - + drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 30 +- + drivers/staging/rtl8723bs/core/rtw_mlme.c | 269 +++++------ + drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 513 +++++++++++---------- + drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 32 +- + drivers/staging/rtl8723bs/core/rtw_recv.c | 47 +- + drivers/staging/rtl8723bs/core/rtw_security.c | 48 +- + drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 +- + drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 85 ++-- + drivers/staging/rtl8723bs/core/rtw_xmit.c | 130 +++--- + drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 26 +- + drivers/staging/rtl8723bs/hal/HalPhyRf.c | 12 +- + drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 58 +-- + drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c | 38 +- + drivers/staging/rtl8723bs/hal/hal_btcoex.c | 10 +- + drivers/staging/rtl8723bs/hal/hal_com.c | 14 +- + drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 15 +- + drivers/staging/rtl8723bs/hal/hal_intf.c | 14 +- + drivers/staging/rtl8723bs/hal/hal_sdio.c | 6 +- + drivers/staging/rtl8723bs/hal/odm.c | 2 +- + drivers/staging/rtl8723bs/hal/odm.h | 7 - + drivers/staging/rtl8723bs/hal/odm_DIG.c | 2 +- + drivers/staging/rtl8723bs/hal/odm_DIG.h | 5 - + drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c | 2 +- + drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 3 +- + drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 250 +++++----- + drivers/staging/rtl8723bs/hal/rtl8723b_dm.c | 7 +- + drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 113 +---- + drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 8 +- + drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 67 +-- + drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 10 +- + drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 11 +- + drivers/staging/rtl8723bs/hal/sdio_halinit.c | 83 ++-- + drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 +- + drivers/staging/rtl8723bs/include/drv_types.h | 9 +- + drivers/staging/rtl8723bs/include/hal_com_reg.h | 10 +- + drivers/staging/rtl8723bs/include/hal_data.h | 122 ----- + drivers/staging/rtl8723bs/include/hal_intf.h | 8 +- + drivers/staging/rtl8723bs/include/hal_pg.h | 6 - + drivers/staging/rtl8723bs/include/ieee80211.h | 30 +- + drivers/staging/rtl8723bs/include/ioctl_cfg80211.h | 4 +- + .../rtl8723bs/include/osdep_service_linux.h | 3 - + drivers/staging/rtl8723bs/include/rtl8192c_recv.h | 3 - + drivers/staging/rtl8723bs/include/rtl8723b_hal.h | 22 +- + drivers/staging/rtl8723bs/include/rtw_ap.h | 2 +- + drivers/staging/rtl8723bs/include/rtw_cmd.h | 144 +++--- + drivers/staging/rtl8723bs/include/rtw_event.h | 4 - + drivers/staging/rtl8723bs/include/rtw_ioctl_set.h | 2 +- + drivers/staging/rtl8723bs/include/rtw_mlme.h | 61 ++- + drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 64 +-- + drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 6 +- + drivers/staging/rtl8723bs/include/rtw_qos.h | 4 - + drivers/staging/rtl8723bs/include/rtw_security.h | 20 +- + drivers/staging/rtl8723bs/include/rtw_xmit.h | 4 +- + drivers/staging/rtl8723bs/include/sta_info.h | 2 +- + drivers/staging/rtl8723bs/include/wifi.h | 83 +--- + drivers/staging/rtl8723bs/include/wlan_bssdef.h | 92 ++-- + drivers/staging/rtl8723bs/include/xmit_osdep.h | 2 +- + drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 146 +++--- + drivers/staging/rtl8723bs/os_dep/os_intfs.c | 30 +- + drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 24 +- + drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 +- + drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 12 +- + drivers/staging/sm750fb/Kconfig | 1 + + drivers/staging/sm750fb/ddk750_chip.c | 27 -- + drivers/staging/sm750fb/ddk750_chip.h | 7 - + drivers/staging/sm750fb/ddk750_power.c | 14 - + drivers/staging/sm750fb/ddk750_power.h | 5 - + drivers/staging/sm750fb/sm750.c | 26 +- + drivers/staging/sm750fb/sm750.h | 20 +- + drivers/staging/sm750fb/sm750_accel.h | 44 +- + drivers/staging/sm750fb/sm750_hw.c | 28 +- + 99 files changed, 1564 insertions(+), 2179 deletions(-) +Merging counter-next/counter-next (353b2e09f44a9 counter: ti-eqep: Remove redundant dev_err_probe()) +$ git merge -m Merge branch 'counter-next' of https://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter.git counter-next/counter-next +Already up to date. +Merging mux/for-next (ac7bde3c53166 mux: Add driver for Renesas RZ/V2H VBENCTL VBUS_SEL mux) +$ git merge -m Merge branch 'for-next' of https://gitlab.com/peda-linux/mux.git mux/for-next +Merge made by the 'ort' strategy. + drivers/mux/Kconfig | 13 ++++++++ + drivers/mux/Makefile | 2 ++ + drivers/mux/rzv2h-vbenctl.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 96 insertions(+) + create mode 100644 drivers/mux/rzv2h-vbenctl.c +Merging dmaengine/next (0d995da5fb97e dmaengine: dw-edma: Mark emulated IRQ as level-triggered) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git dmaengine/next +Auto-merging MAINTAINERS +Auto-merging drivers/crypto/atmel-aes.c +Auto-merging drivers/nvme/target/pci-epf.c +Auto-merging drivers/pci/endpoint/functions/pci-epf-mhi.c +Merge made by the 'ort' strategy. + .../devicetree/bindings/dma/altr,msgdma.yaml | 2 +- + .../devicetree/bindings/dma/mediatek,uart-dma.yaml | 1 + + .../devicetree/bindings/dma/qcom,bam-dma.yaml | 2 +- + .../bindings/dma/xilinx/xlnx,axi-dma.yaml | 13 +- + Documentation/driver-api/dmaengine/client.rst | 9 + + MAINTAINERS | 4 +- + drivers/crypto/atmel-aes.c | 10 +- + drivers/dma/arm-dma350.c | 9 + + drivers/dma/dmaengine.c | 9 +- + drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- + drivers/dma/dw-edma/dw-edma-core.c | 583 +++++++++++++-------- + drivers/dma/dw-edma/dw-edma-core.h | 113 +++- + drivers/dma/dw-edma/dw-edma-pcie.c | 264 ++++++---- + drivers/dma/dw-edma/dw-edma-v0-core.c | 382 +++++++++----- + drivers/dma/dw-edma/dw-hdma-v0-core.c | 265 ++++++---- + drivers/dma/dw-edma/dw-hdma-v0-regs.h | 3 +- + drivers/dma/fsl-edma-main.c | 2 + + drivers/dma/fsl-edma-trace.h | 4 +- + drivers/dma/fsl_raid.c | 58 +- + drivers/dma/fsl_raid.h | 4 +- + drivers/dma/hisi_dma.c | 2 +- + drivers/dma/idxd/defaults.c | 12 +- + drivers/dma/mediatek/mtk-uart-apdma.c | 2 +- + drivers/dma/pl330.c | 19 +- + drivers/dma/qcom/bam_dma.c | 1 + + drivers/dma/qcom/hidma_ll.c | 6 +- + drivers/dma/tegra210-adma.c | 12 +- + drivers/dma/ti/k3-udma.c | 2 +- + drivers/dma/xilinx/xilinx_dma.c | 66 ++- + drivers/dma/xilinx/zynqmp_dma.c | 6 +- + drivers/nvme/target/pci-epf.c | 33 +- + drivers/pci/endpoint/functions/pci-epf-mhi.c | 52 +- + drivers/pci/endpoint/functions/pci-epf-test.c | 8 +- + include/linux/dma/edma.h | 51 +- + include/linux/dmaengine.h | 151 +++++- + 35 files changed, 1388 insertions(+), 774 deletions(-) +Merging cgroup/for-next (e0c62cce00d19 Merge branch 'for-7.3-fixes' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git cgroup/for-next +Auto-merging Documentation/admin-guide/cgroup-v1/cpusets.rst +Auto-merging Documentation/admin-guide/cgroup-v2.rst +Auto-merging include/linux/cgroup.h +Auto-merging include/linux/sched.h +Auto-merging kernel/cgroup/cgroup.c +Auto-merging kernel/cgroup/cpuset.c +Auto-merging tools/testing/selftests/cgroup/lib/include/cgroup_util.h +Auto-merging tools/testing/selftests/cgroup/test_zswap.c +Merge made by the 'ort' strategy. + Documentation/admin-guide/cgroup-v1/cpusets.rst | 42 +- + Documentation/admin-guide/cgroup-v1/memcg_test.rst | 2 +- + Documentation/admin-guide/cgroup-v2.rst | 50 +- + include/linux/cgroup-defs.h | 2 +- + include/linux/cgroup.h | 2 +- + include/linux/sched.h | 5 - + kernel/cgroup/cgroup.c | 2 +- + kernel/cgroup/cpuset-internal.h | 12 +- + kernel/cgroup/cpuset-v1.c | 13 +- + kernel/cgroup/cpuset.c | 573 +++++++++++++-------- + tools/cgroup/iocost_monitor.py | 10 +- + .../selftests/cgroup/lib/include/cgroup_util.h | 1 + + tools/testing/selftests/cgroup/test_core.c | 14 +- + tools/testing/selftests/cgroup/test_cpu.c | 47 +- + tools/testing/selftests/cgroup/test_cpuset.c | 249 ++++++++- + tools/testing/selftests/cgroup/test_cpuset_prs.sh | 24 +- + .../testing/selftests/cgroup/test_cpuset_v1_hp.sh | 2 +- + tools/testing/selftests/cgroup/test_freezer.c | 2 +- + .../testing/selftests/cgroup/test_hugetlb_memcg.c | 10 +- + tools/testing/selftests/cgroup/test_kill.c | 2 +- + tools/testing/selftests/cgroup/test_kmem.c | 2 +- + tools/testing/selftests/cgroup/test_memcontrol.c | 2 +- + tools/testing/selftests/cgroup/test_pids.c | 2 +- + tools/testing/selftests/cgroup/test_zswap.c | 2 +- + 24 files changed, 758 insertions(+), 314 deletions(-) +Merging scsi/for-next (cf1af0ccca54d Merge branch 'misc' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi/for-next +Merge made by the 'ort' strategy. +Merging scsi-mkp/for-next (30733f28c0347 Merge patch series "scsi: lpfc: Remove all strlcat() uses") +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git scsi-mkp/for-next +Auto-merging MAINTAINERS +Auto-merging drivers/ata/pata_buddha.c +Auto-merging drivers/scsi/hosts.c +Auto-merging drivers/scsi/scsi_lib.c +Auto-merging drivers/ufs/core/ufs-rpmb.c +Auto-merging drivers/ufs/core/ufshcd.c +Auto-merging include/linux/mod_devicetable.h +CONFLICT (content): Merge conflict in include/linux/mod_devicetable.h +Auto-merging include/scsi/scsi_host.h +Auto-merging kernel/dma/mapping.c +Resolved 'include/linux/mod_devicetable.h' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master f9a7e992ab645] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +$ git diff -M --stat --summary HEAD^.. + .../devicetree/bindings/ufs/qcom,sm8650-ufshc.yaml | 3 + + .../devicetree/bindings/ufs/ufs-common.yaml | 58 + + Documentation/scsi/index.rst | 1 + + Documentation/scsi/leapraid.rst | 110 + + MAINTAINERS | 12 +- + drivers/ata/pata_buddha.c | 8 +- + drivers/s390/scsi/Makefile | 2 + + drivers/s390/scsi/zfcp_dbf.c | 80 +- + drivers/s390/scsi/zfcp_dbf.h | 34 +- + drivers/s390/scsi/zfcp_ext.h | 7 +- + drivers/s390/scsi/zfcp_fsf.h | 4 +- + drivers/s390/scsi/zfcp_qdio.c | 1 + + drivers/s390/scsi/zfcp_sysfs.c | 19 +- + drivers/scsi/Kconfig | 1 + + drivers/scsi/Makefile | 23 + + drivers/scsi/a2091.c | 6 +- + drivers/scsi/aha1542.c | 2 +- + drivers/scsi/dc395x.c | 6 - + drivers/scsi/device_handler/Makefile | 3 + + drivers/scsi/device_handler/scsi_dh_alua.c | 5 +- + drivers/scsi/fnic/Makefile | 1 + + drivers/scsi/fnic/fcpio.h | 35 + + drivers/scsi/fnic/fdls_disc.c | 978 ++- + drivers/scsi/fnic/fdls_fc.h | 7 + + drivers/scsi/fnic/fip.c | 119 +- + drivers/scsi/fnic/fip.h | 2 +- + drivers/scsi/fnic/fnic.h | 94 +- + drivers/scsi/fnic/fnic_debugfs.c | 99 +- + drivers/scsi/fnic/fnic_fcs.c | 199 +- + drivers/scsi/fnic/fnic_fdls.h | 48 +- + drivers/scsi/fnic/fnic_io.h | 24 +- + drivers/scsi/fnic/fnic_isr.c | 28 +- + drivers/scsi/fnic/fnic_main.c | 214 +- + drivers/scsi/fnic/fnic_nvme.c | 2268 +++++ + drivers/scsi/fnic/fnic_nvme.h | 214 + + drivers/scsi/fnic/fnic_res.c | 31 +- + drivers/scsi/fnic/fnic_res.h | 32 +- + drivers/scsi/fnic/fnic_scsi.c | 251 +- + drivers/scsi/fnic/fnic_stats.h | 28 + + drivers/scsi/fnic/fnic_trace.c | 3 +- + drivers/scsi/fnic/vnic_dev.c | 2 +- + drivers/scsi/fnic/vnic_devcmd.h | 2 +- + drivers/scsi/g_NCR5380.c | 2 +- + drivers/scsi/gvp11.c | 17 +- + drivers/scsi/hosts.c | 25 +- + drivers/scsi/ibmvscsi/Makefile | 2 + + drivers/scsi/ibmvscsi/{ibmvfc.c => ibmvfc-core.c} | 825 +- + drivers/scsi/ibmvscsi/ibmvfc-nvme.c | 573 ++ + drivers/scsi/ibmvscsi/ibmvfc-nvme.h | 49 + + drivers/scsi/ibmvscsi/ibmvfc.h | 219 +- + drivers/scsi/isci/scu_task_context.h | 14 - + drivers/scsi/leapraid/Kconfig | 14 + + drivers/scsi/leapraid/Makefile | 10 + + drivers/scsi/leapraid/leapraid.h | 2048 +++++ + drivers/scsi/leapraid/leapraid_app.c | 803 ++ + drivers/scsi/leapraid/leapraid_func.c | 8626 ++++++++++++++++++++ + drivers/scsi/leapraid/leapraid_func.h | 1486 ++++ + drivers/scsi/leapraid/leapraid_os.c | 2468 ++++++ + drivers/scsi/leapraid/leapraid_transport.c | 1403 ++++ + drivers/scsi/libsas/sas_expander.c | 98 +- + drivers/scsi/libsas/sas_internal.h | 1 + + drivers/scsi/lpfc/lpfc_attr.c | 533 +- + drivers/scsi/lpfc/lpfc_ct.c | 29 +- + drivers/scsi/lpfc/lpfc_debugfs.c | 198 +- + drivers/scsi/lpfc/lpfc_scsi.c | 49 +- + drivers/scsi/lpfc/lpfc_scsi.h | 3 - + drivers/scsi/lpfc/lpfc_sli.c | 43 +- + drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- + drivers/scsi/mpi3mr/mpi3mr_os.c | 2 +- + drivers/scsi/mpt3sas/Makefile | 2 + + drivers/scsi/mpt3sas/mpt3sas_base.c | 8 +- + drivers/scsi/mpt3sas/mpt3sas_base.h | 20 + + drivers/scsi/mpt3sas/mpt3sas_config.c | 36 + + drivers/scsi/mpt3sas/mpt3sas_hwmon.c | 191 + + drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 +- + drivers/scsi/qla2xxx/qla_attr.c | 63 +- + drivers/scsi/qla2xxx/qla_bsg.c | 622 +- + drivers/scsi/qla2xxx/qla_bsg.h | 34 + + drivers/scsi/qla2xxx/qla_dbg.c | 37 +- + drivers/scsi/qla2xxx/qla_def.h | 148 +- + drivers/scsi/qla2xxx/qla_dfs.c | 8 +- + drivers/scsi/qla2xxx/qla_edif.c | 101 +- + drivers/scsi/qla2xxx/qla_fw.h | 144 +- + drivers/scsi/qla2xxx/qla_fw29.h | 830 ++ + drivers/scsi/qla2xxx/qla_gbl.h | 40 +- + drivers/scsi/qla2xxx/qla_gs.c | 176 +- + drivers/scsi/qla2xxx/qla_init.c | 930 ++- + drivers/scsi/qla2xxx/qla_inline.h | 295 +- + drivers/scsi/qla2xxx/qla_iocb.c | 1419 +++- + drivers/scsi/qla2xxx/qla_isr.c | 748 +- + drivers/scsi/qla2xxx/qla_mbx.c | 501 +- + drivers/scsi/qla2xxx/qla_mid.c | 78 +- + drivers/scsi/qla2xxx/qla_nvme.c | 307 +- + drivers/scsi/qla2xxx/qla_nvme.h | 4 +- + drivers/scsi/qla2xxx/qla_nx.c | 2 +- + drivers/scsi/qla2xxx/qla_os.c | 316 +- + drivers/scsi/qla2xxx/qla_sup.c | 782 +- + drivers/scsi/qla2xxx/qla_target.c | 34 +- + drivers/scsi/qla2xxx/qla_tmpl.c | 48 +- + drivers/scsi/qla2xxx/qla_version.h | 10 +- + drivers/scsi/qla4xxx/ql4_os.c | 6 +- + drivers/scsi/scsi_lib.c | 5 +- + drivers/scsi/scsi_scan.c | 52 +- + drivers/scsi/scsi_sysfs.c | 7 +- + drivers/scsi/sd.c | 55 +- + drivers/scsi/smartpqi/smartpqi_init.c | 204 +- + drivers/scsi/storvsc_drv.c | 32 + + drivers/scsi/virtio_scsi.c | 18 +- + drivers/scsi/zorro7xx.c | 16 +- + drivers/scsi/zorro_esp.c | 2 +- + drivers/ufs/core/Makefile | 2 + + drivers/ufs/core/ufs-debugfs.c | 10 +- + drivers/ufs/core/ufs-mcq.c | 14 +- + drivers/ufs/core/ufs-rpmb.c | 8 +- + drivers/ufs/core/ufs-sysfs.c | 1 + + drivers/ufs/core/ufs-txeq.c | 73 +- + drivers/ufs/core/ufs_bsg.c | 41 +- + drivers/ufs/core/ufshcd.c | 158 +- + drivers/ufs/host/Makefile | 2 + + drivers/ufs/host/ufs-mediatek.c | 16 +- + drivers/ufs/host/ufs-mediatek.h | 4 +- + drivers/ufs/host/ufs-qcom.c | 11 +- + drivers/ufs/host/ufshcd-pltfrm.c | 154 + + include/scsi/scsi_host.h | 24 +- + include/uapi/linux/cciss_ioctl.h | 1 + + include/ufs/ufs.h | 6 + + include/ufs/ufshcd.h | 45 +- + include/ufs/ufshci.h | 12 + + kernel/dma/mapping.c | 3 + + 129 files changed, 30596 insertions(+), 2934 deletions(-) + create mode 100644 Documentation/scsi/leapraid.rst + create mode 100644 drivers/scsi/fnic/fnic_nvme.c + create mode 100644 drivers/scsi/fnic/fnic_nvme.h + rename drivers/scsi/ibmvscsi/{ibmvfc.c => ibmvfc-core.c} (87%) + create mode 100644 drivers/scsi/ibmvscsi/ibmvfc-nvme.c + create mode 100644 drivers/scsi/ibmvscsi/ibmvfc-nvme.h + create mode 100644 drivers/scsi/leapraid/Kconfig + create mode 100644 drivers/scsi/leapraid/Makefile + create mode 100644 drivers/scsi/leapraid/leapraid.h + create mode 100644 drivers/scsi/leapraid/leapraid_app.c + create mode 100644 drivers/scsi/leapraid/leapraid_func.c + create mode 100644 drivers/scsi/leapraid/leapraid_func.h + create mode 100644 drivers/scsi/leapraid/leapraid_os.c + create mode 100644 drivers/scsi/leapraid/leapraid_transport.c + create mode 100644 drivers/scsi/mpt3sas/mpt3sas_hwmon.c + create mode 100644 drivers/scsi/qla2xxx/qla_fw29.h +$ git am -3 ../patches/device-id-zorro +Applying: foofof +$ git reset HEAD^ +Unstaged changes after reset: +M include/linux/device-id/zorro.h +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master 36b9a86c8c12e] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git + Date: Thu Aug 20 13:58:01 2026 +0100 +Merging vhost/linux-next (ae864da7d762b vduse: Add suspend) +$ git merge -m Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost/linux-next +Auto-merging MAINTAINERS +Auto-merging drivers/vhost/net.c +Auto-merging lib/iov_iter.c +Auto-merging net/vmw_vsock/virtio_transport_common.c +Merge made by the 'ort' strategy. + MAINTAINERS | 2 - + .../crypto/virtio/virtio_crypto_akcipher_algs.c | 6 +- + .../crypto/virtio/virtio_crypto_skcipher_algs.c | 3 +- + drivers/nvdimm/nd_virtio.c | 263 ++++++++++++++++---- + drivers/nvdimm/pmem.c | 53 +++-- + drivers/nvdimm/region_devs.c | 5 +- + drivers/nvdimm/virtio_pmem.c | 65 ++++- + drivers/nvdimm/virtio_pmem.h | 22 +- + drivers/vdpa/alibaba/eni_vdpa.c | 1 + + drivers/vdpa/mlx5/core/mr.c | 2 +- + drivers/vdpa/mlx5/net/mlx5_vnet.c | 27 ++- + drivers/vdpa/octeon_ep/octep_vdpa_main.c | 5 +- + drivers/vdpa/solidrun/snet_ctrl.c | 4 +- + drivers/vdpa/vdpa_sim/vdpa_sim.c | 29 ++- + drivers/vdpa/vdpa_user/vduse_dev.c | 265 ++++++++++++++++----- + drivers/vdpa/virtio_pci/vp_vdpa.c | 12 +- + drivers/vhost/iotlb.c | 6 +- + drivers/vhost/net.c | 3 +- + drivers/vhost/vhost.c | 15 ++ + drivers/vhost/vsock.c | 80 +++++-- + drivers/virtio/virtio.c | 41 ++-- + drivers/virtio/virtio_balloon.c | 102 +++++--- + drivers/virtio/virtio_dma_buf.c | 2 +- + drivers/virtio/virtio_mem.c | 10 +- + drivers/virtio/virtio_mmio.c | 13 +- + drivers/virtio/virtio_pci_common.c | 2 +- + drivers/virtio/virtio_ring.c | 8 + + drivers/virtio/virtio_rtc_driver.c | 14 +- + include/linux/libnvdimm.h | 9 + + include/linux/virtio.h | 1 + + include/linux/virtio_dma_buf.h | 2 +- + include/uapi/linux/vduse.h | 28 +++ + include/uapi/linux/virtio_ids.h | 1 + + lib/iov_iter.c | 1 + + net/vmw_vsock/virtio_transport_common.c | 13 + + tools/virtio/vhost_net_test.c | 5 - + tools/virtio/virtio-trace/trace-agent-ctl.c | 2 +- + tools/virtio/vringh_test.c | 2 +- + 38 files changed, 865 insertions(+), 259 deletions(-) +Merging rpmsg/for-next (d4d61a4b0a52e Merge branches 'hwspinlock-next', 'rpmsg-next' and 'rproc-next' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rpmsg/for-next +Auto-merging MAINTAINERS +Auto-merging arch/arm64/boot/dts/qcom/eliza.dtsi +Auto-merging drivers/firmware/xilinx/zynqmp.c +Auto-merging include/linux/firmware/xlnx-zynqmp.h +Merge made by the 'ort' strategy. + .../bindings/remoteproc/amd,bram-rproc.yaml | 105 ++++++ + .../remoteproc/amlogic,meson-mx-ao-arc.yaml | 2 +- + .../devicetree/bindings/remoteproc/qcom,adsp.yaml | 82 ++--- + .../remoteproc/qcom,kaanapali-soccp-pas.yaml | 156 +++++++++ + .../bindings/remoteproc/qcom,milos-pas.yaml | 29 +- + .../bindings/remoteproc/qcom,nord-pas.yaml | 173 ++++++++++ + .../bindings/remoteproc/qcom,pas-common.yaml | 28 +- + .../bindings/remoteproc/qcom,qcs404-pas.yaml | 22 +- + .../bindings/remoteproc/qcom,sa8775p-pas.yaml | 22 +- + .../bindings/remoteproc/qcom,sc7180-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sc8280xp-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sdx55-pas.yaml | 24 +- + .../bindings/remoteproc/qcom,shikra-pas.yaml | 20 ++ + .../bindings/remoteproc/qcom,sm6115-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sm6350-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sm6375-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sm8150-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sm8350-pas.yaml | 28 ++ + .../bindings/remoteproc/qcom,sm8550-pas.yaml | 55 +++ + .../bindings/remoteproc/ti,am3352-wkup-m3.yaml | 89 +++++ + .../bindings/remoteproc/ti,pru-consumer.yaml | 1 - + .../bindings/remoteproc/wkup_m3_rproc.txt | 52 --- + Documentation/staging/rpmsg.rst | 1 - + MAINTAINERS | 3 +- + arch/arm64/boot/dts/qcom/eliza.dtsi | 2 +- + drivers/firmware/xilinx/zynqmp.c | 93 +++++ + drivers/hwspinlock/hwspinlock_core.c | 2 +- + drivers/remoteproc/Kconfig | 13 +- + drivers/remoteproc/Makefile | 1 + + drivers/remoteproc/amd_mbv_bram_rproc.c | 213 ++++++++++++ + drivers/remoteproc/da8xx_remoteproc.c | 2 +- + drivers/remoteproc/imx_dsp_rproc.c | 41 +-- + drivers/remoteproc/imx_rproc.c | 40 +-- + drivers/remoteproc/ingenic_rproc.c | 4 +- + drivers/remoteproc/keystone_remoteproc.c | 6 +- + drivers/remoteproc/mtk_scp.c | 13 +- + drivers/remoteproc/omap_remoteproc.c | 2 +- + drivers/remoteproc/qcom_common.c | 4 +- + drivers/remoteproc/qcom_common.h | 6 + + drivers/remoteproc/qcom_q6v5.c | 79 +++-- + drivers/remoteproc/qcom_q6v5.h | 4 + + drivers/remoteproc/qcom_q6v5_adsp.c | 7 +- + drivers/remoteproc/qcom_q6v5_mss.c | 24 +- + drivers/remoteproc/qcom_q6v5_pas.c | 373 +++++++++++++++++---- + drivers/remoteproc/qcom_sysmon.c | 21 +- + drivers/remoteproc/qcom_wcnss.c | 45 +-- + drivers/remoteproc/rcar_rproc.c | 41 +-- + drivers/remoteproc/remoteproc_core.c | 173 ++++++---- + drivers/remoteproc/remoteproc_internal.h | 54 +++ + drivers/remoteproc/remoteproc_sysfs.c | 1 - + drivers/remoteproc/st_remoteproc.c | 31 +- + drivers/remoteproc/stm32_rproc.c | 42 +-- + drivers/remoteproc/ti_k3_r5_remoteproc.c | 8 +- + drivers/remoteproc/xlnx_r5_remoteproc.c | 204 +++++------ + drivers/rpmsg/qcom_glink_native.c | 5 +- + drivers/rpmsg/qcom_glink_smem.c | 7 + + drivers/rpmsg/qcom_smd.c | 2 +- + drivers/rpmsg/rpmsg_char.c | 11 +- + drivers/rpmsg/rpmsg_core.c | 6 +- + drivers/soc/qcom/mdt_loader.c | 27 +- + include/linux/firmware/qcom/qcom_pas.h | 12 + + include/linux/firmware/xlnx-zynqmp.h | 12 + + include/linux/remoteproc.h | 55 +-- + include/linux/rsc_table.h | 46 +-- + include/linux/soc/qcom/mdt_loader.h | 10 +- + 65 files changed, 2084 insertions(+), 718 deletions(-) + create mode 100644 Documentation/devicetree/bindings/remoteproc/amd,bram-rproc.yaml + create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,kaanapali-soccp-pas.yaml + create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml + create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,am3352-wkup-m3.yaml + delete mode 100644 Documentation/devicetree/bindings/remoteproc/wkup_m3_rproc.txt + create mode 100644 drivers/remoteproc/amd_mbv_bram_rproc.c +Merging gpio-brgl/gpio/for-next (146cc263e457f Merge tag 'v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next) +$ git merge -m Merge branch 'gpio/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio-brgl/gpio/for-next +Already up to date. +Merging gpio-intel/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git gpio-intel/for-next +Already up to date. +Merging pinctrl/for-next (d067f0f4c96cb Merge tag 'pinctrl-qcom-updates-for-v7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git pinctrl/for-next +Auto-merging Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml +Auto-merging MAINTAINERS +Auto-merging drivers/pinctrl/Kconfig +Auto-merging drivers/pinctrl/intel/pinctrl-tigerlake.c +Auto-merging drivers/pinctrl/meson/pinctrl-meson.c +Auto-merging drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c +Auto-merging drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +Auto-merging drivers/pinctrl/pinctrl-eic7700.c +Auto-merging drivers/pinctrl/pinctrl-mcp23s08.c +Auto-merging drivers/pinctrl/tegra/pinctrl-tegra264.c +Merge made by the 'ort' strategy. + .../bindings/pinctrl/airoha,an7563-pinctrl.yaml | 350 +++ + .../bindings/pinctrl/airoha,an7583-pinctrl.yaml | 65 +- + .../bindings/pinctrl/airoha,en7523-pinctrl.yaml | 378 +++ + .../bindings/pinctrl/airoha,en7581-pinctrl.yaml | 17 +- + .../devicetree/bindings/pinctrl/apple,pinctrl.yaml | 2 + + .../pinctrl/aspeed,ast2700-soc1-pinctrl.yaml | 1 + + .../bindings/pinctrl/mediatek,mt6858-pinctrl.yaml | 190 ++ + .../bindings/pinctrl/mediatek,mt7622-pinctrl.yaml | 5 + + .../bindings/pinctrl/microchip,pic32-pinctrl.txt | 60 - + .../pinctrl/microchip,pic32mzda-pinctrl.yaml | 109 + + .../pinctrl/nvidia,tegra264-pinmux-main.yaml | 6 +- + .../bindings/pinctrl/nxp,s32g2-siul2-pinctrl.yaml | 90 +- + .../bindings/pinctrl/qcom,maili-tlmm.yaml | 120 + + .../pinctrl/qcom,milos-lpass-lpi-pinctrl.yaml | 18 +- + .../bindings/pinctrl/qcom,pmic-gpio.yaml | 3 + + .../bindings/pinctrl/rockchip,pinctrl.yaml | 1 + + .../pinctrl/samsung,pinctrl-wakeup-interrupt.yaml | 1 + + .../bindings/pinctrl/samsung,pinctrl.yaml | 1 + + .../devicetree/bindings/pinctrl/ti,da850-pupd.txt | 55 - + .../devicetree/bindings/pinctrl/ti,da850-pupd.yaml | 74 + + .../bindings/pinctrl/ti,dra7-iodelay.yaml | 83 + + .../devicetree/bindings/pinctrl/ti,iodelay.txt | 47 - + Documentation/driver-api/pin-control.rst | 2 +- + MAINTAINERS | 7 + + arch/arm64/boot/dts/mediatek/mt6858-pinfunc.h | 1335 ++++++++++ + drivers/pinctrl/Kconfig | 6 +- + drivers/pinctrl/actions/pinctrl-owl.c | 2 +- + drivers/pinctrl/airoha/Kconfig | 42 +- + drivers/pinctrl/airoha/Makefile | 7 + + drivers/pinctrl/airoha/airoha-common.h | 147 ++ + drivers/pinctrl/airoha/pinctrl-airoha.c | 2669 ++------------------ + drivers/pinctrl/airoha/pinctrl-an7563.c | 1115 ++++++++ + drivers/pinctrl/airoha/pinctrl-an7581.c | 1487 +++++++++++ + drivers/pinctrl/airoha/pinctrl-an7583.c | 1517 +++++++++++ + drivers/pinctrl/airoha/pinctrl-en7523.c | 1157 +++++++++ + drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc1.c | 6 +- + drivers/pinctrl/bcm/Kconfig | 2 + + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 1 - + drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 9 +- + drivers/pinctrl/freescale/pinctrl-imx1-core.c | 7 +- + drivers/pinctrl/intel/pinctrl-intel.c | 2 +- + drivers/pinctrl/intel/pinctrl-tigerlake.c | 32 + + drivers/pinctrl/mediatek/Kconfig | 80 +- + drivers/pinctrl/mediatek/Makefile | 1 + + drivers/pinctrl/mediatek/mtk-eint.c | 27 +- + drivers/pinctrl/mediatek/pinctrl-moore.c | 11 +- + drivers/pinctrl/mediatek/pinctrl-mt2701.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt2712.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt6397.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt6795.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt6797.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt6858.c | 1409 +++++++++++ + drivers/pinctrl/mediatek/pinctrl-mt6878.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt6893.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt7620.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt7621.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt7622.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt7629.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt76x8.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt7981.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt7986.c | 21 +- + drivers/pinctrl/mediatek/pinctrl-mt7988.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt8127.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt8135.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt8167.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt8173.c | 5 + + drivers/pinctrl/mediatek/pinctrl-mt8183.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt8186.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt8188.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt8189.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt8192.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt8195.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mt8196.c | 2 + + drivers/pinctrl/mediatek/pinctrl-mt8365.c | 3 + + drivers/pinctrl/mediatek/pinctrl-mt8516.c | 4 + + drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 7 +- + drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 22 +- + drivers/pinctrl/mediatek/pinctrl-mtk-mt6858.h | 2378 +++++++++++++++++ + drivers/pinctrl/mediatek/pinctrl-mtmips.c | 4 + + drivers/pinctrl/mediatek/pinctrl-paris.c | 2 +- + drivers/pinctrl/mediatek/pinctrl-rt2880.c | 4 + + drivers/pinctrl/mediatek/pinctrl-rt305x.c | 4 + + drivers/pinctrl/mediatek/pinctrl-rt3883.c | 4 + + drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 14 +- + drivers/pinctrl/meson/pinctrl-meson.c | 8 +- + drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 5 +- + drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 191 +- + drivers/pinctrl/nxp/pinctrl-s32cc.c | 49 +- + drivers/pinctrl/pinctrl-aw9523.c | 2 +- + drivers/pinctrl/pinctrl-eic7700.c | 3 + + drivers/pinctrl/pinctrl-generic-mux.c | 2 +- + drivers/pinctrl/pinctrl-generic.c | 25 +- + drivers/pinctrl/pinctrl-mcp23s08.c | 5 +- + drivers/pinctrl/pinctrl-ocelot.c | 2 +- + drivers/pinctrl/pinctrl-rockchip.c | 508 +++- + drivers/pinctrl/pinctrl-rockchip.h | 9 +- + drivers/pinctrl/pinctrl-rp1.c | 2 +- + drivers/pinctrl/pinctrl-stmfx.c | 4 +- + drivers/pinctrl/pinctrl-sx150x.c | 23 +- + drivers/pinctrl/pinctrl-tb10x.c | 2 +- + drivers/pinctrl/pinctrl-upboard.c | 21 + + drivers/pinctrl/qcom/Kconfig.msm | 10 + + drivers/pinctrl/qcom/Makefile | 1 + + drivers/pinctrl/qcom/pinctrl-maili.c | 1625 ++++++++++++ + drivers/pinctrl/qcom/pinctrl-milos-lpass-lpi.c | 40 + + drivers/pinctrl/qcom/pinctrl-msm.c | 67 +- + drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 + + drivers/pinctrl/qcom/pinctrl-x1e80100.c | 4 +- + drivers/pinctrl/qcom/tlmm-test.c | 3 - + drivers/pinctrl/realtek/pinctrl-rtd1625.c | 4 +- + drivers/pinctrl/renesas/pinctrl-rza2.c | 26 +- + drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 132 + + drivers/pinctrl/samsung/pinctrl-samsung.c | 2 + + drivers/pinctrl/samsung/pinctrl-samsung.h | 1 + + drivers/pinctrl/spacemit/pinctrl-k1.c | 10 +- + drivers/pinctrl/spear/pinctrl-plgpio.c | 2 +- + drivers/pinctrl/tegra/pinctrl-tegra264.c | 24 +- + 118 files changed, 15233 insertions(+), 2904 deletions(-) + create mode 100644 Documentation/devicetree/bindings/pinctrl/airoha,an7563-pinctrl.yaml + create mode 100644 Documentation/devicetree/bindings/pinctrl/airoha,en7523-pinctrl.yaml + create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6858-pinctrl.yaml + delete mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32-pinctrl.txt + create mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml + create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,maili-tlmm.yaml + delete mode 100644 Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.txt + create mode 100644 Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.yaml + create mode 100644 Documentation/devicetree/bindings/pinctrl/ti,dra7-iodelay.yaml + delete mode 100644 Documentation/devicetree/bindings/pinctrl/ti,iodelay.txt + create mode 100644 arch/arm64/boot/dts/mediatek/mt6858-pinfunc.h + create mode 100644 drivers/pinctrl/airoha/airoha-common.h + create mode 100644 drivers/pinctrl/airoha/pinctrl-an7563.c + create mode 100644 drivers/pinctrl/airoha/pinctrl-an7581.c + create mode 100644 drivers/pinctrl/airoha/pinctrl-an7583.c + create mode 100644 drivers/pinctrl/airoha/pinctrl-en7523.c + create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt6858.c + create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-mt6858.h + create mode 100644 drivers/pinctrl/qcom/pinctrl-maili.c +Merging pinctrl-intel/for-next (ed1608d5e3c44 Merge patch series "upboard pinctrl support for device id INTC1055") +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git pinctrl-intel/for-next +Already up to date. +Merging pinctrl-renesas/renesas-pinctrl (5a653cedec948 pinctrl: renesas: rza2: Embed pins in the priv struct) +$ git merge -m Merge branch 'renesas-pinctrl' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git pinctrl-renesas/renesas-pinctrl +Already up to date. +Merging pinctrl-samsung/for-next (d441836c9d704 pinctrl: samsung: Add Exynos8855 pinctrl configuration) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git pinctrl-samsung/for-next +Already up to date. +Merging pinctrl-qcom/pinctrl-qcom/for-next (1860fb0be224d pinctrl: qcom: Add irq_get/set_irqchip_state() for msm gpio irqchip) +$ git merge -m Merge branch 'pinctrl-qcom/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git pinctrl-qcom/pinctrl-qcom/for-next +Already up to date. +Merging pwm/pwm/for-next (b4e94b0418ad6 pwm: th1520: use vertical import style) +$ git merge -m Merge branch 'pwm/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/pwm/for-next +Already up to date. +Merging ktest/for-next (932cdaf3e273a ktest: Add logfile to failure directory) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git ktest/for-next +Already up to date. +Merging kselftest/next (649ba27dfac78 selftests/zram: fix kernel_gte() for POSIX sh) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kselftest/next +Already up to date. +Merging kunit/test (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'test' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kunit/test +Already up to date. +Merging kunit-next/kunit (dea754ded9518 kunit: tool: fix _list_tests filtering wrong variable when list has TAP prefix) +$ git merge -m Merge branch 'kunit' of https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kunit-next/kunit +Already up to date. +Merging livepatching/for-next (e77f165d26f72 kbuild: unset sub_make_done before calling kselftest build system) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git livepatching/for-next +Auto-merging Makefile +Merge made by the 'ort' strategy. + Makefile | 4 ++-- + kernel/livepatch/core.c | 34 ++++++++++++++++++++++------------ + 2 files changed, 24 insertions(+), 14 deletions(-) +Merging rtc/rtc-next (da5e8713aee51 rtc: st-lpc: get IRQ via platform_get_irq()) +$ git merge -m Merge branch 'rtc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc/rtc-next +Merge made by the 'ort' strategy. + drivers/rtc/rtc-ab-eoz9.c | 1 + + drivers/rtc/rtc-brcmstb-waketimer.c | 1 + + drivers/rtc/rtc-ds1343.c | 4 ++-- + drivers/rtc/rtc-mv.c | 41 ++++++++----------------------------- + drivers/rtc/rtc-pcf8563.c | 4 +++- + drivers/rtc/rtc-s32g.c | 1 + + drivers/rtc/rtc-spacemit-p1.c | 5 +++-- + drivers/rtc/rtc-st-lpc.c | 9 +++----- + drivers/rtc/rtc-zynqmp.c | 7 +++---- + 9 files changed, 25 insertions(+), 48 deletions(-) +Merging nvdimm/libnvdimm-for-next (e99cb3ecd8334 nvdimm-btt: clean up kernel-doc warnings) +$ git merge -m Merge branch 'libnvdimm-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git nvdimm/libnvdimm-for-next +Auto-merging drivers/nvdimm/btt.c +Auto-merging fs/dax.c +Merge made by the 'ort' strategy. + drivers/dax/dax-private.h | 2 - + drivers/dax/fsdev.c | 154 ++++++++++++++++++++++++++----------- + drivers/dax/super.c | 54 +++++++++++-- + drivers/nvdimm/btt.c | 8 ++ + drivers/nvdimm/btt.h | 2 +- + drivers/nvdimm/label.c | 17 +++- + fs/dax.c | 12 +-- + include/linux/nd.h | 8 +- + tools/testing/nvdimm/test/ndtest.c | 3 +- + tools/testing/nvdimm/test/nfit.c | 3 +- + 10 files changed, 194 insertions(+), 69 deletions(-) +Merging at24/at24/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'at24/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git at24/at24/for-next +Already up to date. +Merging ntb/ntb-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'ntb-next' of https://github.com/jonmason/ntb.git ntb/ntb-next +Already up to date. +Merging seccomp/for-next/seccomp (41fa043273841 selftests/seccomp: Add hard-coded __NR_uprobe for x86_64) +$ git merge -m Merge branch 'for-next/seccomp' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git seccomp/for-next/seccomp +Already up to date. +Merging slimbus/for-next (c922423ce66bc slimbus: qcom-ngd-ctrl: Use the unified QMI service ID instead of defining it locally) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/srini/slimbus.git slimbus/for-next +Auto-merging drivers/slimbus/qcom-ngd-ctrl.c +Merge made by the 'ort' strategy. + drivers/slimbus/qcom-ngd-ctrl.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) +Merging nvmem/for-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git nvmem/for-next +Already up to date. +Merging hyperv/hyperv-next (a4ffc59238be8 mshv: add bounds check on vp_index in mshv_intercept_isr()) +$ git merge -m Merge branch 'hyperv-next' of https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv/hyperv-next +Already up to date. +Merging auxdisplay/for-next (e3e3bf40916c1 auxdisplay: charlcd: cancel backlight work on registration failure) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git auxdisplay/for-next +Merge made by the 'ort' strategy. + drivers/auxdisplay/charlcd.c | 21 ++++++++++++++------- + drivers/auxdisplay/ht16k33.c | 5 +---- + drivers/auxdisplay/panel.c | 37 ------------------------------------- + 3 files changed, 15 insertions(+), 48 deletions(-) +Merging kgdb/kgdb/for-next (fdbdd0ccb30af kdb: remove redundant check for scancode 0xe0) +$ git merge -m Merge branch 'kgdb/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git kgdb/kgdb/for-next +Already up to date. +Merging hmm/hmm (19272b37aa4f8 Linux 6.16-rc1) +$ git merge -m Merge branch 'hmm' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git hmm/hmm +Already up to date. +Merging cfi/cfi/next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'cfi/next' of https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/cfi/next +Already up to date. +Merging mhi/mhi-next (9656bcd4c321a PCI: epf-mhi: Implement mhi_cntrl->flush_async() to flush DMA read/write) +$ git merge -m Merge branch 'mhi-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git mhi/mhi-next +Already up to date. +$ git am -3 ../patches/0001-fix-up-for-net-qrtr-Drop-the-MHI-auto_queue-feature-.patch +Applying: fix up for "net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels" +Using index info to reconstruct a base tree... +M drivers/net/wireless/ath/ath12k/wifi7/mhi.c +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging memblock/for-next (b3c1ec1a9ad84 Merge branch 'misc' into for-next) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git memblock/for-next +Already up to date. +Merging cxl/next (7098e9cd98a05 Merge branch 'for-7.3/cxl-misc' into cxl-for-next) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git cxl/next +Auto-merging drivers/acpi/apei/ghes.c +Merge made by the 'ort' strategy. + Documentation/ABI/testing/sysfs-bus-cxl | 15 +- + Documentation/ABI/testing/sysfs-bus-nvdimm | 3 +- + Documentation/driver-api/cxl/linux/dax-driver.rst | 4 +- + drivers/acpi/apei/ghes.c | 66 +- + drivers/cxl/core/core.h | 7 +- + drivers/cxl/core/features.c | 23 +- + drivers/cxl/core/mbox.c | 27 +- + drivers/cxl/core/mce.c | 27 +- + drivers/cxl/core/memdev.c | 2 +- + drivers/cxl/core/pmem.c | 10 +- + drivers/cxl/core/port.c | 43 +- + drivers/cxl/core/ras.c | 7 +- + drivers/cxl/core/ras_rch.c | 27 +- + drivers/cxl/core/region.c | 61 +- + drivers/cxl/core/trace.h | 10 +- + drivers/cxl/cxl.h | 11 +- + drivers/cxl/cxlmem.h | 4 +- + drivers/cxl/pci.c | 14 +- + drivers/cxl/pmem.c | 2 +- + include/cxl/event.h | 21 +- + include/cxl/mailbox.h | 2 + + tools/testing/cxl/test/Kbuild | 2 + + tools/testing/cxl/test/accel.c | 66 ++ + tools/testing/cxl/test/cxl.c | 833 ++++++++++++++++------ + tools/testing/cxl/test/hmem_test.c | 3 +- + tools/testing/cxl/test/mem.c | 15 +- + tools/testing/cxl/test/mock.h | 2 + + 27 files changed, 923 insertions(+), 384 deletions(-) + create mode 100644 tools/testing/cxl/test/accel.c +Merging zstd/zstd-next (65d1f5507ed2c zstd: Import upstream v1.5.7) +$ git merge -m Merge branch 'zstd-next' of https://github.com/terrelln/linux.git zstd/zstd-next +Already up to date. +Merging efi/next (f56c000d6f5e0 efivarfs: Rate limit statfs() handler) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git efi/next +Merge made by the 'ort' strategy. + arch/x86/platform/efi/quirks.c | 9 +---- + drivers/firmware/efi/Kconfig | 2 +- + drivers/firmware/efi/apple-properties.c | 5 ++- + drivers/firmware/efi/runtime-wrappers.c | 70 ++++++++++++++++++++++++++++----- + fs/efivarfs/super.c | 30 +++++++++++--- + include/linux/efi.h | 8 ++-- + tools/objtool/noreturns.h | 1 + + 7 files changed, 96 insertions(+), 29 deletions(-) +Merging unicode/for-next (a511442085c14 unicode: Properly reject invalid encoding version strings) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode.git unicode/for-next +Merge made by the 'ort' strategy. + fs/unicode/utf8-core.c | 30 +++++------------------------- + include/linux/unicode.h | 3 --- + 2 files changed, 5 insertions(+), 28 deletions(-) +Merging slab/slab/for-next (e7f630142df2a Merge branch 'slab/for-7.3/kfree_rcu_nolock' into slab/for-next) +$ git merge -m Merge branch 'slab/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git slab/slab/for-next +Auto-merging Documentation/admin-guide/kernel-parameters.txt +Auto-merging Documentation/mm/allocation-profiling.rst +Auto-merging include/linux/memcontrol.h +Auto-merging include/linux/rcupdate.h +Auto-merging include/linux/types.h +Auto-merging include/trace/events/rcu.h +Auto-merging mm/memcontrol.c +Auto-merging mm/slab.h +Auto-merging mm/slab_common.c +CONFLICT (content): Merge conflict in mm/slab_common.c +Auto-merging mm/slub.c +Resolved 'mm/slab_common.c' using previous resolution. +Automatic merge failed; fix conflicts and then commit the result. +$ git commit --no-edit -v -a +[master 9443ced4df017] Merge branch 'slab/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git +$ git diff -M --stat --summary HEAD^.. + Documentation/ABI/testing/sysfs-kernel-slab | 18 +- + Documentation/admin-guide/kernel-parameters.txt | 5 + + Documentation/mm/allocation-profiling.rst | 7 + + include/linux/memcontrol.h | 13 - + include/linux/rcupdate.h | 32 +- + include/linux/slab.h | 19 +- + include/linux/types.h | 10 + + include/trace/events/rcu.h | 2 +- + lib/tests/slub_kunit.c | 190 +++++-- + mm/kfence/core.c | 12 - + mm/kfence/kfence.h | 3 - + mm/kfence/kfence_test.c | 2 +- + mm/memcontrol.c | 37 +- + mm/mempool.c | 35 +- + mm/slab.h | 243 +++++++-- + mm/slab_common.c | 111 +++- + mm/slub.c | 672 ++++++++++++++---------- + 17 files changed, 945 insertions(+), 466 deletions(-) +$ git am -3 ../patches/0001-drm-panthor-I-love-Werror.patch +Applying: drm/panthor: I love -Werror +Using index info to reconstruct a base tree... +M drivers/gpu/drm/panthor/panthor_mmu.c +Falling back to patching base and 3-way merge... +Auto-merging drivers/gpu/drm/panthor/panthor_mmu.c +No changes -- Patch already applied. +$ git am -3 ../patches/0001-rust-poll-fix-compilation-error-due-to-kvfree_call_r.patch +Applying: From: "Vlastimil Babka (SUSE)" Subject: rust: poll: fix compilation error due to kvfree_call_rcu changes Date: Wed, 05 Aug 2026 18:28:45 +0200 +$ git reset HEAD^ +Unstaged changes after reset: +M rust/kernel/sync/poll.rs +$ git add -A . +$ git commit -v -a --amend +warning: notes ref refs/notes/commits is invalid +[master 2016b929b6c1f] Merge branch 'slab/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git + Date: Thu Aug 20 13:58:45 2026 +0100 +Merging random/master (bb9ff576fdff4 virt: vmgenid: remap memory as decrypted) +$ git merge -m Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git random/master +Merge made by the 'ort' strategy. + drivers/virt/vmgenid.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) +Merging landlock/next (172b6a6d84635 landlock: Document tracepoints) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git landlock/next +Auto-merging MAINTAINERS +Merge made by the 'ort' strategy. + Documentation/admin-guide/LSM/landlock.rst | 106 +- + Documentation/security/landlock.rst | 38 +- + Documentation/trace/events-landlock.rst | 326 ++++ + Documentation/trace/index.rst | 1 + + Documentation/userspace-api/landlock.rst | 62 +- + MAINTAINERS | 3 + + include/linux/landlock.h | 56 + + include/trace/events/landlock.h | 965 ++++++++++++ + include/uapi/linux/landlock.h | 22 +- + samples/landlock/sandboxer.c | 16 +- + security/landlock/Kconfig | 5 + + security/landlock/Makefile | 12 +- + security/landlock/access.h | 6 +- + security/landlock/audit.c | 639 +------- + security/landlock/audit.h | 57 +- + security/landlock/cred.c | 14 +- + security/landlock/cred.h | 29 +- + security/landlock/domain.c | 472 +++++- + security/landlock/domain.h | 163 +- + security/landlock/errata/abi-1.h | 23 + + security/landlock/fs.c | 259 +++- + security/landlock/fs.h | 40 +- + security/landlock/id.h | 6 +- + security/landlock/limits.h | 2 +- + security/landlock/log.c | 587 +++++++ + security/landlock/log.h | 86 ++ + security/landlock/net.c | 38 +- + security/landlock/ruleset.c | 550 +------ + security/landlock/ruleset.h | 270 ++-- + security/landlock/syscalls.c | 129 +- + security/landlock/task.c | 87 +- + security/landlock/trace.c | 185 +++ + security/landlock/trace.h | 44 + + security/landlock/tsync.c | 24 +- + security/landlock/tsync.h | 4 +- + tools/testing/selftests/landlock/audit.h | 35 - + tools/testing/selftests/landlock/base_test.c | 104 +- + tools/testing/selftests/landlock/common.h | 47 + + tools/testing/selftests/landlock/config | 2 + + tools/testing/selftests/landlock/fs_test.c | 738 ++++++++- + tools/testing/selftests/landlock/net_test.c | 590 ++++++- + tools/testing/selftests/landlock/ptrace_test.c | 402 +++++ + .../selftests/landlock/scoped_abstract_unix_test.c | 264 ++++ + .../selftests/landlock/scoped_signal_test.c | 404 +++++ + tools/testing/selftests/landlock/trace.h | 639 ++++++++ + tools/testing/selftests/landlock/trace_fs_test.c | 496 ++++++ + tools/testing/selftests/landlock/trace_test.c | 1620 ++++++++++++++++++++ + tools/testing/selftests/landlock/true.c | 10 + + tools/testing/selftests/landlock/tsync_test.c | 96 +- + 49 files changed, 9257 insertions(+), 1516 deletions(-) + create mode 100644 Documentation/trace/events-landlock.rst + create mode 100644 include/linux/landlock.h + create mode 100644 include/trace/events/landlock.h + create mode 100644 security/landlock/log.c + create mode 100644 security/landlock/log.h + create mode 100644 security/landlock/trace.c + create mode 100644 security/landlock/trace.h + create mode 100644 tools/testing/selftests/landlock/trace.h + create mode 100644 tools/testing/selftests/landlock/trace_fs_test.c + create mode 100644 tools/testing/selftests/landlock/trace_test.c +Merging sysctl/sysctl-next (8d75c338f0bce sysctl: remove CONFIG_PROC_SYSCTL, it just mirrors CONFIG_SYSCTL) +$ git merge -m Merge branch 'sysctl-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl/sysctl-next +Auto-merging arch/s390/Kconfig +Auto-merging fs/pipe.c +Auto-merging init/Kconfig +Auto-merging kernel/pid.c +Auto-merging kernel/sched/core.c +Auto-merging kernel/sched/topology.c +Auto-merging lib/Kconfig.debug +Auto-merging tools/testing/selftests/net/config +Merge made by the 'ort' strategy. + arch/m68k/configs/amcore_defconfig | 2 +- + arch/m68k/configs/stmark2_defconfig | 2 +- + arch/s390/Kconfig | 4 +- + arch/x86/kernel/cpu/bus_lock.c | 2 +- + fs/pipe.c | 2 +- + fs/proc/Kconfig | 3 +- + fs/proc/Makefile | 2 +- + fs/proc/internal.h | 2 +- + include/linux/sysctl.h | 133 +++-- + include/linux/utsname.h | 2 +- + init/Kconfig | 3 - + kernel/delayacct.c | 2 +- + kernel/pid.c | 31 -- + kernel/reboot.c | 29 ++ + kernel/sched/core.c | 8 +- + kernel/sched/topology.c | 4 +- + kernel/sysctl.c | 542 +++++++++++---------- + kernel/time/jiffies.c | 31 +- + kernel/utsname_sysctl.c | 4 +- + lib/Kconfig.debug | 2 +- + lib/test_sysctl.c | 2 +- + net/mpls/Kconfig | 2 +- + tools/testing/selftests/net/config | 2 +- + tools/testing/selftests/net/packetdrill/config | 2 +- + .../testing/selftests/wireguard/qemu/kernel.config | 2 +- + 25 files changed, 459 insertions(+), 361 deletions(-) +$ git am -3 ../patches/0001-jifies-Fix-up-merge.patch +Applying: jifies: Fix up merge +Using index info to reconstruct a base tree... +M kernel/time/jiffies.c +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging execve/for-next/execve (ab11176bd3a76 x86/elf: Correct comment for STACK_RND_MASK()) +$ git merge -m Merge branch 'for-next/execve' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git execve/for-next/execve +Merge made by the 'ort' strategy. + arch/x86/include/asm/elf.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +Merging bitmap/bitmap-for-next (f4806cc63cc65 lib: test bitmap vs IDA vs Maple Tree performance for region allocations) +$ git merge -m Merge branch 'bitmap-for-next' of https://github.com/norov/linux.git bitmap/bitmap-for-next +Auto-merging MAINTAINERS +Auto-merging arch/powerpc/perf/imc-pmu.c +Auto-merging arch/x86/events/amd/uncore.c +Auto-merging arch/x86/events/intel/core.c +Auto-merging arch/x86/events/intel/uncore.c +Auto-merging drivers/devfreq/event/rockchip-dfi.c +Auto-merging drivers/fpga/dfl-fme-perf.c +Auto-merging drivers/hwtracing/ptt/hisi_ptt.c +Auto-merging drivers/pci/pci-sysfs.c +Auto-merging drivers/perf/alibaba_uncore_drw_pmu.c +Auto-merging drivers/perf/arm-cmn.c +Auto-merging drivers/perf/arm_cspmu/arm_cspmu.c +Auto-merging drivers/perf/arm_pmu.c +Auto-merging drivers/perf/arm_spe_pmu.c +Auto-merging drivers/perf/cxl_pmu.c +Auto-merging drivers/perf/dwc_pcie_pmu.c +Auto-merging drivers/perf/fsl_imx8_ddr_perf.c +Auto-merging drivers/perf/fsl_imx9_ddr_perf.c +Auto-merging drivers/perf/fujitsu_uncore_pmu.c +Auto-merging drivers/perf/hisilicon/hisi_uncore_pmu.c +Auto-merging drivers/perf/marvell_cn10k_ddr_pmu.c +Auto-merging drivers/perf/qcom_l2_pmu.c +Auto-merging drivers/perf/qcom_l3_pmu.c +Auto-merging drivers/perf/starfive_starlink_pmu.c +Auto-merging drivers/perf/xgene_pmu.c +Auto-merging kernel/events/core.c +Auto-merging lib/Kconfig.debug +Auto-merging lib/Makefile +Merge made by the 'ort' strategy. + MAINTAINERS | 3 + + arch/arm/mach-imx/mmdc.c | 2 +- + arch/arm/mm/cache-l2x0-pmu.c | 2 +- + arch/arm/mm/dma-mapping.c | 4 +- + arch/powerpc/kernel/cacheinfo.c | 3 +- + arch/powerpc/perf/hv-24x7.c | 2 +- + arch/powerpc/perf/hv-gpci.c | 2 +- + arch/powerpc/perf/imc-pmu.c | 2 +- + arch/powerpc/sysdev/msi_bitmap.c | 2 +- + arch/x86/events/amd/iommu.c | 2 +- + arch/x86/events/amd/power.c | 2 +- + arch/x86/events/amd/uncore.c | 2 +- + arch/x86/events/intel/core.c | 2 +- + arch/x86/events/intel/uncore.c | 2 +- + drivers/base/cpu.c | 2 +- + drivers/crypto/ccp/ccp-dev-v3.c | 2 +- + drivers/crypto/ccp/ccp-dev-v5.c | 2 +- + drivers/devfreq/event/rockchip-dfi.c | 2 +- + drivers/devfreq/hisi_uncore_freq.c | 2 +- + drivers/firmware/psci/psci_checker.c | 15 +- + drivers/fpga/dfl-fme-perf.c | 2 +- + drivers/hwtracing/ptt/hisi_ptt.c | 2 +- + drivers/infiniband/hw/hfi1/sdma.c | 3 +- + .../media/platform/samsung/s5p-mfc/s5p_mfc_opr.c | 2 +- + drivers/pci/pci-sysfs.c | 7 +- + drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- + drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- + drivers/perf/arm-cci.c | 2 +- + drivers/perf/arm-ccn.c | 2 +- + drivers/perf/arm-cmn.c | 2 +- + drivers/perf/arm-ni.c | 2 +- + drivers/perf/arm_cspmu/arm_cspmu.c | 2 +- + drivers/perf/arm_dmc620_pmu.c | 4 +- + drivers/perf/arm_dsu_pmu.c | 2 +- + drivers/perf/arm_pmu.c | 2 +- + drivers/perf/arm_smmuv3_pmu.c | 2 +- + drivers/perf/arm_spe_pmu.c | 2 +- + drivers/perf/cxl_pmu.c | 2 +- + drivers/perf/dwc_pcie_pmu.c | 2 +- + drivers/perf/fsl_imx8_ddr_perf.c | 2 +- + drivers/perf/fsl_imx9_ddr_perf.c | 2 +- + drivers/perf/fujitsu_uncore_pmu.c | 2 +- + drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- + drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- + drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- + drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- + drivers/perf/marvell_pem_pmu.c | 2 +- + drivers/perf/nvidia_t410_c2c_pmu.c | 2 +- + drivers/perf/nvidia_t410_cmem_latency_pmu.c | 2 +- + drivers/perf/qcom_l2_pmu.c | 2 +- + drivers/perf/qcom_l3_pmu.c | 2 +- + drivers/perf/starfive_starlink_pmu.c | 2 +- + drivers/perf/thunderx2_pmu.c | 2 +- + drivers/perf/xgene_pmu.c | 2 +- + include/asm-generic/bitops/le.h | 18 +- + include/linux/bitmap.h | 15 +- + include/linux/bits.h | 6 +- + include/linux/cpumask.h | 19 -- + include/linux/nodemask.h | 15 +- + kernel/events/core.c | 2 +- + lib/Kconfig.debug | 13 ++ + lib/Makefile | 1 + + lib/bitmap-str.c | 9 +- + lib/bitmap.c | 30 +-- + lib/find_bit_benchmark.c | 17 ++ + lib/region_alloc_benchmark.c | 217 +++++++++++++++++++++ + lib/test_bitmap.c | 39 ++++ + tools/include/linux/bits.h | 6 +- + 68 files changed, 402 insertions(+), 138 deletions(-) + create mode 100644 lib/region_alloc_benchmark.c +Merging hte/for-next (005b25ad11717 hte: tegra194: Add Tegra264 GTE support) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux.git hte/for-next +Already up to date. +Merging kspp/for-next/kspp (3421b9b056a65 selftests/seccomp: Fix pointer type mismatch build error) +$ git merge -m Merge branch 'for-next/kspp' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/for-next/kspp +Already up to date. +Merging nolibc/for-next (b58afc8d1cf85 tools/nolibc: add support for Alpha) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/nolibc/linux-nolibc.git nolibc/for-next +Already up to date. +Merging iommufd/for-next (8c07df7cdfcf5 iommufd: Fix UAF in selftest IOPF reporting) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git iommufd/for-next +Already up to date. +Merging turbostat/next (1c996a37fd244 tools/power turbostat: pmt: Improve sscanf() hygiene) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat/next +Merge made by the 'ort' strategy. + tools/power/x86/turbostat/turbostat.8 | 6 +- + tools/power/x86/turbostat/turbostat.c | 567 ++++++++++++++++------------------ + 2 files changed, 266 insertions(+), 307 deletions(-) +Merging pwrseq/pwrseq/for-next (a39ac4651e3b9 power: sequencing: pcie-m2: Match WCN6855 and WCN7851 UART BT variants by subdevice ID) +$ git merge -m Merge branch 'pwrseq/for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git pwrseq/pwrseq/for-next +Already up to date. +Merging capabilities-next/caps-next (9b0ee13b80798 capability: remove non-kernel-doc comments) +$ git merge -m Merge branch 'caps-next' of https://git.kernel.org/pub/scm/linux/kernel/git/sergeh/linux.git capabilities-next/caps-next +Merge made by the 'ort' strategy. + include/uapi/linux/capability.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) +$ git am -3 ../patches/0001-sign-file-Fix-up-merge-issue.patch +Applying: sign-file: Fix up merge issue +Using index info to reconstruct a base tree... +M scripts/sign-file.c +Falling back to patching base and 3-way merge... +Auto-merging scripts/sign-file.c +No changes -- Patch already applied. +Merging ipe/next (028ef9c96e961 Linux 7.0) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe.git ipe/next +Already up to date. +Merging kcsan/next (a8488ecbd7ba4 kcsan: avoid unintended access checking in NMIs) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git kcsan/next +Merge made by the 'ort' strategy. + kernel/kcsan/core.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) +Merging crc/crc-next (dc59e4fea9d83 Linux 7.2-rc1) +$ git merge -m Merge branch 'crc-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git crc/crc-next +Already up to date. +Merging keys-next/keys-next (965e9a2cf23b0 pkcs7: Change a pr_warn() to pr_warn_once()) +$ git merge -m Merge branch 'keys-next' of https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git keys-next/keys-next +Already up to date. +Merging fwctl/for-next (e052daab94ee8 rust: introduce abstractions for fwctl) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl.git fwctl/for-next +Already up to date. +$ git am -3 ../patches/rust-fwctl-replace-__pinned_init-with-raw_try_init +Applying: rust: fwctl: replace `__pinned_init` with `raw_try_init` +Using index info to reconstruct a base tree... +M rust/kernel/fwctl.rs +Falling back to patching base and 3-way merge... +No changes -- Patch already applied. +Merging devsec-tsm/next (3177779ae17db virt: coco: change tsm_class to a const struct) +$ git merge -m Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git devsec-tsm/next +Already up to date. +Merging hisilicon/for-next (a5db65458a911 Merge branch 'next/dt64' into for-next) +$ git merge -m Merge branch 'for-next' of https://github.com/hisilicon/linux-hisi.git hisilicon/for-next +Merge made by the 'ort' strategy. +Merging device-id/device-id-rework (995832b2cebe6 Replace by more specific (c files)) +$ git merge -m Merge branch 'device-id-rework' of https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git device-id/device-id-rework +Already up to date. +Merging kthread/for-next (fa39ec4f89f26 doc: Add housekeeping documentation) +$ git merge -m Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git kthread/for-next +Already up to date. diff --git a/localversion-next b/localversion-next new file mode 100644 index 00000000000000..3c3b61a2807ab4 --- /dev/null +++ b/localversion-next @@ -0,0 +1 @@ +-next-20260820 From 2e5980a43d81039ee5a4b02fc8ff6637fead084d Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Tue, 18 Aug 2026 20:14:06 +0000 Subject: [PATCH 241/250] ogc: linux-unstable: first commit -- 2.47.3 (cherry picked from commit 536526d1b587ace66924207d8dcbfd0a50279aec) (cherry picked from commit 0ebc551a74d0ee721a6f59870a5a88ff88e42268) From 2f421f05c596dafd6314ab881b685d1fb17cec0d Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Tue, 18 Aug 2026 20:21:12 +0000 Subject: [PATCH 242/250] ogc: linux-unstable: re-apply patches on top of linux-next (cherry picked from commit c99c14015e4cf4fae9d99707f37a931b2265a617) (cherry picked from commit 4ca2fc862ec8e0e3da589b78b66ba6a80547fd27) --- .github/workflows/sync-linux-next.yml | 88 +++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/sync-linux-next.yml diff --git a/.github/workflows/sync-linux-next.yml b/.github/workflows/sync-linux-next.yml new file mode 100644 index 00000000000000..0a70c36c7df0bd --- /dev/null +++ b/.github/workflows/sync-linux-next.yml @@ -0,0 +1,88 @@ +name: Sync linux-next -> master (replay from marker) + +on: + schedule: + - cron: "0 2 * * *" # every day at 02:00 UTC + workflow_dispatch: {} + +permissions: + contents: write + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout fork + uses: actions/checkout@v4 + with: + ref: master + fetch-depth: 0 + + - name: Configure upstream + run: | + git remote remove upstream || true + git remote add upstream https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git + git fetch upstream --prune + + - name: Replay only commits after marker on top of upstream/master + env: + # Set this to the hash of your single marker commit. + MARKER_COMMIT: "536526d1b587" + run: | + set -euo pipefail + + git checkout master + + # REQUIRED for cherry-pick commit creation (runner has no identity by default) + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + UP_BASE="upstream/master" + git show -s --oneline "$UP_BASE" >/dev/null + git show -s --oneline "$MARKER_COMMIT" >/dev/null + + # Compute replay list BEFORE resetting. + # This lists commits in chronological order (old->new) after MARKER_COMMIT. + MY_COMMITS="$(git rev-list --reverse --no-merges "${MARKER_COMMIT}^..master")" + + if [ -z "${MY_COMMITS// }" ]; then + echo "No commits to replay after marker." + exit 0 + fi + + echo "Replaying $(echo "$MY_COMMITS" | wc -w) commit(s):" + for c in $MY_COMMITS; do + echo " $c $(git show -s --format=%s "$c")" + done + echo + + # Reset master to upstream base + git reset --hard "$UP_BASE" + + # Cherry-pick each commit; allow-empty prevents failing when the change is already present. + for c in $MY_COMMITS; do + echo "Cherry-picking: $c $(git show -s --format=%s "$c")" + + if git cherry-pick -x --allow-empty "$c"; then + : + else + # If we’re left mid-cherry-pick, abort to avoid a broken working state. + if [ -f .git/CHERRY_PICK_HEAD ]; then + git cherry-pick --abort || true + fi + + # Fail on real conflicts (this should be rare with allow-empty, but keep it strict). + if git diff --name-only --diff-filter=U | grep -q .; then + echo "Real conflict detected while applying $c" + git status + exit 1 + fi + + echo "Cherry-pick failed for $c (non-conflict). Failing to avoid corrupting history." + git status + exit 1 + fi + done + + echo "Done. Pushing updated master." + git push --force-with-lease origin master From 29ff0b0dfc5ca26d51248679939644f4853694f5 Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Wed, 19 Aug 2026 18:06:06 +0000 Subject: [PATCH 243/250] ogc: linux-unstable: build the kernel on push (cherry picked from commit e822804ca492965dfdc2b96a712b3e5edbdb2143) --- .github/packaging/PKGBUILD | 262 ++++++++++++++++++++++++++++ .github/packaging/config.fragment | 25 +++ .github/workflows/build-kernel.yml | 267 +++++++++++++++++++++++++++++ 3 files changed, 554 insertions(+) create mode 100644 .github/packaging/PKGBUILD create mode 100644 .github/packaging/config.fragment create mode 100644 .github/workflows/build-kernel.yml diff --git a/.github/packaging/PKGBUILD b/.github/packaging/PKGBUILD new file mode 100644 index 00000000000000..85dcd59ff2abe7 --- /dev/null +++ b/.github/packaging/PKGBUILD @@ -0,0 +1,262 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Maintainer: OpenGamingCollective +# +# PKGBUILD for the linux-unstable-ogc kernel. +# +# It is designed to be built by the CI job defined in +# .github/workflows/build-kernel.yml, which stages the following next to this +# file before invoking makepkg: +# - linux.tar.gz -> tarball of the checked-out kernel tree (no VCS data) +# - config -> Arch linux-headers .config with the OGC +# kernel-packages config fragments already applied +# - config.fragment -> repo-local overrides merged on top of it +# +# Based on the official Arch Linux kernel PKGBUILD and on the (known to work +# with linux-next) https://github.com/NeroReflex/linux-bisector PKGBUILD. + +pkgbase=linux-unstable-ogc +# Placeholder: makepkg refuses an empty pkgver before pkgver() runs; the real +# version is computed dynamically by pkgver() once sources are extracted. +pkgver=0.0.0 +pkgrel=1 +pkgdesc='linux-next kernel for the Open Gaming Collective' +url='https://github.com/OpenGamingCollective/linux-unstable' +arch=(x86_64) +license=(GPL2) +makedepends=( + bc + cpio + gettext + libelf + pahole + perl + python + tar + xz + gcc + ccache + git + + llvm + clang + lld + + # CONFIG_RUST=y in the base config + rust + rust-bindgen +) +options=('!strip') +source=( + 'linux.tar.gz' + 'config' + 'config.fragment' +) +b2sums=( + 'SKIP' + 'SKIP' + 'SKIP' +) + +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="" +export CC="ccache clang" +export MAKEFLAGS="-j$(nproc)" + +_make() { + test -s version + LLVM=1 LLVM_IAS=1 WERROR=0 KBUILD_BUILD_TIMESTAMP="" make CC="$CC" KERNELRELEASE="$(.. + $(cat localversion-next) + # + the git short sha recorded by CI in .build_commit + # e.g. "7.2.0" + "-next-20260818" + ".g4ca2fc86" -> "7.2.0-next-20260818.g4ca2fc86". + # Pacman does not allow hyphens in pkgver, so they become underscores: + # 7.2.0-next-20260818.g4ca2fc86 -> 7.2.0_next_20260818.g4ca2fc86 + cd "$srcdir/linux" + local ver + ver="$(make -s kernelversion)$(cat localversion-next 2>/dev/null || true)" + if [[ -s .build_commit ]]; then + ver+=".g$(<.build_commit)" + fi + printf '%s\n' "${ver//-/_}" +} + +prepare() { + cd "$srcdir/linux" + + # glibc >= 2.42 made strstr/strchr const-correct; some trees hardcode + # -Werror in tools/lib/bpf which then fails to compile. Keep builds green. + if [[ -f tools/lib/bpf/Makefile ]]; then + sed -i 's/ -Werror -Wall/ -Wall/' tools/lib/bpf/Makefile || true + fi + + echo "Setting version..." + # localversion* files are picked up sorted by name, so the final kernel + # release becomes e.g.: 7.2.0-next-20260818-unstable-ogc-g4ca2fc86-1 + # The -g suffix comes from the .build_commit file the CI writes into + # the tarball (same trick linux-bisector uses with .bisector_commit). + local _commit="" + if [[ -s .build_commit ]]; then + _commit="-g$(<.build_commit)" + fi + echo "${pkgbase#linux}${_commit}" > localversion.10-pkgname + echo "-$pkgrel" > localversion.20-pkgrel + LLVM=1 LLVM_IAS=1 make defconfig + LLVM=1 LLVM_IAS=1 make -s kernelrelease > version + LLVM=1 LLVM_IAS=1 make mrproper + + echo "Setting config..." + cp ../config .config + _make olddefconfig + + echo "Applying OGC config fragment..." + scripts/kconfig/merge_config.sh -m .config ../config.fragment + _make olddefconfig + + diff -u ../config .config || : + + echo "Prepared $pkgbase version $(> "$GITHUB_OUTPUT" + echo "next=${NEXT}" >> "$GITHUB_OUTPUT" + echo "sha8=${SHA8}" >> "$GITHUB_OUTPUT" + echo "krel=${KREL}" >> "$GITHUB_OUTPUT" + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "Kernel release: ${KREL}" + echo "Release tag: ${TAG}" + + - name: Stage sources and packaging files + run: | + set -euxo pipefail + # Commit marker consumed by the PKGBUILD (same trick as linux-bisector) + git rev-parse --short=8 HEAD > .build_commit + + mkdir -p "${PKGDIR}" "${DISTDIR}" + cp .github/packaging/PKGBUILD "${PKGDIR}/PKGBUILD" + cp .github/packaging/config.fragment "${PKGDIR}/config.fragment" + + # ------------------------------------------------------------------ + # Base config: extract the official Arch Linux kernel .config from + # the distro's `linux-headers` package (same method as the OGC + # kernel-packages arch.yaml workflow). + # ------------------------------------------------------------------ + set -o pipefail + CACHE="${PKGDIR}/pkgcache" + mkdir -p "$CACHE" + pacman -Sw --noconfirm --cachedir "$CACHE" linux-headers + PKG="$(find "$CACHE" -maxdepth 1 -name 'linux-headers-*.pkg.tar.zst' -type f)" + if [ -z "$PKG" ]; then + echo "::error::linux-headers package not found in cache"; exit 1 + fi + CFG="$(tar --zstd -tf "$PKG" | grep -E '^usr/lib/modules/[^/]+/build/\.config$' || true)" + if [ -z "$CFG" ]; then + echo "::error::kernel .config not found inside $PKG"; exit 1 + fi + tar --zstd -xOf "$PKG" "$CFG" > "${PKGDIR}/config" + test -s "${PKGDIR}/config" + rm -rf "$CACHE" + head -n 3 "${PKGDIR}/config" + + # ------------------------------------------------------------------ + # Layer the OGC config fragments from kernel-packages on top. + # Semantics replicate OpenGamingCollective/kernel-configurator: + # *.config.set -> key=value lines: replace or append + # *.config.unset -> bare key lines: turn into "# key is not set" + # Applied in the same order as kernel-packages' arch.yaml: + # set: arch.config.set, ogc.config.set + # unset: arch.config.unset, ogc.config.unset + # ------------------------------------------------------------------ + apply_set() { + local cfg="$1" frag="$2" line key value + while IFS= read -r line; do + line="${line#"${line%%[![:space:]]*}"}"; line="${line%"${line##*[![:space:]]}"}" + [ -z "$line" ] && continue + case "$line" in '#'*) continue ;; esac + case "$line" in *=*) ;; *) continue ;; esac + key="${line%%=*}"; value="${line#*=}" + if grep -q "^${key}=" "$cfg"; then + sed -i "s|^${key}=.*|${key}=${value}|" "$cfg" + elif grep -q "^# ${key} is not set$" "$cfg"; then + sed -i "s|^# ${key} is not set\$|${key}=${value}|" "$cfg" + else + printf '%s=%s\n' "$key" "$value" >> "$cfg" + fi + done < "$frag" + } + apply_unset() { + local cfg="$1" frag="$2" line key + while IFS= read -r line; do + line="${line#"${line%%[![:space:]]*}"}"; line="${line%"${line##*[![:space:]]}"}" + [ -z "$line" ] && continue + case "$line" in '#'*) continue ;; esac + key="$line" + if grep -q "^${key}=" "$cfg"; then + sed -i "s|^${key}=.*|# ${key} is not set|" "$cfg" + fi + done < "$frag" + } + + for f in arch.config.set ogc.config.set arch.config.unset ogc.config.unset; do + curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${PKGDIR}/${f}" + done + apply_set "${PKGDIR}/config" "${PKGDIR}/arch.config.set" + apply_set "${PKGDIR}/config" "${PKGDIR}/ogc.config.set" + apply_unset "${PKGDIR}/config" "${PKGDIR}/arch.config.unset" + apply_unset "${PKGDIR}/config" "${PKGDIR}/ogc.config.unset" + echo "Config after OGC fragment merge (head):" + head -n 3 "${PKGDIR}/config" + + # Source tarball: contents of the repo as ./linux/, without VCS data. + # pigz keeps compression fast on the 4-vCPU runners. + tar --exclude-vcs -I pigz -cf "${PKGDIR}/linux.tar.gz" \ + --transform 's|^\./|linux/|' -C "$GITHUB_WORKSPACE" . + + ls -lh "${PKGDIR}" + chown -R build:build "${PKGDIR}" + + - name: Build packages with makepkg + env: + KREL: ${{ steps.kernel.outputs.krel }} + run: | + set -euxo pipefail + cd "${PKGDIR}" + runuser -u build -- env HOME=/home/build CCACHE_DIR=/ccache \ + makepkg -f --noconfirm --noprogressbar + + ls -lh ./*.pkg.tar.zst + cp -v ./*.pkg.tar.zst "${DISTDIR}/" + # Ship the exact .config used for the build as well + cp -v "src/linux/.config" "${DISTDIR}/config-${KREL}" + + - name: Generate checksums + run: | + set -euxo pipefail + cd "${DISTDIR}" + sha256sum * > SHA256SUMS + cat SHA256SUMS + + - name: Clean build tree (free disk before upload) + run: rm -rf "${PKGDIR}/src" "${PKGDIR}/pkg" ; df -h / + + - name: Create GitHub release and upload packages + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ steps.kernel.outputs.tag }} + KREL: ${{ steps.kernel.outputs.krel }} + KVER: ${{ steps.kernel.outputs.kver }} + NEXT: ${{ steps.kernel.outputs.next }} + run: | + set -euxo pipefail + + # Idempotency: if a stale release exists for this tag (e.g. re-run + # of the same commit), remove it so this run can recreate it. + if gh release view "$TAG" --repo "$GITHUB_REPOSITORY"; then + echo "Deleting existing release $TAG, will recreate it" + gh release delete "$TAG" --repo "$GITHUB_REPOSITORY" --yes --cleanup-tag + fi + # In case a tag without a release is left over, drop it too. + gh api -X DELETE "repos/${GITHUB_REPOSITORY}/git/refs/tags/${TAG}" >/dev/null 2>&1 || true + + NOTES="$(mktemp)" + { + echo "Automated build of linux-unstable-ogc." + echo + echo "- Source commit: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" + echo "- Kernel release: ${KREL}" + echo "- Upstream version: ${KVER}${NEXT}" + echo "- Base config: Arch \`linux-headers\` .config + [OGC kernel-packages fragments](${KERNEL_PACKAGES_RAW}/config)" + echo "- Compiler: clang / LLVM=1 (with ccache)" + echo + echo "### Artifacts" + echo + echo '- `linux-unstable-ogc` — kernel image and modules' + echo '- `linux-unstable-ogc-headers` — headers for building external modules' + echo "- \`config-${KREL}\` — the exact kernel .config used for this build" + echo '- `SHA256SUMS` — checksums of all artifacts' + echo + echo "### Install" + echo + echo '```sh' + echo 'sudo pacman -U linux-unstable-ogc-headers-*.pkg.tar.zst linux-unstable-ogc-*.pkg.tar.zst' + echo '```' + echo + echo "> The initramfs is generated automatically on install via the" + echo "> mkinitcpio/dracut pacman hooks (package \`pkgbase\` file)." + } > "$NOTES" + + cd "${DISTDIR}" + gh release create "$TAG" \ + --repo "$GITHUB_REPOSITORY" \ + --target "$GITHUB_SHA" \ + --title "linux-unstable-ogc ${KREL}" \ + --notes-file "$NOTES" \ + ./*.pkg.tar.zst SHA256SUMS "config-${KREL}" + + - name: Summary + env: + TAG: ${{ steps.kernel.outputs.tag }} + KREL: ${{ steps.kernel.outputs.krel }} + run: | + { + echo "## linux-unstable-ogc build" + echo + echo "- Kernel release: \`${KREL}\`" + echo "- Release: https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG}" + } >> "$GITHUB_STEP_SUMMARY" \ No newline at end of file From 29e5e4d14379e4b5f3348fcb428da613fd8a32aa Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Thu, 20 Aug 2026 02:25:48 +0000 Subject: [PATCH 244/250] ogc: linux-unstable: improve build time (cherry picked from commit 8829a4dd5db142fea574e35b13281b83872bca51) --- .github/packaging/config.fragment | 127 ++++++++++++++++++++++---- .github/workflows/build-kernel.yml | 6 +- .github/workflows/sync-linux-next.yml | 2 +- 3 files changed, 113 insertions(+), 22 deletions(-) diff --git a/.github/packaging/config.fragment b/.github/packaging/config.fragment index d72ff1280ba797..c726261944fc3b 100644 --- a/.github/packaging/config.fragment +++ b/.github/packaging/config.fragment @@ -1,25 +1,116 @@ # OGC config overrides for linux-unstable-ogc # -# This fragment is merged on top of the OGC config (base Arch kernel config + -# OpenGamingCollective/kernel-packages config/*.{set,unset} fragments) using -# scripts/kconfig/merge_config.sh in the PKGBUILD prepare() step. +# This fragment is merged LAST, on top of the OGC config (Arch linux-headers +# base + OpenGamingCollective/kernel-packages config/*.{set,unset} fragments) +# via scripts/kconfig/merge_config.sh + olddefconfig in the PKGBUILD. # -# Add one "CONFIG_X=y" / "CONFIG_X=m" / "# CONFIG_X is not set" line per -# option you want to override. +# Target hardware: modern gaming desktops and handhelds (Steam Deck, ROG Ally, +# Legion Go, MSI Claw, GPD, Ayaneo, OneXPlayer...). Keep IMU/gyro/accel/IIO +# drivers, Bluetooth, UVC webcams and all OGC handheld drivers (those live in +# drivers/hid, drivers/platform/x86 — NOT in staging, so STAGING can go). # --- Build fixes ------------------------------------------------------------ # drivers/net/ethernet/cadence/macb_main.c fails to compile in linux-next -# (implicit declarations of macb_alloc_tieoff/macb_free_tieoff). The Cadence -# MACB/GEM hardware is an ARM/SoC NIC, never present on x86_64 OGC targets, -# so disable the driver until the upstream breakage is fixed. +# (implicit declarations of macb_alloc_tieoff/macb_free_tieoff). Cadence +# MACB/GEM is an ARM SoC NIC, never present on x86_64 gaming hardware. # MACB_PCI and MACB_USE_HWSTAMP depend on MACB and drop out automatically. -CONFIG_MACB=n - -# --- CI build sanity -------------------------------------------------------- -# The official Arch config builds with full DWARF5 debug info, which needs -# ~10+ GB of disk and several hours on a 4-vCPU GitHub runner. A released, -# every-day-use kernel does not need debug symbols (they are not shipped in -# the packages anyway), so debug info is disabled here. -# NOTE: this also disables CONFIG_DEBUG_INFO_BTF, which depends on it. -# Remove these lines if you need a debug build. -# CONFIG_DEBUG_INFO is not set \ No newline at end of file +# CONFIG_MACB is not set + +# --- Build speed ------------------------------------------------------------ +# Keep DEBUG_INFO/DEBUG_INFO_BTF=y (OGC requires them for BPF/sched_ext) but +# skip running pahole on every module (thousands of invocations saved). +# CONFIG_DEBUG_INFO_BTF_MODULES is not set + +# --- Xen guest support (not running inside a Xen VM) ------------------------ +# CONFIG_XEN is not set + +# --- Ancient graphics / buses ------------------------------------------------ +# AGP is a pre-PCIe bus; radeon covers pre-GCN AMD GPUs (12+ years old). +# CONFIG_AGP is not set +# CONFIG_DRM_RADEON is not set +# PCMCIA/CardBus slots (2000s laptops) +# CONFIG_PCCARD is not set +# FireWire (IEEE 1394) ports +# CONFIG_FIREWIRE is not set +# Parallel port (printers/scanners from the 90s) +# CONFIG_PARPORT is not set +# IndustryPack carrier boards +# CONFIG_IPACK_BUS is not set +# 1-Wire bus +# CONFIG_W1 is not set +# Analog gameport joysticks (pre-USB) +# CONFIG_GAMEPORT is not set +# Floppy disk controller +# CONFIG_BLK_DEV_FD is not set +# Server BMC management +# CONFIG_IPMI_HANDLER is not set + +# --- Enterprise / datacenter storage ---------------------------------------- +# Fibre Channel HBAs and enterprise RAID controllers +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_QEDF is not set +# CONFIG_FCOE is not set +# CONFIG_LIBFC is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_MAILBOX is not set +# CONFIG_FUSION is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_SMARTPQI is not set + +# --- Ancient Ethernet NICs --------------------------------------------------- +# Vendor menus for 10/100 hardware from the 90s/00s (3Com, Tulip, NatSemi, +# NE2000-era, SiS 900, VIA Rhine/Velocity, Adaptec starfire). Modern NICs +# (Intel/Realtek/Marvell/Broadcom/Aquantia) are untouched. +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_TULIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_8390 is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_NET_VENDOR_VIA is not set + +# --- Specialized/legacy networking ------------------------------------------ +# CONFIG_ATM is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_CAN is not set +# CONFIG_NFC is not set +# CONFIG_INFINIBAND is not set + +# --- Analog/digital TV, radio, legacy webcams -------------------------------- +# UVC (USB_VIDEO_CLASS) webcams stay enabled — handhelds use them. +# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set +# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set +# CONFIG_MEDIA_RADIO_SUPPORT is not set +# CONFIG_USB_GSPCA is not set + +# --- Ancient/cluster filesystems ---------------------------------------------- +# Desktop FS (ext4/btrfs/xfs/f2fs/exfat/ntfs3/vfat/nfs/cifs) untouched. +# CONFIG_MINIX_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_AFS_FS is not set + +# --- Chemical / gas / air-quality sensors ------------------------------------ +# IMU/gyro/accelerometer/pressure/temp/humidity IIO drivers are KEPT +# (handheld controllers need them); only gas/VOC/CO2/PM sensors removed. +# CONFIG_CCS811 is not set +# CONFIG_SPS30 is not set +# CONFIG_PMS7003 is not set +# CONFIG_SENSIRION_SGP30 is not set +# CONFIG_SENSIRION_SGP40 is not set +# CONFIG_SCD30_CORE is not set +# CONFIG_SCD4X is not set +# CONFIG_VZ89X is not set +# CONFIG_BME680 is not set + +# --- Staging drivers ---------------------------------------------------------- +# All OGC handheld drivers live in mainline trees (drivers/hid, +# drivers/platform/x86), not staging. +# CONFIG_STAGING is not set \ No newline at end of file diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index c0e9b94eefe7e3..36013b6ee76b67 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -16,7 +16,7 @@ env: PKGDIR: /tmp/pkgbuild DISTDIR: /tmp/dist CCACHE_DIR: /ccache - CCACHE_MAXSIZE: 4G + CCACHE_MAXSIZE: 10G # Config fragments maintained by the OGC kernel-packages repository. # The base config is extracted from the official Arch `linux-headers` # package (same approach as kernel-packages' own arch.yaml workflow). @@ -51,12 +51,12 @@ jobs: install -d -o build -g build -m 0777 /ccache - name: Checkout kernel sources - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 1 - name: Restore compiler cache - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: /ccache key: ccache-kernel-${{ github.sha }} diff --git a/.github/workflows/sync-linux-next.yml b/.github/workflows/sync-linux-next.yml index 0a70c36c7df0bd..2d2d27240be052 100644 --- a/.github/workflows/sync-linux-next.yml +++ b/.github/workflows/sync-linux-next.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout fork - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: ref: master fetch-depth: 0 From 779ea1f6de7f24798f6df5572218c4efd749feed Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Thu, 20 Aug 2026 14:28:11 +0000 Subject: [PATCH 245/250] ogc: linux-unstable: build rpm for fedora distros (cherry picked from commit 47b6fa78e17e33b9a1d5b3d62f9e3a6b2fd5dee9) --- .github/packaging/fedora/kernel.spec | 274 +++++++++++++++++ .github/packaging/merge-fragments.sh | 62 ++++ .github/workflows/build-kernel.yml | 436 ++++++++++++++++++++------- 3 files changed, 655 insertions(+), 117 deletions(-) create mode 100644 .github/packaging/fedora/kernel.spec create mode 100644 .github/packaging/merge-fragments.sh diff --git a/.github/packaging/fedora/kernel.spec b/.github/packaging/fedora/kernel.spec new file mode 100644 index 00000000000000..2f13bbd4260979 --- /dev/null +++ b/.github/packaging/fedora/kernel.spec @@ -0,0 +1,274 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# RPM spec for the linux-unstable-ogc kernel (linux-next based). +# +# Built by .github/workflows/build-kernel.yml ("fedora" job) which, before +# invoking rpmbuild: +# - substitutes @@KBASEVER@@ / @@KVERDOTTED@@ / @@SHA8@@ placeholders below +# - stages SOURCES/linux.tar.gz (kernel tree contents, root dir "linux/", +# no VCS data, localversion-next included) +# - stages SOURCES/config (Fedora kernel-core .config with the OGC +# kernel-packages fragments and the local +# config.fragment already applied) +# +# Derived from the OpenGamingCollective/kernel-packages fedora/kernel.spec +# (itself based on CachyOS/Nobara), trimmed down to core/modules/devel only. +# The kernel is compiled with clang (LLVM=1) exactly like the Arch packages. + +%global _default_patch_fuzz 2 + +# See https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck +%if 0%{?fedora} >= 37 +%undefine _auto_set_build_flags +%endif + +%define _build_id_links none +%define _disable_source_fetch 1 +# no debuginfo generation, no brp strip/mangle of kernel binaries +%define debug_package %{nil} +%define __spec_install_post /usr/lib/rpm/brp-compress || : + +# ---- substituted by CI ------------------------------------------------------ +%define kbasever @@KBASEVER@@ +%define sha8 @@SHA8@@ +# ---------------------------------------------------------------------------- + +Version: @@KVERDOTTED@@ +Release: 1.g%{sha8}%{?dist} + +%define rpmver %{version}-%{release} +# Kernel release string (uname -r). Identical to what the localversion* files +# below produce during the build, and identical to the Arch packages built +# from the same commit: +# -unstable-ogc-g-1 +%define kverstr %{kbasever}-unstable-ogc-g%{sha8}-1 +# RPM dependency versions may contain at most ONE hyphen (V-R separator), so +# the full kernel release string cannot be used as a Provides: version. Use a +# 1:1 dotted translation for the *-uname-r provides instead. +%define kverdot %(echo "%{kverstr}" | sed -e "s/-/./g") + +Name: kernel-unstable-ogc +Summary: The linux-next kernel for the Open Gaming Collective +License: GPLv2 +URL: https://github.com/OpenGamingCollective/linux-unstable +Group: System Environment/Kernel +ExclusiveArch: x86_64 +Source0: linux.tar.gz +Source1: config + +BuildRequires: bash, coreutils, make, tar, findutils, gawk, diffutils, m4 +BuildRequires: bc, bison, flex, perl-interpreter, perl-Carp, binutils +BuildRequires: xz, zstd, kmod, python3 +BuildRequires: elfutils-libelf-devel, elfutils-devel +BuildRequires: openssl, openssl-devel +BuildRequires: dwarves, hmaccalc +# clang toolchain (like the Arch packages) +BuildRequires: clang, lld, llvm, ccache +# needed when the base config enables CONFIG_RUST. The bindgen binary +# package was renamed from rust-bindgen to bindgen in newer Fedora releases; +# accept either so this spec works across distro versions. +BuildRequires: rust, rust-src +BuildRequires: (bindgen or rust-bindgen) + +# All kernel make invocations: clang via ccache, deterministic version strings +%define kmake make CC="ccache clang" LLVM=1 LLVM_IAS=1 WERROR=0 KBUILD_BUILD_HOST=ogc-ci KBUILD_BUILD_USER=kernel-unstable-ogc KBUILD_BUILD_TIMESTAMP="" + +%description +This package is a meta package that pulls in the linux-unstable-ogc kernel +(a linux-next snapshot for the Open Gaming Collective) and its matching +modules. + +%package core +Summary: The linux-unstable-ogc kernel (vmlinuz and core files) +Group: System Environment/Kernel +Provides: installonlypkg(kernel) +Provides: %{name}-core-uname-r = %{kverdot} +Requires: bash, coreutils, kmod +Requires: /usr/bin/kernel-install +Requires: %{name}-modules = %{rpmver} +Recommends: linux-firmware +%description core +This package contains the linux-unstable-ogc kernel image (vmlinuz), +System.map, the build configuration and the module symbol version file. + +%package modules +Summary: Kernel modules to match the linux-unstable-ogc core kernel +Group: System Environment/Kernel +Provides: installonlypkg(kernel-module) +Provides: %{name}-modules-uname-r = %{kverdot} +Supplements: %{name}-core = %{rpmver} +# kmod needed for depmod in %%post +Requires: kmod +%description modules +This package provides the kernel modules for the linux-unstable-ogc kernel. + +%package devel +Summary: Development files for building external modules +Group: Development/System +AutoReqProv: no +Requires: findutils, make, perl-interpreter, flex, bison +Requires: elfutils-libelf-devel, openssl-devel, gcc +Requires: clang, llvm, lld +Provides: %{name}-devel-uname-r = %{kverdot} +Enhances: akmods +Enhances: dkms +%description devel +This package provides the headers, scripts and tooling (objtool, +resolve_btfids) needed to build out-of-tree kernel modules against the +linux-unstable-ogc kernel (%{kverstr}). + +%prep +%setup -q -n linux + +cp %{SOURCE1} .config + +# The Fedora distro config references Fedora-only certificate files that do +# not exist in this tree; use the ephemeral in-tree key instead. +scripts/config --set-str SYSTEM_TRUSTED_KEYS "" +scripts/config --set-str SYSTEM_REVOCATION_KEYS "" +# CONFIG_MODULE_SIG_KEY points at the Red Hat signing cert in the distro +# config; build modules unsigned instead (same as the Arch packages). +scripts/config --set-str MODULE_SIG_KEY "" + +# Deterministic / distro-agnostic build identity +scripts/config -u DEFAULT_HOSTNAME +scripts/config --set-str BUILD_SALT "%{kverstr}" + +# Kernel release suffix, same scheme as the Arch packages: +# -unstable-ogc-g-1 +echo "-unstable-ogc-g%{sha8}" > localversion.10-pkgname +echo "-1" > localversion.20-pkgrel + +# glibc >= 2.42 const-correctness vs -Werror in tools/lib/bpf (used by +# resolve_btfids when DEBUG_INFO_BTF=y); keep the build green. +if [ -f tools/lib/bpf/Makefile ]; then + sed -i 's/ -Werror -Wall/ -Wall/' tools/lib/bpf/Makefile || true +fi + +%{kmake} olddefconfig + +# Fail fast if the release string ever drifts from the spec +REL="$(make -s kernelrelease)" +if [ "$REL" != "%{kverstr}" ]; then + echo "kernelrelease '$REL' does not match spec kverstr '%{kverstr}'" >&2 + exit 1 +fi +cp .config config-linux-unstable-ogc + +%build +%{kmake} %{?_smp_mflags} all + +%install +MODDIR="%{buildroot}/lib/modules/%{kverstr}" +DEVEL="%{buildroot}%{_prefix}/src/kernels/%{kverstr}" + +mkdir -p "%{buildroot}/boot" "$MODDIR" + +echo "Installing boot image..." +ImageName="$(make -s image_name | tail -n 1)" +install -m 0644 "$ImageName" "$MODDIR/vmlinuz" +chmod 0755 "$MODDIR/vmlinuz" + +echo "Installing modules..." +# Modules are compressed by modules_install itself (CONFIG_MODULE_COMPRESS_*). +# depmod runs from %%post at install time. +%{kmake} %{?_smp_mflags} KERNELRELEASE=%{kverstr} \ + INSTALL_MOD_PATH=%{buildroot} INSTALL_MOD_STRIP=1 \ + DEPMOD=/doesnt/exist modules_install + +echo "Installing core files..." +cp System.map "$MODDIR/System.map" +cp .config "$MODDIR/config" +gzip -c9 < Module.symvers > "$MODDIR/symvers.gz" +(cd "$MODDIR" && sha512hmac vmlinuz > .vmlinuz.hmac) + +# ---- kernel-devel ----------------------------------------------------------- +echo "Preparing kernel-devel..." +rm -f "$MODDIR"/build "$MODDIR"/source +ln -s "%{_prefix}/src/kernels/%{kverstr}" "$MODDIR/build" +(cd "$MODDIR" && ln -s build source) +mkdir -p "$MODDIR"/updates "$MODDIR"/weak-updates "$DEVEL" + +find . -type f \( -name 'Makefile*' -o -name 'Kconfig*' \) -print0 \ + | xargs -0 cp --parents -t "$DEVEL" +cp -a include "$DEVEL"/ +cp -a arch/x86/include "$DEVEL"/arch/x86/ +if [ -f arch/x86/kernel/module.lds ]; then + cp -a --parents arch/x86/kernel/module.lds "$DEVEL"/ +fi +cp -a scripts "$DEVEL"/ +rm -rf "$DEVEL"/scripts/tracing +rm -f "$DEVEL"/scripts/spdxcheck.py +cp Module.symvers System.map .config "$DEVEL"/ + +mkdir -p "$DEVEL"/tools/{objtool,bpf/resolve_btfids,lib,build} +cp -a tools/objtool/objtool "$DEVEL"/tools/objtool/ || : +cp -a tools/bpf/resolve_btfids/resolve_btfids "$DEVEL"/tools/bpf/resolve_btfids/ || : +cp -a tools/include "$DEVEL"/tools/ +cp -a tools/lib/subcmd "$DEVEL"/tools/lib/ +cp -a tools/lib/bpf "$DEVEL"/tools/lib/ +cp -a tools/build/Build.include tools/build/fixdep.c "$DEVEL"/tools/build/ +cp -a tools/scripts/utilities.mak "$DEVEL"/tools/scripts/ 2>/dev/null || : +cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl "$DEVEL"/ +cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl "$DEVEL"/ +cp -a arch/x86/tools "$DEVEL"/arch/x86/ + +# Drop intermediate build artifacts from devel tree +find "$DEVEL" \( -name '*.o' -o -name '*.cmd' -o -name '.*.cmd' \) -delete + +# Timestamps must line up so external module builds do not rerun kconfig +touch -r "$DEVEL"/Makefile \ + "$DEVEL"/include/generated/uapi/linux/version.h \ + "$DEVEL"/include/config/auto.conf + +%post core +# nothing to do at this point + +%posttrans core +# Runs after ALL packages of this transaction have been installed and their +# %%post scriptlets (incl. depmod from -modules) have run. +if [ -x /usr/bin/kernel-install ]; then + /usr/bin/kernel-install add %{kverstr} /lib/modules/%{kverstr}/vmlinuz || exit $? +fi +if [ -x /usr/sbin/grubby ]; then + grubby --set-default="/boot/vmlinuz-%{kverstr}" || : +fi + +%preun core +if [ "$1" = "0" ] && [ -x /usr/bin/kernel-install ]; then + /usr/bin/kernel-install remove %{kverstr} /lib/modules/%{kverstr}/vmlinuz || exit $? +fi + +%post modules +/sbin/depmod -a %{kverstr} + +%files +# meta package: everything lives in the subpackages + +%files core +%ghost /boot/vmlinuz-%{kverstr} +%ghost /boot/initramfs-%{kverstr}.img +/lib/modules/%{kverstr}/vmlinuz +/lib/modules/%{kverstr}/.vmlinuz.hmac +/lib/modules/%{kverstr}/System.map +/lib/modules/%{kverstr}/config +/lib/modules/%{kverstr}/symvers.gz + +%files modules +/lib/modules/%{kverstr}/ +%exclude /lib/modules/%{kverstr}/vmlinuz +%exclude /lib/modules/%{kverstr}/.vmlinuz.hmac +%exclude /lib/modules/%{kverstr}/System.map +%exclude /lib/modules/%{kverstr}/config +%exclude /lib/modules/%{kverstr}/symvers.gz +%exclude /lib/modules/%{kverstr}/build +%exclude /lib/modules/%{kverstr}/source + +%files devel +/usr/src/kernels/%{kverstr} +/lib/modules/%{kverstr}/build +/lib/modules/%{kverstr}/source + +%changelog +* Thu Aug 20 2026 OpenGamingCollective CI +- Initial linux-unstable-ogc spec, generated by CI from linux-next. \ No newline at end of file diff --git a/.github/packaging/merge-fragments.sh b/.github/packaging/merge-fragments.sh new file mode 100644 index 00000000000000..e8525b2d86ce8e --- /dev/null +++ b/.github/packaging/merge-fragments.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +# Textually merge kernel config fragments into a base .config file. +# +# Usage: merge-fragments.sh [...] +# +# Recognized fragment line formats (fragments are applied in order, later +# fragments win): +# CONFIG_X=value set X to value +# CONFIG_X unset X (kernel-configurator *.unset format) +# "# CONFIG_X is not set" unset X (kconfig fragment format) +# Blank lines and other comments are ignored. +# +# This replicates the semantics of the OpenGamingCollective +# kernel-configurator action (*.config.set / *.config.unset fragments) and +# additionally accepts regular kconfig fragment files, so both the OGC +# fragments and the repo-local config.fragment can be handled uniformly. +# The final `make olddefconfig` (run by the PKGBUILD / RPM spec) turns the +# textual result into a consistent kconfig. + +set -euo pipefail + +if [ "$#" -lt 2 ]; then + echo "usage: $0 ..." >&2 + exit 2 +fi + +CFG="$(realpath "$1")" +shift + +set_key() { + local key="$1" value="$2" + if grep -q "^${key}=" "$CFG"; then + sed -i "s|^${key}=.*|${key}=${value}|" "$CFG" + elif grep -q "^# ${key} is not set$" "$CFG"; then + sed -i "s|^# ${key} is not set\$|${key}=${value}|" "$CFG" + else + printf '%s=%s\n' "${key}" "${value}" >> "$CFG" + fi +} + +unset_key() { + local key="$1" + if grep -q "^${key}=" "$CFG"; then + sed -i "s|^${key}=.*|# ${key} is not set|" "$CFG" + fi +} + +for frag in "$@"; do + frag="$(realpath "$frag")" + while IFS= read -r line || [ -n "$line" ]; do + line="${line#"${line%%[![:space:]]*}"}" + line="${line%"${line##*[![:space:]]}"}" + [ -z "$line" ] && continue + if [[ "$line" =~ ^#\ (CONFIG_[A-Za-z0-9_]+)\ is\ not\ set$ ]]; then + unset_key "${BASH_REMATCH[1]}" + elif [[ "$line" =~ ^(CONFIG_[A-Za-z0-9_]+)=(.*)$ ]]; then + set_key "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" + elif [[ "$line" =~ ^(CONFIG_[A-Za-z0-9_]+)$ ]]; then + unset_key "${BASH_REMATCH[1]}" + fi + done < "$frag" +done \ No newline at end of file diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 36013b6ee76b67..94ca73368af1d7 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -13,22 +13,91 @@ concurrency: cancel-in-progress: true env: - PKGDIR: /tmp/pkgbuild - DISTDIR: /tmp/dist - CCACHE_DIR: /ccache - CCACHE_MAXSIZE: 10G # Config fragments maintained by the OGC kernel-packages repository. - # The base config is extracted from the official Arch `linux-headers` - # package (same approach as kernel-packages' own arch.yaml workflow). + # Distro base configs are extracted from the official distro packages + # (Arch: linux-headers, Fedora: kernel-core) — same approach as the + # kernel-packages arch.yaml / fedora.yaml workflows. KERNEL_PACKAGES_RAW: https://raw.githubusercontent.com/OpenGamingCollective/kernel-packages/main jobs: - build: - name: Build kernel packages and publish release + prepare: + name: Prepare sources and version + runs-on: ubuntu-latest + outputs: + kver: ${{ steps.kernel.outputs.kver }} + next: ${{ steps.kernel.outputs.next }} + sha8: ${{ steps.kernel.outputs.sha8 }} + krel: ${{ steps.kernel.outputs.krel }} + tag: ${{ steps.kernel.outputs.tag }} + kbase: ${{ steps.kernel.outputs.kbase }} + kverdot: ${{ steps.kernel.outputs.kverdot }} + steps: + - name: Checkout kernel sources + uses: actions/checkout@v7 + with: + fetch-depth: 1 + + - name: Compute kernel version + id: kernel + run: | + set -euxo pipefail + KVER="$(make -s kernelversion)" + NEXT="$(cat localversion-next 2>/dev/null || true)" + SHA8="$(git rev-parse --short=8 HEAD)" + KREL="${KVER}${NEXT}-unstable-ogc-g${SHA8}-1" + TAG="v${KVER}${NEXT}-g${SHA8}" + # RPM Version: field must not contain hyphens + KVERDOT="$(printf '%s%s' "${KVER}" "${NEXT}" | tr '-' '.')" + echo "kver=${KVER}" >> "$GITHUB_OUTPUT" + echo "next=${NEXT}" >> "$GITHUB_OUTPUT" + echo "sha8=${SHA8}" >> "$GITHUB_OUTPUT" + echo "krel=${KREL}" >> "$GITHUB_OUTPUT" + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "kbase=${KVER}${NEXT}" >> "$GITHUB_OUTPUT" + echo "kverdot=${KVERDOT}" >> "$GITHUB_OUTPUT" + echo "Kernel release: ${KREL}" + echo "Release tag: ${TAG}" + + - name: Stage sources and packaging files + run: | + set -euxo pipefail + # Commit marker consumed by the Arch PKGBUILD (same trick as + # linux-bisector). Written before the tarball is created so it is + # included in it. + git rev-parse --short=8 HEAD > .build_commit + + STAGE="/tmp/stage" + mkdir -p "${STAGE}" + cp .github/packaging/PKGBUILD "${STAGE}/PKGBUILD" + cp .github/packaging/merge-fragments.sh "${STAGE}/merge-fragments.sh" + cp .github/packaging/config.fragment "${STAGE}/config.fragment" + cp .github/packaging/fedora/kernel.spec "${STAGE}/kernel.spec" + + # Source tarball: contents of the repo as ./linux/, without VCS data. + tar --exclude-vcs -I 'gzip -1' -cf "${STAGE}/linux.tar.gz" \ + --transform 's|^\./|linux/|' -C "$GITHUB_WORKSPACE" . + ls -lh "${STAGE}" + + - name: Upload staged sources + uses: actions/upload-artifact@v7 + with: + name: kernel-sources + path: /tmp/stage + retention-days: 3 + + arch: + name: Build Arch Linux packages + needs: prepare runs-on: ubuntu-latest timeout-minutes: 330 container: image: docker.io/archlinux:base-devel + env: + PKGDIR: /tmp/pkgbuild + DISTDIR: /tmp/dist + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 10G + KREL: ${{ needs.prepare.outputs.krel }} steps: - name: Show disk space run: df -h / @@ -44,66 +113,39 @@ jobs: # CONFIG_RUST=y. pacman -S --needed --noconfirm \ bc cpio gettext libelf pahole perl python tar xz zstd \ - gcc clang llvm lld ccache pigz file git github-cli curl \ + gcc clang llvm lld ccache pigz file curl git \ rust rust-bindgen # makepkg refuses to run as root useradd -m build install -d -o build -g build -m 0777 /ccache - - name: Checkout kernel sources - uses: actions/checkout@v7 + - name: Download staged sources + uses: actions/download-artifact@v8 with: - fetch-depth: 1 + name: kernel-sources + path: /tmp/stage - name: Restore compiler cache uses: actions/cache@v6 with: path: /ccache - key: ccache-kernel-${{ github.sha }} + key: ccache-arch-${{ github.sha }} restore-keys: | - ccache-kernel- + ccache-arch- - name: Prepare ccache for the build user run: chown -R build:build /ccache && su build -c 'ccache -s' || true - - name: Compute kernel version - id: kernel + - name: Assemble Arch kernel config + working-directory: /tmp/stage run: | set -euxo pipefail - # Run steps in job containers get HOME=/github/home while - # actions/checkout writes its safe.directory entry to /root/.gitconfig, - # so git commands here would fail with "dubious ownership". - git config --global --add safe.directory "$GITHUB_WORKSPACE" - KVER="$(make -s kernelversion)" - NEXT="$(cat localversion-next 2>/dev/null || true)" - SHA8="$(git rev-parse --short=8 HEAD)" - KREL="${KVER}${NEXT}-unstable-ogc-g${SHA8}-1" - TAG="v${KVER}${NEXT}-g${SHA8}" - echo "kver=${KVER}" >> "$GITHUB_OUTPUT" - echo "next=${NEXT}" >> "$GITHUB_OUTPUT" - echo "sha8=${SHA8}" >> "$GITHUB_OUTPUT" - echo "krel=${KREL}" >> "$GITHUB_OUTPUT" - echo "tag=${TAG}" >> "$GITHUB_OUTPUT" - echo "Kernel release: ${KREL}" - echo "Release tag: ${TAG}" - - - name: Stage sources and packaging files - run: | - set -euxo pipefail - # Commit marker consumed by the PKGBUILD (same trick as linux-bisector) - git rev-parse --short=8 HEAD > .build_commit - - mkdir -p "${PKGDIR}" "${DISTDIR}" - cp .github/packaging/PKGBUILD "${PKGDIR}/PKGBUILD" - cp .github/packaging/config.fragment "${PKGDIR}/config.fragment" - # ------------------------------------------------------------------ # Base config: extract the official Arch Linux kernel .config from # the distro's `linux-headers` package (same method as the OGC # kernel-packages arch.yaml workflow). # ------------------------------------------------------------------ - set -o pipefail - CACHE="${PKGDIR}/pkgcache" + CACHE="/tmp/pkgcache" mkdir -p "$CACHE" pacman -Sw --noconfirm --cachedir "$CACHE" linux-headers PKG="$(find "$CACHE" -maxdepth 1 -name 'linux-headers-*.pkg.tar.zst' -type f)" @@ -114,71 +156,36 @@ jobs: if [ -z "$CFG" ]; then echo "::error::kernel .config not found inside $PKG"; exit 1 fi - tar --zstd -xOf "$PKG" "$CFG" > "${PKGDIR}/config" - test -s "${PKGDIR}/config" + tar --zstd -xOf "$PKG" "$CFG" > config + test -s config rm -rf "$CACHE" - head -n 3 "${PKGDIR}/config" # ------------------------------------------------------------------ - # Layer the OGC config fragments from kernel-packages on top. - # Semantics replicate OpenGamingCollective/kernel-configurator: - # *.config.set -> key=value lines: replace or append - # *.config.unset -> bare key lines: turn into "# key is not set" - # Applied in the same order as kernel-packages' arch.yaml: + # Layer the OGC config fragments from kernel-packages on top, then + # the repo-local config.fragment (which wins). Order matches the + # kernel-packages arch.yaml / kernel-configurator semantics: # set: arch.config.set, ogc.config.set # unset: arch.config.unset, ogc.config.unset # ------------------------------------------------------------------ - apply_set() { - local cfg="$1" frag="$2" line key value - while IFS= read -r line; do - line="${line#"${line%%[![:space:]]*}"}"; line="${line%"${line##*[![:space:]]}"}" - [ -z "$line" ] && continue - case "$line" in '#'*) continue ;; esac - case "$line" in *=*) ;; *) continue ;; esac - key="${line%%=*}"; value="${line#*=}" - if grep -q "^${key}=" "$cfg"; then - sed -i "s|^${key}=.*|${key}=${value}|" "$cfg" - elif grep -q "^# ${key} is not set$" "$cfg"; then - sed -i "s|^# ${key} is not set\$|${key}=${value}|" "$cfg" - else - printf '%s=%s\n' "$key" "$value" >> "$cfg" - fi - done < "$frag" - } - apply_unset() { - local cfg="$1" frag="$2" line key - while IFS= read -r line; do - line="${line#"${line%%[![:space:]]*}"}"; line="${line%"${line##*[![:space:]]}"}" - [ -z "$line" ] && continue - case "$line" in '#'*) continue ;; esac - key="$line" - if grep -q "^${key}=" "$cfg"; then - sed -i "s|^${key}=.*|# ${key} is not set|" "$cfg" - fi - done < "$frag" - } - for f in arch.config.set ogc.config.set arch.config.unset ogc.config.unset; do - curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${PKGDIR}/${f}" + curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${f}" done - apply_set "${PKGDIR}/config" "${PKGDIR}/arch.config.set" - apply_set "${PKGDIR}/config" "${PKGDIR}/ogc.config.set" - apply_unset "${PKGDIR}/config" "${PKGDIR}/arch.config.unset" - apply_unset "${PKGDIR}/config" "${PKGDIR}/ogc.config.unset" - echo "Config after OGC fragment merge (head):" - head -n 3 "${PKGDIR}/config" - - # Source tarball: contents of the repo as ./linux/, without VCS data. - # pigz keeps compression fast on the 4-vCPU runners. - tar --exclude-vcs -I pigz -cf "${PKGDIR}/linux.tar.gz" \ - --transform 's|^\./|linux/|' -C "$GITHUB_WORKSPACE" . + bash ./merge-fragments.sh config \ + arch.config.set ogc.config.set \ + arch.config.unset ogc.config.unset \ + config.fragment + echo "Config after fragment merge (head):" + head -n 3 config - ls -lh "${PKGDIR}" + - name: Stage PKGBUILD directory + run: | + set -euxo pipefail + mkdir -p "${PKGDIR}" "${DISTDIR}" + cd /tmp/stage + cp PKGBUILD config.fragment linux.tar.gz config "${PKGDIR}/" chown -R build:build "${PKGDIR}" - name: Build packages with makepkg - env: - KREL: ${{ steps.kernel.outputs.krel }} run: | set -euxo pipefail cd "${PKGDIR}" @@ -188,31 +195,209 @@ jobs: ls -lh ./*.pkg.tar.zst cp -v ./*.pkg.tar.zst "${DISTDIR}/" # Ship the exact .config used for the build as well - cp -v "src/linux/.config" "${DISTDIR}/config-${KREL}" + cp -v "src/linux/.config" "${DISTDIR}/config-arch-${KREL}" + + - name: Clean build tree (free disk before cache save) + run: rm -rf "${PKGDIR}/src" "${PKGDIR}/pkg" ; df -h / + + - name: Upload Arch packages + uses: actions/upload-artifact@v7 + with: + name: arch-packages + path: /tmp/dist + retention-days: 3 + + fedora: + name: Build Fedora RPM packages + needs: prepare + runs-on: ubuntu-latest + timeout-minutes: 330 + container: + image: docker.io/library/fedora:43 + env: + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 10G + KREL: ${{ needs.prepare.outputs.krel }} + KBASE: ${{ needs.prepare.outputs.kbase }} + KVERDOT: ${{ needs.prepare.outputs.kverdot }} + SHA8: ${{ needs.prepare.outputs.sha8 }} + steps: + - name: Show disk space + run: df -h / + + - name: Install build tools + run: | + set -euxo pipefail + dnf -y install dnf5-plugins rpm-build + dnf -y install cpio curl findutils tar gzip + mkdir -p /ccache + + - name: Download staged sources + uses: actions/download-artifact@v8 + with: + name: kernel-sources + path: /tmp/stage + + - name: Restore compiler cache + uses: actions/cache@v6 + with: + path: /ccache + key: ccache-fedora-${{ github.sha }} + restore-keys: | + ccache-fedora- + + - name: Assemble Fedora kernel config + working-directory: /tmp/stage + run: | + set -euxo pipefail + # ------------------------------------------------------------------ + # Base config: extract the official Fedora kernel .config from the + # distro's `kernel-core` package (same method as the OGC + # kernel-packages fedora.yaml workflow). + # ------------------------------------------------------------------ + CACHE="/tmp/pkgcache" + mkdir -p "$CACHE" + dnf download --destdir "$CACHE" kernel-core + RPM="$(find "$CACHE" -maxdepth 1 -name 'kernel-core-*.rpm' -type f)" + if [ -z "$RPM" ]; then + echo "::error::kernel-core package not found in cache"; exit 1 + fi + CFG="$(rpm -qlp "$RPM" | grep -E '^/lib/modules/[^/]+/config$' | head -n1 || true)" + if [ -z "$CFG" ]; then + echo "::error::kernel config not found inside $RPM"; exit 1 + fi + rpm2cpio "$RPM" | cpio -i --to-stdout ".${CFG}" > config + test -s config + rm -rf "$CACHE" + + # ------------------------------------------------------------------ + # Layer the OGC config fragments on top, then the repo-local + # config.fragment (which wins). Order matches the kernel-packages + # fedora.yaml / kernel-configurator semantics: + # set: fedora.config.set, ogc.config.set + # unset: fedora.config.unset, ogc.config.unset + # ------------------------------------------------------------------ + for f in fedora.config.set ogc.config.set fedora.config.unset ogc.config.unset; do + curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${f}" + done + bash ./merge-fragments.sh config \ + fedora.config.set ogc.config.set \ + fedora.config.unset ogc.config.unset \ + config.fragment + echo "Config after fragment merge (head):" + head -n 3 config + + - name: Finalize spec and install build dependencies + working-directory: /tmp/stage + run: | + set -euxo pipefail + # Substitute the CI placeholders (must happen before `dnf builddep` + # so RPM can parse Version:/Release:). + sed -i \ + -e "s/@@KBASEVER@@/${KBASE}/" \ + -e "s/@@KVERDOTTED@@/${KVERDOT}/" \ + -e "s/@@SHA8@@/${SHA8}/" \ + kernel.spec + grep -n '^Version:\|^Release:\|%define kbasever\|%define sha8' kernel.spec + ! grep -q '@@' kernel.spec + + # Installs the toolchain from the spec BuildRequires, including the + # distro dwarves/pahole. Run BEFORE the pahole check below so a + # source-built pahole is not overwritten by builddep. + dnf -y builddep kernel.spec + + - name: Ensure pahole >= 1.31 (sched_ext/BTF) + working-directory: /tmp + run: | + set -euxo pipefail + VER="$(pahole --version | tr -d 'v')" + MAJ="${VER%%.*}"; MIN="${VER#*.}"; MIN="${MIN%%.*}" + echo "Installed pahole: ${VER}" + if [ "$MAJ" -lt 1 ] || { [ "$MAJ" -eq 1 ] && [ "$MIN" -lt 31 ]; }; then + echo "pahole < 1.31 breaks sched_ext; building dwarves 1.31 from source" + dnf -y install cmake make gcc elfutils-devel zlib-devel + curl -fsSLO https://fedorapeople.org/~acme/dwarves/dwarves-1.31.tar.xz + echo "0a7f255ccacf8cc7f8cd119099eb327179b4b3c67cb015af646af6d0cb03054d dwarves-1.31.tar.xz" | sha256sum -c + tar -xf dwarves-1.31.tar.xz + cmake -B dwarves-1.31/build -S dwarves-1.31 \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -D__LIB=lib + make -C dwarves-1.31/build -j"$(nproc)" install + fi + pahole --version + + - name: Build RPMs with rpmbuild + working-directory: /tmp + run: | + set -euxo pipefail + TOPDIR=/tmp/rpmbuild + mkdir -p "${TOPDIR}"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} + cp /tmp/stage/linux.tar.gz "${TOPDIR}/SOURCES/" + cp /tmp/stage/config "${TOPDIR}/SOURCES/config" + cp /tmp/stage/kernel.spec "${TOPDIR}/SPECS/kernel.spec" + + rpmbuild --define "_topdir ${TOPDIR}" -ba "${TOPDIR}/SPECS/kernel.spec" + + ls -lh "${TOPDIR}"/RPMS/x86_64/ + + - name: Collect Fedora artifacts + run: | + set -euxo pipefail + DISTDIR=/tmp/dist + mkdir -p "${DISTDIR}" + cp -v /tmp/rpmbuild/RPMS/x86_64/*.rpm "${DISTDIR}/" + cp -v /tmp/stage/config "${DISTDIR}/config-fedora-${KREL}" + ls -lh "${DISTDIR}" + + - name: Clean build tree (free disk before cache save) + run: rm -rf /tmp/rpmbuild/BUILD /tmp/rpmbuild/BUILDROOT ; df -h / + + - name: Upload Fedora packages + uses: actions/upload-artifact@v7 + with: + name: fedora-packages + path: /tmp/dist + retention-days: 3 + + release: + name: Create GitHub release + needs: [prepare, arch, fedora] + runs-on: ubuntu-latest + env: + TAG: ${{ needs.prepare.outputs.tag }} + KREL: ${{ needs.prepare.outputs.krel }} + KVER: ${{ needs.prepare.outputs.kver }} + NEXT: ${{ needs.prepare.outputs.next }} + steps: + - name: Download package artifacts + uses: actions/download-artifact@v8 + with: + path: /tmp/dist + pattern: "*-packages" + + - name: Flatten artifact directory + run: | + set -euxo pipefail + cd /tmp/dist + find . -mindepth 2 -maxdepth 2 -type f -exec mv -t . {} + + find . -mindepth 1 -type d -delete + ls -lh - name: Generate checksums run: | set -euxo pipefail - cd "${DISTDIR}" + cd /tmp/dist sha256sum * > SHA256SUMS cat SHA256SUMS - - name: Clean build tree (free disk before upload) - run: rm -rf "${PKGDIR}/src" "${PKGDIR}/pkg" ; df -h / - - name: Create GitHub release and upload packages env: GH_TOKEN: ${{ github.token }} - TAG: ${{ steps.kernel.outputs.tag }} - KREL: ${{ steps.kernel.outputs.krel }} - KVER: ${{ steps.kernel.outputs.kver }} - NEXT: ${{ steps.kernel.outputs.next }} run: | set -euxo pipefail # Idempotency: if a stale release exists for this tag (e.g. re-run # of the same commit), remove it so this run can recreate it. - if gh release view "$TAG" --repo "$GITHUB_REPOSITORY"; then + if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" 2>/dev/null; then echo "Deleting existing release $TAG, will recreate it" gh release delete "$TAG" --repo "$GITHUB_REPOSITORY" --yes --cleanup-tag fi @@ -226,38 +411,55 @@ jobs: echo "- Source commit: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" echo "- Kernel release: ${KREL}" echo "- Upstream version: ${KVER}${NEXT}" - echo "- Base config: Arch \`linux-headers\` .config + [OGC kernel-packages fragments](${KERNEL_PACKAGES_RAW}/config)" + echo "- Base configs: Arch \`linux-headers\` + Fedora \`kernel-core\`, plus [OGC kernel-packages fragments](${KERNEL_PACKAGES_RAW}/config)" echo "- Compiler: clang / LLVM=1 (with ccache)" echo echo "### Artifacts" echo + echo "#### Arch Linux" + echo echo '- `linux-unstable-ogc` — kernel image and modules' echo '- `linux-unstable-ogc-headers` — headers for building external modules' - echo "- \`config-${KREL}\` — the exact kernel .config used for this build" + echo "- \`config-arch-${KREL}\` — the exact .config used for this build" + echo + echo "#### Fedora" + echo + echo '- `kernel-unstable-ogc-core` — kernel image (vmlinuz) and core files' + echo '- `kernel-unstable-ogc-modules` — kernel modules' + echo '- `kernel-unstable-ogc-devel` — headers for building external modules' + echo "- \`config-fedora-${KREL}\` — the exact .config used for this build" + echo echo '- `SHA256SUMS` — checksums of all artifacts' echo echo "### Install" echo + echo "Arch Linux:" + echo echo '```sh' echo 'sudo pacman -U linux-unstable-ogc-headers-*.pkg.tar.zst linux-unstable-ogc-*.pkg.tar.zst' echo '```' echo - echo "> The initramfs is generated automatically on install via the" - echo "> mkinitcpio/dracut pacman hooks (package \`pkgbase\` file)." + echo "Fedora:" + echo + echo '```sh' + echo 'sudo dnf install ./kernel-unstable-ogc-core-*.rpm ./kernel-unstable-ogc-modules-*.rpm' + echo '```' + echo + echo "> The initramfs is generated automatically on install (mkinitcpio hooks" + echo "> on Arch, kernel-install/dracut on Fedora)." } > "$NOTES" - cd "${DISTDIR}" + cd /tmp/dist + # Upload every artifact produced by the distro jobs (package files + # plus the config-* files). SHA256SUMS itself is included by ./*. gh release create "$TAG" \ --repo "$GITHUB_REPOSITORY" \ --target "$GITHUB_SHA" \ --title "linux-unstable-ogc ${KREL}" \ --notes-file "$NOTES" \ - ./*.pkg.tar.zst SHA256SUMS "config-${KREL}" + ./* - name: Summary - env: - TAG: ${{ steps.kernel.outputs.tag }} - KREL: ${{ steps.kernel.outputs.krel }} run: | { echo "## linux-unstable-ogc build" From 6cca8a399e397a739f936eea9d4d9a613e1f941d Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Thu, 20 Aug 2026 16:18:10 +0000 Subject: [PATCH 246/250] ogc: linux-unstable: add debian packaging (cherry picked from commit 3fbcd8a0a542b7402ef63464ca3427d04c6a7799) --- .github/packaging/config.fragment | 8 + .github/workflows/build-kernel.yml | 244 ++++++++++++++++++++++++++++- 2 files changed, 250 insertions(+), 2 deletions(-) diff --git a/.github/packaging/config.fragment b/.github/packaging/config.fragment index c726261944fc3b..8d455d78cc2417 100644 --- a/.github/packaging/config.fragment +++ b/.github/packaging/config.fragment @@ -9,6 +9,14 @@ # drivers, Bluetooth, UVC webcams and all OGC handheld drivers (those live in # drivers/hid, drivers/platform/x86 — NOT in staging, so STAGING can go). +# --- Kernel identity -------------------------------------------------------- +# Distro base configs carry their own release suffix (Arch "-arch1", Debian +# "-1-amd64", ...). It must be empty so that uname -r is identical across +# the Arch/Fedora/Debian packages: -unstable-ogc-g-1 (the suffix +# itself comes from the localversion.10/20 files written by the packaging). +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set + # --- Build fixes ------------------------------------------------------------ # drivers/net/ethernet/cadence/macb_main.c fails to compile in linux-next # (implicit declarations of macb_alloc_tieoff/macb_free_tieoff). Cadence diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 94ca73368af1d7..23b060ce00949a 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -358,9 +358,237 @@ jobs: path: /tmp/dist retention-days: 3 + debian: + name: Build Debian packages + needs: prepare + runs-on: ubuntu-latest + timeout-minutes: 330 + container: + image: docker.io/library/debian:trixie + env: + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 10G + KREL: ${{ needs.prepare.outputs.krel }} + KVERDOT: ${{ needs.prepare.outputs.kverdot }} + SHA8: ${{ needs.prepare.outputs.sha8 }} + steps: + - name: Show disk space + run: df -h / + + - name: Install build tools + run: | + set -euxo pipefail + apt-get update + # Satisfies the Build-Depends generated by scripts/package/mkdebian + # (debhelper-compat, bc, bison, flex, kmod, libdw/libelf/libssl-dev, + # python3, rsync) plus the clang toolchain used by all OGC builds. + apt-get install -y --no-install-recommends \ + build-essential debhelper rsync \ + bc bison flex python3 kmod \ + libelf-dev libdw-dev libssl-dev zlib1g-dev \ + dwarves zstd xz-utils \ + clang llvm lld ccache curl ca-certificates git + # dpkg-buildpackage refuses to run as root + useradd -m builder + install -d -o builder -g builder -m 0777 /ccache + + - name: Download staged sources + uses: actions/download-artifact@v8 + with: + name: kernel-sources + path: /tmp/stage + + - name: Restore compiler cache + uses: actions/cache@v6 + with: + path: /ccache + key: ccache-debian-${{ github.sha }} + restore-keys: | + ccache-debian- + + - name: Assemble Debian kernel config + working-directory: /tmp/stage + run: | + set -euxo pipefail + # ------------------------------------------------------------------ + # Base config: the official Debian kernel configuration. It ships in + # the small linux-config- package; fall back to /boot/config-* + # of the linux-image- package if that is unavailable. + # ------------------------------------------------------------------ + ABI="$(apt-cache depends linux-image-amd64 \ + | awk '/^ *Depends: *linux-image-[0-9]/ {print $2; exit}' \ + | sed 's/^linux-image-//')" + test -n "${ABI}" + echo "Debian kernel ABI: ${ABI}" + # linux-config is versioned by major.minor only (e.g. 6.12) and + # stores the per-flavour config xz-compressed, e.g. + # /usr/src/linux-config-6.12/config.amd64_none_amd64.xz + KMAJMIN="$(printf '%s' "${ABI}" | cut -d. -f1,2)" + mkdir -p /tmp/pkgcfg + if apt-get download "linux-config-${KMAJMIN}"; then + dpkg-deb -x linux-config-"${KMAJMIN}"_*.deb /tmp/pkgcfg + BASE="$(find /tmp/pkgcfg/usr/src -name 'config.amd64_none_amd64.xz' | head -n1)" + test -s "${BASE}" + xz -dc "${BASE}" > config + else + apt-get download "linux-image-${ABI}" + dpkg-deb -x linux-image-"${ABI}"_*.deb /tmp/pkgcfg + BASE="$(find /tmp/pkgcfg/boot -maxdepth 1 -name 'config-*' | head -n1)" + test -s "${BASE}" + cp "${BASE}" config + fi + test -s config + rm -rf /tmp/pkgcfg + + # ------------------------------------------------------------------ + # Layer the OGC config fragments and the repo-local config.fragment + # (which wins). kernel-packages ships no debian-specific fragments. + # ------------------------------------------------------------------ + for f in ogc.config.set ogc.config.unset; do + curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${f}" + done + bash ./merge-fragments.sh config \ + ogc.config.set ogc.config.unset \ + config.fragment + echo "Config after fragment merge (head):" + head -n 3 config + + - name: Ensure pahole >= 1.31 (sched_ext/BTF) + run: | + set -euxo pipefail + VER="$(pahole --version | tr -d 'v')" + MAJ="${VER%%.*}"; MIN="${VER#*.}"; MIN="${MIN%%.*}" + echo "Installed pahole: ${VER}" + if [ "$MAJ" -lt 1 ] || { [ "$MAJ" -eq 1 ] && [ "$MIN" -lt 31 ]; }; then + echo "pahole < 1.31 breaks sched_ext; building dwarves 1.31 from source" + apt-get install -y --no-install-recommends cmake pkg-config + cd /tmp + curl -fsSLO https://fedorapeople.org/~acme/dwarves/dwarves-1.31.tar.xz + echo "0a7f255ccacf8cc7f8cd119099eb327179b4b3c67cb015af646af6d0cb03054d dwarves-1.31.tar.xz" | sha256sum -c + tar -xf dwarves-1.31.tar.xz + cmake -B dwarves-1.31/build -S dwarves-1.31 \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr + make -C dwarves-1.31/build -j"$(nproc)" install + fi + pahole --version + + - name: Build .deb packages with the in-tree packaging + run: | + set -euxo pipefail + mkdir -p /build + tar -xzf /tmp/stage/linux.tar.gz -C /build + cd /build/linux + + # Config adjustments + kernel release suffix, identical scheme to + # the Arch and Fedora packages (uname -r == ${KREL}). + cp /tmp/stage/config .config + # Debian's config references distro-only certificate files that do + # not exist in this tree; use the ephemeral in-tree key instead. + scripts/config --set-str SYSTEM_TRUSTED_KEYS "" + scripts/config --set-str SYSTEM_REVOCATION_KEYS "" + scripts/config --set-str MODULE_SIG_KEY "" + scripts/config -u DEFAULT_HOSTNAME + scripts/config --set-str BUILD_SALT "${KREL}" + echo "-unstable-ogc-g${SHA8}" > localversion.10-pkgname + echo "-1" > localversion.20-pkgrel + # The staged tarball carries no VCS data, but mkdebian (via + # gen-diff-patch) runs "git diff HEAD" and aborts on failure. + # A throwaway repo with everything committed makes that a no-op. + git init -q + git config user.email "ci@opengamingcollective.org" + git config user.name "OpenGamingCollective CI" + git add -A + git commit -qm "linux-unstable-ogc ${KREL}" + chown -R builder:builder /build + + # scripts/setlocalversion appends a "+" whenever a git repo exists + # and LOCALVERSION is unset and the HEAD is not at an annotated + # version tag. The throwaway repo below would therefore corrupt the + # release string. Setting LOCALVERSION to the empty string (as + # documented in the script) suppresses that suffix everywhere. + runuser -u builder -- env HOME=/home/builder CCACHE_DIR=/ccache \ + LOCALVERSION= \ + make CC="ccache clang" LLVM=1 LLVM_IAS=1 WERROR=0 \ + KBUILD_BUILD_HOST=ogc-ci KBUILD_BUILD_USER=kernel-unstable-ogc \ + olddefconfig + + # Fail fast if the release string ever drifts from the other distros + REL="$(runuser -u builder -- env HOME=/home/builder LOCALVERSION= make -s kernelrelease)" + if [ "$REL" != "${KREL}" ]; then + echo "kernelrelease '$REL' does not match expected '${KREL}'" >&2 + exit 1 + fi + + # Generate the debian/ directory with the tree's own packaging. + # mkdebian is invoked directly as a script: a bare "make debian" is + # NOT a top-level make target in this tree (only *-pkg patterns are + # delegated to scripts/Makefile.package), and going through make + # without the exact same CC flags as the olddefconfig above made + # kbuild re-sync the config interactively. As a plain sh script it + # touches nothing kbuild-related. + # KDEB_PKGVERSION must not contain hyphens except the final revision + # separator (Debian policy), hence the dotted translation. + KDEBVER="${KVERDOT}.unstable.ogc.g${SHA8}-1" + runuser -u builder -- env HOME=/home/builder \ + srctree="$PWD" \ + ARCH=x86_64 SRCARCH=x86 UTS_MACHINE=x86_64 \ + KERNELRELEASE="${KREL}" \ + KCONFIG_CONFIG=.config \ + KDEB_SOURCENAME=linux-unstable-ogc \ + KDEB_PKGVERSION="${KDEBVER}" \ + KDEB_CHANGELOG_DIST=trixie \ + DEBFULLNAME="OpenGamingCollective CI" \ + DEBEMAIL="ci@opengamingcollective.org" \ + sh scripts/package/mkdebian + echo "debian arch: $(cat debian/arch)" + + # Kbuild only honours command-line variables, so inject the + # clang/ccache toolchain into the generated debian/rules (this is + # what "make bindeb-pkg" would otherwise lose). LOCALVERSION= (set, + # empty) keeps setlocalversion from appending "+" inside the build. + sed -i 's|^make-opts = |make-opts = CC="ccache clang" LLVM=1 LLVM_IAS=1 WERROR=0 LOCALVERSION= KBUILD_BUILD_HOST=ogc-ci KBUILD_BUILD_USER=kernel-unstable-ogc |' debian/rules + grep -n '^make-opts' debian/rules + + # Same invocation as "make bindeb-pkg" (scripts/Makefile.package), + # but with parallel jobs, --no-check-builddeps (the build deps are + # preinstalled above; the generated Build-Depends-Arch also names a + # distro-only cross-gcc package that need not exist), and without + # the multi-GB debug-symbol package (all other distro jobs ship no + # debug packages either). + runuser -u builder -- env HOME=/home/builder CCACHE_DIR=/ccache \ + LOCALVERSION= \ + DEB_BUILD_PROFILES="pkg.linux-unstable-ogc.nokerneldbg" \ + dpkg-buildpackage --build=binary --no-pre-clean --unsigned-changes \ + --no-check-builddeps \ + -R'make -f debian/rules' -j"$(nproc)" -a"$(cat debian/arch)" + + ls -lh /build/*.deb + + - name: Collect Debian artifacts + run: | + set -euxo pipefail + DISTDIR=/tmp/dist + mkdir -p "${DISTDIR}" + cp -v "/build/linux-image-${KREL}"_*.deb "${DISTDIR}/" + cp -v "/build/linux-headers-${KREL}"_*.deb "${DISTDIR}/" + cp -v /build/linux/.config "${DISTDIR}/config-debian-${KREL}" + # linux-libc-dev is intentionally NOT shipped: installing it would + # replace the distribution's own linux-libc-dev package. + ls -lh "${DISTDIR}" + + - name: Clean build tree (free disk before cache save) + run: rm -rf /build ; df -h / + + - name: Upload Debian packages + uses: actions/upload-artifact@v7 + with: + name: debian-packages + path: /tmp/dist + retention-days: 3 + release: name: Create GitHub release - needs: [prepare, arch, fedora] + needs: [prepare, arch, fedora, debian] runs-on: ubuntu-latest env: TAG: ${{ needs.prepare.outputs.tag }} @@ -429,6 +657,12 @@ jobs: echo '- `kernel-unstable-ogc-devel` — headers for building external modules' echo "- \`config-fedora-${KREL}\` — the exact .config used for this build" echo + echo "#### Debian (and derivatives)" + echo + echo "- \`linux-image-${KREL}\` — kernel image and modules" + echo "- \`linux-headers-${KREL}\` — headers for building external modules" + echo "- \`config-debian-${KREL}\` — the exact .config used for this build" + echo echo '- `SHA256SUMS` — checksums of all artifacts' echo echo "### Install" @@ -445,8 +679,14 @@ jobs: echo 'sudo dnf install ./kernel-unstable-ogc-core-*.rpm ./kernel-unstable-ogc-modules-*.rpm' echo '```' echo + echo "Debian and derivatives:" + echo + echo '```sh' + echo 'sudo apt install ./linux-image-*.deb ./linux-headers-*.deb' + echo '```' + echo echo "> The initramfs is generated automatically on install (mkinitcpio hooks" - echo "> on Arch, kernel-install/dracut on Fedora)." + echo "> on Arch, kernel-install/dracut on Fedora, initramfs-tools hooks on Debian)." } > "$NOTES" cd /tmp/dist From 756bcba80ac62c18859d6a7ad81a04a58adee5fd Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Thu, 20 Aug 2026 21:23:40 +0000 Subject: [PATCH 247/250] ogc: linux-unstable: fix openssl errors in build (cherry picked from commit 575ef8710bded88196f4dc89442128bef75d9a12) --- .github/packaging/fedora/kernel.spec | 9 +++++++-- .github/workflows/build-kernel.yml | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/packaging/fedora/kernel.spec b/.github/packaging/fedora/kernel.spec index 2f13bbd4260979..2165fefce635a9 100644 --- a/.github/packaging/fedora/kernel.spec +++ b/.github/packaging/fedora/kernel.spec @@ -127,8 +127,13 @@ cp %{SOURCE1} .config scripts/config --set-str SYSTEM_TRUSTED_KEYS "" scripts/config --set-str SYSTEM_REVOCATION_KEYS "" # CONFIG_MODULE_SIG_KEY points at the Red Hat signing cert in the distro -# config; build modules unsigned instead (same as the Arch packages). -scripts/config --set-str MODULE_SIG_KEY "" +# config, which does not exist in this tree. Reset it to the kbuild default +# ("certs/signing_key.pem"): an ephemeral self-signed key generated during +# the build and trusted by the kernel itself. The Fedora config sets +# CONFIG_MODULE_SIG_ALL=y, and with an empty key string scripts/Makefile.modinst +# resolves sig-key to "./", making sign-file read a directory as the private +# key (SSL DECODER error) on every module. +scripts/config --set-str MODULE_SIG_KEY "certs/signing_key.pem" # Deterministic / distro-agnostic build identity scripts/config -u DEFAULT_HOSTNAME diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 23b060ce00949a..e6ff8a36c3ec9f 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -387,7 +387,8 @@ jobs: bc bison flex python3 kmod \ libelf-dev libdw-dev libssl-dev zlib1g-dev \ dwarves zstd xz-utils \ - clang llvm lld ccache curl ca-certificates git + clang llvm lld ccache curl ca-certificates git \ + openssl # dpkg-buildpackage refuses to run as root useradd -m builder install -d -o builder -g builder -m 0777 /ccache @@ -486,7 +487,15 @@ jobs: # not exist in this tree; use the ephemeral in-tree key instead. scripts/config --set-str SYSTEM_TRUSTED_KEYS "" scripts/config --set-str SYSTEM_REVOCATION_KEYS "" - scripts/config --set-str MODULE_SIG_KEY "" + # CONFIG_MODULE_SIG_KEY points at the Debian signing cert, which + # does not exist in this tree. Reset it to the kbuild default + # ("certs/signing_key.pem"): an ephemeral self-signed key generated + # during the build and trusted by the kernel itself. The Debian + # config sets CONFIG_MODULE_SIG_ALL=y, and with an empty key string + # scripts/Makefile.modinst resolves sig-key to "./", making + # sign-file read a directory as the private key (SSL DECODER error) + # on every module. + scripts/config --set-str MODULE_SIG_KEY "certs/signing_key.pem" scripts/config -u DEFAULT_HOSTNAME scripts/config --set-str BUILD_SALT "${KREL}" echo "-unstable-ogc-g${SHA8}" > localversion.10-pkgname From 041cef1d5efffdb58513e4c947c6e7cd9fd5f8da Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Fri, 21 Aug 2026 02:02:38 +0000 Subject: [PATCH 248/250] ogc: linux-unstable: fix sync (cherry picked from commit 25bc8ccedf60c84bed1b696207315d138d87d26d) --- .github/workflows/sync-linux-next.yml | 109 +++++++++++++++++++------- 1 file changed, 79 insertions(+), 30 deletions(-) diff --git a/.github/workflows/sync-linux-next.yml b/.github/workflows/sync-linux-next.yml index 2d2d27240be052..a83fec1d5c146e 100644 --- a/.github/workflows/sync-linux-next.yml +++ b/.github/workflows/sync-linux-next.yml @@ -1,4 +1,4 @@ -name: Sync linux-next -> master (replay from marker) +name: Sync linux-next -> master (replay fork commits) on: schedule: @@ -8,6 +8,10 @@ on: permissions: contents: write +concurrency: + group: sync-linux-next + cancel-in-progress: false + jobs: sync: runs-on: ubuntu-latest @@ -22,12 +26,9 @@ jobs: run: | git remote remove upstream || true git remote add upstream https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git - git fetch upstream --prune + git fetch --no-tags upstream --prune - - name: Replay only commits after marker on top of upstream/master - env: - # Set this to the hash of your single marker commit. - MARKER_COMMIT: "536526d1b587" + - name: Replay fork commits on top of upstream/master run: | set -euo pipefail @@ -39,50 +40,98 @@ jobs: UP_BASE="upstream/master" git show -s --oneline "$UP_BASE" >/dev/null - git show -s --oneline "$MARKER_COMMIT" >/dev/null - # Compute replay list BEFORE resetting. - # This lists commits in chronological order (old->new) after MARKER_COMMIT. - MY_COMMITS="$(git rev-list --reverse --no-merges "${MARKER_COMMIT}^..master")" + # ------------------------------------------------------------------ + # Find the upstream snapshot that master's fork commits sit on. + # + # linux-next is rebuilt from scratch every day: commits merged into + # yesterday's tree are regularly dropped from today's history + # (subsystem trees get rebased), so: + # - "upstream/master..master" contains hundreds of unrelated + # upstream commits, not just our fork commits, and + # - a hardcoded marker hash gets orphaned by the very replay this + # workflow performs (run #2 then dies with "unknown revision", + # which is how this workflow broke in the first place). + # + # Anchor: walk first-parent history from master and stop at the + # second consecutive commit whose subject does not start with + # "ogc:" (the reserved prefix of every fork commit; cherry-pick + # preserves subjects, so this survives replays and force-pushes). + # The first of those two commits is the upstream snapshot the fork + # was built on. + # ------------------------------------------------------------------ + BASE="" + NONOGC="" + while read -r c; do + case "$(git show -s --format=%s "$c")" in + ogc:*) NONOGC="" ;; + *) + if [ -n "$NONOGC" ]; then BASE="$NONOGC"; break; fi + NONOGC="$c" + ;; + esac + done < <(git rev-list --first-parent master) + + if [ -z "$BASE" ]; then + echo "::error::Could not determine the upstream base of the fork; refusing to touch master." + exit 1 + fi + echo "Upstream base: $(git show -s --oneline "$BASE")" - if [ -z "${MY_COMMITS// }" ]; then - echo "No commits to replay after marker." + # If master already sits on the current upstream tip there is + # nothing to sync: replaying would only churn the fork commits' + # hashes for identical content. + if [ "$(git rev-parse "$BASE")" = "$(git rev-parse "$UP_BASE")" ]; then + echo "master is already based on the current linux-next tip; nothing to do." exit 0 fi - echo "Replaying $(echo "$MY_COMMITS" | wc -w) commit(s):" + # Everything on master on top of the upstream base = the fork + # commits (including non-"ogc:"-prefixed ones, e.g. squash-merged + # PRs). --no-merges matches the cherry-pick loop below and makes + # merge commits replay as their constituent commits. + MY_COMMITS="$(git rev-list --reverse --no-merges "${BASE}..master")" + if [ -z "${MY_COMMITS// }" ]; then + echo "::error::No commits found on top of the upstream base; refusing to reset master (that would delete the fork)." + exit 1 + fi + + # Safety net: a mis-detected base would replay days of upstream + # history. The fork accumulates its own commits over time (and PR + # squash-merges add to that), so allow a generous 150; anything + # beyond that is far more likely a mis-detected base than real fork + # commits, so bail out and ask for a manual look instead of + # corrupting master. + N="$(echo "$MY_COMMITS" | wc -l)" + if [ "$N" -gt 150 ]; then + echo "::error::Refusing to replay ${N} commits (expected only fork commits). Check master's history (all fork commits must carry the 'ogc:' subject prefix)." + exit 1 + fi + + echo "Replaying ${N} commit(s):" for c in $MY_COMMITS; do echo " $c $(git show -s --format=%s "$c")" done echo - # Reset master to upstream base + # Reset master to the new upstream tip, then replay the fork commits. git reset --hard "$UP_BASE" - # Cherry-pick each commit; allow-empty prevents failing when the change is already present. for c in $MY_COMMITS; do echo "Cherry-picking: $c $(git show -s --format=%s "$c")" - if git cherry-pick -x --allow-empty "$c"; then - : - else - # If we’re left mid-cherry-pick, abort to avoid a broken working state. + if ! git cherry-pick -x --allow-empty "$c"; then + git status || true + # If we're left mid-cherry-pick, abort to avoid a broken + # working state. Nothing was pushed, so master on origin is + # still intact. if [ -f .git/CHERRY_PICK_HEAD ]; then git cherry-pick --abort || true fi - - # Fail on real conflicts (this should be rare with allow-empty, but keep it strict). - if git diff --name-only --diff-filter=U | grep -q .; then - echo "Real conflict detected while applying $c" - git status - exit 1 - fi - - echo "Cherry-pick failed for $c (non-conflict). Failing to avoid corrupting history." - git status + echo "::error::Cherry-pick failed for $c; nothing was pushed." exit 1 fi done echo "Done. Pushing updated master." - git push --force-with-lease origin master + git push --force-with-lease origin master \ No newline at end of file From 34c2996c76692c1d05f70f837efeefeda69cd2a0 Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Fri, 21 Aug 2026 02:39:36 +0000 Subject: [PATCH 249/250] ogc: linux-unstable: test PRs --- .github/workflows/test-pr.yml | 227 ++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 .github/workflows/test-pr.yml diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml new file mode 100644 index 00000000000000..29c4e2fb8f2dbe --- /dev/null +++ b/.github/workflows/test-pr.yml @@ -0,0 +1,227 @@ +name: Test PR (checkpatch + config gate + gcc build) + +on: + pull_request: + branches: [master] + +permissions: + contents: read + +concurrency: + group: pr-test-${{ github.event.pull_request.number }} + cancel-in-progress: true + +env: + KERNEL_PACKAGES_RAW: https://raw.githubusercontent.com/OpenGamingCollective/kernel-packages/main + +jobs: + checks: + name: Static checks (checkpatch, new-driver symbols) + runs-on: ubuntu-latest + outputs: + new_symbols: ${{ steps.syms.outputs.syms }} + steps: + - name: Checkout PR merge result + uses: actions/checkout@v7 + with: + # Default ref for pull_request is the merge commit refs/pull/N/merge. + # depth 2 fetches the merge commit AND its parents, so HEAD^1 + # (current master tip) is present and the PR diff is exactly + # "what landing this PR changes on master". + fetch-depth: 2 + + - name: Compute PR patch and new driver symbols + id: syms + run: | + set -euo pipefail + # For pull_request, checkout gets the merge commit refs/pull/N/merge: + # parent 1 = master tip, parent 2 = PR head. Fall back to + # origin/master if HEAD is not a merge commit for any reason. + BASE="$(git rev-parse --verify -q HEAD^1 || true)" + if [ -z "$BASE" ]; then + echo "HEAD^1 unresolvable; falling back to origin/master" + git fetch --depth=1 origin master + BASE="$(git rev-parse --verify -q FETCH_HEAD || true)" + fi + if [ -z "$BASE" ]; then + echo "::error::Could not determine the base commit for the PR diff." + exit 1 + fi + git diff "$BASE" HEAD > /tmp/pr.patch + + if [ ! -s /tmp/pr.patch ]; then + echo "Empty patch; nothing to check." + echo "syms=" >> "$GITHUB_OUTPUT" + exit 0 + fi + + # Selectable symbols introduced under drivers/ (added + # "config FOO" / "menuconfig FOO" lines in any Kconfig file). + # NOTE: grep exits 1 on zero matches; under `set -euo pipefail` + # that would abort the step, so it is neutralised here only + # (git diff / awk failures still propagate). + SYMS="$(git diff "$BASE" HEAD -- drivers/ \ + | { grep -E '^\+[[:space:]]*(menu)?config[[:space:]]+[A-Z0-9_]+' || true; } \ + | awk '{print $NF}' | sort -u | tr '\n' ' ')" + echo "syms=${SYMS}" >> "$GITHUB_OUTPUT" + { + echo "### PR checks" + echo + echo "- Changed files: $(git diff --name-only "$BASE" HEAD | wc -l)" + echo "- New driver CONFIG symbols: ${SYMS:-none}" + } >> "$GITHUB_STEP_SUMMARY" + + - name: checkpatch (fail on errors) + run: | + set -uo pipefail + if [ ! -s /tmp/pr.patch ]; then + echo "Empty patch; skipping checkpatch." + exit 0 + fi + # --no-signoff: internal fork PRs do not require Signed-off-by. + perl scripts/checkpatch.pl --no-signoff /tmp/pr.patch \ + > /tmp/checkpatch.out 2>&1 || true + cat /tmp/checkpatch.out + + if grep -q '^ERROR:' /tmp/checkpatch.out; then + NERRS="$(grep -c '^ERROR:' /tmp/checkpatch.out)" + echo "::error::checkpatch reported ${NERRS} error(s); fix them before merge (warnings do not block)." + exit 1 + fi + echo "checkpatch: no errors." + + build: + name: Build with GCC (Arch config + fragments) + needs: checks + runs-on: ubuntu-latest + timeout-minutes: 330 + container: + image: docker.io/archlinux:base-devel + env: + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 10G + NEW_SYMBOLS: ${{ needs.checks.outputs.new_symbols }} + steps: + - name: Show disk space + run: df -h / + + - name: Bootstrap build environment + run: | + set -euxo pipefail + pacman -Sy --needed --noconfirm archlinux-keyring + pacman -Su --needed --noconfirm + # base-devel provides gcc/make/perl; the rest mirrors the makedepends + # of the release PKGBUILD minus clang and the rust toolchain. + pacman -S --needed --noconfirm \ + bc cpio gettext libelf pahole perl python tar xz zstd \ + file curl git ccache + + - name: Checkout PR merge result + uses: actions/checkout@v7 + with: + fetch-depth: 1 + + - name: Restore compiler cache + uses: actions/cache@v6 + with: + path: /ccache + key: ccache-pr-gcc-${{ github.sha }} + restore-keys: | + ccache-pr-gcc- + + - name: Assemble test config (same as the Arch release build) + run: | + set -euxo pipefail + # ------------------------------------------------------------------ + # Base config: official Arch Linux kernel .config extracted from the + # distro's linux-headers package (same method as the release build). + # ------------------------------------------------------------------ + CACHE="/tmp/pkgcache" + mkdir -p "$CACHE" + pacman -Sw --noconfirm --cachedir "$CACHE" linux-headers + PKG="$(find "$CACHE" -maxdepth 1 -name 'linux-headers-*.pkg.tar.zst' -type f)" + if [ -z "$PKG" ]; then + echo "::error::linux-headers package not found in cache"; exit 1 + fi + CFG="$(tar --zstd -tf "$PKG" | grep -E '^usr/lib/modules/[^/]+/build/\.config$' || true)" + if [ -z "$CFG" ]; then + echo "::error::kernel .config not found inside $PKG"; exit 1 + fi + tar --zstd -xOf "$PKG" "$CFG" > .config + test -s .config + rm -rf "$CACHE" + + # ------------------------------------------------------------------ + # OGC kernel-packages fragments + the repo-local config.fragment + # (merged last, wins). Same order as the release build. + # ------------------------------------------------------------------ + for f in arch.config.set ogc.config.set arch.config.unset ogc.config.unset; do + curl -fsSL "${KERNEL_PACKAGES_RAW}/config/${f}" -o "${f}" + done + bash .github/packaging/merge-fragments.sh .config \ + arch.config.set ogc.config.set \ + arch.config.unset ogc.config.unset \ + .github/packaging/config.fragment + + # Same fixups as the release packaging... + scripts/config --set-str SYSTEM_TRUSTED_KEYS "" + scripts/config --set-str SYSTEM_REVOCATION_KEYS "" + scripts/config --set-str MODULE_SIG_KEY "certs/signing_key.pem" + scripts/config --set-str CONFIG_LOCALVERSION "" || true + # ...plus test-only tweaks: + # No rust toolchain is installed in this job; the release builds + # (clang) compile the rust bits, this job focuses on the C parts. + scripts/config -d RUST + make olddefconfig + + - name: "Gate: new driver symbols must be enabled in the config" + run: | + set -euo pipefail + if [ -z "${NEW_SYMBOLS// }" ]; then + echo "No new driver CONFIG symbols in this PR; skipping gate." + exit 0 + fi + echo "Gate symbols: ${NEW_SYMBOLS}" + + FAIL=0 + for s in ${NEW_SYMBOLS}; do + if grep -qE "^CONFIG_${s}=[ym]$" .config; then + echo "OK: CONFIG_${s} is enabled." + elif grep -q "^# CONFIG_${s} is not set$" .config; then + echo "::error::CONFIG_${s} was added by this PR but is disabled in the merged config." + echo "::error::Enable it in .github/packaging/config.fragment (CONFIG_${s}=y or =m) if it should ship." + FAIL=1 + elif grep -q "^CONFIG_${s}=" .config; then + echo "::error::CONFIG_${s} is set but not to y/m: $(grep "^CONFIG_${s}=" .config)" + FAIL=1 + else + echo "::error::CONFIG_${s} is absent from the final .config (its dependencies or its vendor menu are off in the merged config)." + echo "::error::If this driver should ship, enable it (and its dependencies) in .github/packaging/config.fragment." + FAIL=1 + fi + done + if [ "$FAIL" -ne 0 ]; then + echo "::error::config gate failed: new drivers must be enabled in the OGC config." + exit 1 + fi + echo "config gate passed." + + - name: Build kernel with GCC + run: | + set -euxo pipefail + ccache -s || true + make CC="ccache gcc" WERROR=0 -j"$(nproc)" all + echo "Kernel release: $(make -s kernelrelease)" + ccache -s + df -h / + + - name: Summary + if: always() + run: | + { + echo "### GCC compile test" + echo + echo "- Compiler: gcc (Arch Linux) via ccache" + echo "- Config: Arch linux-headers base + OGC fragments + repo config.fragment (Rust disabled for this test)" + echo "- New driver symbols checked: ${NEW_SYMBOLS:-none}" + } >> "$GITHUB_STEP_SUMMARY" \ No newline at end of file From 044f8fc6f7461b15ad8dee038026359f2816a2bf Mon Sep 17 00:00:00 2001 From: Panz Dev Date: Tue, 18 Aug 2026 17:14:31 +0200 Subject: [PATCH 250/250] HID: asus: do not send keyboard init reports to touchpads Commit 0919db9f3583 ("HID: asus: always fully initialize devices") added a loop during asus_probe() to send keyboard feature report initializations (asus_kbd_init) to all ASUS HID devices. On ASUS laptops with I2C/HID touchpads (such as the ASUS E200HA), sending keyboard feature reports (FEATURE_KBD_REPORT_ID) to touchpad endpoints sends invalid feature requests to touchpad hardware, corrupting probe state and causing the touchpad to become unresponsive. Wrap the asus_report_id_init loop in an `if (!drvdata->tp)` check so keyboard feature initialization only runs for actual keyboards. Tested on ASUS E200HA (where touchpad functionality is fully restored) and ASUS VivoBook Flip 14 TP401MA (confirming zero regressions). Fixes: 0919db9f3583 ("HID: asus: always fully initialize devices") Cc: stable@vger.kernel.org Signed-off-by: Panz Dev --- drivers/hid/hid-asus.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index ec966fc0a411c5..bd46aba6622a1d 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1493,12 +1493,14 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id) return ret; } - for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) { - if (asus_has_report_id(hdev, asus_report_id_init[r])) { - ret = asus_kbd_init(hdev, asus_report_id_init[r]); - if (ret < 0) - hid_warn(hdev, "Failed to initialize 0x%x: %d.\n", - asus_report_id_init[r], ret); + if (!drvdata->tp) { + for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) { + if (asus_has_report_id(hdev, asus_report_id_init[r])) { + ret = asus_kbd_init(hdev, asus_report_id_init[r]); + if (ret < 0) + hid_warn(hdev, "Failed to initialize 0x%x: %d.\n", + asus_report_id_init[r], ret); + } } }