From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2D263B8BBB for ; Mon, 27 Apr 2026 12:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777292905; cv=none; b=kANJBAzb+ncJfca1esc9jVIqLl5LH2GeDUcjJYRv6CsHzk96esAQx7tycs99iIOnssXS6hQY30c1SFpBWoFF8w8bmMMeSjMj1T/yg7xZd7kgQHadXZeOHhumfB5figeEEG1wBxJTZjJEvB23iDviPKn7YW6M2yHor2Duu4Idrqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777292905; c=relaxed/simple; bh=/8LSDJk+sKjwswm7ewc3g08rAs8h2GJkwkKpE2XJNcY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Aqlbzma4Jt9W/1i8dPYD0M0Sq7G68z6QdMBQIEWKD4EJgaZSxIcKIPgjp6u/Z+k3Vlf/t2NEZew4lJpe55qoRU/iVzDYocj6VxS8L3dH+lcv/2s0nZpDaf7fJkvtZg8DBjnV5fEXXyQjRlg+U2EMythBRoeMTz5PP+cB4koyQcE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MeUuTofR; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MeUuTofR" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-824c9da9928so4908173b3a.3 for ; Mon, 27 Apr 2026 05:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777292903; x=1777897703; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F7kNDm/BPqOqbkHNlgIl8EcDdI8YLcc/3k2ekG2vBcE=; b=MeUuTofREkExBK/hot/U8W0Lx+skzV4KZl44G9f8fhZpbAOCO1s/INti+yq70cMwWw 0bk7Q5qt+SO0561sZxKQ336UWzuLi6yPTc2KOAGhHLA6kzlxAc5MO0IDIXjgCTD1rzYb pnJe12LdP/M9x2lxvMjbt/j6earCvp73ce8D23HsPQdM+/87T4k1Nc8wLUouN/GdyNQg 090MgyVIJJEpwTLpyZNaO/Pq6c8wbQvNe+vrGJozNxHyZDOD/4XGEikM8JUBqJUNwbXV dBNzpqyh6dUX01/NNH/cTw65itHHojOKhRooJkkSNn76FrVVAr48fP672jsv80MDUAb5 Bq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777292903; x=1777897703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=F7kNDm/BPqOqbkHNlgIl8EcDdI8YLcc/3k2ekG2vBcE=; b=GzeWRrifQ/h5NzD12BC9zpSXcdTuJ3k/ViW6r9hRvRd4vT9ETABQccM/Pwu+toxeym NmGhFWyO05m8Q7Y6BK6JFxWA/8pr0SA+4Y8WUuL4EY5JnClKO3B49A8aqpFlMnVawyDH 9gzgn96u1arosp7Rg1gi6EzBEUN4g+nsvcXM94HszYDNVEbhuo4EMSja3Ynv7/XO6cX5 f25HGCqAfQ0gWPedhRfo2XN1qq7L0DmuKjI/Rd6/w8UGVxQxCbIbtfw1Jss2MsuZ1r04 b1cGmMtKTGuel9atJBwG0RPcZxwSXTZpXF9d+y1bpCdAigHJp9bAj2ym86cI/N86Dlec mn6A== X-Forwarded-Encrypted: i=1; AFNElJ/ELsBszYqxS1HiV4B68x4ZKUUeCw85csT8rZqHXuIZ/z8OM8wMVWLBtc/OxfyZ2u9fdhVX6z5Rok74Z30=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6tbecnAyjOwGMtnSSC+0HyN5oeWX0G7o9obkxcJRL3aifgSe/ yPMeqN+xAfSnp8EfMa5lLT3786Q/RF39ADucqhp5tmmxDUONNMw3PKIy X-Gm-Gg: AeBDietunAeNH15kK11PkWr0U+CDUOkK9FAapIbQcaSJP+dj8KPtK93JRoREUzdWuLe LdPkpK71le+DVkhKXO0wJa84htzM1xIIRa+ZFnzo1Mg2ZvnodP830g0erA1/VHk6DRHmVjKsVLZ s1EC4qqVdZNcpBIC61gEHcJwtlADjQyNGZRMagQTdvy+afQwByCh2Rz/p5wEkL1C62pOjzIuu1A 2kmS9JwQBanWE+ZD0gmUuM0JKpM7NjItzBoWYkw8WKaEvBTb0TsLsgaVMiE36shi4lORoSPFaZx +fIGSecKXxP+t5IAnoukfoAkigQ1TFD8c4Rl6ZlR1XL1P91C9CvO4z3inA+oYnepci1SRIu/j8g cwMJ6Kfzjpft0NDmz55rT2mfuCwqka5xebt5lB5bcZWdBMg3xyqBYtkedBv7mw4KADunHGFv1Lm XjYuYvjkfPciOm5Ac23A+c4YgFX/RBz64C15XgZrRpRqO+iB2f9aHQC8PELa+4pduh1mdN4rYy8 OghsA== X-Received: by 2002:a05:6a00:c8f:b0:82c:26a4:df02 with SMTP id d2e1a72fcca58-82f8c9bad60mr45450220b3a.42.1777292903159; Mon, 27 Apr 2026 05:28:23 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com ([129.41.58.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f8e9f7735sm32733466b3a.21.2026.04.27.05.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 05:28:22 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, ryabinin.a.a@gmail.com, glider@google.com, andreyknvl@gmail.com, dvyukov@google.com, vincenzo.frascino@arm.com, oleg@redhat.com, kees@kernel.org, luto@amacapital.net, wad@chromium.org, mchauras@linux.ibm.com, sshegde@linux.ibm.com, thuth@redhat.com, ruanjinjie@huawei.com, akpm@linux-foundation.org, macro@orcam.me.uk, ldv@strace.io, charlie@rivosinc.com, deller@gmx.de, kevin.brodsky@arm.com, ritesh.list@gmail.com, yeoreum.yun@arm.com, agordeev@linux.ibm.com, segher@kernel.crashing.org, mark.rutland@arm.com, ryan.roberts@arm.com, pmladek@suse.com, feng.tang@linux.alibaba.com, peterz@infradead.org, kan.liang@linux.intel.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Cc: Samir M , David Gow , Venkat Rao Bagalkote Subject: [PATCH v5 2/8] powerpc: Prepare to build with generic entry/exit framework Date: Mon, 27 Apr 2026 17:57:36 +0530 Message-ID: <20260427122742.210074-3-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260427122742.210074-1-mkchauras@gmail.com> References: <20260427122742.210074-1-mkchauras@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mukesh Kumar Chaurasiya 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 Tested-by: Samir M Tested-by: David Gow Tested-by: Venkat Rao Bagalkote Reviewed-by: Shrikanth Hegde --- arch/powerpc/include/asm/entry-common.h | 8 ++++++++ arch/powerpc/include/asm/stacktrace.h | 6 ++++++ arch/powerpc/include/asm/syscall.h | 5 +++++ arch/powerpc/include/asm/thread_info.h | 1 + 4 files changed, 20 insertions(+) create mode 100644 arch/powerpc/include/asm/entry-common.h diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h new file mode 100644 index 000000000000..05ce0583b600 --- /dev/null +++ b/arch/powerpc/include/asm/entry-common.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _ASM_PPC_ENTRY_COMMON_H +#define _ASM_PPC_ENTRY_COMMON_H + +#include + +#endif /* _ASM_PPC_ENTRY_COMMON_H */ diff --git a/arch/powerpc/include/asm/stacktrace.h b/arch/powerpc/include/asm/stacktrace.h index 6149b53b3bc8..987f2e996262 100644 --- a/arch/powerpc/include/asm/stacktrace.h +++ b/arch/powerpc/include/asm/stacktrace.h @@ -10,4 +10,10 @@ 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 */ diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h index 4b3c52ed6e9d..834fcc4f7b54 100644 --- a/arch/powerpc/include/asm/syscall.h +++ b/arch/powerpc/include/asm/syscall.h @@ -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 */ diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index 97f35f9b1a96..ee3b9adb5b67 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -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; -- 2.53.0