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 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 9429CC4332F for ; Wed, 2 Nov 2022 13:43:06 +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: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=x2DvZ3PaPPtUZEMlPPI53y8LajgNCOv0hdzEttMHV5w=; b=b+7ZFs5jxDf6PF XlxjSP+YNr28EHX2IszVXqXBSMKvGTdJuyw+7Ur96EahqcM/SzwJblF/H2HtMicJnoEod5wX/R9/z 3zAJCPoLiJUyCk/wsIqC9xEDEBai5TnPLPi13A0SjmxSfy2uGAvcj5wmQlL03lhPyxjbwq79C+3SI LAC1J/AFaClMjBKncuYcvd8r4SfT6nV8njavrj0m+uZ00Y6MUN7PE/cgABeb0Y4WBR+AUjpG+6mHf dP28Z3LTZMlsrXxEK8OXDoH3RAOF0r0mq/unfCALwhLYHCAiuE6T8Ja4BZM43U11rtb8C3TAqEtXS 5YMTh/A1zKF1v0eyKIJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDzu-00BKOa-Hb; Wed, 02 Nov 2022 13:41:38 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqDzq-00BKNG-UY for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 13:41:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EF6F6CE2192; Wed, 2 Nov 2022 13:41:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C49EC4314D; Wed, 2 Nov 2022 13:41:28 +0000 (UTC) Date: Wed, 2 Nov 2022 13:41:25 +0000 From: Catalin Marinas To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, will@kernel.org, linux-efi@vger.kernel.org, maz@kernel.org Subject: Re: [PATCH] arm64: efi: Recover from synchronous exceptions occurring in firmware Message-ID: References: <20221028150112.2883620-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_064135_170073_40A6E966 X-CRM114-Status: GOOD ( 23.50 ) 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 Wed, Nov 02, 2022 at 10:08:28AM +0100, Ard Biesheuvel wrote: > On Fri, 28 Oct 2022 at 17:01, Ard Biesheuvel wrote: > > > > Unlike x86, which has machinery to deal with page faults that occur > > during the execution of EFI runtime services, arm64 has nothing like > > that, and a synchronous exception raised by firmware code brings down > > the whole system. > > > > With more EFI based systems appearing that were not built to run Linux > > (such as the Windows-on-ARM laptops based on Qualcomm SOCs), as well as > > the introduction of PRM (platform specific firmware routines that are > > callable just like EFI runtime services), we are more likely to run into > > issues of this sort, and it is much more likely that we can identify and > > work around such issues if they don't bring down the system entirely. > > > > Since we already use a EFI runtime services call wrapper in assembler, > > we can quite easily add some code that captures the execution state at > > the point where the call is made, allowing us to revert to this state > > and proceed execution if the call triggered a synchronous exception. > > > > Given that the kernel and the firmware don't share any data structures > > that could end up in an indeterminate state, we can happily continue > > running, as long as we mark the EFI runtime services as unavailable from > > that point on. > > > > Signed-off-by: Ard Biesheuvel > > Does anyone mind if I take this via the EFI tree for v6.1? No, feel free to take it. Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel