[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70803af5-369c-4de2-af30-70d74f1e6256@linux.ibm.com>
Date: Thu, 10 Jul 2025 14:28:06 +0200
From: Jens Remus <jremus@...ux.ibm.com>
To: Steven Rostedt <rostedt@...nel.org>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, bpf@...r.kernel.org,
x86@...nel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andrii Nakryiko <andrii@...nel.org>,
Indu Bhagat <indu.bhagat@...cle.com>,
"Jose E. Marchesi" <jemarch@....org>,
Beau Belgrave <beaub@...ux.microsoft.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>, Florian Weimer <fweimer@...hat.com>,
Sam James <sam@...too.org>, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH v13 02/14] unwind_user: Add frame pointer support
On 09.07.2025 12:01, Jens Remus wrote:
> On 08.07.2025 03:22, Steven Rostedt wrote:
>> From: Josh Poimboeuf <jpoimboe@...nel.org>
>> diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c
>> static int unwind_user_next(struct unwind_user_state *state)
>> {
>> - /* no implementation yet */
>> + struct unwind_user_frame *frame;
>> + unsigned long cfa = 0, fp, ra = 0;
>> + unsigned int shift;
>> +
>> + if (state->done)
>> + return -EINVAL;
>> +
>> + if (fp_state(state))
>> + frame = &fp_frame;
>> + else
>> + goto done;
>> +
>> + if (frame->use_fp) {
>> + if (state->fp < state->sp)
The initial check above is correct. I got the logic wrong. Sorry for
the fuss! Do not change the check to what I came up with yesterday:
> if (state->fp <= state->sp)
>
Below s390 particularity, that FP may be equal to FP in any frame,
is only allowed with the initial check.
> I meanwhile came to the conclusion that for architectures, such as s390,
> where SP at function entry == SP at call site, the FP may be equal to
> the SP. At least for the brief period where the FP has been setup and
> stack allocation did not yet take place. For most architectures this
> can probably only occur in the topmost frame. For s390 the FP is setup
> after static stack allocation, so --fno-omit-frame-pointer would enforce
> FP==SP in any frame that does not perform dynamic stack allocation.
>
>> + goto done;
>> + cfa = state->fp;
>> + } else {
>> + cfa = state->sp;
>> + }
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@...ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
Powered by blists - more mailing lists