From patchwork Tue Feb 6 12:38:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 13547209 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 D3BEEC48297 for ; Tue, 6 Feb 2024 12:39:16 +0000 (UTC) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=CXBDOeZT95gpAJnulIS4M2mUFr/qgw6RG6ifwZvSi2E=; b=S8ZB3iRHaLKo3m ReBaxq/yVQWMSQwAJmdlw/cNBoFLixv6lo9wI8vl/CjSOh1gkKHZXF/FR4AnU6C3nNwSMXg6WYtR6 V5ne1kdmC/Vy+g+zmkO7s+6xWMYncVfMPJMVGU+zZvbXnMpRK20PmMZ07eSV0FGayYYAansS+JNKR F21804giu7AxZSSuh6U18E5Z7GdhNL6ow5zDJOQ4RE1RFZEEqW0C6l3jVxQKsM4snoLdUdnMQ82SJ lCNNwsbfuGDZ5udXSLWo/0XqubbbaCqqVQObXR+/CFRegPEQ1SEnTtr40VKb9gle0FUYsrmaTkLyf v9MfJnhUp5+T1vhSsnjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXKjC-00000007bHo-3dQb; Tue, 06 Feb 2024 12:39:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXKj9-00000007bFO-1JH5 for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2024 12:39:05 +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 E530B1FB; Tue, 6 Feb 2024 04:39:40 -0800 (PST) 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 7A6B33F762; Tue, 6 Feb 2024 04:38:57 -0800 (PST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: broonie@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, mark.rutland@arm.com, will@kernel.org Subject: [PATCH 0/3] arm64: cleanup DAIF handling for EL0 returns Date: Tue, 6 Feb 2024 12:38:45 +0000 Message-Id: <20240206123848.1696480-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240206_043903_417188_DC0BEE95 X-CRM114-Status: UNSURE ( 8.14 ) 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 Hi, These patches rework DAIF handling when returning to EL0, simplifiying the logic in do_notify_resume() and allowing Debug + SError to be unmasked for a little longer during exception return. My primary motivation for these changes is to centralize entry/exit DAIF management within entry-common.c, as this will allow entry/exit sequences to be specialised, and make it much easier to add support for FEAT_NMI. With specialized entry DAIF management, it will also be possible to simplify local_daif_{save,restore}() and local_irq_{save,restore}(). I'm sending this out on its own as (IMO) it's a nice cleanup on its own, and I don't believe that I'll have the remainder of the DAIF rework ready for this cycle. The series is based on v6.8-rc3. Mark. Mark Rutland (3): arm64: Simplify do_notify_resume() DAIF masking arm64: Move do_notify_resume() to entry-common.c arm64: Unmask Debug + SError in do_notify_resume() arch/arm64/include/asm/exception.h | 2 +- arch/arm64/kernel/entry-common.c | 36 ++++++++++++++++++++++++++- arch/arm64/kernel/signal.c | 39 ++---------------------------- 3 files changed, 38 insertions(+), 39 deletions(-)