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 A0A1DC3DA7D for ; Thu, 5 Jan 2023 21:18:31 +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=VKjpQkOBRRVcZuE9NYupH3BqhOrdF5PM1A0jhI/x8pI=; b=gl/85TWi3GKFZ3 hCQV5PSiCUaIObMnlFzyrCWsHCn9nwEPJPUjAQPF7Xnk4dj59b03EPJ731RtLrqXb7DTflpoKm8Fn 9jRHhThbbD08lCRwvcAqZkvhZhpHRNIu5W/fMsvqTUJXvoyJTIuVZaV8EI985XGsm1P8vDcsneRxf m/9mQa1GO0ms++ADx/px49zc6xV5TyRazw6IdyI/6ELE2K/Ji1iCRjXM16Y/DzBXFvitxjvCBBnKi AmEbJKJsjl31UwBWqSHc49EVO8L81+ZHAyl/0zlv79qNeeVFUutZNPxIVll/XCXcZrECty1kf0RjT Wld63nd6OPOTIy0iSqFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDXcA-00F0LU-HE; Thu, 05 Jan 2023 21:17:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDUrP-00DVOI-83 for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Jan 2023 18:21:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=At9mghnxHH/NIgfNsH9+Df1AMSiiHlNDkhok3VqeXAo=; b=Uc4z+FUTpPgXq4icebHPe+JbIJ G/d5WDiW/hN7pAaQXcvTVMm8+qts+E0B5tur7KRZxVWn1m1gGFqgqGREEn9KnFq+gRQLmPhw2JK0h lDSad73mDFC9aAj5pmQQ43jGB959K7va20/1CmpoFIwl7HUBx3hq052YV9KmffdqUHaBK6Ds/+9qI +Iw+e0WHBM/ILthZHaV2oVSrcxw6sLa9xtm00jUUO5GRo+tWsRzIcBnf+D6YJ5hw8gRkiafeTs6rM FIM9ej5zfDSae10wfmX851iZfsNrQ1TD1m+MQyTvc207ZaNTdl0Tt3pE4h8ACQBU65tdJSZgj2mhV pcxEm1TA==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pDPeH-001Jp4-36 for linux-arm-kernel@lists.infradead.org; Thu, 05 Jan 2023 12:47:12 +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 371A115BF; Thu, 5 Jan 2023 04:47:52 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.45.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7427E3F663; Thu, 5 Jan 2023 04:47:09 -0800 (PST) Date: Thu, 5 Jan 2023 12:47:06 +0000 From: Mark Rutland To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: Re: [PATCH v2 2/2] arm64: efi: Account for the EFI runtime stack in stack unwinder Message-ID: References: <20230104174433.1259428-1-ardb@kernel.org> <20230104174433.1259428-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230104174433.1259428-3-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_124710_242388_B45304CA X-CRM114-Status: GOOD ( 17.96 ) 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, Jan 04, 2023 at 06:44:33PM +0100, Ard Biesheuvel wrote: > The EFI runtime services run from a dedicated stack now, and so the > stack unwinder needs to be informed about this. > > Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Thanks for this! Mark. > --- > arch/arm64/include/asm/stacktrace.h | 15 +++++++++++++++ > arch/arm64/kernel/stacktrace.c | 12 ++++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h > index 4e5354beafb01bac..66ec8caa6ac07fa0 100644 > --- a/arch/arm64/include/asm/stacktrace.h > +++ b/arch/arm64/include/asm/stacktrace.h > @@ -106,4 +106,19 @@ static inline struct stack_info stackinfo_get_sdei_critical(void) > #define stackinfo_get_sdei_critical() stackinfo_get_unknown() > #endif > > +#ifdef CONFIG_EFI > +extern u64 *efi_rt_stack_top; > + > +static inline struct stack_info stackinfo_get_efi(void) > +{ > + unsigned long high = (u64)efi_rt_stack_top; > + unsigned long low = high - THREAD_SIZE; > + > + return (struct stack_info) { > + .low = low, > + .high = high, > + }; > +} > +#endif > + > #endif /* __ASM_STACKTRACE_H */ > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > index 117e2c180f3c77d8..83154303e682c8b6 100644 > --- a/arch/arm64/kernel/stacktrace.c > +++ b/arch/arm64/kernel/stacktrace.c > @@ -5,6 +5,7 @@ > * Copyright (C) 2012 ARM Ltd. > */ > #include > +#include > #include > #include > #include > @@ -12,6 +13,7 @@ > #include > #include > > +#include > #include > #include > #include > @@ -186,6 +188,13 @@ void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl) > : stackinfo_get_unknown(); \ > }) > > +#define STACKINFO_EFI \ > + ({ \ > + ((task == current) && current_in_efi()) \ > + ? stackinfo_get_efi() \ > + : stackinfo_get_unknown(); \ > + }) > + > noinline noinstr void arch_stack_walk(stack_trace_consume_fn consume_entry, > void *cookie, struct task_struct *task, > struct pt_regs *regs) > @@ -199,6 +208,9 @@ noinline noinstr void arch_stack_walk(stack_trace_consume_fn consume_entry, > #if defined(CONFIG_VMAP_STACK) && defined(CONFIG_ARM_SDE_INTERFACE) > STACKINFO_SDEI(normal), > STACKINFO_SDEI(critical), > +#endif > +#ifdef CONFIG_EFI > + STACKINFO_EFI, > #endif > }; > struct unwind_state state = { > -- > 2.39.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel