[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bbd9ee1e-d604-43d6-9cb5-77e2972807ef@zytor.com>
Date: Mon, 9 Feb 2026 20:53:37 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Xi Ruoyao <xry111@...111.site>, Jens Remus <jremus@...ux.ibm.com>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Theodore Ts'o" <tytso@....edu>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Xin Li <xin@...or.com>, Andrew Cooper <andrew.cooper3@...rix.com>,
Andy Lutomirski <luto@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Borislav Petkov <bp@...en8.de>, Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, James Morse <james.morse@....com>,
Jarkko Sakkinen <jarkko@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>, Kees Cook <kees@...nel.org>,
Nam Cao <namcao@...utronix.de>, Oleg Nesterov <oleg@...hat.com>,
Perry Yuan <perry.yuan@....com>, Thomas Gleixner <tglx@...utronix.de>,
Thomas Huth <thuth@...hat.com>, Uros Bizjak <ubizjak@...il.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-sgx@...r.kernel.org, x86@...nel.org,
Indu Bhagat <indu.bhagat@...cle.com>,
Claudiu Zissulescu-Ianculescu <claudiu.zissulescu-ianculescu@...cle.com>,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH v4.1 06/10] x86/entry/vdso32: remove open-coded DWARF in
sigreturn.S
On 2026-02-09 20:45, Xi Ruoyao wrote:
>>
>> Oh, good grief...
>>
>> How does this possibly work on non-x86 platforms?
>
> On ARM64 the vdso does not have eh_frame_hdr at all, on LoongArch
> eh_frame_hdr is empty (note that an ampty en_frame_hdr is actually buggy
> and I'm trying to fix it), so _Unwind_Find_FDE returns NULL and libgcc
> falls back to MD_FALLBACK_FRAME_STATE_FOR, which handles the sigreturn
> trampoline using some machine-dependant logic.
>
> On RISC-V things are more theatrical: the sigreturn trampoline happens
> to be at the beginning of the vdso .text section, so after subtracting 1
> from the PC, the result is out of the .text section and so not in any
> FDE. Thus _Unwind_Find_FDE returns NULL and libgcc again falls back to
> MD_FALLBACK_FRAME_STATE_FOR.
>
> If the RISC-V sigreturn trampoline was not the first in .text,
> subtracting 1 would cause the PC to be in the FDE of the previous
> function and then _Unwind_Find_FDE would return that FDE, then RISC-V
> would have some big trouble.
>
> I've not taken a serious look at other architectures yet.
>
In other words, it is broken on pretty much all architectures and it ends up
using the hacky fallbacks on every single platform...
-hpa
Powered by blists - more mailing lists