[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020103859.GO3419281@noisy.programming.kicks-ass.net>
Date: Mon, 20 Oct 2025 12:38:59 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jens Remus <jremus@...ux.ibm.com>
Cc: jpoimboe@...nel.org, rostedt@...nel.org,
Indu Bhagat <indu.bhagat@...cle.com>, linux-kernel@...r.kernel.org,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH 11/12] unwind: Implement compat fp unwind
On Fri, Oct 17, 2025 at 05:47:26PM +0200, Jens Remus wrote:
> On 9/24/2025 9:59 AM, Peter Zijlstra wrote:
>
> > --- a/include/linux/unwind_user_types.h
> > +++ b/include/linux/unwind_user_types.h
> > @@ -36,6 +36,7 @@ struct unwind_user_state {
> > unsigned long ip;
> > unsigned long sp;
> > unsigned long fp;
> > + unsigned int ws;
>
> Factoring out the word size (ws) from the CFA, FP, and RA offsets is
> clever. Wondering though whether that would be an issue for unwind user
> sframe. Do all architectures guarantee that those offsets are aligned
> to the native word size?
I would hope so, but this is all opt-in, I'm sure the first architecture
with an unaligned stack trying to support this will let us know ;-)
> > /* Make sure that the address is word aligned */
> > - if (cfa & (sizeof(long) - 1))
> > + if (cfa & (state->ws - 1))
> > return -EINVAL;
>
> Alternatively using a state->ws of 1 in uwind user sframe would defeat
> this alignment check.
Indeed. Or rather, with a words size of 1, everything is aligned :-)
Powered by blists - more mailing lists