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 C921ACFC293 for ; Tue, 15 Oct 2024 11:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0CpMO+Vwmv1TUbabFPMotJkgikC8KTHM3FhGL60n6CY=; b=aP/3EL0kS+Piqyk2c4pvBHp63C 97tbWvt7dwMlenJ7hC2p2oBSBEgKL21SVsiiz7dLYcr7MKu6BbiD5gnCd2J3j/OB2R9qBO4lkw4qw cj4FnbyGNKUNaQnmwV0aMZYr7zsudrIDUYeE9TmWD2MUN6QEVKdJSUfkPbnKuDweILHMg+4Bsa/9s p4iZ2Bu+CIwNJkQy8Un8mSBQiLeiHHQNtEVUnrLJoQPug7t+nI7bqeNNpdpanRJ/nBcC9maHxzsxT dtIAAg3jXaas4mKOEgGP8gsVw7hELmIqgyJLW5nNI1wpZNcyV0MEAaz5/gLpEWsPBI5Sp03xusJHk 4LglkuYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0gA7-000000085ju-1Kh8; Tue, 15 Oct 2024 11:56:27 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0g8Q-000000085aK-2Mjx for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 11:54:43 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5c960af31daso3808597a12.3 for ; Tue, 15 Oct 2024 04:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728993280; x=1729598080; darn=lists.infradead.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=0CpMO+Vwmv1TUbabFPMotJkgikC8KTHM3FhGL60n6CY=; b=j/+igbCDTpIUBGvLs5m/GenjRD0IX0aWb0LUjw5LJuCJwjNDDdi0YkXPkVxzpUQyhZ +0mw4pGFag7cxcaRZF0/3+hooCovkpVyBZoQ2TeXk4ZiDmWvEaCDZlcuGmuIA8sg+KwD 8+8JnhMveI0ZVCmXCnojT0g/sBlcnlz2gwh+GOE7JLGb7TgspAncrgKOr1tDS/na5Ik7 4ifs/kRZKzobXlj/wUBbK9WrRITUL5Ycn10qvpcoUi3JV+/F4G9J+DOMs3E/xWklrjNK glffnU46xxpM3iaJzY1y3AKD+7EtlMocqDBzSSq31obojUH83j01fEdvAvZiFvj7s5Ji 9zgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728993280; x=1729598080; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0CpMO+Vwmv1TUbabFPMotJkgikC8KTHM3FhGL60n6CY=; b=Fqquu1IjBwNpmbggqT/va/oKL+WKjJKK6nDPOBJLDOV5/Rtuh07fow5+S1k57ZwTa5 Pxj0Qoa4b9LubSBllLSYnHXcaRqFVEMYl6bapzv7TKlUFwptFb52UFqwF21SMcpFZJub nHGMqSUHl9l9+z5T6sUa/Em7g1qT2Hf3yy3+jrFQ7c6NU/uDgSq8gCrjPjkruPh/HXoG nPoLr3hHoZ9dvhYNWlXrq2M8NcoC0df5qQdd19i1iwSNEhpQvTRDAnAQfcgUz0ltvz/H mZPo/nUARNBRZhKFRgJTM10+RaODAWFDPjf1USP4shCastWE93gr6XQ/oAhDduKyBq21 HW0g== X-Forwarded-Encrypted: i=1; AJvYcCVQulVM/57rlMvf4g7C5hr4/CSr5rS6ChqLZIEYIHqhZ/LaQMSLHGQO8o7kkvFXt5WexlFKSMYNaMDA4OLHOnd+@lists.infradead.org X-Gm-Message-State: AOJu0Yz9G/VPnpk3U64DLtJJ2uUxnXKxCIsa/gqpHIl5exLmDd1A7xr+ MS/8hA7EVhm9RtAq/WzsX+lTz3TsgFLjnSoDn8hIHXQ9zj0TV4Ru3lX/ffw49dY= X-Google-Smtp-Source: AGHT+IFj1hJP0rgcG9HECkN89ztB5Tf9xJsFRF62IbJBHwFysnGcnQ+NOg6P2n5FdF0255rLE1NCyw== X-Received: by 2002:a05:6402:5210:b0:5c9:4a35:7a20 with SMTP id 4fb4d7f45d1cf-5c94a357bc6mr10635034a12.14.1728993279713; Tue, 15 Oct 2024 04:54:39 -0700 (PDT) Received: from localhost (54-240-197-231.amazon.com. [54.240.197.231]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d50782bsm613558a12.45.2024.10.15.04.54.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2024 04:54:39 -0700 (PDT) From: Puranjay Mohan To: Mark Rutland , linux-arm-kernel@lists.infradead.org Cc: ardb@kernel.org, broonie@kernel.org, catalin.marinas@arm.com, jpoimboe@kernel.org, kaleshsingh@google.com, madvenka@linux.microsoft.com, mark.rutland@arm.com, maz@kernel.org, mbenes@suse.cz, will@kernel.org Subject: Re: [PATCH 00/10] arm64: stacktrace: improve unwind reporting In-Reply-To: <20241010101510.1487477-1-mark.rutland@arm.com> References: <20241010101510.1487477-1-mark.rutland@arm.com> Date: Tue, 15 Oct 2024 11:54:34 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_045442_628982_F92104FA X-CRM114-Status: GOOD ( 20.08 ) 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 --=-=-= Content-Type: text/plain Mark Rutland writes: > This series improves arm64's unwinder to explicitly identify exception > boundaries, reporting both pt_regs::pc and pt_regs::lr and explicitly > identifying the source of elements in the stacktrace. This is useful to > humans when reviewing a stacktrace, and serves as infrastructure that > can be used for RELIABLE_STACKTRACE in future. > > The first 6 patches are preparatory work that are not intended to have > any functional impact, with patches 7 to 10 making the key changes. > Largely this involves teaching the unwinder to track metadata for each > unwind step, and modifying the way we manage pt_regs::stackframe so that > exception boundaries can be identifier explcitily. > > With this series applied, the unwinder will report when unwind elements are not > simply the result of a frame pointer based unwind, e.g. > > | Call trace: > | show_stack+0x20/0x38 (CF) > | dump_stack_lvl+0x60/0x80 (F) > | dump_stack+0x18/0x28 > | nmi_cpu_backtrace+0xfc/0x140 > | nmi_trigger_cpumask_backtrace+0x1c8/0x200 > | arch_trigger_cpumask_backtrace+0x20/0x40 > | sysrq_handle_showallcpus+0x24/0x38 (F) > | __handle_sysrq+0xa8/0x1b0 (F) > | handle_sysrq+0x38/0x50 (F) > | pl011_int+0x420/0x570 (F) > | __handle_irq_event_percpu+0x60/0x220 (F) > | handle_irq_event+0x54/0xc0 (F) > | handle_fasteoi_irq+0xa8/0x1d0 (F) > | generic_handle_domain_irq+0x34/0x58 (F) > | gic_handle_irq+0x54/0x140 (FK) > | call_on_irq_stack+0x24/0x58 (F) > | do_interrupt_handler+0x88/0xa0 > | el1_interrupt+0x34/0x68 (F) > | el1h_64_irq_handler+0x18/0x28 > | el1h_64_irq+0x6c/0x70 > | default_idle_call+0x34/0x180 (P) > | default_idle_call+0x28/0x180 (L) > | do_idle+0x204/0x268 > | cpu_startup_entry+0x3c/0x50 (F) > | rest_init+0xe4/0xf0 > | start_kernel+0x738/0x740 > | __primary_switched+0x88/0x98 > > ... where: > > * "C" indicates that the first element of the trace was the caller of an unwind > function (vs "T" for a blocked task's stave PC, or "P" for a pt_regs::pc). > > * "F" indicates that the element was recovered from fgraph (and > would otherwise have been reported as return_to_handler). > > * "K" indicates that the element was recovered from kretprobes (and > would otherwise have been reported as __kretprobe_trampoline). > > * "P" indicates that the element was recovered from pt_regs::pc, and therefore > this is the first element after an exception boundary. > > * "L" indidates that the element was recovered from pt_regs::lr, and therefore > this may or may not be reliable depending on whether the LR was live at the > moment the exception was taken. > > Mark. with all the typos reported by others fixed. Reviewed-by: Puranjay Mohan Thanks, Puranjay Mohan --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIsEARYKADMWIQQ3wHGvVs/5bdl78BKwwPkjG3B2nQUCZw5X+xUccHVyYW5qYXkx MkBnbWFpbC5jb20ACgkQsMD5Ixtwdp33yQEAugmgdY3Nmsi8xf/AIxb1gzWRbz3l 3CUgPxscmhDXE1IA/1JXf4b3YeJGNHi/C1soq1XrOoENakl3UTcAf3d5fLoG =ekCY -----END PGP SIGNATURE----- --=-=-=--