Skip to content

Commit feeacfe

Browse files
committed
linux/modules/pagetables: fix building on Linux 6.15
Linux 6.15 removed `struct pcpu_hot` and used `current_task` again. https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a1e4cc0155ad577adc3a2c563fc5eec625945ce7 Building on Fedora 43 reported: make -C /lib/modules/6.15.0-0.rc0.20250327git1a9239bb4253.5.fc43.x86_64/build M=/shared/linux/modules modules CC [M] pagetables.o pagetables.c: In function ‘print_additional_desc’: pagetables.c:334:44: error: ‘pcpu_hot’ undeclared (first use in this function) 334 | describe_with_pointer(per_cpu_ptr(&pcpu_hot, 0), "percpu area"); | ^~~~~~~~ pagetables.c:306:54: note: in definition of macro ‘describe_with_pointer’ 306 | unsigned long _ptr = (unsigned long)(ptr); \ | ^~~ /usr/src/kernels/6.15.0-0.rc0.20250327git1a9239bb4253.5.fc43.x86_64/include/linux/percpu-defs.h:238:9: note: in expansion of macro ‘__verify_pcpu_ptr’ 238 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ pagetables.c:334:31: note: in expansion of macro ‘per_cpu_ptr’ 334 | describe_with_pointer(per_cpu_ptr(&pcpu_hot, 0), "percpu area"); | ^~~~~~~~~~~ pagetables.c:334:44: note: each undeclared identifier is reported only once for each function it appears in 334 | describe_with_pointer(per_cpu_ptr(&pcpu_hot, 0), "percpu area"); | ^~~~~~~~ pagetables.c:306:54: note: in definition of macro ‘describe_with_pointer’ 306 | unsigned long _ptr = (unsigned long)(ptr); \ | ^~~ /usr/src/kernels/6.15.0-0.rc0.20250327git1a9239bb4253.5.fc43.x86_64/include/linux/percpu-defs.h:238:9: note: in expansion of macro ‘__verify_pcpu_ptr’ 238 | __verify_pcpu_ptr(ptr); \ | ^~~~~~~~~~~~~~~~~ pagetables.c:334:31: note: in expansion of macro ‘per_cpu_ptr’ 334 | describe_with_pointer(per_cpu_ptr(&pcpu_hot, 0), "percpu area"); | ^~~~~~~~~~~
1 parent d18c0af commit feeacfe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

linux/modules/pagetables.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,13 @@ static void print_additional_desc(struct pg_state *st, unsigned long last_addr)
326326
describe_with_pointer(&addr, "current stack");
327327

328328
#ifdef CONFIG_X86
329-
# if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
329+
# if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
330+
/* Commit a1e4cc0155ad ("x86/percpu: Move current_task to percpu hot
331+
* section") replaced pcpu_hot.current_task with current_task again.
332+
* Show where the percpu area is on x86, using current_task
333+
*/
334+
describe_with_pointer(per_cpu_ptr(&current_task, 0), "percpu area");
335+
# elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
330336
/* Commit e57ef2ed97c1 ("x86: Put hot per CPU variables into a struct")
331337
* replaced current_task with pcpu_hot.current_task.
332338
* Show where the percpu area is on x86, using pcpu_hot

0 commit comments

Comments
 (0)