Re: [PATCH v14 05/19] unwind_user/sframe: Add support for reading .sframe contents

Steven Rostedt <[email protected]> Wed, 13 May 2026 08:22:49 -0400
Newsgroups dev.linux.lists.sashiko,org.kernel.vger.bpf
Message-ID <20260513082249.51238d75@fedora>
On Tue, 12 May 2026 15:35:09 +0200
Jens Remus <[email protected]> wrote:

> 
> 
> IIUC config options that get selected should not depend on.  So the
> following would not be ok, although it seems to work?
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> @@ -495,6 +495,8 @@ config HAVE_UNWIND_USER_FP
> 
>  config HAVE_UNWIND_USER_SFRAME
> 	bool
> +	depends on 64BIT
> +	depends on HAVE_EFFICIENT_UNALIGNED_ACCESS

A config selected by architectures should not have architecture
dependencies, as those architectures should not be selecting it!

Archs with both 32 bit and 64 bit should do:

	select HAVE_UNWIND_USER_SFRAME if 64BIT

And no arch without unaligned access should have it selected.

> 	select UNWIND_USER
> 


> 
> Shall I better use BUILD_BUG_ON(!IS_ENABLED(CONFIG_...)) instead?  Would
> I add that to all functions that are affected (i.e. __read_fre(),
> __read_default_fre_datawords(), and __read_flex_fde_fre_datawords()),
> duplicating the build-time error message, or would I better introduce a
> dummy function to check this precondition (and 64-bit arch), for
> instance:

Yeah, that's a better idea. You only need one BUILD_BUG_ON() in the
file for it to have the desired effect. You don't need to add a dummy
function. Just put it in sframe_read_header().

Thanks,

-- Steve