Re: [RFC PATCH 7/7] objtool: Make unwind_hints available for all architectures

From: Miroslav Benes
Date: Wed Jun 10 2020 - 09:20:17 EST


Hi Julien,

On Mon, 8 Jun 2020, Julien Thierry wrote:

> Unwind hints are useful to give some information about the call frame
> or stack states in non-standard code.
>
> Despite unwind hints being used in arch-independent code, the
> unwind_hint structure type itself is define in x86 kernel headers.
>
> This is because what an unwind hint will describe is very architecture
> specific, both regarding the state and the affected registers.
>
> To get to share this concept, expose the unwind_hint structure across
> architecutres. However, the hint types remain defined by the
> architecture code. Objtool then needs it's arch specific code to
> "decode" the unwind hint into a cfi_state.

I think it would be nice to split the patch. Something like.

1. current include/linux/frame.h mixes assembly and non-assembly
definitions, so introduce ASSEMBLY ifdef first seems like a good idea to
me.

2. move the relevant definitions to frame.h and add the file to
sync-check

3. the rest of the patch

Would it make sense?

Otherwise, it looks good to me.

Miroslav