Re: [RFC PATCH v2 14/15] unwind_user/backchain: Introduce back chain user space unwinding

From: Jens Remus
Date: Mon Dec 08 2025 - 10:39:01 EST


Hello Josh,

thank you for your feedback!

On 12/7/2025 4:10 PM, Josh Poimboeuf wrote:
> On Fri, Dec 05, 2025 at 06:14:45PM +0100, Jens Remus wrote:
>> @@ -159,6 +165,10 @@ static int unwind_user_next(struct unwind_user_state *state)
>> if (!unwind_user_next_fp(state))
>> return 0;
>> continue;
>> + case UNWIND_USER_TYPE_BACKCHAIN:
>> + if (!unwind_user_next_backchain(state))
>> + return 0;
>> + continue; /* Try next method. */
>> default:
>> WARN_ONCE(1, "Undefined unwind bit %d", bit);
>> break;
>> @@ -187,6 +197,8 @@ static int unwind_user_start(struct unwind_user_state *state)
>> state->available_types |= UNWIND_USER_TYPE_SFRAME;
>> if (IS_ENABLED(CONFIG_HAVE_UNWIND_USER_FP))
>> state->available_types |= UNWIND_USER_TYPE_FP;
>> + if (IS_ENABLED(CONFIG_HAVE_UNWIND_USER_BACKCHAIN))
>> + state->available_types |= UNWIND_USER_TYPE_BACKCHAIN;
>
> Any reason not to just use the existing CONFIG_HAVE_UNWIND_USER_FP hook
> here rather than create the new BACKCHAIN one?

At first I thought this would not be a good idea, as my unwind user
backchain implementation relies on being standalone without using
unwind_user_next_common(). Mainly because s390 back chain unwinding
does not have fixed CFA, FP, and RA offsets/locations. But then I gave
it a try and it does not look that bad actually.

I'll send a RFC v3 soon.

Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@xxxxxxxxxx

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/