From patchwork Wed Jan 4 17:44:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13088806 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 10EA3C4332F for ; Wed, 4 Jan 2023 17:45:51 +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=K4ZcIDCk8FJudreo72vhhNzOT0EtpiYe6pPNg3Rcjo8=; b=s94DZNJwBribaW 3WmZ+ntHQHjuxTC0QH8nPFNTBzmrg5Y9TTeWDGllwqo0gUf0vH2XxZRhfObBFgGkevOCh/Z/1VhXb uXiLQHRXTIXUETfI3tC3kUpUw7o2tqGcJVmDVlaXUv1NPDQ+Zr/1x2c1wDupD2Hez1yDYNeY0h+ox cy3FF9EUybgm0Gvr7unugTCvRPWR4QvCHDzx9XMNCsFDnoXcSO4jy4zOG8DL1srAB9nUTPk5TP/uw NbV7qaryzqcuj0COMqoT2lBGBzKR8jchtvIVwBl29Ji12ollBWgXW5iFifcW0uf8Fq+bEF7M2Uxzz RYFrvYgcH8/bSXTH6s3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD7oo-00Ai6g-Tq; Wed, 04 Jan 2023 17:44:51 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD7ok-00Ai2j-MF for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2023 17:44:48 +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 ams.source.kernel.org (Postfix) with ESMTPS id 3DD9AB81894; Wed, 4 Jan 2023 17:44:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 784EFC433EF; Wed, 4 Jan 2023 17:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672854284; bh=4TD447+1AlzzfNQIM/zTYXzGWHZkZTqSZMuk5jvGLqg=; h=From:To:Cc:Subject:Date:From; b=KC+IgMwAw3LMKX3/Dg74V+HH3BCW0SA2HH/RSAr729snK+/rv0Ze9hGYEeqSPsEJI dIVNqzDf/9eKFZpAZ+E+y/A0tQvY6QDbEy7cx/GGyqOKpDnVfqGN9DKFdXFXhU3CZg GPOOT6yYEGv37qB33txVkQWDhehqg4h5fPK24lrjn9tvEIAzfx6P0jtSyxYNtwexto gyOrlIWc0Tj2NyAS/TF1YwyF+QyyPrF2waIG79eC/n5zOSvO7iRnxD07ripyWU4w4s 57uEa7UA8iVrBSctnDQBHMXPqQFZEyXireuWwu8e/EUY1bWKzQA2TL36rLC4cEfHlO vUIhtaHVSa/kw== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, Ard Biesheuvel , Mark Rutland , Lee Jones Subject: [PATCH v2 0/2] efi: Follow-up fixes for EFI runtime stack Date: Wed, 4 Jan 2023 18:44:31 +0100 Message-Id: <20230104174433.1259428-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1233; i=ardb@kernel.org; h=from:subject; bh=4TD447+1AlzzfNQIM/zTYXzGWHZkZTqSZMuk5jvGLqg=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjtbr8dl/IUsYlUPeg8qb3atDV6dgiABFcQsE0kdp/ inxSgqyJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY7W6/AAKCRDDTyI5ktmPJGgNC/ 4xwp23Qtf5dJVpYsoOVH3V9PZJUXrOUfxufQsLqdEs/vfr1Ln27ryXFKxQFk3Z0xvxktomoBamc1NF GGFRrfYxWMedZnaVMfJbmMzvSYEDCh3tRJMGEZLNMexfpo49EOouEdmIYewIujFwyRgO094ruMhwku cXbV+34E3WqJyYVAVDyEA92zpJzTUB0yOnM2KwCHm5tCI6zOpt6yhVfYTlbK96K0FjPf5fWw8MDlVI dL++ZsPy2KwFQQzqRQK6uw9UhxusEr/guqtJoQOLnEbkCaqorL18qtsCFQwgP9Zr0eyBmWnI+flT3E wirDEDMp5Vy7hnqgRZ6y0yyqeSmjP+q0WW6dprFjoMMiWpfGgLQ15gcU4T+T15MpDsEr3zseUTSavz 5BNGkGXul0n1Cq23RCYTYnPAqMBBbOiGJBknDsPqJgRVoQ07NUZwQ6uRLG2o/i6rkVN3n17INhY+cB AHUXodoZw+glUEmpKeMK+uvS2KGUP7AjXTIdLLNK5Asa0= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230104_094446_947754_6973D70C X-CRM114-Status: GOOD ( 12.40 ) 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 Commit ff7a167961d1b ("arm64: efi: Execute runtime services from a dedicated stack") introduced a dedicated stack for EFI runtime services, in an attempt to make the execution of EFI runtime services more robust, given that they execute at the same privilege level as the kernel. However, this stack needs to be declared to the stacktrace machinery, which is careful not to walk the stack when it leads into memory regions that are not known to be allocated for stack use. Also, given that the ACPI code may invoke the low-level EFI runtime call wrapper without using the dedicated kernel thread and workqueue, we should take this into account when trying to gracefully handle synchronous exceptions. Cc: Mark Rutland Cc: Lee Jones Ard Biesheuvel (2): arm64: efi: Avoid workqueue to check whether EFI runtime is live arm64: efi: Account for the EFI runtime stack in stack unwinder arch/arm64/include/asm/efi.h | 10 ++++++++++ arch/arm64/include/asm/stacktrace.h | 15 +++++++++++++++ arch/arm64/kernel/efi.c | 3 ++- arch/arm64/kernel/stacktrace.c | 12 ++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-)