From patchwork Fri Aug 5 12:45:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 12937253 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 8524BC00140 for ; Fri, 5 Aug 2022 12:46:54 +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=Ug7a57ZYOiVrOuYHdim38tLZq34JdKsKQmqOTYEYabA=; b=r9Qed3n2OH1hrx 6Z9+l1AlLsEZarb18E2R0jt4BcWUhgYZzxUycGoXik2Xyhl5Cvb67vV3Vo6FtEiGy4d4uOJ9zfNwx 6egAyhYWQlRgLhQDHpsb/GADuXyQY469ropFyXWzAA/n2dvNe32VjKuyxFiQw1iXtV3ISkp8gpRmN 7sUKQ/MA57U7Iu1GkH4ga+v7vMXONMu3j2RMnfEY8DMHYnuJmY0fi0jpCvpYwR/JK69l6CvHEyhMt L5YWelfQ1/c77iyHU9Acn7CQq9E0fJrmkDp8erBDxcVT6Hr2ZyBWHiF9PPB/asD9j1L2wAyqR/kBi JWuHTOkNexu08XUoKjPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJwiC-00F4V1-Cw; Fri, 05 Aug 2022 12:45:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJwht-00F4Ir-Hs for linux-arm-kernel@lists.infradead.org; Fri, 05 Aug 2022 12:45:39 +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 9B22511FB; Fri, 5 Aug 2022 05:45:31 -0700 (PDT) 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 946C13F67D; Fri, 5 Aug 2022 05:45:29 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org, Marc Zyngier Cc: broonie@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, kaleshsingh@google.com, madvenka@linux.microsoft.com, mark.rutland@arm.com, tabba@google.com, will@kernel.org Subject: [PATCH v2 0/8] arm64: stacktrace: cleanups and improvements Date: Fri, 5 Aug 2022 13:45:14 +0100 Message-Id: <20220805124522.706457-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-20220805_054537_661986_690CA1BD X-CRM114-Status: GOOD ( 12.99 ) 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 Marc, This series is a set of improvements for the recently merged stacktrace rework queued in the kvmarm next branch, along the lines of my prior suggestions. I'm hoping that it would be possible to queue this for -rc1. Largely, the series decouples portions of the unwind code, making some structural changes that remove the need for coupling (e.g. removing the need for the stack type enumeration, and factoring out callbacks). This should make it easier to make some further changes I have spoken about previously (e.g. adding some metadata to the stack dump output), and I have some patches building atop this which I intend to send out once this is merged. The only (intended) functional change from this series is improved boundary detection, where overlapping frame records will now be caught and rejected. I've tested this natively (with the ftrace tests, LKDTM, and /proc/self/stack), which seems happy. I've also tested the NVHE and PKVM unwinders by hacking a BUG() into the hyp code shortly after the KVM hyp code is initialized, and in both cases the output is unchanged. Since v1 [1]: * Fix build warning with CONFIG_SDEI_INTERFACE=y && W=1 * Fix typos * Fix whitespace errors * Apply tags from Kalesh Singh and Mark Brown [1] https://lore.kernel.org/r/20220801121209.2479449-1-mark.rutland@arm.com Thanks, Mark. Mark Rutland (8): arm64: stacktrace: simplify unwind_next_common() arm64: stacktrace: rename unwind_next_common() -> unwind_next_frame_record() arm64: stacktrace: move SDEI stack helpers to stacktrace code arm64: stacktrace: add stackinfo_on_stack() helper arm64: stacktrace: rework stack boundary discovery arm64: stacktrace: remove stack type from fp translator arm64: stacktrace: track all stack boundaries explicitly arm64: stacktrace: track hyp stacks in unwinder's address space arch/arm64/include/asm/processor.h | 2 +- arch/arm64/include/asm/sdei.h | 17 -- arch/arm64/include/asm/stacktrace.h | 71 +++++-- arch/arm64/include/asm/stacktrace/common.h | 211 +++++++++------------ arch/arm64/kernel/ptrace.c | 2 +- arch/arm64/kernel/sdei.c | 32 ---- arch/arm64/kernel/stacktrace.c | 66 ++++--- arch/arm64/kvm/hyp/nvhe/stacktrace.c | 40 ++-- arch/arm64/kvm/stacktrace.c | 135 +++++++------ 9 files changed, 288 insertions(+), 288 deletions(-) Reviewed-by: Madhavan T. Venkataraman