]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc: Prepare to build with generic entry/exit framework
authorMukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
Mon, 27 Apr 2026 12:27:36 +0000 (17:57 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 20 May 2026 01:27:13 +0000 (06:57 +0530)
This patch introduces preparatory changes needed to support building
PowerPC with the generic entry/exit (irqentry) framework.

The following infrastructure updates are added:
 - Add a syscall_work field to struct thread_info to hold SYSCALL_WORK_* flags.
 - Provide a stub implementation of arch_syscall_is_vdso_sigreturn(),
   returning false for now.
 - Introduce on_thread_stack() helper to detect if the current stack pointer
   lies within the task’s kernel stack.

These additions enable later integration with the generic entry/exit
infrastructure while keeping existing PowerPC behavior unchanged.

No functional change is intended in this patch.

Signed-off-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
Tested-by: Samir M <samir@linux.ibm.com>
Tested-by: David Gow <davidgow@google.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260427122742.210074-3-mkchauras@gmail.com
arch/powerpc/include/asm/entry-common.h [new file with mode: 0644]
arch/powerpc/include/asm/stacktrace.h
arch/powerpc/include/asm/syscall.h
arch/powerpc/include/asm/thread_info.h

diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h
new file mode 100644 (file)
index 0000000..05ce058
--- /dev/null
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _ASM_PPC_ENTRY_COMMON_H
+#define _ASM_PPC_ENTRY_COMMON_H
+
+#include <asm/stacktrace.h>
+
+#endif /* _ASM_PPC_ENTRY_COMMON_H */
index 6149b53b3bc8e30d48162b571429f5c2b899f525..987f2e996262f98574f7a250d5e5abf6e3f7658b 100644 (file)
 
 void show_user_instructions(struct pt_regs *regs);
 
+static __always_inline bool on_thread_stack(void)
+{
+       return !(((unsigned long)(current->stack) ^ current_stack_pointer)
+                       & ~(THREAD_SIZE - 1));
+}
+
 #endif /* _ASM_POWERPC_STACKTRACE_H */
index 4b3c52ed6e9d2b099ad30cefc858ffcda76438b3..834fcc4f7b543bca3276a75fb8d1761554fa219e 100644 (file)
@@ -139,4 +139,9 @@ static inline int syscall_get_arch(struct task_struct *task)
        else
                return AUDIT_ARCH_PPC64;
 }
+
+static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
+{
+       return false;
+}
 #endif /* _ASM_SYSCALL_H */
index 97f35f9b1a96e5766a7bbb7a61e8a6a562a297ab..ee3b9adb5b6710cc610c31d7bb3a48f4d010c57a 100644 (file)
@@ -57,6 +57,7 @@ struct thread_info {
 #ifdef CONFIG_SMP
        unsigned int    cpu;
 #endif
+       unsigned long   syscall_work;           /* SYSCALL_WORK_ flags */
        unsigned long   local_flags;            /* private flags for thread */
 #ifdef CONFIG_LIVEPATCH_64
        unsigned long *livepatch_sp;