From nobody Thu Oct 2 15:32:59 2025 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 7F7D82F360B for ; Tue, 16 Sep 2025 08:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758011149; cv=none; b=FeW45JLeinOChAW6GW2KJCSqylYZfvMHwvI2Pl15YWCmo6pqyNY1B/WTmG99FC3XhG8uUyi6jSINNL509qhV8bcDM0QZ1Jju3FLrO1ZM/cvV+vVV1nsvVF4JBKSRJ9WeAjGvWu6Oa0hjQH707OePDsTkRPwWSBIvlIHVz2npuhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758011149; c=relaxed/simple; bh=7CBJomfnX+bYeaPCqOO9pEZf4xMtKrPmquVHF6O4A+M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AJ5OqcVjyrKuCiViPSwhy/t7mJmOLgAKB2UWpjW7m+lIi4pMdpcYssKTEFMvXAoiA9j9hCuF5kZfNGSrXkqcdOF9xK8Vp1zpf2OVLo3YLMbe2IiVAFsssPaH1gmbNvurniCHQjf/OgLAM0Ox+wiDhy/fQ7/CJCVUwv3t/uD1hhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4cQw2J1yF9z14MvJ; Tue, 16 Sep 2025 16:25:28 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 372FD1402E9; Tue, 16 Sep 2025 16:25:44 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 16 Sep 2025 16:25:43 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , CC: Subject: [PATCH -next v6 09/10] entry: Add has_syscall_work() helper Date: Tue, 16 Sep 2025 16:26:10 +0800 Message-ID: <20250916082611.2972008-10-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916082611.2972008-1-ruanjinjie@huawei.com> References: <20250916082611.2972008-1-ruanjinjie@huawei.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 X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To dggpemf500011.china.huawei.com (7.185.36.131) Content-Type: text/plain; charset="utf-8" Add has_syscall_work() helper to facilitate reuse of this function in other places. No functional changes. Signed-off-by: Jinjie Ruan --- include/linux/entry-common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index cd6dacb2d8bf..e0f94e937e84 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -44,6 +44,11 @@ SYSCALL_WORK_SYSCALL_EXIT_TRAP | \ ARCH_SYSCALL_WORK_EXIT) =20 +static inline bool has_syscall_work(unsigned long work) +{ + return unlikely(work & SYSCALL_WORK_ENTER); +} + /** * syscall_enter_from_user_mode_prepare - Establish state and enable inter= rupts * @regs: Pointer to currents pt_regs @@ -91,7 +96,7 @@ static __always_inline long syscall_enter_from_user_mode_= work(struct pt_regs *re { unsigned long work =3D READ_ONCE(current_thread_info()->syscall_work); =20 - if (work & SYSCALL_WORK_ENTER) + if (has_syscall_work(work)) syscall =3D syscall_trace_enter(regs, syscall, work); =20 return syscall; --=20 2.34.1