projects/linux·commit e406d57b

Merge tag 'mm-nonmm-stable-2025-10-02-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

e406d57b · Linus Torvalds <[email protected]> · 2025-10-02 18:44:54 -07:00

Pull non-MM updates from Andrew Morton:

 - "ida: Remove the ida_simple_xxx() API" from Christophe Jaillet
   completes the removal of this legacy IDR API

 - "panic: introduce panic status function family" from Jinchao Wang
   provides a number of cleanups to the panic code and its various
   helpers, which were rather ad-hoc and scattered all over the place

 - "tools/delaytop: implement real-time keyboard interaction support"
   from Fan Yu adds a few nice user-facing usability changes to the
   delaytop monitoring tool

 - "efi: Fix EFI boot with kexec handover (KHO)" from Evangelos
   Petrongonas fixes a panic which was happening with the combination of
   EFI and KHO

 - "Squashfs: performance improvement and a sanity check" from Phillip
   Lougher teaches squashfs's lseek() about SEEK_DATA/SEEK_HOLE. A mere
   150x speedup was measured for a well-chosen microbenchmark

 - plus another 50-odd singleton patches all over the place

* tag 'mm-nonmm-stable-2025-10-02-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (75 commits)
  Squashfs: reject negative file sizes in squashfs_read_inode()
  kallsyms: use kmalloc_array() instead of kmalloc()
  MAINTAINERS: update Sibi Sankar's email address
  Squashfs: add SEEK_DATA/SEEK_HOLE support
  Squashfs: add additional inode sanity checking
  lib/genalloc: fix device leak in of_gen_pool_get()
  panic: remove CONFIG_PANIC_ON_OOPS_VALUE
  ocfs2: fix double free in user_cluster_connect()
  checkpatch: suppress strscpy warnings for userspace tools
  cramfs: fix incorrect physical page address calculation
  kernel: prevent prctl(PR_SET_PDEATHSIG) from racing with parent process exit
  Squashfs: fix uninit-value in squashfs_get_parent
  kho: only fill kimage if KHO is finalized
  ocfs2: avoid extra calls to strlen() after ocfs2_sprintf_system_inode_name()
  kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths
  sched/task.h: fix the wrong comment on task_lock() nesting with tasklist_lock
  coccinelle: platform_no_drv_owner: handle also built-in drivers
  coccinelle: of_table: handle SPI device ID tables
  lib/decompress: use designated initializers for struct compress_format
  efi: support booting with kexec handover (KHO)
  ...
Commit
e406d57be7bd2a4e73ea512c1ae36a40a44e499e
Parents
8804d970 · 9f1c14c1

Merge commit. Changes below are compared with the first parent: 8804d970.

Changes

78 files changed · +1619 −476

