From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0923D3859F0 for ; Mon, 18 May 2026 17:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.222.41 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779126953; cv=pass; b=YtDOMQ/oJRa6x1gm5jSz0wsAwdirYo8ebwQM/5GbHbZ21msFA9SzYN2jKe5lNGHRkb36OOHFA4FN/bB0+Exm3jEBluREmCnBwM5VCw9Ircu5Yif08aIn5BziTEtKd+DIVEZUJr7VnNmncCnISLvn9OZxWRJrk6KqJwrHCsh/0Qg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779126953; c=relaxed/simple; bh=AMBMcN6Oz88RhegA9Ps7e2JqEUwXUNQUQ6Z+7YCgw4U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZlBe5RzWijb2ApQeeXfLPhrSXXwjiaCxS+VNdaLt8Bi8q+DDrnnT7ulk6DwsIuTESEYvpbQfreOID7QpwC/toVgkIXFHuLxxnyVnD/jAmjHXDc80etp3QYns+3HOqANm7W2HJGSEaKKJ1r/I9yl34bx098Xwald8BI1pb85JuE4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UxFDiZkA; arc=pass smtp.client-ip=209.85.222.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UxFDiZkA" Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-9568bae58f7so1710116241.3 for ; Mon, 18 May 2026 10:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779126950; cv=none; d=google.com; s=arc-20240605; b=F5xA64m2gMYY3YTMBtyyfIwqzCSqLEDNaxEzTSNG2rbPkq7hMlWSlS7o0/BpU5unN2 VoEqa8UyUD7UE6GTbcvWACa9IOtvYnbxNJeLR6MUO/ez4JDlT3aZPI+SboWWO6DmZafm qSxRaGghubZLrGQKLgK6KXta25CfVdT6Ip6ezlxNmJtn3XwepoC050PsgqhIVSo3R8sg vZogPE0BjTXPf4/OXju4s8lLeEuu6I8egMYS84yYNQUWBZtTnG06iOOc/+QoTy4F25bD k03nLRMlAC/Xvro/1DPIlgGNRbAiIFKZaOxmZZM6GjmN4rGC6fUOa9ZL1M/ymYIfYSPk 8KnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uRWobckzeW61/um9iWV6bMFpw8+SVVVfvtQLyFDktwE=; fh=bj2H+gMDlljdobi25uExm6p8XexWy6RKVZIXUOtQxIc=; b=hC7f/Cmp9XBwx62I5XFpTgVY82NrFxJAskAX5vMDXb1ZJC8x/qsikU8QoAqJS8rQej nxrEJtGhN2Xt6QTvDrFCZrAHuaiOkqXwMnl6eHX7gyCFl8jn3LT9gAmeyPPCMGIQixhf CLwZLJls1hxQ3cWicGOcr/A/TDJgjqrOZWkVKwm53je1n/phd9VHwyXM6ka/xeO35PDQ BK7tfNOe9y26JY0TITYWV6RNR+Y/FDPEQTyINcD1IOEakPeHFB7g+Y0prOv3x+eJhoKx yNUcUlUMgPSok8A5RX7KiHqQo5+Heysjal05OR3LnzLV00YOUks9d4she9+ubuXo4Nr6 97Pg==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779126950; x=1779731750; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uRWobckzeW61/um9iWV6bMFpw8+SVVVfvtQLyFDktwE=; b=UxFDiZkAzWqXxRggYjEgrh6gSIoZ2jo4O/0axyiTxBFOsG3xrI8jQXBVwbMXZvYvB4 5IIlkNSsWaCBuFFu+VQ38skwjeaBYrWWjzkuuVyI393Se5e+Rgnhq+xeX281NPj8iko8 S/klYJa2xknXyBQGXnmI6sFNhNGUb1bTrfu6Py9hXmpDQKH2BpjNx14GNR+s1anAM5P2 rU+6XXDv9sF5Hb9awaumRiyBDJQQMvuiK1lwC3JA9pHlaJRPseEHRspSbjqaDnrZEkrr qgYOEytlXOltl45Z7696oHXrpsTVDv1OvJ4BFw6yOyFxu59+NkLxtFrfjlzkhlZrAzDu Ghgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779126950; x=1779731750; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uRWobckzeW61/um9iWV6bMFpw8+SVVVfvtQLyFDktwE=; b=Xw1ulvHqojpaDeU6fDq+4H0NXpQ2SHD3UNZS5UvHqPcANAkwrmh2OMeUR3SBgagES2 MOn0P5NkH87/gt8c/Ji0hin4IVbVqYBwMV1FxdBGmBhnmFknoIMaJ6uyMCP+V0vOEpoa lpXlbdFfVkkBjuYl0UsCRdqH3S3Fxx8IClMGv9e18dFHOQBpUe/PqoFS/WwbtpN1quJC NGAyosOirOFwvP+Odo3nEyDGJSKwJr6KwMpCVdkAeiXuXZoKeZ3aSQ14ZEK3IdXUDuFB 4xAcOf+GfKjbSagqZ9NmmxqT6a0rfewszBPpSteX9fUnmFNZw5X40lEpF3A5g+uwAT5w iYtA== X-Forwarded-Encrypted: i=1; AFNElJ9k7Fzr2OZdENWy+WDQl1medxMLf+QVpPG+lzOkflF6+lCBWseFfAKaJtZwuokxdYyaER577EWfsXenicg=@vger.kernel.org X-Gm-Message-State: AOJu0YwTcWvDmrGe1zErKPyl0FflL8nBGAsXb5QijlB1g2gM+hdYsgzx mKOrha7rJhfkawqARP8ffs9JhjDW2tOSVG0gd7bP2/nFexnw/ho2PLX6s7owlGoRUM3GIJ0Bbmx TTGB/D4munwOX5GwUXACfzcq7+1dGwt4inxOCYysQ X-Gm-Gg: Acq92OGPHlHWXzJ7KqE1qg2o+W39vXAu6IukYSTnttqwmm6COLduHJ3s8oCXU9R8tNv C8ZZeYgVoruqB/9M2pdZwd2NkF0oY4yuhME66sBOtVXyiKtcqDxKL22fAqcImkyRi+KURYKdOT4 ZyccnKXb7BccDXDe5lTcwkcaypEQokSePp69b7Gq42Z4uAIESIgAKggmNJcCYmwGpLFoSKVawYT 1bPWBcf4IlWM+v2U2PiAAQehSf0j7OCLsiWoOHw7tSOiyhC03mLQmtYfSu9OeIL1oirer0rolnJ zJK8RDRMxmiVpU3u6QH/oN/cFsrdoDEDoVyWP4PsNUHKKGm2 X-Received: by 2002:a05:6102:5493:b0:631:37cb:1e64 with SMTP id ada2fe7eead31-63a3cd147f1mr8765580137.4.1779126949351; Mon, 18 May 2026 10:55:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260428183643.3796063-1-dylanbhatch@google.com> In-Reply-To: From: Dylan Hatch Date: Mon, 18 May 2026 10:55:37 -0700 X-Gm-Features: AVHnY4KAVyVG3MIthAgIvuYFRo0zgnpM4Osagc0xDbfXJPvO4gKarvsASmJ8hSE Message-ID: Subject: Re: [PATCH v5 0/8] unwind, arm64: add sframe unwinder for kernel To: Mostafa Saleh Cc: Roman Gushchin , Weinan Liu , Will Deacon , Josh Poimboeuf , Indu Bhagat , Peter Zijlstra , Steven Rostedt , Catalin Marinas , Jiri Kosina , Jens Remus , Mark Rutland , Prasanna Kumar T S M , Puranjay Mohan , Song Liu , joe.lawrence@redhat.com, linux-toolchains@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Randy Dunlap Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mostafa, On Fri, May 15, 2026 at 4:32=E2=80=AFAM Mostafa Saleh = wrote: > > On Tue, Apr 28, 2026 at 06:36:35PM +0000, Dylan Hatch wrote: > > Implement a generic kernel sframe-based [1] unwinder. The main goal is > > to improve reliable stacktrace on arm64 by unwinding across exception > > boundaries. > > > > On x86, the ORC unwinder provides reliable stacktrace through similar > > methodology, but arm64 lacks the necessary support from objtool to > > create ORC unwind tables. > > > > Currently, there's already a sframe unwinder proposed for userspace: [2= ]. > > To maintain common definitions and algorithms for sframe lookup, a > > substantial portion of this patch series aims to refactor the sframe > > lookup code to support both kernel and userspace sframe sections. > > > > Currently, only GNU Binutils support sframe. This series relies on the > > Sframe V3 format, which is supported in binutils 2.46. > > > > These patches are based on Steven Rostedt's sframe/core branch [3], > > which is and aggregation of existing work done for x86 sframe userspace > > unwind, and contains [2]. This branch is, in turn, based on Linux > > v7.0-rc3. This full series (applied to the sframe/core branch) is > > available on github: [4]. > > > > Not sure if related, but after updating my toolchain > (aarch64-linux-gnu-gcc (Debian 15.2.0-4) 15.2.0), I hit link errors: > ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.sframe) is being = placed in '.sframe' > ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.sframe) is being pla= ced in '.sframe` Previously when developing against the SFrame V2 format, I had fixed these warnings with the VDSO Makefile change currently in this series: diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makef= ile index 7dec05dd33b7..c60ef921956f 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -38,7 +38,7 @@ ccflags-y +=3D -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO CC_FLAGS_REMOVE_VDSO :=3D $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \ $(RANDSTRUCT_CFLAGS) $(KSTACK_ERASE_CFLAGS) \ $(GCC_PLUGINS_CFLAGS) \ - $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \ + $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) $(CC_FLAGS_SFRAME) = \ -Wmissing-prototypes -Wmissing-declarations CC_FLAGS_ADD_VDSO :=3D -O2 -mcmodel=3Dtiny -fasynchronous-unwind-tables But the warnings seem to have returned after upgrading my toolchain, possibly due to SFrame V3 or some confounding change in GCC. The --gsframe in the assembler should be set to 'no' by default, so perhaps GCC is providing an override --gsframe internally? > > I applied this series hoping that fix it, but it doesn't, so far I > have this hack : > diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/v= dso.lds.S > index 52314be29191..53bdf757ee44 100644 > --- a/arch/arm64/kernel/vdso/vdso.lds.S > +++ b/arch/arm64/kernel/vdso/vdso.lds.S > @@ -77,7 +77,7 @@ SECTIONS > /DISCARD/ : { > *(.data .data.* .gnu.linkonce.d.* .sdata*) > *(.bss .sbss .dynbss .dynsbss) > - *(.eh_frame .eh_frame_hdr) > + *(.eh_frame .eh_frame_hdr .sframe) > } > } > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmli= nux.lds.h > index 60c8c22fd3e4..759903acd6fc 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -1064,6 +1064,7 @@ > /* ld.bfd warns about .gnu.version* even when not emitted */ \ > *(.gnu.version*) \ > *(__tracepoint_check) \ > + *(.sframe) \ > > #define DISCARDS \ > /DISCARD/ : { \ Since this series only handles kernel stacktrace, I believe it's better to omit the .sframe section entirely in the case where only ARCH_SUPPORTS_UNWIND_KERNEL_SFRAME is enabled. I think this hack may work better for this purpose: diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makef= ile index c60ef921956f..29f802bfedb1 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -41,7 +41,7 @@ CC_FLAGS_REMOVE_VDSO :=3D $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \ $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) $(CC_FLAGS_SFRAME) = \ -Wmissing-prototypes -Wmissing-declarations -CC_FLAGS_ADD_VDSO :=3D -O2 -mcmodel=3Dtiny -fasynchronous-unwind-tables +CC_FLAGS_ADD_VDSO :=3D -O2 -mcmodel=3Dtiny -fasynchronous-unwind-tables -Wa,--gsframe=3Dno CFLAGS_REMOVE_vgettimeofday.o =3D $(CC_FLAGS_REMOVE_VDSO) CFLAGS_REMOVE_vgetrandom.o =3D $(CC_FLAGS_REMOVE_VDSO) Though, I don't understand why it is necessary to provide --gsframe=3Dno explicitly. If this approach seems ok to other folks/maintainers, I can fold this into my series. On the topic of SFrame for VDSO, Jens has a patch adding support for this as part of a series to support userspace SFrame unwinding for arm64: https://lore.kernel.org/lkml/20260417150827.1183376-4-jremus@linux.ibm.com/ > > > Thanks, > Mostafa > Thanks, Dylan