From patchwork Thu Jun 27 08:12:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13713921 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2923DC2BD09 for ; Thu, 27 Jun 2024 08:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u+aC3Y4HGPoU6SWWsff7LmJ61yr0ZBhdoIlfYKd7f14=; b=BqjCxaeX5oVQ1O VNANWQdTi59hebGf1OP8ZdWWkYSfBFk2Vxe3oxYObq/ax7pxmGnJpAj5DEJ5meCPC5JGjOpRy1JZa rqQuTrvddmyACZAjAR9YIYLGlCUoVt1ipRFhW5E/lgcToYZO88mDnO3SVJgPSyUgRe1GezcVUiGgi 3ab7zZwwe/yWHMDSRv9kBx+rUswr0bFZwC6yEuH1EPViVmRjJ8AxR5RPKia4HsEmy3c5voqcav4cc EmX/pTT2R9SEesmpuRaHwL3hdDhNmBYn07tegml3H08xG12xasBJ3hRKszomgwoaCIQw9cfyPZe7o jQwHQ0L5BkhDFHZS4uBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMkCP-00000009g60-1rMs; Thu, 27 Jun 2024 08:09:45 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMkCF-00000009g0a-0Lzr for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 08:09:37 +0000 Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4W8rhy73NQz1X4Pw; Thu, 27 Jun 2024 16:05:22 +0800 (CST) Received: from kwepemi100008.china.huawei.com (unknown [7.221.188.57]) by mail.maildlp.com (Postfix) with ESMTPS id 1B8BC140157; Thu, 27 Jun 2024 16:09:24 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi100008.china.huawei.com (7.221.188.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 27 Jun 2024 16:09:23 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , Subject: [PATCH v2 0/3] arm64: entry: Convert to generic entry Date: Thu, 27 Jun 2024 16:12:06 +0800 Message-ID: <20240627081209.3511918-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi100008.china.huawei.com (7.221.188.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_010935_335974_C13C2142 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, x86, Riscv, Loongarch use the generic entry. Convert arm64 to use the generic entry infrastructure from kernel/entry/*. The generic entry makes maintainers' work easier and codes more elegant, which aslo removed a lot of duplicate code. Changes in v2: - Add tested-by. - Fix a bug that not call arch_post_report_syscall_entry() in syscall_trace_enter() if ptrace_report_syscall_entry() return not zero. - Refactor report_syscall(). - Add comment for arch_prepare_report_syscall_exit(). - Adjust entry-common.h header file inclusion to alphabetical order. - Update the commit message. Jinjie Ruan (3): entry: Add some arch funcs to support arm64 to use generic entry arm64: Prepare to switch to generic entry arm64: entry: Convert to generic entry arch/arm64/Kconfig | 1 + arch/arm64/include/asm/entry-common.h | 60 +++++ arch/arm64/include/asm/ptrace.h | 5 + arch/arm64/include/asm/stacktrace.h | 5 +- arch/arm64/include/asm/syscall.h | 6 +- arch/arm64/include/asm/thread_info.h | 23 +- arch/arm64/kernel/entry-common.c | 355 ++++++-------------------- arch/arm64/kernel/ptrace.c | 81 +++--- arch/arm64/kernel/signal.c | 3 +- arch/arm64/kernel/syscall.c | 18 +- include/linux/entry-common.h | 51 ++++ kernel/entry/common.c | 48 +++- 12 files changed, 294 insertions(+), 362 deletions(-) create mode 100644 arch/arm64/include/asm/entry-common.h