FileStatusAddDelContent
.mailmapmodified+2−1View file
Documentation/accounting/delay-accounting.rstmodified+58−33View file
Documentation/admin-guide/kernel-parameters.txtmodified+1−1View file
Documentation/admin-guide/sysctl/kernel.rstmodified+1−1View file
Documentation/dev-tools/kcov.rstmodified+6−1View file
MAINTAINERSmodified+1−1View file
arch/x86/kernel/crash.cmodified+19−6View file
arch/x86/kernel/kexec-bzimage64.cmodified+44−3View file
drivers/firmware/efi/efi-init.cmodified+25−4View file
drivers/video/fbdev/core/fbcon.cmodified+1−8View file
fs/cramfs/inode.cmodified+1−1View file
fs/fat/dir.cmodified+3−4View file
fs/ocfs2/alloc.cmodified+1−2View file
fs/ocfs2/dlm/dlmmaster.cmodified+0−11View file
fs/ocfs2/dlm/dlmrecovery.cmodified+0−1View file
fs/ocfs2/inode.cmodified+8−0View file
fs/ocfs2/ioctl.cmodified+7−11View file
fs/ocfs2/move_extents.cmodified+4−4View file
fs/ocfs2/ocfs2_fs.hmodified+1−1View file
fs/ocfs2/stack_user.cmodified+1−0View file
fs/ocfs2/sysfile.cmodified+6−6View file
fs/proc/base.cmodified+1−1View file
fs/squashfs/file.cmodified+126−11View file
fs/squashfs/inode.cmodified+35−4View file
fs/squashfs/squashfs.hmodified+1−0View file
fs/squashfs/squashfs_fs.hmodified+1−0View file
fs/squashfs/squashfs_fs_i.hmodified+1−1View file
include/linux/idr.hmodified+0−8View file
include/linux/kernel.hmodified+17−4View file
include/linux/kexec.hmodified+4−1View file
include/linux/kexec_handover.hmodified+6−0View file
include/linux/list.hmodified+8−0View file
include/linux/moduleparam.hmodified+13−0View file
include/linux/nvmem-provider.hmodified+1−1View file
include/linux/panic.hmodified+6−0View file
include/linux/printk.hmodified+0−2View file
include/linux/sched/task.hmodified+2−3View file
include/uapi/linux/kexec.hmodified+4−0View file
init/main.cmodified+12−0View file
kernel/Kconfig.kexecmodified+11−0View file
kernel/Makefilemodified+1−0View file
kernel/crash_core.cmodified+18−12View file
kernel/crash_core_test.cadded+343−0View file
kernel/fork.cmodified+6−12View file
kernel/hung_task.cmodified+41−37View file
kernel/kallsyms_selftest.cmodified+1−1View file
kernel/kcov.cmodified+9−0View file
kernel/kexec_core.cmodified+0−1View file
kernel/kexec_file.cmodified+1−0View file
kernel/kexec_handover.cmodified+21−1View file
kernel/panic.cmodified+103−26View file
kernel/printk/internal.hmodified+0−1View file
kernel/printk/nbcon.cmodified+7−7View file
kernel/printk/printk.cmodified+5−32View file
kernel/printk/printk_ringbuffer.cmodified+1−1View file
kernel/sys.cmodified+30−2View file
kernel/watchdog.cmodified+23−5View file
kernel/watchdog_perf.cmodified+4−0View file
lib/Kconfig.debugmodified+0−6View file
lib/alloc_tag.cmodified+2−1View file
lib/btree.cmodified+2−2View file
lib/decompress.cmodified+10−11View file
lib/digsig.cmodified+0−1View file
lib/dump_stack.cmodified+1−1View file
lib/fault-inject-usercopy.cmodified+1−3View file
lib/genalloc.cmodified+4−1View file
lib/ref_tracker.cmodified+3−3View file
lib/sys_info.cmodified+2−1View file
lib/test_firmware.cmodified+4−3View file
scripts/checkpatch.plmodified+9−5View file
scripts/coccinelle/api/platform_no_drv_owner.coccimodified+9−0View file
scripts/coccinelle/misc/of_table.coccimodified+7−7View file
tools/accounting/delaytop.cmodified+427−144View file
tools/testing/radix-tree/idr-test.cmodified+7−9View file
tools/testing/selftests/proc/.gitignoremodified+1−0View file
tools/testing/selftests/proc/Makefilemodified+1−0View file
tools/testing/selftests/proc/proc-net-dev-lseek.cadded+68−0View file
tools/testing/selftests/proc/proc-pid-vm.cmodified+8−4View file

Only the first 600 diff lines are shown. Download the complete patch.

.mailmap

View file
diff --git a/.mailmap b/.mailmap
index d30f936..644b0dc 100644
--- a/.mailmap
+++ b/.mailmap
@@ -721,7 +721,8 @@ Shuah Khan <[email protected]> <[email protected]>

Documentation/accounting/delay-accounting.rst

