From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32ED93AD50D; Sun, 12 Jul 2026 12:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860251; cv=none; b=ejzJOw1li73XkWBuO/qbJGvpOOzDk/Yu6pmrp+MvHdxGoIhY6YMezC91kUkP3Q5UB/pyop9xUcWSh/zPyPCFTJyp4G53T7AO7YCqMS3KxFu1RbwD9WF1LhuV1IglpPMuH+xntpZ+2baLIEYpGbThl9GQ/6w6aTZZlFN0Dseh2/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860251; c=relaxed/simple; bh=Mubu6csIeOmLjlkp3WG1ZHX9YB5t8A/PSBnsN731i3A=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=n6VadBh4UWfc00nlg/t+OnEoRmJ5QflMRHQUiM75Bs+/t+Cr67uVPzhBvE5W3ae5537GRz9HArx3hNu9tlNqN0U2koQUeKToZbuLGn+QnFOzVh/8/L5lQ8eQYBSXvB0Q7TGqgGOlIEtHT+6kJ9jQo5nSOkcihGVumv3HVdn0XQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lrZl/y/l; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Rx9iG/LP; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lrZl/y/l"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Rx9iG/LP" Date: Sun, 12 Jul 2026 12:44:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783860244; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zuf1Y31fZ6NeF28AmbNxj29rHT7FZz9m4qPMH3DyrLQ=; b=lrZl/y/l4ECsI2XKI1y4xMASwxKZIDbR6Ap0Bf9bP3QSVo7PnwLCV2hlky81YoAmheRCd2 qbIGwT2J78L6AwMuMIQ+82+Yy/wERMYct7jgEsnIvkrfw2qW6bVM8W8SdeYzKhce1eYUg4 l77alKqJSfX/Aez8qTj2/HYtauL05HYl7YVGbwFQlElMpRRqFyL8NZqdJo3aYwVqgghS+g T9yWhGZQqzwFIrkfMXLetKLKVJ2mAH1qOdFx6DpsfdDV5czFxYarivEsA02vooypkSAP5y GN2XZt6JmFjv+fUx2YD8OSw7Aaw03+aZ5+n+DU1k3HirqVGbZ2tI4KCRCuSO9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783860244; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zuf1Y31fZ6NeF28AmbNxj29rHT7FZz9m4qPMH3DyrLQ=; b=Rx9iG/LPqOUXvIg+oo8V3RiMs5dU646smPgCyCxvwzgvzLIi5DhVM8l95R/ky8ePTZ0Yme lw9v7zEd9JwFNyCg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/entry] entry: Remove syscall_enter_from_user_mode() Cc: Thomas Gleixner , "Mukesh Kumar Chaurasiya (IBM)" , Jinjie Ruan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260707190254.132654198@kernel.org> References: <20260707190254.132654198@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178386024242.1844600.1165856868915032563.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the core/entry branch of tip: Commit-ID: bad2a27ba8c4a6bd2c47e598898d9dbd0f98511f Gitweb: https://git.kernel.org/tip/bad2a27ba8c4a6bd2c47e598898d9dbd0f9= 8511f Author: Thomas Gleixner AuthorDate: Tue, 07 Jul 2026 21:06:32 +02:00 Committer: Thomas Gleixner CommitterDate: Sun, 12 Jul 2026 12:38:01 +02:00 entry: Remove syscall_enter_from_user_mode() All architecture use either: nr =3D syscall_enter_from_user_mode_randomize_stack(regs, nr); or enter_from_user_mode_randomize_stack(regs); nr =3D syscall_enter_from_user_mode_work(regs, nr); Remove the now unused function. Signed-off-by: Thomas Gleixner Tested-by: Mukesh Kumar Chaurasiya (IBM) Reviewed-by: Jinjie Ruan Reviewed-by: Mukesh Kumar Chaurasiya (IBM) Link: https://patch.msgid.link/20260707190254.132654198@kernel.org --- Documentation/core-api/entry.rst | 17 +++++++------ include/linux/entry-common.h | 40 +++---------------------------- include/linux/irq-entry-common.h | 6 ++--- 3 files changed, 17 insertions(+), 46 deletions(-) diff --git a/Documentation/core-api/entry.rst b/Documentation/core-api/entry.= rst index 71d8eed..44e9608 100644 --- a/Documentation/core-api/entry.rst +++ b/Documentation/core-api/entry.rst @@ -68,7 +68,7 @@ invoked from low-level assembly code looks like this: noinstr void syscall(struct pt_regs *regs, int nr) { arch_syscall_enter(regs); - nr =3D syscall_enter_from_user_mode(regs, nr); + nr =3D syscall_enter_from_user_mode_randomize_stack(regs, nr); =20 instrumentation_begin(); if (!invoke_syscall(regs, nr) && nr !=3D -1) @@ -78,12 +78,14 @@ invoked from low-level assembly code looks like this: syscall_exit_to_user_mode(regs); } =20 -syscall_enter_from_user_mode() first invokes enter_from_user_mode() which -establishes state in the following order: +syscall_enter_from_user_mode_randomize_stack() first invokes +enter_from_user_mode_randomize_stack() which establishes state in the +following order: =20 * Lockdep * RCU / Context tracking * Tracing + * Apply stack randomization =20 and then invokes the various entry work functions like ptrace, seccomp, audi= t, syscall tracing, etc. After all that is done, the instrumentable invoke_sysc= all @@ -99,10 +101,11 @@ transition in the reverse order: * RCU / Context tracking * Lockdep =20 -syscall_enter_from_user_mode() and syscall_exit_to_user_mode() are also -available as fine grained subfunctions in cases where the architecture code -has to do extra work between the various steps. In such cases it has to -ensure that enter_from_user_mode() is called first on entry and +syscall_enter_from_user_mode_randomize_stack() and +syscall_exit_to_user_mode() are also available as fine grained subfunctions +in cases where the architecture code has to do extra work between the +various steps. In such cases it has to ensure that +enter_from_user_mode_randomize_stack() is called first on entry and exit_to_user_mode() is called last on exit. =20 Do not nest syscalls. Nested syscalls will cause RCU and/or context tracking diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index 166b1ed..c0f6464 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -20,7 +20,7 @@ #endif =20 /* - * SYSCALL_WORK flags handled in syscall_enter_from_user_mode() + * SYSCALL_WORK flags handled in syscall_enter_from_user_mode_work() */ #define SYSCALL_WORK_ENTER (SYSCALL_WORK_SECCOMP | \ SYSCALL_WORK_SYSCALL_TRACEPOINT | \ @@ -205,42 +205,10 @@ do { \ _ret; \ }) =20 -/** - * syscall_enter_from_user_mode - Establish state and check and handle work - * before invoking a syscall - * @regs: Pointer to currents pt_regs - * @syscall: The syscall number - * - * Invoked from architecture specific syscall entry code with interrupts - * disabled. The calling code has to be non-instrumentable. When the - * function returns all state is correct, interrupts are enabled and the - * subsequent functions can be instrumented. - * - * This is the combination of enter_from_user_mode() and - * syscall_enter_from_user_mode_work() to be used when there is no - * architecture specific work to be done between the two. - * - * Returns: The original or a modified syscall number. See - * syscall_enter_from_user_mode_work() for further explanation. - */ -static __always_inline long syscall_enter_from_user_mode(struct pt_regs *reg= s, long syscall) -{ - long ret; - - enter_from_user_mode(regs); - - instrumentation_begin(); - local_irq_enable(); - ret =3D syscall_enter_from_user_mode_work(regs, syscall); - instrumentation_end(); - - return ret; -} - /* - * If SYSCALL_EMU is set, then the only reason to report is when - * SINGLESTEP is set (i.e. PTRACE_SYSEMU_SINGLESTEP). This syscall - * instruction has been already reported in syscall_enter_from_user_mode(). + * If SYSCALL_EMU is set, then the only reason to report is when SINGLESTEP = is + * set (i.e. PTRACE_SYSEMU_SINGLESTEP). This syscall instruction has been + * already reported in syscall_enter_from_user_mode_work(). */ static __always_inline bool report_single_step(unsigned long work) { diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-commo= n.h index 1fabf0f..0bb6c03 100644 --- a/include/linux/irq-entry-common.h +++ b/include/linux/irq-entry-common.h @@ -49,9 +49,9 @@ * Defaults to an empty implementation. Can be replaced by architecture * specific code. * - * Invoked from syscall_enter_from_user_mode() in the non-instrumentable - * section. Use __always_inline so the compiler cannot push it out of line - * and make it instrumentable. + * Invoked from enter_from_user_mode() in the non-instrumentable section. Use + * __always_inline so the compiler cannot push it out of line and make it + * instrumentable. */ static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs); =20