From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79D58C44501 for ; Mon, 29 Jun 2026 13:07:54 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gpmlX0B8cz2yvQ; Mon, 29 Jun 2026 23:07:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=113.46.200.225 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1782738439; cv=none; b=CMotB5R4SOB582sy3XcIHHd7rcyBB17nDagSQBKA6hITiUI0d89uxyc79WFCdALOvWgtVA7PyIK3q7hiCZn0uwsCtU8kjcMP80O2fI+RBNDEcA+3/V/8xYqKhT7mSSoai69FKFelUiyfaELawdZ0WwKVnB6acudidqXkpt+jrpGngVUrPxuIOYHfr5WoK07lWWY36zZmuEsxvG/SO6JPbGBkTdR0FI1/8NhMl/YxNqy5ODGOf41CrzBLvaG/bYAEuv7K2Q+dmoRL0UzKb34e3tf/fdH3WWpoc/snRz4HzA5sRbCz7xTfUkRZ8UzqqX4RCN6yXKjbom3bhR83/7LIKw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1782738439; c=relaxed/relaxed; bh=HN8NjJ+zPKxTzXRyOxLcgICqxKoEbhiQjfmIJCpQt1s=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b3aI+1Jq5busxyzXZTXjYQDIWqH5DbfGoVQ9bgNhWmfeq47pHTUevX25qb4QGDYWTHGhDjNtJcuq9Hl3SnlbwskAT6pinZ3IWpW4CvCF7cxGgZWu7K7uhOrPq87mUG5F1IixuRp+U0jm6tf6L3l5fW67tYVAr5KJk1Ovu+aeZB2emAUoYJS1Ek/7niU/60JVL7Lyj6UNE7mjgjluB+DEDHjyj0aJKorOlAdsBLMW7LL5lQVAToyzZFkUqsIJx7KgP6MnKeEj6tfYd+yTDsvmOKmML/j6RHmifeFkWyPJymuNkbiFG2hqXxDuI+oFN5bLc5M1CslNJ2lOg6FxbrUwKg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=yG6p70fb; dkim-atps=neutral; spf=pass (client-ip=113.46.200.225; helo=canpmsgout10.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=yG6p70fb; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=113.46.200.225; helo=canpmsgout10.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4gpmlW0dBBz2ydn for ; Mon, 29 Jun 2026 23:07:19 +1000 (AEST) dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=HN8NjJ+zPKxTzXRyOxLcgICqxKoEbhiQjfmIJCpQt1s=; b=yG6p70fbS+t+40LRAhtdos24Tp7YdOS8O4575ps1QgQmd+XMA94tknGINg+rwCcEXU7M0fUUq stWm1xP0dr61A2lxGHwkPAp/7Db8W5kfoXIJDdhr0sqlNNN4ycGIUw0baVaLMcu3nG8+tF+oY2W Y6DzgmZwznzlgd8SeWdkRO8= Received: from mail.maildlp.com (unknown [172.19.163.214]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4gpmXw6H6Yz1K9BQ; Mon, 29 Jun 2026 20:58:08 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 2F6E140580; Mon, 29 Jun 2026 21:07:16 +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; Mon, 29 Jun 2026 21:07:11 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v16 09/18] arm64: syscall: Rework the syscall exit path in el0_svc_common() Date: Mon, 29 Jun 2026 21:06:07 +0800 Message-ID: <20260629130616.642022-10-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260629130616.642022-1-ruanjinjie@huawei.com> References: <20260629130616.642022-1-ruanjinjie@huawei.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To dggpemf500011.china.huawei.com (7.185.36.131) In preparation for moving arm64 over to the generic entry code, restructure the fast-path syscall exit sequence within el0_svc_common(). Invert the nested conditional flags check so that when syscall work is pending or single-stepping is active, the corresponding exit work can be dispatched directly from within the fast-path bailout block. This clarifies the separation between the fast and slow exit paths, facilitating a cleaner transition to the generic entry state machine in subsequent patches. No functional changes. Cc: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Cc: Ada Couprie Diaz Signed-off-by: Jinjie Ruan --- arch/arm64/kernel/syscall.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 43ffb74162c5..f6e9aa132b09 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -127,8 +127,11 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, */ if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) { flags = read_thread_flags(); - if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) - return; + if (has_syscall_work(flags) || flags & _TIF_SINGLESTEP) { + flags = read_thread_flags(); + syscall_exit_work(regs, flags); + } + return; } trace_exit: -- 2.34.1