View file
diff --git a/Documentation/accounting/delay-accounting.rst b/Documentation/accounting/delay-accounting.rst
index 8ccc5af..86d7902 100644
--- a/Documentation/accounting/delay-accounting.rst
+++ b/Documentation/accounting/delay-accounting.rst
@@ -134,47 +134,72 @@ The above command can be used with -v to get more debug information.
After the system starts, use `delaytop` to get the system-wide delay information,
which includes system-wide PSI information and Top-N high-latency tasks.
+Note: PSI support requires `CONFIG_PSI=y` and `psi=1` for full functionality.
-`delaytop` supports sorting by CPU latency in descending order by default,
-displays the top 20 high-latency tasks by default, and refreshes the latency
-data every 2 seconds by default.
+`delaytop` is an interactive tool for monitoring system pressure and task delays.
+It supports multiple sorting options, display modes, and real-time keyboard controls.
-Get PSI information and Top-N tasks delay, since system boot::
+Basic usage with default settings (sorts by CPU delay, shows top 20 tasks, refreshes every 2 seconds)::
bash# ./delaytop
- System Pressure Information: (avg10/avg60/avg300/total)
- CPU some: 0.0%/ 0.0%/ 0.0%/ 345(ms)
+ System Pressure Information: (avg10/avg60vg300/total)
+ CPU some: 0.0%/ 0.0%/ 0.0%/ 106137(ms)
CPU full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
Memory full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
Memory some: 0.0%/ 0.0%/ 0.0%/ 0(ms)
- IO full: 0.0%/ 0.0%/ 0.0%/ 65(ms)
- IO some: 0.0%/ 0.0%/ 0.0%/ 79(ms)
+ IO full: 0.0%/ 0.0%/ 0.0%/ 2240(ms)
+ IO some: 0.0%/ 0.0%/ 0.0%/ 2783(ms)
IRQ full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
- Top 20 processes (sorted by CPU delay):
- PID TGID COMMAND CPU(ms) IO(ms) SWAP(ms) RCL(ms) THR(ms) CMP(ms) WP(ms) IRQ(ms)
- ----------------------------------------------------------------------------------------------
- 161 161 zombie_memcg_re 1.40 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 130 130 blkcg_punt_bio 1.37 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 444 444 scsi_tmf_0 0.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 1280 1280 rsyslogd 0.53 0.04 0.00 0.00 0.00 0.00 0.00 0.00
- 12 12 ksoftirqd/0 0.47 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 1277 1277 nbd-server 0.44 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 308 308 kworker/2:2-sys 0.41 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 55 55 netns 0.36 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 1187 1187 acpid 0.31 0.03 0.00 0.00 0.00 0.00 0.00 0.00
- 6184 6184 kworker/1:2-sys 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 186 186 kaluad 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 18 18 ksoftirqd/1 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 185 185 kmpath_rdacd 0.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 190 190 kstrp 0.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 2759 2759 agetty 0.20 0.03 0.00 0.00 0.00 0.00 0.00 0.00
- 1190 1190 kworker/0:3-sys 0.19 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 1272 1272 sshd 0.15 0.04 0.00 0.00 0.00 0.00 0.00 0.00
- 1156 1156 license 0.15 0.11 0.00 0.00 0.00 0.00 0.00 0.00
- 134 134 md 0.13 0.00 0.00 0.00 0.00 0.00 0.00 0.00
- 6142 6142 kworker/3:2-xfs 0.13 0.00 0.00 0.00 0.00 0.00 0.00 0.00
-
-Dynamic interactive interface of delaytop::
+ [o]sort [M]memverbose [q]quit
+ Top 20 processes (sorted by cpu delay):
+ PID TGID COMMAND CPU(ms) IO(ms) IRQ(ms) MEM(ms)
+ ------------------------------------------------------------------------
+ 110 110 kworker/15:0H-s 27.91 0.00 0.00 0.00
+ 57 57 cpuhp/7 3.18 0.00 0.00 0.00
+ 99 99 cpuhp/14 2.97 0.00 0.00 0.00
+ 51 51 cpuhp/6 0.90 0.00 0.00 0.00
+ 44 44 kworker/4:0H-sy 0.80 0.00 0.00 0.00
+ 60 60 ksoftirqd/7 0.74 0.00 0.00 0.00
+ 76 76 idle_inject/10 0.31 0.00 0.00 0.00
+ 100 100 idle_inject/14 0.30 0.00 0.00 0.00
+ 1309 1309 systemsettings 0.29 0.00 0.00 0.00
+ 45 45 cpuhp/5 0.22 0.00 0.00 0.00
+ 63 63 cpuhp/8 0.20 0.00 0.00 0.00
+ 87 87 cpuhp/12 0.18 0.00 0.00 0.00
+ 93 93 cpuhp/13 0.17 0.00 0.00 0.00
+ 1265 1265 acpid 0.17 0.00 0.00 0.00
+ 1552 1552 sshd 0.17 0.00 0.00 0.00
+ 2584 2584 sddm-helper 0.16 0.00 0.00 0.00
+ 1284 1284 rtkit-daemon 0.15 0.00 0.00 0.00
+ 1326 1326 nde-netfilter 0.14 0.00 0.00 0.00
+ 27 27 cpuhp/2 0.13 0.00 0.00 0.00
+ 631 631 kworker/11:2-rc 0.11 0.00 0.00 0.00
+
+Interactive keyboard controls during runtime::
+
+ o - Select sort field (CPU, IO, IRQ, Memory, etc.)
+ M - Toggle display mode (Default/Memory Verbose)
+ q - Quit
+
+Available sort fields(use -s/--sort or interactive command)::
+
+ cpu(c) - CPU delay
+ blkio(i) - I/O delay
+ irq(q) - IRQ delay
+ mem(m) - Total memory delay
+ swapin(s) - Swapin delay (memory verbose mode only)
+ freepages(r) - Freepages reclaim delay (memory verbose mode only)
+ thrashing(t) - Thrashing delay (memory verbose mode only)
+ compact(p) - Compaction delay (memory verbose mode only)
+ wpcopy(w) - Write page copy delay (memory verbose mode only)
+
+Advanced usage examples::
+
+ # ./delaytop -s blkio
+ Sorted by IO delay
+
+ # ./delaytop -s mem -M
+ Sorted by memory delay in memory verbose mode
# ./delaytop -p pid
Print delayacct stats

