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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 22158C4743D for ; Fri, 4 Jun 2021 16:48:59 +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 E3B2A611ED for ; Fri, 4 Jun 2021 16:48:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3B2A611ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Oezh0Xz5ztBF26YecA0XsbHJWj8YHyPixPDlrAUFxkY=; b=IndDB6CHBtmeqB ZW1k0v/M8XblkARA9oa2lxdF5lMyXLs2i/zL7icS4TF0eNFeYijZ2cb569cS8Td6992GUEVHhoYRX /nmf6rSZQQrrcTZcyabcAR79H746E6M7td34M6sbEOH7uSO0mWVwEZAs5ccX2qegEmDPYbwDOkeN/ 3W8se7Qj+8cUMPN47V4uNOQIYIqyeIz7gKl2MyFbPdNnz8+gd5jifA2mbRvtAJOOZpbNyHr9WsdW1 kf0tVLvmeRV4NN5fSr1CYbjCCGMh+AddIRjx4PcS3rJRjWziQPEQmMLt5iWuwqiu2InzBvTS0xNRQ tWd9aoNwHi1uArbomziQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpCyp-00EQXF-Tk; Fri, 04 Jun 2021 16:47:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpCyg-00EQSr-41 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 16:47:23 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9774B613B3; Fri, 4 Jun 2021 16:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622825241; bh=GcyYmjzng5OuzvzXqJe44YOgsL+591+c67lq7S66TII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eZBFMmJm2UsAyDPpzKEGzwK7hMBN6aMnaAJMsCE3T22VMVfio2aBNAPvRfelPexcj 1usU0/e14zPYEJrSXeTSXRnwKrDbljMd3ipV8aHZlcJx/TYQ9rwUqQf+aS1+HEOtMW wlLu82mdh4FrbWMFMw2P65yDkrBjG6j7tx/pRPKjKCB/A6RrX1aDsFgTPPfqduLQXT eGQncslUHIPG0Kj4Sa4nUefVpLjplGDaB9Ifa+5vnexlr9/dOgMf+SXKYiKw9clKsC oz9SOluivecTQDpvlnrFDrgZzCUfwaOcxSJ03DNnFO1mOe++KYDymRuI4ffgEo7Lr2 QHfdCyBNH5EdQ== Date: Fri, 4 Jun 2021 17:47:17 +0100 From: Will Deacon To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, james.morse@arm.com, joey.gouly@arm.com, maz@kernel.org Subject: Re: [PATCH v3 02/20] arm64: entry: unmask IRQ+FIQ after EL0 handling Message-ID: <20210604164716.GA3416@willie-the-truck> References: <20210525183302.56293-1-mark.rutland@arm.com> <20210525183302.56293-3-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210525183302.56293-3-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_094722_217624_228BB9F9 X-CRM114-Status: GOOD ( 18.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: , 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 On Tue, May 25, 2021 at 07:32:44PM +0100, Mark Rutland wrote: > For non-fatal exceptions taken from EL0, we expect that at some point > during exception handling it is possible to return to a regular process > context with all exceptions unmasked (e.g. as we do in > do_notify_resume()), and we generally aim to unmask exceptions wherever > possible. > > While handling SError and debug exceptions from EL0, we need to leave > some exceptions masked during handling. Handling SError requires us to > mask SError (which also requires masking IRQ+FIQ), and handing debug > exceptions requires us to mask debug (which also requires masking > SError+IRQ+FIQ). > > Once do_serror() or do_debug_exception() has returned, we no longer need > to mask exceptions, and can unmask them all, which is what we did prior > to commit: > > 9034f6251572a474 ("arm64: Do not enable IRQs for ct_user_exit") > > ... where we had to mask IRQs as for context_tracking_user_exit() > expected IRQs to be masked. > > Since then, we realised that our context tracking wasn't entirely > correct, and reworked the entry code to fix this. As of commit: > > 23529049c6842382 ("arm64: entry: fix non-NMI user<->kernel transitions") > > ... we replaced the call to context_tracking_user_exit() with a call to > user_exit_irqoff() as part of enter_from_user_mode(), which occurs > earlier, before the we run the body of the handler and unmask exceptions before the we run > in DAIF. > > When we return to userspace, we go via ret_to_user(), which masks > exceptions in DAIF prior to calling user_enter_irqoff() as part of > exit_to_user_mode(). > > Thus, there's no longer a reason to leave IRQs or FIQs masked at the end > of the EL) debug or error handlers, as neither the user exit context EL) > tracking nor the user entry context tracking requires this. Let's bring > these into line with other EL0 exceptions handlers and ensure that IRQ exceptions handlers Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel