On Thu, 3 Jul 2025 18:21:10 +0200
Jens Remus [off-list ref] wrote:
quoted
quoted
/* stack going in wrong direction? */
if (sp <= state->sp - topmost)
goto done;
How do you calculate "topmost" then?
Is it another field you add to "state"?
Correct. It is a boolean set to true in unwind_user_start() and set to
false in unwind_user_next() when updating the state.
So it's subtracting 1 or zero? So that the topmost can be equal. Well,
that would need a bit of commenting.
I assume most architectures need above change, as their SP at function
entry should be equal to the SP at call site (unlike x86-64 due to CALL).
s390 also needs this information to allow restoring of FP/RA saved in
other registers (instead of on the stack) only for the topmost frame.
For any other frame arbitrary register contents would not be available,
as user unwind only unwinds SP, FP, and RA.
I would post my s390 sframe support patches as RFC once you have
provided a merged sframe branch as discussed in:
https://lore.kernel.org/all/20250702124737.565934b5@batman.local.home/ (local)
I did have a merge branch on my repo. But I was hoping to see your code
so that I can add this to this patch before having to post again. But
now I'm posting without this change, as I don't want to screw it up. I
think I know what it it looks like, but it would be better to see what
you did to make sure what I envision is correct.
Oh well. I'll post v13 without it.
-- Steve