From nobody Mon Feb 9 13:57:46 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 0261A324716 for ; Sun, 25 Jan 2026 16:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769359285; cv=none; b=cROnqz3PpgGIuRxrn7k7pSS2fSmBem/3dmRZMeDHoTEe6PRZDQFOWLUhrPEAjj42M4E2VQ1UIUCZVsxoyZDVJ/CeXViuRjJwffU+W7k+IktPhaNw0EZqQ/WB+T3Pc1CCDUZ0nfVXefozRMF1C15YL2miWFl27BvHDd2nLgvNrS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769359285; c=relaxed/simple; bh=XYkYZagwOO8cgkvSb1nYHgiHFOoN46jZ556CfG1EODI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BjzbQ0bjEjWmc4oMFIST6FcN9sKKmMAz2815VIzlwWSgeG/p1GAGNgRH/S7M2o7xKRvp8ssLPaGRwHk7b/zpwTOD9lBj/pvabGqZ1VKLNyyBK0xsHgnY4Yw2AqCX0iOb2B4WdU3ivXxrn8nhvAvQTKYUQb0F0jKNwFx76BG20/k= 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=EvYIkB7x; arc=none smtp.client-ip=209.85.214.174 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="EvYIkB7x" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2a743050256so25508165ad.3 for ; Sun, 25 Jan 2026 08:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769359283; x=1769964083; 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=OTnxHq4NFRumQo/SHU741WmHOHpkH+oyQ4unpkNu0b4=; b=EvYIkB7xjITuIYHR44kGAmnjbvVQBMdetuAv3rML5gGS4nUkJ6gjhpzl3Za0A+4mGt r/u/m3ebJXyABMgF+bU4ssf0HRX469fTT0K+fTH8hu+ZmhTldEn3KfI88zEqMqPZYr3I 4G1cdPyGQn7QZDlGgNLR1qe/meLJZnttM3hrds7EQR94ABr+xU5/EU/NqgTGdGJHhTQQ uO2+FOvQk731e8cZhHo8uyB1jG+9rR030qr+z68sQWKdCTpwz9LrLj2LopVL7M9Cdtsp yLnjG7x5xt/ceg0WNKmZ1qp96LLFuJsPWbw7nFQBySz9+xKcMj/vtzbdsN/thOfICJ+g /1/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769359283; x=1769964083; 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=OTnxHq4NFRumQo/SHU741WmHOHpkH+oyQ4unpkNu0b4=; b=JS3x1oKetkv0j+k35IlJp7EwTybEiEcPiVtYGOWd3f6fT4lTCegEaXHVJ704nM6J8Y hnAtGo9ipVEoJNeawD7pgoCaBFQZzyMFn8+ZZInwb31QfleDxw8yrVbyfHybQRixqrhK Zva3lJYEz6KzwLdyHTrin5LAwtywuyQm2HmQiXjXwri6cGRGmL+jKNuYZTx71efikBUi Ox7Wg0AWC3rvFkFBp1ryGaLvGgbG4+r4JYceHYASUbUEJEy/yLaXkePEim8hQw4f7leZ L3jxz0c5sGV3VWDQTSyksw9FwbPGwDyrTlkas/k1eeUQy4QoyyvG/h1weJlUiVj7ILlT EWyw== X-Forwarded-Encrypted: i=1; AJvYcCVFYBNMCnFUZb10DEQ2c60k0iR0Y7vvBm+GbVEt79cQoVRX5NCWYQHtUFwblCAQPCCeEdBzVY+W+NRW6FE=@vger.kernel.org X-Gm-Message-State: AOJu0YwZYytHkYGlHPFOAiVtnOb+DSCMmVZBTxPOD4Y/ecLxnO3rCe8R D4Qq5zVlik+j5uH16+tP2gphNdT6Twd2L1cJqhD/cCGFvcTyOpEI2KKX X-Gm-Gg: AZuq6aL2skLvG+/CAk9ZBaoo/FyKBoMHRTLe0HC6g7Ta5WR8UToSAzhsXEw9HkedA4n N9USIQ174TfzdJRXXsVtbDQ1bBFIRUIm+CR/WuQRBfyyezKNBQ8TpbBI7ssfnRH4+n8P5VGVhh3 WjErUwYcDEh/2TlACMlkT9ttDGhmGtGG0sbKVhzVmVIwiEPZgnpBE8ThoVimT1TOpjix4eDWDkT t+yJmZspcE4Qyi/s9HwsyMlMMlh8wO1V3JJ0QoF1zzgFULDJcNFWvedeYGKnSQeO/xgzk5SJqyb Z6Jh0+XOGaZPXh9R45iGvUoUFGG7qM/U0JdatkRT7d8kQuHGtGCLqdDuA4uglXTkChWudPyGPLV KLswji+xVXy58D+5MgtnhZDqajyk3JtQ8ZjMhE+kuoj3yBumF1oJLkfDWX/YvqOBkeip7gBh5Fr hSFhNxXkVZ1TKDKFPxsKLRTIY8N6Qkd/s= X-Received: by 2002:a17:903:37ce:b0:29f:3a57:ba7a with SMTP id d9443c01a7336-2a845224bb4mr20793505ad.19.1769359283245; Sun, 25 Jan 2026 08:41:23 -0800 (PST) Received: from DESKTOP-3LEPQG8.localdomain ([119.28.20.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802f97667sm70633225ad.56.2026.01.25.08.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 08:41:22 -0800 (PST) From: Xie Yuanbin To: linux@armlinux.org.uk, johannes@sipsolutions.net, masahiroy@kernel.org, jgross@suse.com, nsc@kernel.org, kees@kernel.org, tglx@kernel.org, mingo@kernel.org, frederic@kernel.org, paulmck@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, luto@kernel.org, edumazet@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Xie Yuanbin Subject: [PATCH 4/9] ARM: entry: use exit_to_user_mode() instead of user_enter_callable() Date: Mon, 26 Jan 2026 00:40:11 +0800 Message-ID: <20260125164016.331257-5-qq570070308@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260125164016.331257-1-qq570070308@gmail.com> References: <20260125164016.331257-1-qq570070308@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" According to user_enter_callable()'s comment, the function is obsolete. Since exit_to_user_mode() is a inline function, add arm_exit_to_user_mode_no_work_pending() to call exit_to_user_mode(), thereby replacing user_enter_callable() and asm_trace_hardirqs_on(). Also move stackleak_erase_on_task_stack() to arm_exit_to_user_mode_no_work_pending(). Signed-off-by: Xie Yuanbin --- arch/arm/include/asm/entry-common.h | 8 ++++++++ arch/arm/kernel/Makefile | 2 +- arch/arm/kernel/entry-common.S | 10 +--------- arch/arm/kernel/entry.c | 20 ++++++++++++++++++++ 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 arch/arm/include/asm/entry-common.h create mode 100644 arch/arm/kernel/entry.c diff --git a/arch/arm/include/asm/entry-common.h b/arch/arm/include/asm/ent= ry-common.h new file mode 100644 index 000000000000..d34c80d4b32b --- /dev/null +++ b/arch/arm/include/asm/entry-common.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef ARCH_ARM_ENTRY_COMMON_H +#define ARCH_ARM_ENTRY_COMMON_H + +asmlinkage __section(".entry.text") +void arm_exit_to_user_mode_no_work_pending(void); + +#endif diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index b36cf0cfd4a7..e8a855d73055 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -17,7 +17,7 @@ CFLAGS_REMOVE_return_address.o =3D -pg =20 # Object file lists. =20 -obj-y :=3D elf.o entry-common.o irq.o opcodes.o \ +obj-y :=3D elf.o entry-common.o entry.o irq.o opcodes.o \ process.o ptrace.o reboot.o io.o \ setup.o signal.o sigreturn_codes.o \ stacktrace.o sys_arm.o time.o traps.o diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 0e462bbede2f..108b77e2b405 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -113,15 +113,7 @@ ENTRY(ret_to_user_from_irq) movs r1, r1, lsl #16 bne slow_work_pending no_work_pending: -#ifdef CONFIG_CONTEXT_TRACKING_USER - bl user_enter_callable -#endif - - asm_trace_hardirqs_on save =3D 0 - -#ifdef CONFIG_KSTACK_ERASE - bl stackleak_erase_on_task_stack -#endif + bl arm_exit_to_user_mode_no_work_pending restore_user_regs fast =3D 0, offset =3D 0 ENDPROC(ret_to_user_from_irq) ENDPROC(ret_to_user) diff --git a/arch/arm/kernel/entry.c b/arch/arm/kernel/entry.c new file mode 100644 index 000000000000..d32f7be9a107 --- /dev/null +++ b/arch/arm/kernel/entry.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include +#include + +/* + * arm_exit_to_user_mode_no_work_pending - Fixup state when exiting to use= r mode + * + * The calling code satisfies (arch_irqs_disabled() && !lockdep_hardirqs_e= nabled()). + * When the function returns, the state satisfies (arch_irqs_disabled() && + * lockdep_hardirqs_enabled()). + */ +asmlinkage __section(".entry.text") +void arm_exit_to_user_mode_no_work_pending(void) +{ + exit_to_user_mode(); +#ifdef CONFIG_KSTACK_ERASE + stackleak_erase_on_task_stack(); +#endif +} --=20 2.51.0