Documentation/admin-guide/kernel-parameters.txt

View file
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index e019db1..74ca438 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4603,7 +4603,7 @@
bit 2: print timer info
bit 3: print locks info if CONFIG_LOCKDEP is on
bit 4: print ftrace buffer
- bit 5: replay all messages on consoles at the end of panic
+ bit 5: replay all kernel messages on consoles at the end of panic
bit 6: print all CPUs backtrace (if available in the arch)
bit 7: print only tasks in uninterruptible (blocked) state
*Be aware* that this option may print a _lot_ of lines,

Documentation/admin-guide/sysctl/kernel.rst

View file
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 8b49eab..f3ee807 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -890,7 +890,7 @@ bit 1 print system memory info
bit 2 print timer info
bit 3 print locks info if ``CONFIG_LOCKDEP`` is on
bit 4 print ftrace buffer
-bit 5 replay all messages on consoles at the end of panic
+bit 5 replay all kernel messages on consoles at the end of panic
bit 6 print all CPUs backtrace (if available in the arch)
bit 7 print only tasks in uninterruptible (blocked) state
===== ============================================

Documentation/dev-tools/kcov.rst

View file
diff --git a/Documentation/dev-tools/kcov.rst b/Documentation/dev-tools/kcov.rst
index 6611434..8127849 100644
--- a/Documentation/dev-tools/kcov.rst
+++ b/Documentation/dev-tools/kcov.rst
@@ -361,7 +361,12 @@ local tasks spawned by the process and the global task that handles USB bus #1:
*/
sleep(2);
- n = __atomic_load_n(&cover[0], __ATOMIC_RELAXED);
+ /*
+ * The load to the coverage count should be an acquire to pair with
+ * pair with the corresponding write memory barrier (smp_wmb()) on
+ * the kernel-side in kcov_move_area().
+ */
+ n = __atomic_load_n(&cover[0], __ATOMIC_ACQUIRE);
for (i = 0; i < n; i++)
printf("0x%lx\n", cover[i + 1]);
if (ioctl(fd, KCOV_DISABLE, 0))

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 6a6cf85..4abe339 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20987,7 +20987,7 @@ F: Documentation/devicetree/bindings/power/avs/qcom,cpr.yaml
F: drivers/pmdomain/qcom/cpr.c
QUALCOMM CPUCP MAILBOX DRIVER
-M: Sibi Sankar <[email protected]>
+M: Sibi Sankar <[email protected]>
S: Supported
F: Documentation/devicetree/bindings/mailbox/qcom,cpucp-mbox.yaml

arch/x86/kernel/crash.c

View file
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index c6b12be..335fd2e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -165,14 +165,23 @@ static struct crash_mem *fill_up_crash_elf_data(void)
/*
* Exclusion of crash region, crashk_low_res and/or crashk_cma_ranges
* may cause range splits. So add extra slots here.
+ *
+ * Exclusion of low 1M may not cause another range split, because the
+ * range of exclude is [0, 1M] and the condition for splitting a new
+ * region is that the start, end parameters are both in a certain
+ * existing region in cmem and cannot be equal to existing region's
+ * start or end. Obviously, the start of [0, 1M] cannot meet this
+ * condition.
+ *
+ * But in order to lest the low 1M could be changed in the future,
+ * (e.g. [start, 1M]), add a extra slot.
*/
- nr_ranges += 2 + crashk_cma_cnt;
+ nr_ranges += 3 + crashk_cma_cnt;
cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
if (!cmem)
return NULL;
cmem->max_nr_ranges = nr_ranges;
- cmem->nr_ranges = 0;
return cmem;
}
@@ -323,16 +332,20 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
struct crash_mem *cmem;
/*
- * Using random kexec_buf for passing dm crypt keys may cause a range
- * split. So use two slots here.
+ * In the current x86 architecture code, the elfheader is always
+ * allocated at crashk_res.start. But it depends on the allocation
+ * position of elfheader in crashk_res. To avoid potential out of
+ * bounds in future, add an extra slot.
+ *
+ * And using random kexec_buf for passing dm crypt keys may cause a
+ * range split too, add another extra slot here.
*/
- nr_ranges = 2;
+ nr_ranges = 3;
cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
if (!cmem)
return -ENOMEM;
cmem->max_nr_ranges = nr_ranges;
- cmem->nr_ranges = 0;
memset(&cmd, 0, sizeof(struct crash_memmap_data));
cmd.params = params;

