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 X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 899F3C4338F for ; Mon, 2 Aug 2021 14:09:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 561536023B for ; Mon, 2 Aug 2021 14:09:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 561536023B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To: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+pfTUIrUAKtPjP+PGzZkMNmgC4CQkaZU0T/BmFBdCM=; b=fsIGv+GmJ5pQH7 Ah4KNdbbcQNwx7UeONU38Pbzyu8WtZOOeidI5zpc3Hp8VhnWe2k4tEcGZY4gz0Nxhi+Q4nKmZDQCA UvEdklgJUkUbXBItx8UJ9C6MfhksrTdA078Ee7eWjBcRjtl+fwKXu5tCpwWh5vpRL4izXLcx4H/o2 3ADMLeFfEq9Mp87L+h6PLXd1qAELaFdk6++bcSkMOdfriKjdT5KG0OQ4jHjrhDjkWExsutlQGTBNa tR8X55Rfi+MO6qjgPU+r1zKxtOtsPe/SlUZwe/QoY/pa/b1BQE5Fp+gCfbeYyGbaLW5klvmaZqrsy xjWOYx3/FfbxKLc+o7qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAYbt-00GY0R-Q1; Mon, 02 Aug 2021 14:08:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAYbq-00GXv8-0M for linux-arm-kernel@lists.infradead.org; Mon, 02 Aug 2021 14:08:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A705F11D4; Mon, 2 Aug 2021 07:07:53 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A332A3F66F; Mon, 2 Aug 2021 07:07:52 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, james.morse@arm.com, joey.gouly@arm.com, mark.rutland@arm.com, maz@kernel.org, will@kernel.org Subject: [PATCH 0/4] arm64: entry: rework user return handling Date: Mon, 2 Aug 2021 15:07:29 +0100 Message-Id: <20210802140733.52716-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_070802_140265_52666FC4 X-CRM114-Status: GOOD ( 11.05 ) 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: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These patches (based on v5.14-rc3) rework the arm64 entry code, converting the bulk of `ret_to_user` and `work_pending` assembly code to C. This simplifies the code, and ensure that for each exception there is a single assembly<->c transition, which may make it easier to handle backtracing in future if metadata is necessary. The bulk of the additions are comments added in patch 2, which clarify the semantics of some helpers functions used during entry/exit. There should be no functional change as a result of this series, other than that backtraces starting within do_notify_resume() will now include the exception handler for the exception the kernel was entered with, rather than `ret_to_user` or `work_pending` as previously. This is generally immaterial, but may make it easier to debug some issues where knowing the original exception is helpful. This series leaves handling of TFSRE0_EL1 and single-step in assembly, to avoid clashing with concurrent MTE rework, and as moving this to C will require some generic kernel infrastructure (e.g. arch_atomic bitops) which is not yet in mainline. I intend to follow these up for the next cycle. The series can be found on my `arm64/entry/user-return-rework` branch on kernel.org: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/entry/user-return-rework git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/entry/user-return-rework Thanks, Mark. Mark Rutland (4): arm64: entry: consolidate entry/exit helpers arm64: entry: clarify entry/exit helpers arm64: entry: move bulk of ret_to_user to C arm64: entry: call exit_to_user_mode() from C arch/arm64/include/asm/exception.h | 5 +- arch/arm64/kernel/entry-common.c | 219 ++++++++++++++++++++++++++----------- arch/arm64/kernel/entry.S | 36 +----- arch/arm64/kernel/signal.c | 3 +- 4 files changed, 162 insertions(+), 101 deletions(-) -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel