# Re: \[RFC PATCH v1 08/16\] unwind\_user: Enable archs that save RA/FP in other registers

- From: Josh Poimboeuf \<jpoimboe@kernel.org\>
- Date: 2025-07-18 04:52:28 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2025/07/3139529
- Thread: https://ratatoskr.run/linux-trace-kernel/2025/07/3129870/t.md

```text
On Thu, Jul 17, 2025 at 02:07:05PM +0200, Jens Remus wrote:
> On 17.07.2025 04:50, Josh Poimboeuf wrote:
> > So the following is wrong:
> > 
> > 	case UNWIND_USER_LOC_STACK:
> > 		if (!frame->fp.frame_off)
> > 			goto done;
> > 		if (unwind_get_user_long(fp, cfa + frame->fp.frame_off, state))
> > 			goto done;
> > 		break;
> > 
> > Instead of having !fp.frame_off stopping the unwind, it should just
> > break out of the switch statement and keep going.
> 
> If frame->fp.loc is UNWIND_USER_LOC_STACK then frame->fp.frame_off must
> have a value != 0.  At least if we keep the original semantic.
> 
> We can omit this check, if we assume all producers of frame behave
> correctly.  For instance user unwind sframe would not produce that
> (see below).  Could it somehow be made a debug-config-only check?

Ah... the !frame->fp.frame_off check for the UNWIND_USER_LOC_STACK case
completely threw me for a loop.  I was confusing that with
UNWIND_USER_LOC_NONE.  So never mind.

And yes, I think that check has no use and can be removed.

-- 
Josh
```
