git: ff2cddb26686 - stable/15 - linuxkpi: stop inlining accesses to curthread->td_lkpi_task
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 16 Aug 2026 02:46:23 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=ff2cddb26686e0097c09dfb37c7c447d29425f20
commit ff2cddb26686e0097c09dfb37c7c447d29425f20
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-08-08 19:01:20 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-08-16 02:41:17 +0000
linuxkpi: stop inlining accesses to curthread->td_lkpi_task
(cherry picked from commit 6747bf7e223e5400af1c434618b14debd8dca0cf)
---
sys/compat/linuxkpi/common/include/linux/sched.h | 7 ++-----
sys/compat/linuxkpi/common/src/linux_compat.c | 10 ++++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index 3ad2f8e4ce8b..4e2a0f3676a9 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -92,11 +92,8 @@ struct task_struct {
unsigned int fpu_ctx_level;
};
-#define current ({ \
- struct thread *__td = curthread; \
- linux_set_current(__td); \
- ((struct task_struct *)__td->td_lkpi_task); \
-})
+struct task_struct *__lkpi_current(void);
+#define current (__lkpi_current())
#define task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid
#define task_pid(task) ((task)->pid)
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index e93963428195..31fd80faac1d 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -170,6 +170,16 @@ const guid_t guid_null;
enum system_states system_state = SYSTEM_RUNNING;
+struct task_struct *
+__lkpi_current(void)
+{
+ struct thread *td;
+
+ td = curthread;
+ linux_set_current(td);
+ return ((struct task_struct *)td->td_lkpi_task);
+}
+
int
panic_cmp(struct rb_node *one, struct rb_node *two)
{