arch/x86/kernel/kexec-bzimage64.c

View file
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 24a41f0..c3244ac 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -16,6 +16,8 @@
#include <linux/kexec.h>
#include <linux/kernel.h>
#include <linux/mm.h>
+#include <linux/libfdt.h>
+#include <linux/of_fdt.h>
#include <linux/efi.h>
#include <linux/random.h>
@@ -212,6 +214,28 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
}
#endif /* CONFIG_EFI */
+#ifdef CONFIG_OF_FLATTREE
+static void setup_dtb(struct boot_params *params,
+ unsigned long params_load_addr,
+ unsigned int dtb_setup_data_offset)
+{
+ struct setup_data *sd = (void *)params + dtb_setup_data_offset;
+ unsigned long setup_data_phys, dtb_len;
+
+ dtb_len = fdt_totalsize(initial_boot_params);
+ sd->type = SETUP_DTB;
+ sd->len = dtb_len;
+
+ /* Carry over current boot DTB with setup_data */
+ memcpy(sd->data, initial_boot_params, dtb_len);
+
+ /* Add setup data */
+ setup_data_phys = params_load_addr + dtb_setup_data_offset;
+ sd->next = params->hdr.setup_data;
+ params->hdr.setup_data = setup_data_phys;
+}
+#endif /* CONFIG_OF_FLATTREE */
+
static void
setup_ima_state(const struct kimage *image, struct boot_params *params,
unsigned long params_load_addr,
@@ -336,6 +360,17 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,
sizeof(struct efi_setup_data);
#endif
+#ifdef CONFIG_OF_FLATTREE
+ if (image->force_dtb && initial_boot_params) {
+ setup_dtb(params, params_load_addr, setup_data_offset);
+ setup_data_offset += sizeof(struct setup_data) +
+ fdt_totalsize(initial_boot_params);
+ } else {
+ pr_debug("Not carrying over DTB, force_dtb = %d\n",
+ image->force_dtb);
+ }
+#endif
+
if (IS_ENABLED(CONFIG_IMA_KEXEC)) {
/* Setup IMA log buffer state */
setup_ima_state(image, params, params_load_addr,
@@ -529,6 +564,12 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
sizeof(struct setup_data) +
RNG_SEED_LENGTH;
+#ifdef CONFIG_OF_FLATTREE
+ if (image->force_dtb && initial_boot_params)
+ kbuf.bufsz += sizeof(struct setup_data) +
+ fdt_totalsize(initial_boot_params);
+#endif
+
if (IS_ENABLED(CONFIG_IMA_KEXEC))
kbuf.bufsz += sizeof(struct setup_data) +
sizeof(struct ima_setup_data);
@@ -537,7 +578,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
kbuf.bufsz += sizeof(struct setup_data) +
sizeof(struct kho_data);
- params = kzalloc(kbuf.bufsz, GFP_KERNEL);
+ params = kvzalloc(kbuf.bufsz, GFP_KERNEL);
if (!params)
return ERR_PTR(-ENOMEM);
efi_map_offset = params_cmdline_sz;
@@ -647,7 +688,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
return ldata;
out_free_params:
- kfree(params);
+ kvfree(params);
return ERR_PTR(ret);
}
@@ -659,7 +700,7 @@ static int bzImage64_cleanup(void *loader_data)
if (!ldata)
return 0;
- kfree(ldata->bootparams_buf);
+ kvfree(ldata->bootparams_buf);
ldata->bootparams_buf = NULL;
return 0;

drivers/firmware/efi/efi-init.c

View file
diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c
index a00e07b..a65c2d5 100644
--- a/drivers/firmware/efi/efi-init.c
+++ b/drivers/firmware/efi/efi-init.c
@@ -12,6 +12,7 @@
#include <linux/efi.h>
#include <linux/fwnode.h>
#include <linux/init.h>
+#include <linux/kexec_handover.h>
#include <linux/memblock.h>
#include <linux/mm_types.h>
#include <linux/of.h>
@@ -164,12 +165,32 @@ static __init void reserve_regions(void)
pr_info("Processing EFI memory map:\n");
/*
- * Discard memblocks discovered so far: if there are any at this
- * point, they originate from memory nodes in the DT, and UEFI
- * uses its own memory map instead.
+ * Discard memblocks discovered so far except for KHO scratch
+ * regions. Most memblocks at this point originate from memory nodes
+ * in the DT and UEFI uses its own memory map instead. However, if
+ * KHO is enabled, scratch regions, which are good known memory
+ * must be preserved.
*/
memblock_dump_all();
- memblock_remove(0, PHYS_ADDR_MAX);
+
+ if (is_kho_boot()) {
+ struct memblock_region *r;
+
+ /* Remove all non-KHO regions */
+ for_each_mem_region(r) {
+ if (!memblock_is_kho_scratch(r)) {
+ memblock_remove(r->base, r->size);
+ r--;
+ }
+ }
+ } else {
+ /*
+ * KHO is disabled. Discard memblocks discovered so far:
+ * if there are any at this point, they originate from memory
+ * nodes in the DT, and UEFI uses its own memory map instead.
+ */
+ memblock_remove(0, PHYS_ADDR_MAX);
+ }
for_each_efi_memory_desc(md) {
paddr = md->phys_addr;

drivers/video/fbdev/core/fbcon.c

View file
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 5940e2e..96cc9b3 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -279,14 +279,7 @@ static int fbcon_get_rotate(struct fb_info *info)
static bool fbcon_skip_panic(struct fb_info *info)
{
-/* panic_cpu is not exported, and can't be used if built as module. Use
- * oops_in_progress instead, but non-fatal oops won't be printed.
- */
-#if defined(MODULE)
- return (info->skip_panic && unlikely(oops_in_progress));
-#else
- return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID));
-#endif
+ return (info->skip_panic && unlikely(panic_in_progress()));
}
static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *info)

