Re: [PATCH v11 14/14] unwind_user/x86: Enable compat mode frame pointer unwinding on x86

From: Steven Rostedt
Date: Thu Jun 26 2025 - 08:12:19 EST


On Thu, 26 Jun 2025 10:33:05 +0200
Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> * Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > diff --git a/arch/x86/include/asm/unwind_user_types.h b/arch/x86/include/asm/unwind_user_types.h
> > new file mode 100644
> > index 000000000000..d7074dc5f0ce
> > --- /dev/null
> > +++ b/arch/x86/include/asm/unwind_user_types.h
> > @@ -0,0 +1,17 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +#ifndef _ASM_UNWIND_USER_TYPES_H
> > +#define _ASM_UNWIND_USER_TYPES_H
>
> This is not the standard x86 header guard pattern ...

Should it be:

#ifndef _ASM_X86_UNWIND_USER_TYPES_H

?

>
> > +
> > +#ifdef CONFIG_IA32_EMULATION
> > +
> > +struct arch_unwind_user_state {
> > + unsigned long ss_base;
> > + unsigned long cs_base;
> > +};
> > +#define arch_unwind_user_state arch_unwind_user_state
>
> Ran out of newlines? ;-)

I believe Josh purposely kept the #define and the structure together
without a newline as one defines itself to be used in the generic code.

Do you prefer them to be separated by a newline?


>
> > +/*
> > + * If an architecture needs to initialize the state for a specific
> > + * reason, for example, it may need to do something different
> > + * in compat mode, it can define arch_unwind_user_init to a
> > + * function that will perform this initialization.
>
> Please use 'func()' when referring to functions in comments.

You mean to use "arch_unwind_user_init()"?

>
> > +/*
> > + * If an architecture requires some more updates to the state between
> > + * stack frames, it can define arch_unwind_user_next to a function
> > + * that will update the state between reading stack frames during
> > + * the user space stack walk.
>
> Ditto.

And this to have arch_unwind_user_next()?

I'll update.

Thanks for the review.

-- Steve