fs/cramfs/inode.c

View file
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 12daa85..ca54bf2 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -421,7 +421,7 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
vm_fault_t vmf;
unsigned long off = i * PAGE_SIZE;
vmf = vmf_insert_mixed(vma, vma->vm_start + off,
- address + off);
+ PHYS_PFN(address + off));
if (vmf & VM_FAULT_ERROR)
ret = vm_fault_to_errno(vmf, 0);
}

fs/fat/dir.c

View file
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index acbec5b..92b0917 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -1209,7 +1209,7 @@ EXPORT_SYMBOL_GPL(fat_alloc_new_dir);
static int fat_add_new_entries(struct inode *dir, void *slots, int nr_slots,
int *nr_cluster, struct msdos_dir_entry **de,
- struct buffer_head **bh, loff_t *i_pos)
+ struct buffer_head **bh)
{
struct super_block *sb = dir->i_sb;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
@@ -1269,7 +1269,6 @@ static int fat_add_new_entries(struct inode *dir, void *slots, int nr_slots,
get_bh(bhs[n]);
*bh = bhs[n];
*de = (struct msdos_dir_entry *)((*bh)->b_data + offset);
- *i_pos = fat_make_i_pos(sb, *bh, *de);
/* Second stage: clear the rest of cluster, and write outs */
err = fat_zeroed_cluster(dir, start_blknr, ++n, bhs, MAX_BUF_PER_PAGE);
@@ -1298,7 +1297,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,
struct buffer_head *bh, *prev, *bhs[3]; /* 32*slots (672bytes) */
struct msdos_dir_entry *de;
int err, free_slots, i, nr_bhs;
- loff_t pos, i_pos;
+ loff_t pos;
sinfo->nr_slots = nr_slots;
@@ -1386,7 +1385,7 @@ found:
* add the cluster to dir.
*/
cluster = fat_add_new_entries(dir, slots, nr_slots, &nr_cluster,
- &de, &bh, &i_pos);
+ &de, &bh);
if (cluster < 0) {
err = cluster;
goto error_remove;

fs/ocfs2/alloc.c

View file
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 821cb78..162711c 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6928,8 +6928,7 @@ static int ocfs2_grab_folios(struct inode *inode, loff_t start, loff_t end,
out:
if (ret != 0) {
- if (folios)
- ocfs2_unlock_and_free_folios(folios, numfolios);
+ ocfs2_unlock_and_free_folios(folios, numfolios);
numfolios = 0;
}

fs/ocfs2/dlm/dlmmaster.c

View file
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 86bb1a0..4145e06 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -1477,7 +1477,6 @@ way_up_top:
goto send_response;
} else if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) {
spin_unlock(&res->spinlock);
- // mlog(0, "node %u is the master\n", res->owner);
response = DLM_MASTER_RESP_NO;
if (mle)
kmem_cache_free(dlm_mle_cache, mle);
@@ -1493,7 +1492,6 @@ way_up_top:
BUG();
}
- // mlog(0, "lockres is in progress...\n");
spin_lock(&dlm->master_lock);
found = dlm_find_mle(dlm, &tmpmle, name, namelen);
if (!found) {
@@ -1503,8 +1501,6 @@ way_up_top:
set_maybe = 1;
spin_lock(&tmpmle->spinlock);
if (tmpmle->type == DLM_MLE_BLOCK) {
- // mlog(0, "this node is waiting for "
- // "lockres to be mastered\n");
response = DLM_MASTER_RESP_NO;
} else if (tmpmle->type == DLM_MLE_MIGRATION) {
mlog(0, "node %u is master, but trying to migrate to "
@@ -1531,8 +1527,6 @@ way_up_top:
} else
response = DLM_MASTER_RESP_NO;
} else {
- // mlog(0, "this node is attempting to "
- // "master lockres\n");
response = DLM_MASTER_RESP_MAYBE;
}
if (set_maybe)
@@ -1559,7 +1553,6 @@ way_up_top:
found = dlm_find_mle(dlm, &tmpmle, name, namelen);
if (!found) {
/* this lockid has never been seen on this node yet */
- // mlog(0, "no mle found\n");
if (!mle) {
spin_unlock(&dlm->master_lock);
spin_unlock(&dlm->spinlock);
@@ -1573,8 +1566,6 @@ way_up_top:
goto way_up_top;
}
- // mlog(0, "this is second time thru, already allocated, "
- // "add the block.\n");
dlm_init_mle(mle, DLM_MLE_BLOCK, dlm, NULL, name, namelen);
set_bit(request->node_idx, mle->maybe_map);
__dlm_insert_mle(dlm, mle);
@@ -1897,8 +1888,6 @@ ok:
spin_unlock(&res->spinlock);
}
- // mlog(0, "woo! got an assert_master from node %u!\n",
- // assert->node_idx);
if (mle) {
int extra_ref = 0;
int nn = -1;

fs/ocfs2/dlm/dlmrecovery.c

View file
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 00f5281..843ee02 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -464,7 +464,6 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm)
}
if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) {
- // mlog(0, "nothing to recover! sleeping now!\n");
spin_unlock(&dlm->spinlock);
/* return to main thread loop and sleep. */
return 0;

fs/ocfs2/inode.c

View file
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 6c4f78f..fcc8985 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -1495,6 +1495,14 @@ int ocfs2_validate_inode_block(struct super_block *sb,
goto bail;
}
+ if (le16_to_cpu(di->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT &&
+ (u32)le16_to_cpu(di->i_suballoc_slot) > OCFS2_SB(sb)->max_slots - 1) {
+ rc = ocfs2_error(sb, "Invalid dinode %llu: suballoc slot %u\n",
+ (unsigned long long)bh->b_blocknr,
+ le16_to_cpu(di->i_suballoc_slot));
+ goto bail;
+ }
+
rc = 0;
bail:

fs/ocfs2/ioctl.c

View file
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index db14c92..b686460 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -358,13 +358,11 @@ static int ocfs2_info_handle_freeinode(struct inode *inode,
goto bail;
}
} else {
- ocfs2_sprintf_system_inode_name(namebuf,
- sizeof(namebuf),
- type, i);
+ int len = ocfs2_sprintf_system_inode_name(namebuf,
+ sizeof(namebuf),
+ type, i);
status = ocfs2_lookup_ino_from_name(osb->sys_root_inode,
- namebuf,
- strlen(namebuf),
- &blkno);
+ namebuf, len, &blkno);
if (status < 0) {
status = -ENOENT;
goto bail;
@@ -651,12 +649,10 @@ static int ocfs2_info_handle_freefrag(struct inode *inode,
goto bail;
}
} else {
- ocfs2_sprintf_system_inode_name(namebuf, sizeof(namebuf), type,
- OCFS2_INVALID_SLOT);
+ int len = ocfs2_sprintf_system_inode_name(namebuf, sizeof(namebuf),
+ type, OCFS2_INVALID_SLOT);
status = ocfs2_lookup_ino_from_name(osb->sys_root_inode,
- namebuf,
- strlen(namebuf),
- &blkno);

This diff is incomplete. Download the complete patch.

fs/ocfs2/move_extents.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/ocfs2_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/stack_user.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/sysfile.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/base.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/squashfs.h

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/squashfs_fs.h

View file

This diff is incomplete. Download the complete patch.

fs/squashfs/squashfs_fs_i.h

View file

This diff is incomplete. Download the complete patch.

include/linux/idr.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kernel.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kexec.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kexec_handover.h

View file

This diff is incomplete. Download the complete patch.

include/linux/list.h

View file

This diff is incomplete. Download the complete patch.

include/linux/moduleparam.h

View file

This diff is incomplete. Download the complete patch.

include/linux/nvmem-provider.h

View file

This diff is incomplete. Download the complete patch.

include/linux/panic.h

View file

This diff is incomplete. Download the complete patch.

include/linux/printk.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched/task.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/kexec.h

View file

This diff is incomplete. Download the complete patch.

init/main.c

View file

This diff is incomplete. Download the complete patch.

kernel/Kconfig.kexec

View file

This diff is incomplete. Download the complete patch.

kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/crash_core.c

View file

This diff is incomplete. Download the complete patch.

kernel/crash_core_test.c

View file

This diff is incomplete. Download the complete patch.

kernel/fork.c

View file

This diff is incomplete. Download the complete patch.

kernel/hung_task.c

View file

This diff is incomplete. Download the complete patch.

kernel/kallsyms_selftest.c

View file

This diff is incomplete. Download the complete patch.

kernel/kcov.c

View file

This diff is incomplete. Download the complete patch.

kernel/kexec_core.c

View file

This diff is incomplete. Download the complete patch.

kernel/kexec_file.c

View file

This diff is incomplete. Download the complete patch.

kernel/kexec_handover.c

View file

This diff is incomplete. Download the complete patch.

kernel/panic.c

View file

This diff is incomplete. Download the complete patch.

kernel/printk/internal.h

View file

This diff is incomplete. Download the complete patch.

kernel/printk/nbcon.c

View file

This diff is incomplete. Download the complete patch.

kernel/printk/printk.c

View file

This diff is incomplete. Download the complete patch.

kernel/printk/printk_ringbuffer.c

View file

This diff is incomplete. Download the complete patch.

kernel/sys.c

View file

This diff is incomplete. Download the complete patch.

kernel/watchdog.c

View file

This diff is incomplete. Download the complete patch.

kernel/watchdog_perf.c

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.debug

View file

This diff is incomplete. Download the complete patch.

lib/alloc_tag.c

View file

This diff is incomplete. Download the complete patch.

lib/btree.c

View file

This diff is incomplete. Download the complete patch.

lib/decompress.c

View file

This diff is incomplete. Download the complete patch.

lib/digsig.c

View file

This diff is incomplete. Download the complete patch.

lib/dump_stack.c

View file

This diff is incomplete. Download the complete patch.

lib/fault-inject-usercopy.c

View file

This diff is incomplete. Download the complete patch.

lib/genalloc.c

View file

This diff is incomplete. Download the complete patch.

lib/ref_tracker.c

View file

This diff is incomplete. Download the complete patch.

lib/sys_info.c

View file

This diff is incomplete. Download the complete patch.

lib/test_firmware.c

View file

This diff is incomplete. Download the complete patch.

scripts/checkpatch.pl

View file

This diff is incomplete. Download the complete patch.

scripts/coccinelle/api/platform_no_drv_owner.cocci

View file

This diff is incomplete. Download the complete patch.

scripts/coccinelle/misc/of_table.cocci

View file

This diff is incomplete. Download the complete patch.

tools/accounting/delaytop.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/radix-tree/idr-test.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/proc/.gitignore

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/proc/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/proc/proc-net-dev-lseek.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/proc/proc-pid-vm.c

View file

This diff is incomplete. Download the complete patch.